From d901899ef1fe78a68ba3ed23f39dd3784deaba1b Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Fri, 3 Sep 2021 16:47:57 +0200
Subject: [PATCH] Built motion from commit 2c427cc0.|2.5.345
---
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/teamVoicePrefix/index.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoicePrefix/teamVoicePrefix.rpc.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/userVoicePrefix/index.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoicePrefix/userVoicePrefix.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 +-
1155 files changed, 1155 insertions(+), 1155 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 2b60c5f..d435e56 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-09-03T14:25:03.223Z",
+ "time": "2021-09-03T14:37:22.620Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index fb92508..dea3609 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-03T14:25:03.223Z",
+ "time": "2021-09-03T14:37:22.620Z",
"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 efe9f70..60d8b7a 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 _0xfc46=['TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc46,0x9a));var _0x6fc4=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0xfc46[_0x3b085];return _0x476a57;};'use strict';var Sequelize=require(_0x6fc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fc4('0x1')],'get':function(_0x2818de){return this[_0x6fc4('0x2')]('action');}},'action':{'type':Sequelize[_0x6fc4('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6fc4('0x4'),_0x6fc4('0x5'),_0x6fc4('0x6'),'jscripty',_0x6fc4('0x7'),_0x6fc4('0x8'),_0x6fc4('0x9'),_0x6fc4('0xa')]],'msg':_0x6fc4('0xb')}},'comment':_0x6fc4('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6fc4('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x6fc4('0xd')},'data3':{'type':Sequelize[_0x6fc4('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x6fc4('0x3')](0x1000),'comments':_0x6fc4('0xe')},'data5':{'type':Sequelize[_0x6fc4('0x3')](0x1000),'comments':_0x6fc4('0xf')},'data6':{'type':Sequelize[_0x6fc4('0x3')],'comments':_0x6fc4('0x10')},'data7':{'type':Sequelize[_0x6fc4('0x11')],'comments':_0x6fc4('0x12')}};
\ No newline at end of file
+var _0x3f8a=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x43d0e7,_0x201b93){var _0x1bfd9c=function(_0x4ffe28){while(--_0x4ffe28){_0x43d0e7['push'](_0x43d0e7['shift']());}};_0x1bfd9c(++_0x201b93);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x271ad2,_0x2c93eb){_0x271ad2=_0x271ad2-0x0;var _0x3ee9e4=_0x3f8a[_0x271ad2];return _0x3ee9e4;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'get':function(_0x23c224){return this['getDataValue'](_0xa3f8('0x3'));}},'action':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xa3f8('0x5'),_0xa3f8('0x6'),_0xa3f8('0x7'),_0xa3f8('0x8'),_0xa3f8('0x9'),_0xa3f8('0xa'),_0xa3f8('0xb'),_0xa3f8('0xc')]],'msg':_0xa3f8('0xd')}},'comment':_0xa3f8('0xd')},'data1':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comment':_0xa3f8('0xe')},'data2':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comment':_0xa3f8('0xf')},'data3':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comments':_0xa3f8('0x10')},'data5':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comments':_0xa3f8('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0xa3f8('0x12')},'data7':{'type':Sequelize[_0xa3f8('0x13')],'comments':_0xa3f8('0x14')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index e501ba9..2e288ea 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 _0xec4a=['error','stack','name','body','find','params','Action','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','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','limit','count','offset','Content-Range','apply','save','update','then','destroy'];(function(_0x53c098,_0xdea94a){var _0x4cd7=function(_0x14d334){while(--_0x14d334){_0x53c098['push'](_0x53c098['shift']());}};_0x4cd7(++_0xdea94a);}(_0xec4a,0x1ab));var _0xaec4=function(_0x30880e,_0x4c2699){_0x30880e=_0x30880e-0x0;var _0x2cc6ac=_0xec4a[_0x30880e];return _0x2cc6ac;};'use strict';var emlformat=require(_0xaec4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaec4('0x1'));var jsonpatch=require(_0xaec4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaec4('0x3'));var Mustache=require(_0xaec4('0x4'));var util=require('util');var path=require(_0xaec4('0x5'));var sox=require(_0xaec4('0x6'));var csv=require(_0xaec4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaec4('0x8'));var crypto=require(_0xaec4('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xaec4('0xa'));var toCsv=require(_0xaec4('0x7'));var querystring=require('querystring');var Papa=require(_0xaec4('0xb'));var Redis=require('ioredis');var authService=require(_0xaec4('0xc'));var qs=require(_0xaec4('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaec4('0xe'));var logger=require(_0xaec4('0xf'))(_0xaec4('0x10'));var utils=require(_0xaec4('0x11'));var config=require(_0xaec4('0x12'));var licenseUtil=require(_0xaec4('0x13'));var db=require(_0xaec4('0x14'))['db'];function respondWithStatusCode(_0x289961,_0x479c38){_0x479c38=_0x479c38||0xcc;return function(_0x255d5f){if(_0x255d5f){return _0x289961[_0xaec4('0x15')](_0x479c38);}return _0x289961[_0xaec4('0x16')](_0x479c38)[_0xaec4('0x17')]();};}function respondWithResult(_0x19697e,_0x45007e){_0x45007e=_0x45007e||0xc8;return function(_0x5030de){if(_0x5030de){return _0x19697e['status'](_0x45007e)[_0xaec4('0x18')](_0x5030de);}};}function respondWithFilteredResult(_0x3627e9,_0x17cf23){return function(_0x391e8c){if(_0x391e8c){var _0x384c4d=typeof _0x17cf23['offset']===_0xaec4('0x19')&&typeof _0x17cf23[_0xaec4('0x1a')]===_0xaec4('0x19');var _0x305b7e=_0x391e8c[_0xaec4('0x1b')];var _0x12e65f=_0x384c4d?0x0:_0x17cf23[_0xaec4('0x1c')];var _0x57400b=_0x384c4d?_0x391e8c[_0xaec4('0x1b')]:_0x17cf23['offset']+_0x17cf23[_0xaec4('0x1a')];var _0x11810c;if(_0x57400b>=_0x305b7e){_0x57400b=_0x305b7e;_0x11810c=0xc8;}else{_0x11810c=0xce;}_0x3627e9[_0xaec4('0x16')](_0x11810c);return _0x3627e9['set'](_0xaec4('0x1d'),_0x12e65f+'-'+_0x57400b+'/'+_0x305b7e)['json'](_0x391e8c);}return null;};}function patchUpdates(_0x5464f5){return function(_0x13a487){try{jsonpatch[_0xaec4('0x1e')](_0x13a487,_0x5464f5,!![]);}catch(_0x5f1387){return BPromise['reject'](_0x5f1387);}return _0x13a487[_0xaec4('0x1f')]();};}function saveUpdates(_0x469014,_0x158aee){return function(_0x5b0925){if(_0x5b0925){return _0x5b0925[_0xaec4('0x20')](_0x469014)[_0xaec4('0x21')](function(_0xf18fd6){return _0xf18fd6;});}return null;};}function removeEntity(_0x204aa4,_0x3a3a82){return function(_0x446065){if(_0x446065){return _0x446065[_0xaec4('0x22')]()[_0xaec4('0x21')](function(){_0x204aa4[_0xaec4('0x16')](0xcc)[_0xaec4('0x17')]();});}};}function handleEntityNotFound(_0x19e240,_0x87c10e){return function(_0x5d17c9){if(!_0x5d17c9){_0x19e240[_0xaec4('0x15')](0x194);}return _0x5d17c9;};}function handleError(_0x513969,_0x53f6eb){_0x53f6eb=_0x53f6eb||0x1f4;return function(_0x2226c7){logger[_0xaec4('0x23')](_0x2226c7[_0xaec4('0x24')]);if(_0x2226c7[_0xaec4('0x25')]){delete _0x2226c7[_0xaec4('0x25')];}_0x513969['status'](_0x53f6eb)['send'](_0x2226c7);};}exports[_0xaec4('0x20')]=function(_0x7afef3,_0x2d86cb){if(_0x7afef3[_0xaec4('0x26')]['id']){delete _0x7afef3['body']['id'];}return db['Action'][_0xaec4('0x27')]({'where':{'id':_0x7afef3[_0xaec4('0x28')]['id']}})['then'](handleEntityNotFound(_0x2d86cb,null))[_0xaec4('0x21')](saveUpdates(_0x7afef3['body'],null))[_0xaec4('0x21')](respondWithResult(_0x2d86cb,null))['catch'](handleError(_0x2d86cb,null));};exports[_0xaec4('0x22')]=function(_0x58ec8a,_0x418948){return db[_0xaec4('0x29')]['find']({'where':{'id':_0x58ec8a[_0xaec4('0x28')]['id']}})[_0xaec4('0x21')](handleEntityNotFound(_0x418948,null))[_0xaec4('0x21')](removeEntity(_0x418948,null))['catch'](handleError(_0x418948,null));};
\ No newline at end of file
+var _0x4cac=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','body','find','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra'];(function(_0xc86f1a,_0x54d4ba){var _0x513368=function(_0x27e711){while(--_0x27e711){_0xc86f1a['push'](_0xc86f1a['shift']());}};_0x513368(++_0x54d4ba);}(_0x4cac,0x130));var _0xc4ca=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4cac[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xc4ca('0x0'));var rimraf=require(_0xc4ca('0x1'));var zipdir=require(_0xc4ca('0x2'));var jsonpatch=require(_0xc4ca('0x3'));var rp=require('request-promise');var moment=require(_0xc4ca('0x4'));var BPromise=require(_0xc4ca('0x5'));var Mustache=require('mustache');var util=require(_0xc4ca('0x6'));var path=require(_0xc4ca('0x7'));var sox=require('sox');var csv=require(_0xc4ca('0x8'));var ejs=require(_0xc4ca('0x9'));var fs=require('fs');var fs_extra=require(_0xc4ca('0xa'));var _=require(_0xc4ca('0xb'));var squel=require(_0xc4ca('0xc'));var crypto=require(_0xc4ca('0xd'));var jsforce=require(_0xc4ca('0xe'));var deskjs=require(_0xc4ca('0xf'));var toCsv=require(_0xc4ca('0x8'));var querystring=require(_0xc4ca('0x10'));var Papa=require(_0xc4ca('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc4ca('0x12'));var as=require(_0xc4ca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc4ca('0x14'));var utils=require(_0xc4ca('0x15'));var config=require(_0xc4ca('0x16'));var licenseUtil=require(_0xc4ca('0x17'));var db=require(_0xc4ca('0x18'))['db'];function respondWithStatusCode(_0x3ca8d5,_0x2936dd){_0x2936dd=_0x2936dd||0xcc;return function(_0x4549e7){if(_0x4549e7){return _0x3ca8d5[_0xc4ca('0x19')](_0x2936dd);}return _0x3ca8d5['status'](_0x2936dd)[_0xc4ca('0x1a')]();};}function respondWithResult(_0x4b123b,_0x48b468){_0x48b468=_0x48b468||0xc8;return function(_0x3c38ba){if(_0x3c38ba){return _0x4b123b[_0xc4ca('0x1b')](_0x48b468)[_0xc4ca('0x1c')](_0x3c38ba);}};}function respondWithFilteredResult(_0xdade7a,_0x2590a8){return function(_0x282cc1){if(_0x282cc1){var _0x4aa478=typeof _0x2590a8['offset']===_0xc4ca('0x1d')&&typeof _0x2590a8[_0xc4ca('0x1e')]===_0xc4ca('0x1d');var _0x42db90=_0x282cc1[_0xc4ca('0x1f')];var _0x27cb3a=_0x4aa478?0x0:_0x2590a8[_0xc4ca('0x20')];var _0x29ba20=_0x4aa478?_0x282cc1[_0xc4ca('0x1f')]:_0x2590a8[_0xc4ca('0x20')]+_0x2590a8[_0xc4ca('0x1e')];var _0x5e9d7f;if(_0x29ba20>=_0x42db90){_0x29ba20=_0x42db90;_0x5e9d7f=0xc8;}else{_0x5e9d7f=0xce;}_0xdade7a[_0xc4ca('0x1b')](_0x5e9d7f);return _0xdade7a['set'](_0xc4ca('0x21'),_0x27cb3a+'-'+_0x29ba20+'/'+_0x42db90)['json'](_0x282cc1);}return null;};}function patchUpdates(_0x3262a9){return function(_0x1d38e2){try{jsonpatch[_0xc4ca('0x22')](_0x1d38e2,_0x3262a9,!![]);}catch(_0x5befbc){return BPromise[_0xc4ca('0x23')](_0x5befbc);}return _0x1d38e2['save']();};}function saveUpdates(_0x1dc4c6,_0x339f74){return function(_0x499c8e){if(_0x499c8e){return _0x499c8e[_0xc4ca('0x24')](_0x1dc4c6)[_0xc4ca('0x25')](function(_0x2939c4){return _0x2939c4;});}return null;};}function removeEntity(_0x5ac0d1,_0x9d26a4){return function(_0x87037a){if(_0x87037a){return _0x87037a[_0xc4ca('0x26')]()[_0xc4ca('0x25')](function(){_0x5ac0d1[_0xc4ca('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8c56,_0xd2f14c){return function(_0x5553d0){if(!_0x5553d0){_0x4a8c56[_0xc4ca('0x19')](0x194);}return _0x5553d0;};}function handleError(_0x299fe1,_0x3f8e88){_0x3f8e88=_0x3f8e88||0x1f4;return function(_0x459072){logger[_0xc4ca('0x27')](_0x459072['stack']);if(_0x459072[_0xc4ca('0x28')]){delete _0x459072[_0xc4ca('0x28')];}_0x299fe1[_0xc4ca('0x1b')](_0x3f8e88)['send'](_0x459072);};}exports[_0xc4ca('0x24')]=function(_0x1383ac,_0x56c70e){if(_0x1383ac[_0xc4ca('0x29')]['id']){delete _0x1383ac[_0xc4ca('0x29')]['id'];}return db['Action'][_0xc4ca('0x2a')]({'where':{'id':_0x1383ac['params']['id']}})['then'](handleEntityNotFound(_0x56c70e,null))[_0xc4ca('0x25')](saveUpdates(_0x1383ac[_0xc4ca('0x29')],null))[_0xc4ca('0x25')](respondWithResult(_0x56c70e,null))[_0xc4ca('0x2b')](handleError(_0x56c70e,null));};exports[_0xc4ca('0x26')]=function(_0x396673,_0x5b1b36){return db[_0xc4ca('0x2c')]['find']({'where':{'id':_0x396673['params']['id']}})[_0xc4ca('0x25')](handleEntityNotFound(_0x5b1b36,null))[_0xc4ca('0x25')](removeEntity(_0x5b1b36,null))[_0xc4ca('0x2b')](handleError(_0x5b1b36,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 5033973..2632309 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 _0x50fa=['exports','Action','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./action.attributes'];(function(_0x1678a6,_0x3b85bd){var _0x58fc8a=function(_0x4d945a){while(--_0x4d945a){_0x1678a6['push'](_0x1678a6['shift']());}};_0x58fc8a(++_0x3b85bd);}(_0x50fa,0x70));var _0xa50f=function(_0x60bd21,_0x538836){_0x60bd21=_0x60bd21-0x0;var _0x2203cc=_0x50fa[_0x60bd21];return _0x2203cc;};'use strict';var _=require(_0xa50f('0x0'));var util=require(_0xa50f('0x1'));var logger=require(_0xa50f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa50f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa50f('0x4'));var rimraf=require(_0xa50f('0x5'));var config=require(_0xa50f('0x6'));var attributes=require(_0xa50f('0x7'));module[_0xa50f('0x8')]=function(_0x13d242,_0x34afd0){return _0x13d242['define'](_0xa50f('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf858=['request-promise','path','../../config/environment','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x35ded5,_0x4cd999){var _0x1bd1ee=function(_0xae2c9c){while(--_0xae2c9c){_0x35ded5['push'](_0x35ded5['shift']());}};_0x1bd1ee(++_0x4cd999);}(_0xf858,0x13f));var _0x8f85=function(_0x1321cd,_0x4ebce9){_0x1321cd=_0x1321cd-0x0;var _0x4137eb=_0xf858[_0x1321cd];return _0x4137eb;};'use strict';var _=require(_0x8f85('0x0'));var util=require(_0x8f85('0x1'));var logger=require(_0x8f85('0x2'))(_0x8f85('0x3'));var moment=require(_0x8f85('0x4'));var BPromise=require(_0x8f85('0x5'));var rp=require(_0x8f85('0x6'));var fs=require('fs');var path=require(_0x8f85('0x7'));var rimraf=require('rimraf');var config=require(_0x8f85('0x8'));var attributes=require(_0x8f85('0x9'));module['exports']=function(_0x453e90,_0x4f7d8b){return _0x453e90[_0x8f85('0xa')](_0x8f85('0xb'),attributes,{'tableName':_0x8f85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index ccee75c..fc5a8eb 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0xf494,0x1c6));var _0x4f49=function(_0x2c1136,_0x5bdc39){_0x2c1136=_0x2c1136-0x0;var _0x4e3732=_0xf494[_0x2c1136];return _0x4e3732;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ 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(_0x49b0bf,_0x2c50e9){var _0x4e6b5c=function(_0x2eaf9e){while(--_0x2eaf9e){_0x49b0bf['push'](_0x49b0bf['shift']());}};_0x4e6b5c(++_0x2c50e9);}(_0x5fab,0x177));var _0xb5fa=function(_0x5be892,_0x68238a){_0x5be892=_0x5be892-0x0;var _0x53fc35=_0x5fab[_0x5be892];return _0x53fc35;};'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 24e59f4..7bf13ff 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 _0x44d5=['put','/:id','delete','isAuthenticated','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x72934c,_0x504f6a){var _0x4a2dd3=function(_0x1fc920){while(--_0x1fc920){_0x72934c['push'](_0x72934c['shift']());}};_0x4a2dd3(++_0x504f6a);}(_0x44d5,0x1b3));var _0x544d=function(_0x208749,_0x2b7b66){_0x208749=_0x208749-0x0;var _0x3e0042=_0x44d5[_0x208749];return _0x3e0042;};'use strict';var multer=require(_0x544d('0x0'));var util=require(_0x544d('0x1'));var path=require(_0x544d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x544d('0x3'));var auth=require(_0x544d('0x4'));var interaction=require(_0x544d('0x5'));var config=require(_0x544d('0x6'));var controller=require('./action.controller');router[_0x544d('0x7')](_0x544d('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x544d('0x9')](_0x544d('0x8'),auth[_0x544d('0xa')](),controller[_0x544d('0xb')]);module[_0x544d('0xc')]=router;
\ No newline at end of file
+var _0x580e=['exports','multer','path','fs-extra','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x5b36ac,_0x4767aa){var _0x512bc2=function(_0x312285){while(--_0x312285){_0x5b36ac['push'](_0x5b36ac['shift']());}};_0x512bc2(++_0x4767aa);}(_0x580e,0xfe));var _0xe580=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x580e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe580('0x0'));var util=require('util');var path=require(_0xe580('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe580('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xe580('0x3'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xe580('0x4')](_0xe580('0x5'),auth[_0xe580('0x6')](),controller[_0xe580('0x7')]);router[_0xe580('0x8')](_0xe580('0x5'),auth[_0xe580('0x6')](),controller[_0xe580('0x9')]);module[_0xe580('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index fea6645..70545cb 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 _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x2b7c70,_0x3e68fd){var _0x265f38=function(_0x198c71){while(--_0x198c71){_0x2b7c70['push'](_0x2b7c70['shift']());}};_0x265f38(++_0x3e68fd);}(_0xabce,0x103));var _0xeabc=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xabce[_0x34021d];return _0x16597b;};'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 _0x4819=['TEXT','exports','STRING'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0x4819,0xcd));var _0x9481=function(_0x25b022,_0x394a08){_0x25b022=_0x25b022-0x0;var _0x2e13a5=_0x4819[_0x25b022];return _0x2e13a5;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 3138903..026f8b4 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 _0x3a98=['apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','autoAssociation','CustomReports','preview','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','left_join','right_join','COUNT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ValidationErrorItem','replace','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json'];(function(_0x33de88,_0x581346){var _0x105957=function(_0x52752d){while(--_0x52752d){_0x33de88['push'](_0x33de88['shift']());}};_0x105957(++_0x581346);}(_0x3a98,0x84));var _0x83a9=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x3a98[_0x1627ae];return _0x34b38f;};'use strict';var emlformat=require(_0x83a9('0x0'));var rimraf=require(_0x83a9('0x1'));var zipdir=require(_0x83a9('0x2'));var jsonpatch=require(_0x83a9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x83a9('0x4'));var Mustache=require('mustache');var util=require(_0x83a9('0x5'));var path=require(_0x83a9('0x6'));var sox=require(_0x83a9('0x7'));var csv=require('to-csv');var ejs=require(_0x83a9('0x8'));var fs=require('fs');var fs_extra=require(_0x83a9('0x9'));var _=require(_0x83a9('0xa'));var squel=require(_0x83a9('0xb'));var crypto=require(_0x83a9('0xc'));var jsforce=require(_0x83a9('0xd'));var deskjs=require(_0x83a9('0xe'));var toCsv=require(_0x83a9('0xf'));var querystring=require(_0x83a9('0x10'));var Papa=require('papaparse');var Redis=require(_0x83a9('0x11'));var authService=require(_0x83a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x83a9('0x13'));var hardwareService=require(_0x83a9('0x14'));var logger=require(_0x83a9('0x15'))(_0x83a9('0x16'));var utils=require(_0x83a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x83a9('0x18'));var db=require(_0x83a9('0x19'))['db'];var dbH=require(_0x83a9('0x19'))[_0x83a9('0x1a')];function respondWithStatusCode(_0x4898cf,_0x4845f5){_0x4845f5=_0x4845f5||0xcc;return function(_0x394e94){if(_0x394e94){return _0x4898cf[_0x83a9('0x1b')](_0x4845f5);}return _0x4898cf[_0x83a9('0x1c')](_0x4845f5)['end']();};}function respondWithResult(_0x3a3234,_0x3663ad){_0x3663ad=_0x3663ad||0xc8;return function(_0x6709bd){if(_0x6709bd){return _0x3a3234[_0x83a9('0x1c')](_0x3663ad)['json'](_0x6709bd);}};}function respondWithFilteredResult(_0x192071,_0x1c9361){return function(_0x3a7ef6){if(_0x3a7ef6){var _0x50da15=typeof _0x1c9361[_0x83a9('0x1d')]===_0x83a9('0x1e')&&typeof _0x1c9361[_0x83a9('0x1f')]==='undefined';var _0x272180=_0x3a7ef6[_0x83a9('0x20')];var _0x34c009=_0x50da15?0x0:_0x1c9361[_0x83a9('0x1d')];var _0x3f6f58=_0x50da15?_0x3a7ef6[_0x83a9('0x20')]:_0x1c9361['offset']+_0x1c9361['limit'];var _0x323157;if(_0x3f6f58>=_0x272180){_0x3f6f58=_0x272180;_0x323157=0xc8;}else{_0x323157=0xce;}_0x192071[_0x83a9('0x1c')](_0x323157);return _0x192071[_0x83a9('0x21')]('Content-Range',_0x34c009+'-'+_0x3f6f58+'/'+_0x272180)[_0x83a9('0x22')](_0x3a7ef6);}return null;};}function patchUpdates(_0x481f06){return function(_0x59975e){try{jsonpatch[_0x83a9('0x23')](_0x59975e,_0x481f06,!![]);}catch(_0x3a161e){return BPromise[_0x83a9('0x24')](_0x3a161e);}return _0x59975e[_0x83a9('0x25')]();};}function saveUpdates(_0x4276e6,_0x7f29e4){return function(_0x11bd18){if(_0x11bd18){return _0x11bd18[_0x83a9('0x26')](_0x4276e6)[_0x83a9('0x27')](function(_0x1a0366){return _0x1a0366;});}return null;};}function removeEntity(_0x549fd5,_0x223d37){return function(_0x2c5337){if(_0x2c5337){return _0x2c5337[_0x83a9('0x28')]()[_0x83a9('0x27')](function(){var _0x1a680d=_0x2c5337[_0x83a9('0x29')]({'plain':!![]});var _0xc6117='CustomReports';return db[_0x83a9('0x2a')][_0x83a9('0x28')]({'where':{'type':_0xc6117,'resourceId':_0x1a680d['id']}})[_0x83a9('0x27')](function(){return _0x2c5337;});})[_0x83a9('0x27')](function(){_0x549fd5[_0x83a9('0x1c')](0xcc)[_0x83a9('0x2b')]();});}};}function handleEntityNotFound(_0x242876,_0x45c77c){return function(_0x6a67ee){if(!_0x6a67ee){_0x242876[_0x83a9('0x1b')](0x194);}return _0x6a67ee;};}function handleError(_0x55c00a,_0x34e53b){_0x34e53b=_0x34e53b||0x1f4;return function(_0x48a120){logger[_0x83a9('0x2c')](_0x48a120['stack']);if(_0x48a120[_0x83a9('0x2d')]){delete _0x48a120[_0x83a9('0x2d')];}_0x55c00a[_0x83a9('0x1c')](_0x34e53b)[_0x83a9('0x2e')](_0x48a120);};}exports['index']=function(_0x363914,_0x43c104){var _0x52098d={},_0x2284d0={},_0x3d5382={'count':0x0,'rows':[]};var _0x5cd3bc=_[_0x83a9('0x2f')](db[_0x83a9('0x30')][_0x83a9('0x31')],function(_0x359806){return{'name':_0x359806[_0x83a9('0x32')],'type':_0x359806[_0x83a9('0x33')][_0x83a9('0x34')]};});_0x2284d0['model']=_[_0x83a9('0x2f')](_0x5cd3bc,_0x83a9('0x2d'));_0x2284d0['query']=_[_0x83a9('0x35')](_0x363914[_0x83a9('0x36')]);_0x2284d0[_0x83a9('0x37')]=_[_0x83a9('0x38')](_0x2284d0[_0x83a9('0x39')],_0x2284d0[_0x83a9('0x36')]);_0x52098d[_0x83a9('0x3a')]=_[_0x83a9('0x38')](_0x2284d0['model'],qs[_0x83a9('0x3b')](_0x363914[_0x83a9('0x36')][_0x83a9('0x3b')]));_0x52098d['attributes']=_0x52098d[_0x83a9('0x3a')][_0x83a9('0x3c')]?_0x52098d['attributes']:_0x2284d0[_0x83a9('0x39')];if(!_0x363914[_0x83a9('0x36')][_0x83a9('0x3d')]('nolimit')){_0x52098d[_0x83a9('0x1f')]=qs['limit'](_0x363914[_0x83a9('0x36')]['limit']);_0x52098d['offset']=qs['offset'](_0x363914[_0x83a9('0x36')][_0x83a9('0x1d')]);}_0x52098d[_0x83a9('0x3e')]=qs['sort'](_0x363914[_0x83a9('0x36')]['sort']);_0x52098d[_0x83a9('0x3f')]=qs[_0x83a9('0x37')](_[_0x83a9('0x40')](_0x363914['query'],_0x2284d0[_0x83a9('0x37')]),_0x5cd3bc);if(_0x363914[_0x83a9('0x36')][_0x83a9('0x41')]){_0x52098d[_0x83a9('0x3f')]=_[_0x83a9('0x42')](_0x52098d[_0x83a9('0x3f')],{'$or':_[_0x83a9('0x2f')](_0x5cd3bc,function(_0x3122c9){if(_0x3122c9[_0x83a9('0x33')]!==_0x83a9('0x43')){var _0x1e41b8={};_0x1e41b8[_0x3122c9[_0x83a9('0x2d')]]={'$like':'%'+_0x363914[_0x83a9('0x36')][_0x83a9('0x41')]+'%'};return _0x1e41b8;}})});}_0x52098d=_[_0x83a9('0x42')]({},_0x52098d,_0x363914[_0x83a9('0x44')]);var _0x470599={'where':_0x52098d[_0x83a9('0x3f')]};return db[_0x83a9('0x30')][_0x83a9('0x20')](_0x470599)[_0x83a9('0x27')](function(_0x58e276){_0x3d5382['count']=_0x58e276;if(_0x363914[_0x83a9('0x36')][_0x83a9('0x45')]){_0x52098d[_0x83a9('0x46')]=[{'all':!![]}];}return db[_0x83a9('0x30')]['findAll'](_0x52098d);})[_0x83a9('0x27')](function(_0x175935){_0x3d5382[_0x83a9('0x47')]=_0x175935;return _0x3d5382;})['then'](respondWithFilteredResult(_0x43c104,_0x52098d))[_0x83a9('0x48')](handleError(_0x43c104,null));};exports[_0x83a9('0x49')]=function(_0x14f707,_0x47246c){var _0x17fde3={'raw':![],'where':{'id':_0x14f707[_0x83a9('0x4a')]['id']}},_0x536b56={};_0x536b56['model']=_[_0x83a9('0x35')](db[_0x83a9('0x30')][_0x83a9('0x31')]);_0x536b56[_0x83a9('0x36')]=_[_0x83a9('0x35')](_0x14f707[_0x83a9('0x36')]);_0x536b56[_0x83a9('0x37')]=_[_0x83a9('0x38')](_0x536b56[_0x83a9('0x39')],_0x536b56[_0x83a9('0x36')]);_0x17fde3['attributes']=_[_0x83a9('0x38')](_0x536b56[_0x83a9('0x39')],qs[_0x83a9('0x3b')](_0x14f707[_0x83a9('0x36')]['fields']));_0x17fde3[_0x83a9('0x3a')]=_0x17fde3[_0x83a9('0x3a')][_0x83a9('0x3c')]?_0x17fde3[_0x83a9('0x3a')]:_0x536b56[_0x83a9('0x39')];if(_0x14f707['query']['includeAll']){_0x17fde3[_0x83a9('0x46')]=[{'all':!![]}];}_0x17fde3=_['merge']({},_0x17fde3,_0x14f707['options']);return db[_0x83a9('0x30')]['find'](_0x17fde3)['then'](handleEntityNotFound(_0x47246c,null))['then'](respondWithResult(_0x47246c,null))['catch'](handleError(_0x47246c,null));};exports[_0x83a9('0x4b')]=function(_0x2cd997,_0x21e603){return db[_0x83a9('0x30')][_0x83a9('0x4b')](_0x2cd997[_0x83a9('0x4c')],{})[_0x83a9('0x27')](function(_0x2255eb){var _0x54f3ed=_0x2cd997[_0x83a9('0x4d')][_0x83a9('0x29')]({'plain':!![]});if(!_0x54f3ed)throw new Error(_0x83a9('0x4e'));if(_0x54f3ed[_0x83a9('0x4f')]==='user'){var _0x1d03d6=_0x2255eb[_0x83a9('0x29')]({'plain':!![]});var _0x1b2997=_0x83a9('0x50');return db[_0x83a9('0x51')][_0x83a9('0x52')]({'where':{'name':_0x1b2997,'userProfileId':_0x54f3ed['userProfileId']},'raw':!![]})['then'](function(_0x1d6709){if(_0x1d6709&&_0x1d6709[_0x83a9('0x53')]===0x0){return db[_0x83a9('0x2a')][_0x83a9('0x4b')]({'name':_0x1d03d6['name'],'resourceId':_0x1d03d6['id'],'type':_0x83a9('0x54'),'sectionId':_0x1d6709['id']},{})[_0x83a9('0x27')](function(){return _0x2255eb;});}else{return _0x2255eb;}})[_0x83a9('0x48')](function(_0x2375d0){logger[_0x83a9('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2375d0);throw _0x2375d0;});}return _0x2255eb;})[_0x83a9('0x27')](respondWithResult(_0x21e603,0xc9))[_0x83a9('0x48')](handleError(_0x21e603,null));};exports[_0x83a9('0x26')]=function(_0x346d5d,_0x509f8b){if(_0x346d5d[_0x83a9('0x4c')]['id']){delete _0x346d5d[_0x83a9('0x4c')]['id'];}return db[_0x83a9('0x30')][_0x83a9('0x52')]({'where':{'id':_0x346d5d[_0x83a9('0x4a')]['id']}})[_0x83a9('0x27')](handleEntityNotFound(_0x509f8b,null))[_0x83a9('0x27')](saveUpdates(_0x346d5d[_0x83a9('0x4c')],null))[_0x83a9('0x27')](respondWithResult(_0x509f8b,null))['catch'](handleError(_0x509f8b,null));};exports[_0x83a9('0x28')]=function(_0x10b836,_0x5af70e){return db['AnalyticCustomReport'][_0x83a9('0x52')]({'where':{'id':_0x10b836['params']['id']}})[_0x83a9('0x27')](handleEntityNotFound(_0x5af70e,null))['then'](removeEntity(_0x5af70e,null))[_0x83a9('0x48')](handleError(_0x5af70e,null));};exports[_0x83a9('0x55')]=function(_0x5ce5c7,_0x436ca5){var _0x317de3=0xa;var _0x4158a9=['join','left_join','right_join',_0x83a9('0x56')];var _0x1234a6={'SUM':_0x83a9('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x83a9('0x58'),'MAX':_0x83a9('0x59'),'MIN':_0x83a9('0x5a'),'AVG':_0x83a9('0x5b'),'GROUP_CONCAT':_0x83a9('0x5c'),'GROUP_CONCAT ASC':_0x83a9('0x5d'),'GROUP_CONCAT DESC':_0x83a9('0x5e')};var _0x284107={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x83a9('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x83a9('0x60'),'UNIX_TIMESTAMP':_0x83a9('0x61')};var _0x21f814=function(_0x155190){return!_[_0x83a9('0x62')]([_0x83a9('0x63'),_0x83a9('0x64'),_0x83a9('0x65'),_0x83a9('0x66')],_0x155190);};var _0x324097=function(_0x385fb9){if(!_0x385fb9||!_0x385fb9['rules'][_0x83a9('0x3c')]){return'';}for(var _0x36ec54='(',_0x3abe07=0x0;_0x3abe07<_0x385fb9[_0x83a9('0x67')][_0x83a9('0x3c')];_0x3abe07+=0x1){_0x3abe07>0x0&&(_0x36ec54+='\x20'+_0x385fb9[_0x83a9('0x68')]+'\x20');_0x36ec54+=_0x385fb9['rules'][_0x3abe07][_0x83a9('0x69')]?_0x324097(_0x385fb9[_0x83a9('0x67')][_0x3abe07][_0x83a9('0x69')]):_0x385fb9[_0x83a9('0x67')][_0x3abe07][_0x83a9('0x6a')]+'\x20'+_0x385fb9[_0x83a9('0x67')][_0x3abe07]['condition']+(_0x21f814(_0x385fb9[_0x83a9('0x67')][_0x3abe07][_0x83a9('0x6b')])?'\x20'+_0x385fb9[_0x83a9('0x67')][_0x3abe07][_0x83a9('0x6c')]:'');}return _0x36ec54+')';};var _0x26e3d4={'where':{'id':_0x5ce5c7[_0x83a9('0x4a')]['id']}},_0x5f1169,_0x2a7604,_0x2bcc3e,_0x38c338,_0x577d6d;_0x26e3d4=_[_0x83a9('0x42')]({},_0x26e3d4,_0x5ce5c7[_0x83a9('0x44')]);return db[_0x83a9('0x30')][_0x83a9('0x52')](_0x26e3d4)[_0x83a9('0x27')](function(_0x1c6544){if(_0x1c6544){_0x5f1169=_0x1c6544;return _0x1c6544[_0x83a9('0x6d')]();}return null;})[_0x83a9('0x27')](function(_0x42c381){if(_0x42c381){if(!_0x42c381[_0x83a9('0x3c')]){throw new db[(_0x83a9('0x6e'))]['ValidationErrorItem'](_0x83a9('0x6f'),0x193);}_0x2a7604=_0x42c381;return db[_0x83a9('0x70')][_0x83a9('0x71')]({'raw':!![]});}return null;})[_0x83a9('0x27')](function(_0x222e25){if(_0x222e25){_0x2bcc3e=_[_0x83a9('0x72')](_0x222e25,'id');var _0xfa95c6;var _0x2d56b5=squel[_0x83a9('0x73')]();_0x2d56b5[_0x83a9('0x74')](_0x5f1169[_0x83a9('0x75')]);for(var _0x49afb1=0x0;_0x49afb1<_0x2a7604[_0x83a9('0x3c')];_0x49afb1+=0x1){_0xfa95c6=_0x2a7604[_0x49afb1][_0x83a9('0x76')]?_0x2bcc3e[_0x2a7604[_0x49afb1][_0x83a9('0x76')]][_0x83a9('0x77')]:_0x2a7604[_0x49afb1]['field'];_0xfa95c6=_0x2a7604[_0x49afb1][_0x83a9('0x78')]?_['replace'](_0x1234a6[_0x2a7604[_0x49afb1][_0x83a9('0x78')]],'%s',_0xfa95c6):_0xfa95c6;_0xfa95c6=_0x2a7604[_0x49afb1][_0x83a9('0x79')]?_['replace'](_0x284107[_0x2a7604[_0x49afb1][_0x83a9('0x79')]],'%s',_0xfa95c6):_0xfa95c6;if(_0x2a7604[_0x49afb1][_0x83a9('0x7a')]){_0x2d56b5[_0x83a9('0x69')](_0xfa95c6);}_0x2a7604[_0x49afb1][_0x83a9('0x7b')]&&_0x2d56b5[_0x83a9('0x3e')](_0xfa95c6,_0x2a7604[_0x49afb1][_0x83a9('0x7b')]===_0x83a9('0x7c')?![]:!![]);_0x2d56b5[_0x83a9('0x6a')](_0xfa95c6,_0x2a7604[_0x49afb1][_0x83a9('0x7d')]||_0xfa95c6);}if(_0x5f1169[_0x83a9('0x7e')]){_0x5f1169[_0x83a9('0x7e')]=JSON[_0x83a9('0x7f')](_0x5f1169[_0x83a9('0x7e')]);for(var _0x6c3503=0x0;_0x6c3503<_0x5f1169[_0x83a9('0x7e')]['length'];_0x6c3503+=0x1){if(_0x5f1169[_0x83a9('0x7e')][_0x6c3503][_0x83a9('0x33')]&&_['includes'](_0x4158a9,_0x5f1169[_0x83a9('0x7e')][_0x6c3503][_0x83a9('0x33')])&&_0x5f1169[_0x83a9('0x7e')][_0x6c3503][_0x83a9('0x80')]&&_0x5f1169[_0x83a9('0x7e')][_0x6c3503][_0x83a9('0x81')]&&_0x5f1169[_0x83a9('0x7e')][_0x6c3503][_0x83a9('0x82')]){_0x2d56b5[_0x5f1169['joins'][_0x6c3503][_0x83a9('0x33')]](_0x5f1169[_0x83a9('0x7e')][_0x6c3503][_0x83a9('0x81')],null,util[_0x83a9('0x79')](_0x83a9('0x83'),_0x5f1169[_0x83a9('0x75')],_0x5f1169[_0x83a9('0x7e')][_0x6c3503][_0x83a9('0x80')],_0x5f1169[_0x83a9('0x7e')][_0x6c3503][_0x83a9('0x81')],_0x5f1169[_0x83a9('0x7e')][_0x6c3503]['foreignKey']));}}}if(_0x5f1169[_0x83a9('0x84')]){_0x5f1169['conditions']=JSON[_0x83a9('0x7f')](_0x5f1169[_0x83a9('0x84')]);_0x2d56b5[_0x83a9('0x3f')](_0x324097(_0x5f1169[_0x83a9('0x84')][_0x83a9('0x69')]));}_0x577d6d=_0x2d56b5[_0x83a9('0x85')]();_0x2d56b5[_0x83a9('0x1f')](_0x317de3);_0x2d56b5[_0x83a9('0x1d')](0x0);logger[_0x83a9('0x86')](_0x83a9('0x87'),_0x2d56b5[_0x83a9('0x88')]());return dbH[_0x83a9('0x89')]['query'](_0x2d56b5[_0x83a9('0x88')](),{'type':dbH[_0x83a9('0x89')][_0x83a9('0x8a')][_0x83a9('0x8b')]});}})['then'](respondWithResult(_0x436ca5,null))[_0x83a9('0x48')](handleError(_0x436ca5,null));};function runReport(_0x194985,_0x3d7d3f,_0x22af3c){var _0x408e5a=_0x3d7d3f['name'];var _0x296d66=0xa;var _0x247df4=[_0x83a9('0x8c'),_0x83a9('0x8d'),_0x83a9('0x8e'),_0x83a9('0x56')];var _0x12b1f9={'SUM':_0x83a9('0x57'),'COUNT':_0x83a9('0x8f'),'COUNT DISTINCT':_0x83a9('0x58'),'MAX':_0x83a9('0x59'),'MIN':_0x83a9('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x83a9('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4bb255={'SEC_TO_TIME':_0x83a9('0x90'),'DATE':_0x83a9('0x5f'),'HOUR':_0x83a9('0x91'),'ROUND':_0x83a9('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5f52e5=function(_0x47f731){return!_[_0x83a9('0x62')](['IS\x20NULL',_0x83a9('0x64'),_0x83a9('0x65'),_0x83a9('0x66')],_0x47f731);};var _0x17b43c=function(_0x48a728){if(!_0x48a728||!_0x48a728[_0x83a9('0x67')][_0x83a9('0x3c')]){return'';}for(var _0x586ba8='(',_0x2d55f3=0x0;_0x2d55f3<_0x48a728[_0x83a9('0x67')][_0x83a9('0x3c')];_0x2d55f3+=0x1){_0x2d55f3>0x0&&(_0x586ba8+='\x20'+_0x48a728[_0x83a9('0x68')]+'\x20');_0x586ba8+=_0x48a728[_0x83a9('0x67')][_0x2d55f3][_0x83a9('0x69')]?_0x17b43c(_0x48a728[_0x83a9('0x67')][_0x2d55f3]['group']):_0x48a728[_0x83a9('0x67')][_0x2d55f3][_0x83a9('0x6a')]+'\x20'+_0x48a728[_0x83a9('0x67')][_0x2d55f3][_0x83a9('0x6b')]+(_0x5f52e5(_0x48a728['rules'][_0x2d55f3]['condition'])?'\x20'+_0x48a728[_0x83a9('0x67')][_0x2d55f3]['value']:'');}return _0x586ba8+')';};var _0x10c6d9={'where':{'id':_0x194985['id']}},_0x4627d4,_0x42c077,_0x4edca2,_0x47aaf0,_0x294d72;_0x10c6d9=_[_0x83a9('0x42')]({},_0x10c6d9,_0x22af3c);return db[_0x83a9('0x30')][_0x83a9('0x52')](_0x10c6d9)['then'](function(_0x674950){if(_0x674950){_0x4627d4=_0x674950;return _0x674950['getFields']();}return null;})[_0x83a9('0x27')](function(_0x2a3dda){if(_0x2a3dda){if(!_0x2a3dda['length']){throw new db[(_0x83a9('0x6e'))][(_0x83a9('0x92'))](_0x83a9('0x6f'),0x193);}_0x42c077=_0x2a3dda;return db['AnalyticMetric'][_0x83a9('0x71')]({'raw':!![]});}return null;})['then'](function(_0xe3458a){if(_0xe3458a){_0x4edca2=_[_0x83a9('0x72')](_0xe3458a,'id');var _0x50832d;var _0x56c35b=squel[_0x83a9('0x73')]();_0x56c35b[_0x83a9('0x74')](_0x4627d4[_0x83a9('0x75')]);for(var _0x4fc3d2=0x0;_0x4fc3d2<_0x42c077[_0x83a9('0x3c')];_0x4fc3d2+=0x1){_0x50832d=_0x42c077[_0x4fc3d2]['MetricId']?_0x4edca2[_0x42c077[_0x4fc3d2]['MetricId']][_0x83a9('0x77')]:_0x42c077[_0x4fc3d2]['field'];_0x50832d=_0x42c077[_0x4fc3d2][_0x83a9('0x78')]?_[_0x83a9('0x93')](_0x12b1f9[_0x42c077[_0x4fc3d2][_0x83a9('0x78')]],'%s',_0x50832d):_0x50832d;_0x50832d=_0x42c077[_0x4fc3d2][_0x83a9('0x79')]?_[_0x83a9('0x93')](_0x4bb255[_0x42c077[_0x4fc3d2]['format']],'%s',_0x50832d):_0x50832d;if(_0x42c077[_0x4fc3d2][_0x83a9('0x7a')]){_0x56c35b['group'](_0x50832d);}_0x42c077[_0x4fc3d2]['orderBy']&&_0x56c35b[_0x83a9('0x3e')](_0x50832d,_0x42c077[_0x4fc3d2]['orderBy']===_0x83a9('0x7c')?![]:!![]);_0x56c35b['field'](_0x50832d,_0x42c077[_0x4fc3d2][_0x83a9('0x7d')]||_0x50832d);}if(_0x4627d4[_0x83a9('0x7e')]){_0x4627d4['joins']=JSON[_0x83a9('0x7f')](_0x4627d4['joins']);for(var _0x237a6a=0x0;_0x237a6a<_0x4627d4['joins'][_0x83a9('0x3c')];_0x237a6a+=0x1){if(_0x4627d4[_0x83a9('0x7e')][_0x237a6a][_0x83a9('0x33')]&&_[_0x83a9('0x62')](_0x247df4,_0x4627d4['joins'][_0x237a6a][_0x83a9('0x33')])&&_0x4627d4[_0x83a9('0x7e')][_0x237a6a][_0x83a9('0x80')]&&_0x4627d4[_0x83a9('0x7e')][_0x237a6a][_0x83a9('0x81')]&&_0x4627d4[_0x83a9('0x7e')][_0x237a6a][_0x83a9('0x82')]){_0x56c35b[_0x4627d4['joins'][_0x237a6a]['type']](_0x4627d4['joins'][_0x237a6a][_0x83a9('0x81')],null,util[_0x83a9('0x79')](_0x83a9('0x83'),_0x4627d4[_0x83a9('0x75')],_0x4627d4['joins'][_0x237a6a][_0x83a9('0x80')],_0x4627d4[_0x83a9('0x7e')][_0x237a6a][_0x83a9('0x81')],_0x4627d4[_0x83a9('0x7e')][_0x237a6a]['foreignKey']));}}}if(_0x4627d4[_0x83a9('0x84')]){_0x4627d4['conditions']=JSON[_0x83a9('0x7f')](_0x4627d4[_0x83a9('0x84')]);_0x56c35b[_0x83a9('0x3f')](_0x17b43c(_0x4627d4[_0x83a9('0x84')]['group']));}_0x294d72=_0x56c35b[_0x83a9('0x85')]();_0x56c35b['limit'](_0x296d66);_0x56c35b[_0x83a9('0x1d')](0x0);return;}})[_0x83a9('0x27')](function(){if(_0x3d7d3f[_0x83a9('0x94')]===_0x83a9('0x95')){return null;}var _0x7b468=_[_0x83a9('0x42')](_0x3d7d3f,{'name':_0x3d7d3f[_0x83a9('0x96')]||_0x3d7d3f[_0x83a9('0x2d')]||_0x4627d4['name'],'basename':_0x408e5a,'savename':util[_0x83a9('0x79')](_0x83a9('0x97'),_0x3d7d3f[_0x83a9('0x2d')]||_0x4627d4[_0x83a9('0x2d')],require(_0x83a9('0x98'))[_0x83a9('0x99')](0x4),_0x3d7d3f[_0x83a9('0x94')]||_0x83a9('0x9a')),'reportId':_0x4627d4['id'],'reportType':_0x83a9('0x9b')});return db['AnalyticExtractedReport'][_0x83a9('0x4b')](_0x7b468,{'raw':!![]});})[_0x83a9('0x27')](function(_0x14868c){if(_0x4627d4['table']===_0x83a9('0x9c')){_0x294d72[_0x83a9('0x3f')](_0x4627d4['table']+_0x83a9('0x9d'),_0x3d7d3f[_0x83a9('0x9e')],_0x3d7d3f[_0x83a9('0x9f')]);}else{_0x294d72[_0x83a9('0x3f')](_0x4627d4['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3d7d3f['startDate'],_0x3d7d3f['endDate']);}if(_0x14868c){logger[_0x83a9('0xa0')]('Run\x20Query:',_0x294d72[_0x83a9('0x88')]());require(_0x83a9('0xa1'))[_0x83a9('0xa2')](path[_0x83a9('0x8c')](__dirname,_0x83a9('0xa3'),_0x14868c[_0x83a9('0x94')]),[_0x14868c['id'],_0x294d72[_0x83a9('0x88')](),path[_0x83a9('0x8c')](__dirname,_0x83a9('0xa4'),_0x14868c[_0x83a9('0xa5')]),_0x408e5a]);return _0x14868c;}else{var _0x389e77=squel[_0x83a9('0x73')]();_0x389e77[_0x83a9('0x74')]('('+_0x294d72['toString']()+')',_0x83a9('0xa6'));_0x389e77[_0x83a9('0x6a')]('COUNT(*)',_0x83a9('0x20'));_0x294d72[_0x83a9('0x1f')](_0x3d7d3f[_0x83a9('0x1f')]||_0x296d66);_0x294d72[_0x83a9('0x1d')](_0x3d7d3f['offset']||0x0);return dbH['sequelize']['query'](_0x389e77[_0x83a9('0x88')](),{'type':dbH[_0x83a9('0x89')][_0x83a9('0x8a')][_0x83a9('0x8b')]})[_0x83a9('0x27')](function(_0x18ff5d){if(!_0x18ff5d[_0x83a9('0x3c')]){_0x47aaf0=0x0;}else{_0x47aaf0=_0x18ff5d[0x0][_0x83a9('0x20')]||0x0;}return dbH[_0x83a9('0x89')]['query'](_0x294d72[_0x83a9('0x88')](),{'type':dbH[_0x83a9('0x89')]['QueryTypes'][_0x83a9('0x8b')]});})[_0x83a9('0x27')](function(_0x54029c){return{'rows':_0x54029c||[],'count':_0x47aaf0};});}});}exports['run']=function(_0x3dfc15,_0x52be7c){return runReport(_0x3dfc15[_0x83a9('0x4a')],_0x3dfc15[_0x83a9('0x36')],_0x3dfc15[_0x83a9('0x44')])['then'](respondWithResult(_0x52be7c,null))['catch'](handleError(_0x52be7c,null));};exports['runReport']=runReport;exports[_0x83a9('0x36')]=function(_0x395ee2,_0x5a478d){var _0x3466e5=0xa;var _0x101e91=['join',_0x83a9('0x8d'),'right_join',_0x83a9('0x56')];var _0x235742={'SUM':'SUM(%s)','COUNT':_0x83a9('0x8f'),'COUNT DISTINCT':_0x83a9('0x58'),'MAX':_0x83a9('0x59'),'MIN':_0x83a9('0x5a'),'AVG':_0x83a9('0x5b'),'GROUP_CONCAT':_0x83a9('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x83a9('0x5e')};var _0x452d48={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x83a9('0x5f'),'HOUR':_0x83a9('0x91'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xdcc461=function(_0x5aea98){return!_[_0x83a9('0x62')]([_0x83a9('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x83a9('0x66')],_0x5aea98);};var _0x1bc42c=function(_0x32d005){if(!_0x32d005||!_0x32d005['rules'][_0x83a9('0x3c')]){return'';}for(var _0x5cea45='(',_0x596242=0x0;_0x596242<_0x32d005['rules'][_0x83a9('0x3c')];_0x596242+=0x1){_0x596242>0x0&&(_0x5cea45+='\x20'+_0x32d005['operator']+'\x20');_0x5cea45+=_0x32d005[_0x83a9('0x67')][_0x596242]['group']?_0x1bc42c(_0x32d005[_0x83a9('0x67')][_0x596242][_0x83a9('0x69')]):_0x32d005['rules'][_0x596242][_0x83a9('0x6a')]+'\x20'+_0x32d005[_0x83a9('0x67')][_0x596242]['condition']+(_0xdcc461(_0x32d005['rules'][_0x596242][_0x83a9('0x6b')])?'\x20'+_0x32d005[_0x83a9('0x67')][_0x596242][_0x83a9('0x6c')]:'');}return _0x5cea45+')';};var _0x365014={'where':{'id':_0x395ee2[_0x83a9('0x4a')]['id']}},_0x297fa5,_0x1ed173,_0xf30db2,_0x48060f,_0x11cd6a;_0x365014=_['merge']({},_0x365014,_0x395ee2[_0x83a9('0x44')]);return db[_0x83a9('0x30')][_0x83a9('0x52')](_0x365014)[_0x83a9('0x27')](function(_0x267136){if(_0x267136){_0x297fa5=_0x267136;return _0x267136[_0x83a9('0x6d')]();}return null;})[_0x83a9('0x27')](function(_0x939334){if(_0x939334){if(!_0x939334[_0x83a9('0x3c')]){throw new db[(_0x83a9('0x6e'))][(_0x83a9('0x92'))](_0x83a9('0x6f'),0x193);}_0x1ed173=_0x939334;return db['AnalyticMetric'][_0x83a9('0x71')]({'raw':!![]});}return null;})[_0x83a9('0x27')](function(_0x577584){if(_0x577584){_0xf30db2=_[_0x83a9('0x72')](_0x577584,'id');var _0x506bda;var _0x1111c8=squel[_0x83a9('0x73')]();_0x1111c8['from'](_0x297fa5[_0x83a9('0x75')]);for(var _0x15b577=0x0;_0x15b577<_0x1ed173[_0x83a9('0x3c')];_0x15b577+=0x1){_0x506bda=_0x1ed173[_0x15b577][_0x83a9('0x76')]?_0xf30db2[_0x1ed173[_0x15b577][_0x83a9('0x76')]]['metric']:_0x1ed173[_0x15b577][_0x83a9('0x6a')];_0x506bda=_0x1ed173[_0x15b577]['function']?_[_0x83a9('0x93')](_0x235742[_0x1ed173[_0x15b577][_0x83a9('0x78')]],'%s',_0x506bda):_0x506bda;_0x506bda=_0x1ed173[_0x15b577][_0x83a9('0x79')]?_[_0x83a9('0x93')](_0x452d48[_0x1ed173[_0x15b577]['format']],'%s',_0x506bda):_0x506bda;if(_0x1ed173[_0x15b577][_0x83a9('0x7a')]){_0x1111c8[_0x83a9('0x69')](_0x506bda);}_0x1ed173[_0x15b577][_0x83a9('0x7b')]&&_0x1111c8[_0x83a9('0x3e')](_0x506bda,_0x1ed173[_0x15b577][_0x83a9('0x7b')]==='DESC'?![]:!![]);_0x1111c8[_0x83a9('0x6a')](_0x506bda,_0x1ed173[_0x15b577][_0x83a9('0x7d')]||_0x506bda);}if(_0x297fa5[_0x83a9('0x7e')]){_0x297fa5['joins']=JSON[_0x83a9('0x7f')](_0x297fa5[_0x83a9('0x7e')]);for(var _0xc4c2b9=0x0;_0xc4c2b9<_0x297fa5[_0x83a9('0x7e')][_0x83a9('0x3c')];_0xc4c2b9+=0x1){if(_0x297fa5[_0x83a9('0x7e')][_0xc4c2b9][_0x83a9('0x33')]&&_[_0x83a9('0x62')](_0x101e91,_0x297fa5[_0x83a9('0x7e')][_0xc4c2b9][_0x83a9('0x33')])&&_0x297fa5[_0x83a9('0x7e')][_0xc4c2b9][_0x83a9('0x80')]&&_0x297fa5[_0x83a9('0x7e')][_0xc4c2b9][_0x83a9('0x81')]&&_0x297fa5['joins'][_0xc4c2b9]['foreignKey']){_0x1111c8[_0x297fa5['joins'][_0xc4c2b9][_0x83a9('0x33')]](_0x297fa5[_0x83a9('0x7e')][_0xc4c2b9]['foreignTable'],null,util['format'](_0x83a9('0x83'),_0x297fa5[_0x83a9('0x75')],_0x297fa5[_0x83a9('0x7e')][_0xc4c2b9][_0x83a9('0x80')],_0x297fa5[_0x83a9('0x7e')][_0xc4c2b9][_0x83a9('0x81')],_0x297fa5[_0x83a9('0x7e')][_0xc4c2b9][_0x83a9('0x82')]));}}}if(_0x297fa5[_0x83a9('0x84')]){_0x297fa5['conditions']=JSON['parse'](_0x297fa5[_0x83a9('0x84')]);_0x1111c8[_0x83a9('0x3f')](_0x1bc42c(_0x297fa5['conditions'][_0x83a9('0x69')]));}_0x11cd6a=_0x1111c8[_0x83a9('0x85')]();_0x1111c8[_0x83a9('0x1f')](_0x3466e5);_0x1111c8[_0x83a9('0x1d')](0x0);logger[_0x83a9('0x86')](_0x83a9('0x87'),_0x1111c8[_0x83a9('0x88')]());return dbH[_0x83a9('0x89')][_0x83a9('0x36')](_0x1111c8[_0x83a9('0x88')](),{'type':dbH[_0x83a9('0x89')]['QueryTypes'][_0x83a9('0x8b')]});}})[_0x83a9('0x27')](function(){return{'sql':_0x11cd6a[_0x83a9('0x88')]()};})[_0x83a9('0x27')](respondWithResult(_0x5a478d,null))[_0x83a9('0x48')](handleError(_0x5a478d,null));};
\ No newline at end of file
+var _0xd07e=['reject','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','catch','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','table','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','select','MetricId','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','SELECT','run','UNIX_TIMESTAMP(%s)','metric','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','undefined','limit','offset','Content-Range','apply'];(function(_0x47d22c,_0x2a8058){var _0x35e7da=function(_0x18bf49){while(--_0x18bf49){_0x47d22c['push'](_0x47d22c['shift']());}};_0x35e7da(++_0x2a8058);}(_0xd07e,0x80));var _0xed07=function(_0x13547d,_0xa3895e){_0x13547d=_0x13547d-0x0;var _0x22c36b=_0xd07e[_0x13547d];return _0x22c36b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed07('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed07('0x1'));var rp=require('request-promise');var moment=require(_0xed07('0x2'));var BPromise=require(_0xed07('0x3'));var Mustache=require('mustache');var util=require(_0xed07('0x4'));var path=require(_0xed07('0x5'));var sox=require(_0xed07('0x6'));var csv=require(_0xed07('0x7'));var ejs=require(_0xed07('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed07('0x9'));var squel=require(_0xed07('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed07('0xb'));var toCsv=require(_0xed07('0x7'));var querystring=require(_0xed07('0xc'));var Papa=require(_0xed07('0xd'));var Redis=require(_0xed07('0xe'));var authService=require(_0xed07('0xf'));var qs=require(_0xed07('0x10'));var as=require(_0xed07('0x11'));var hardwareService=require(_0xed07('0x12'));var logger=require(_0xed07('0x13'))(_0xed07('0x14'));var utils=require('../../config/utils');var config=require(_0xed07('0x15'));var licenseUtil=require(_0xed07('0x16'));var db=require(_0xed07('0x17'))['db'];var dbH=require(_0xed07('0x17'))[_0xed07('0x18')];function respondWithStatusCode(_0x21aa96,_0x1f9b73){_0x1f9b73=_0x1f9b73||0xcc;return function(_0x4e347f){if(_0x4e347f){return _0x21aa96[_0xed07('0x19')](_0x1f9b73);}return _0x21aa96['status'](_0x1f9b73)[_0xed07('0x1a')]();};}function respondWithResult(_0x49b071,_0x5cdad5){_0x5cdad5=_0x5cdad5||0xc8;return function(_0x52c86e){if(_0x52c86e){return _0x49b071[_0xed07('0x1b')](_0x5cdad5)[_0xed07('0x1c')](_0x52c86e);}};}function respondWithFilteredResult(_0x7dee7c,_0x38e6f7){return function(_0x4f41d9){if(_0x4f41d9){var _0x2097f0=typeof _0x38e6f7['offset']===_0xed07('0x1d')&&typeof _0x38e6f7[_0xed07('0x1e')]===_0xed07('0x1d');var _0x61a079=_0x4f41d9['count'];var _0x7a6b29=_0x2097f0?0x0:_0x38e6f7[_0xed07('0x1f')];var _0x315ba9=_0x2097f0?_0x4f41d9['count']:_0x38e6f7['offset']+_0x38e6f7['limit'];var _0x1a8387;if(_0x315ba9>=_0x61a079){_0x315ba9=_0x61a079;_0x1a8387=0xc8;}else{_0x1a8387=0xce;}_0x7dee7c[_0xed07('0x1b')](_0x1a8387);return _0x7dee7c['set'](_0xed07('0x20'),_0x7a6b29+'-'+_0x315ba9+'/'+_0x61a079)[_0xed07('0x1c')](_0x4f41d9);}return null;};}function patchUpdates(_0x11df71){return function(_0x445275){try{jsonpatch[_0xed07('0x21')](_0x445275,_0x11df71,!![]);}catch(_0x10c394){return BPromise[_0xed07('0x22')](_0x10c394);}return _0x445275['save']();};}function saveUpdates(_0x5bb7b6,_0xba74ba){return function(_0x46119f){if(_0x46119f){return _0x46119f[_0xed07('0x23')](_0x5bb7b6)[_0xed07('0x24')](function(_0x4b89c1){return _0x4b89c1;});}return null;};}function removeEntity(_0x25b3e6,_0x16edab){return function(_0x598bea){if(_0x598bea){return _0x598bea[_0xed07('0x25')]()[_0xed07('0x24')](function(){var _0x57d898=_0x598bea['get']({'plain':!![]});var _0x16266b=_0xed07('0x26');return db[_0xed07('0x27')][_0xed07('0x25')]({'where':{'type':_0x16266b,'resourceId':_0x57d898['id']}})[_0xed07('0x24')](function(){return _0x598bea;});})[_0xed07('0x24')](function(){_0x25b3e6[_0xed07('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e4c42,_0x4a6368){return function(_0x2ee303){if(!_0x2ee303){_0x1e4c42[_0xed07('0x19')](0x194);}return _0x2ee303;};}function handleError(_0x143436,_0x1e9113){_0x1e9113=_0x1e9113||0x1f4;return function(_0x7ae630){logger[_0xed07('0x28')](_0x7ae630[_0xed07('0x29')]);if(_0x7ae630[_0xed07('0x2a')]){delete _0x7ae630['name'];}_0x143436[_0xed07('0x1b')](_0x1e9113)[_0xed07('0x2b')](_0x7ae630);};}exports[_0xed07('0x2c')]=function(_0x4d42fe,_0x49e799){var _0x54bc52={},_0x17e264={},_0x51503e={'count':0x0,'rows':[]};var _0x5ab625=_[_0xed07('0x2d')](db[_0xed07('0x2e')][_0xed07('0x2f')],function(_0xfa357e){return{'name':_0xfa357e[_0xed07('0x30')],'type':_0xfa357e['type'][_0xed07('0x31')]};});_0x17e264[_0xed07('0x32')]=_['map'](_0x5ab625,'name');_0x17e264[_0xed07('0x33')]=_[_0xed07('0x34')](_0x4d42fe[_0xed07('0x33')]);_0x17e264['filters']=_[_0xed07('0x35')](_0x17e264[_0xed07('0x32')],_0x17e264[_0xed07('0x33')]);_0x54bc52[_0xed07('0x36')]=_[_0xed07('0x35')](_0x17e264[_0xed07('0x32')],qs[_0xed07('0x37')](_0x4d42fe[_0xed07('0x33')]['fields']));_0x54bc52[_0xed07('0x36')]=_0x54bc52[_0xed07('0x36')][_0xed07('0x38')]?_0x54bc52[_0xed07('0x36')]:_0x17e264[_0xed07('0x32')];if(!_0x4d42fe[_0xed07('0x33')][_0xed07('0x39')](_0xed07('0x3a'))){_0x54bc52['limit']=qs[_0xed07('0x1e')](_0x4d42fe[_0xed07('0x33')][_0xed07('0x1e')]);_0x54bc52[_0xed07('0x1f')]=qs[_0xed07('0x1f')](_0x4d42fe[_0xed07('0x33')][_0xed07('0x1f')]);}_0x54bc52[_0xed07('0x3b')]=qs[_0xed07('0x3c')](_0x4d42fe[_0xed07('0x33')][_0xed07('0x3c')]);_0x54bc52['where']=qs[_0xed07('0x3d')](_[_0xed07('0x3e')](_0x4d42fe[_0xed07('0x33')],_0x17e264[_0xed07('0x3d')]),_0x5ab625);if(_0x4d42fe[_0xed07('0x33')][_0xed07('0x3f')]){_0x54bc52[_0xed07('0x40')]=_[_0xed07('0x41')](_0x54bc52['where'],{'$or':_[_0xed07('0x2d')](_0x5ab625,function(_0x48d230){if(_0x48d230[_0xed07('0x42')]!==_0xed07('0x43')){var _0x3085d0={};_0x3085d0[_0x48d230[_0xed07('0x2a')]]={'$like':'%'+_0x4d42fe[_0xed07('0x33')]['filter']+'%'};return _0x3085d0;}})});}_0x54bc52=_[_0xed07('0x41')]({},_0x54bc52,_0x4d42fe['options']);var _0x1bbcdd={'where':_0x54bc52[_0xed07('0x40')]};return db[_0xed07('0x2e')][_0xed07('0x44')](_0x1bbcdd)[_0xed07('0x24')](function(_0x40967a){_0x51503e['count']=_0x40967a;if(_0x4d42fe[_0xed07('0x33')][_0xed07('0x45')]){_0x54bc52[_0xed07('0x46')]=[{'all':!![]}];}return db[_0xed07('0x2e')][_0xed07('0x47')](_0x54bc52);})[_0xed07('0x24')](function(_0x2e306f){_0x51503e[_0xed07('0x48')]=_0x2e306f;return _0x51503e;})[_0xed07('0x24')](respondWithFilteredResult(_0x49e799,_0x54bc52))['catch'](handleError(_0x49e799,null));};exports[_0xed07('0x49')]=function(_0x305fdc,_0xb5f6ad){var _0xae22b4={'raw':![],'where':{'id':_0x305fdc[_0xed07('0x4a')]['id']}},_0x35e8f6={};_0x35e8f6['model']=_[_0xed07('0x34')](db[_0xed07('0x2e')][_0xed07('0x2f')]);_0x35e8f6[_0xed07('0x33')]=_[_0xed07('0x34')](_0x305fdc[_0xed07('0x33')]);_0x35e8f6[_0xed07('0x3d')]=_['intersection'](_0x35e8f6[_0xed07('0x32')],_0x35e8f6['query']);_0xae22b4[_0xed07('0x36')]=_[_0xed07('0x35')](_0x35e8f6[_0xed07('0x32')],qs[_0xed07('0x37')](_0x305fdc[_0xed07('0x33')][_0xed07('0x37')]));_0xae22b4['attributes']=_0xae22b4[_0xed07('0x36')]['length']?_0xae22b4[_0xed07('0x36')]:_0x35e8f6['model'];if(_0x305fdc['query'][_0xed07('0x45')]){_0xae22b4['include']=[{'all':!![]}];}_0xae22b4=_[_0xed07('0x41')]({},_0xae22b4,_0x305fdc[_0xed07('0x4b')]);return db['AnalyticCustomReport'][_0xed07('0x4c')](_0xae22b4)[_0xed07('0x24')](handleEntityNotFound(_0xb5f6ad,null))[_0xed07('0x24')](respondWithResult(_0xb5f6ad,null))['catch'](handleError(_0xb5f6ad,null));};exports[_0xed07('0x4d')]=function(_0x11f95a,_0x185f07){return db[_0xed07('0x2e')][_0xed07('0x4d')](_0x11f95a[_0xed07('0x4e')],{})[_0xed07('0x24')](function(_0x45e03a){var _0x11d191=_0x11f95a[_0xed07('0x4f')][_0xed07('0x50')]({'plain':!![]});if(!_0x11d191)throw new Error(_0xed07('0x51'));if(_0x11d191['role']===_0xed07('0x4f')){var _0x3567a7=_0x45e03a[_0xed07('0x50')]({'plain':!![]});var _0x2e839a=_0xed07('0x52');return db[_0xed07('0x53')][_0xed07('0x4c')]({'where':{'name':_0x2e839a,'userProfileId':_0x11d191[_0xed07('0x54')]},'raw':!![]})[_0xed07('0x24')](function(_0x1ab2b4){if(_0x1ab2b4&&_0x1ab2b4[_0xed07('0x55')]===0x0){return db[_0xed07('0x27')][_0xed07('0x4d')]({'name':_0x3567a7[_0xed07('0x2a')],'resourceId':_0x3567a7['id'],'type':'CustomReports','sectionId':_0x1ab2b4['id']},{})[_0xed07('0x24')](function(){return _0x45e03a;});}else{return _0x45e03a;}})['catch'](function(_0x373443){logger[_0xed07('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x373443);throw _0x373443;});}return _0x45e03a;})['then'](respondWithResult(_0x185f07,0xc9))['catch'](handleError(_0x185f07,null));};exports[_0xed07('0x23')]=function(_0x12bcfd,_0x255316){if(_0x12bcfd[_0xed07('0x4e')]['id']){delete _0x12bcfd[_0xed07('0x4e')]['id'];}return db[_0xed07('0x2e')][_0xed07('0x4c')]({'where':{'id':_0x12bcfd['params']['id']}})[_0xed07('0x24')](handleEntityNotFound(_0x255316,null))[_0xed07('0x24')](saveUpdates(_0x12bcfd[_0xed07('0x4e')],null))[_0xed07('0x24')](respondWithResult(_0x255316,null))[_0xed07('0x56')](handleError(_0x255316,null));};exports[_0xed07('0x25')]=function(_0x320ade,_0x452278){return db[_0xed07('0x2e')][_0xed07('0x4c')]({'where':{'id':_0x320ade[_0xed07('0x4a')]['id']}})[_0xed07('0x24')](handleEntityNotFound(_0x452278,null))[_0xed07('0x24')](removeEntity(_0x452278,null))[_0xed07('0x56')](handleError(_0x452278,null));};exports[_0xed07('0x57')]=function(_0x5bd6d1,_0x56d830){var _0x30a220=0xa;var _0x5cd790=[_0xed07('0x58'),'left_join',_0xed07('0x59'),_0xed07('0x5a')];var _0x57c844={'SUM':_0xed07('0x5b'),'COUNT':_0xed07('0x5c'),'COUNT DISTINCT':_0xed07('0x5d'),'MAX':_0xed07('0x5e'),'MIN':'MIN(%s)','AVG':_0xed07('0x5f'),'GROUP_CONCAT':_0xed07('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xed07('0x61')};var _0x549fc3={'SEC_TO_TIME':_0xed07('0x62'),'DATE':_0xed07('0x63'),'HOUR':_0xed07('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4e4db3=function(_0x1cc479){return!_[_0xed07('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xed07('0x66')],_0x1cc479);};var _0xf13ba3=function(_0x2c48e9){if(!_0x2c48e9||!_0x2c48e9[_0xed07('0x67')][_0xed07('0x38')]){return'';}for(var _0x367bf5='(',_0x3e54c5=0x0;_0x3e54c5<_0x2c48e9['rules'][_0xed07('0x38')];_0x3e54c5+=0x1){_0x3e54c5>0x0&&(_0x367bf5+='\x20'+_0x2c48e9[_0xed07('0x68')]+'\x20');_0x367bf5+=_0x2c48e9[_0xed07('0x67')][_0x3e54c5][_0xed07('0x69')]?_0xf13ba3(_0x2c48e9[_0xed07('0x67')][_0x3e54c5][_0xed07('0x69')]):_0x2c48e9[_0xed07('0x67')][_0x3e54c5]['field']+'\x20'+_0x2c48e9['rules'][_0x3e54c5][_0xed07('0x6a')]+(_0x4e4db3(_0x2c48e9[_0xed07('0x67')][_0x3e54c5][_0xed07('0x6a')])?'\x20'+_0x2c48e9[_0xed07('0x67')][_0x3e54c5][_0xed07('0x6b')]:'');}return _0x367bf5+')';};var _0x17a796={'where':{'id':_0x5bd6d1[_0xed07('0x4a')]['id']}},_0x22fde4,_0x45a1ac,_0x36b4f5,_0x587286,_0x1a27a8;_0x17a796=_[_0xed07('0x41')]({},_0x17a796,_0x5bd6d1['options']);return db['AnalyticCustomReport'][_0xed07('0x4c')](_0x17a796)[_0xed07('0x24')](function(_0x582089){if(_0x582089){_0x22fde4=_0x582089;return _0x582089[_0xed07('0x6c')]();}return null;})['then'](function(_0x2c8f12){if(_0x2c8f12){if(!_0x2c8f12['length']){throw new db[(_0xed07('0x6d'))][(_0xed07('0x6e'))](_0xed07('0x6f'),0x193);}_0x45a1ac=_0x2c8f12;return db[_0xed07('0x70')][_0xed07('0x47')]({'raw':!![]});}return null;})[_0xed07('0x24')](function(_0x54875f){if(_0x54875f){_0x36b4f5=_[_0xed07('0x71')](_0x54875f,'id');var _0x4835c4;var _0x1c0d52=squel['select']();_0x1c0d52[_0xed07('0x72')](_0x22fde4['table']);for(var _0x50b8e1=0x0;_0x50b8e1<_0x45a1ac[_0xed07('0x38')];_0x50b8e1+=0x1){_0x4835c4=_0x45a1ac[_0x50b8e1]['MetricId']?_0x36b4f5[_0x45a1ac[_0x50b8e1]['MetricId']]['metric']:_0x45a1ac[_0x50b8e1][_0xed07('0x73')];_0x4835c4=_0x45a1ac[_0x50b8e1][_0xed07('0x74')]?_[_0xed07('0x75')](_0x57c844[_0x45a1ac[_0x50b8e1][_0xed07('0x74')]],'%s',_0x4835c4):_0x4835c4;_0x4835c4=_0x45a1ac[_0x50b8e1]['format']?_[_0xed07('0x75')](_0x549fc3[_0x45a1ac[_0x50b8e1][_0xed07('0x76')]],'%s',_0x4835c4):_0x4835c4;if(_0x45a1ac[_0x50b8e1][_0xed07('0x77')]){_0x1c0d52['group'](_0x4835c4);}_0x45a1ac[_0x50b8e1][_0xed07('0x78')]&&_0x1c0d52['order'](_0x4835c4,_0x45a1ac[_0x50b8e1][_0xed07('0x78')]===_0xed07('0x79')?![]:!![]);_0x1c0d52[_0xed07('0x73')](_0x4835c4,_0x45a1ac[_0x50b8e1][_0xed07('0x7a')]||_0x4835c4);}if(_0x22fde4['joins']){_0x22fde4[_0xed07('0x7b')]=JSON['parse'](_0x22fde4['joins']);for(var _0x463564=0x0;_0x463564<_0x22fde4[_0xed07('0x7b')][_0xed07('0x38')];_0x463564+=0x1){if(_0x22fde4[_0xed07('0x7b')][_0x463564]['type']&&_[_0xed07('0x65')](_0x5cd790,_0x22fde4['joins'][_0x463564][_0xed07('0x42')])&&_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7c')]&&_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7d')]&&_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7e')]){_0x1c0d52[_0x22fde4[_0xed07('0x7b')][_0x463564]['type']](_0x22fde4[_0xed07('0x7b')][_0x463564]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x22fde4[_0xed07('0x7f')],_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7c')],_0x22fde4['joins'][_0x463564][_0xed07('0x7d')],_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7e')]));}}}if(_0x22fde4[_0xed07('0x80')]){_0x22fde4['conditions']=JSON[_0xed07('0x81')](_0x22fde4[_0xed07('0x80')]);_0x1c0d52[_0xed07('0x40')](_0xf13ba3(_0x22fde4['conditions'][_0xed07('0x69')]));}_0x1a27a8=_0x1c0d52[_0xed07('0x82')]();_0x1c0d52[_0xed07('0x1e')](_0x30a220);_0x1c0d52[_0xed07('0x1f')](0x0);logger[_0xed07('0x83')](_0xed07('0x84'),_0x1c0d52[_0xed07('0x85')]());return dbH[_0xed07('0x86')][_0xed07('0x33')](_0x1c0d52[_0xed07('0x85')](),{'type':dbH[_0xed07('0x86')][_0xed07('0x87')]['SELECT']});}})[_0xed07('0x24')](respondWithResult(_0x56d830,null))[_0xed07('0x56')](handleError(_0x56d830,null));};function runReport(_0x82d8f8,_0x29bf9d,_0x5b3e14){var _0x5bc9dd=_0x29bf9d[_0xed07('0x2a')];var _0x198f5b=0xa;var _0x3491fb=[_0xed07('0x58'),_0xed07('0x88'),_0xed07('0x59'),_0xed07('0x5a')];var _0x376d01={'SUM':'SUM(%s)','COUNT':_0xed07('0x5c'),'COUNT DISTINCT':_0xed07('0x5d'),'MAX':_0xed07('0x5e'),'MIN':_0xed07('0x89'),'AVG':_0xed07('0x5f'),'GROUP_CONCAT':_0xed07('0x60'),'GROUP_CONCAT ASC':_0xed07('0x8a'),'GROUP_CONCAT DESC':_0xed07('0x61')};var _0x12e130={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xed07('0x63'),'HOUR':_0xed07('0x64'),'ROUND':_0xed07('0x8b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1d0254=function(_0x561473){return!_[_0xed07('0x65')]([_0xed07('0x8c'),_0xed07('0x8d'),'IS\x20EMPTY',_0xed07('0x66')],_0x561473);};var _0x2ae5dd=function(_0x18938e){if(!_0x18938e||!_0x18938e['rules']['length']){return'';}for(var _0x43c4c5='(',_0x183074=0x0;_0x183074<_0x18938e[_0xed07('0x67')]['length'];_0x183074+=0x1){_0x183074>0x0&&(_0x43c4c5+='\x20'+_0x18938e[_0xed07('0x68')]+'\x20');_0x43c4c5+=_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x69')]?_0x2ae5dd(_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x69')]):_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x73')]+'\x20'+_0x18938e['rules'][_0x183074][_0xed07('0x6a')]+(_0x1d0254(_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x6a')])?'\x20'+_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x6b')]:'');}return _0x43c4c5+')';};var _0x54be7d={'where':{'id':_0x82d8f8['id']}},_0x5ebdb5,_0x4e8421,_0xe5631f,_0x113cd0,_0x3cfc43;_0x54be7d=_[_0xed07('0x41')]({},_0x54be7d,_0x5b3e14);return db[_0xed07('0x2e')][_0xed07('0x4c')](_0x54be7d)[_0xed07('0x24')](function(_0x4ec1e6){if(_0x4ec1e6){_0x5ebdb5=_0x4ec1e6;return _0x4ec1e6[_0xed07('0x6c')]();}return null;})[_0xed07('0x24')](function(_0x5b9114){if(_0x5b9114){if(!_0x5b9114[_0xed07('0x38')]){throw new db[(_0xed07('0x6d'))][(_0xed07('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4e8421=_0x5b9114;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xed07('0x24')](function(_0x46c608){if(_0x46c608){_0xe5631f=_['keyBy'](_0x46c608,'id');var _0x2c99c2;var _0x3a42b9=squel[_0xed07('0x8e')]();_0x3a42b9[_0xed07('0x72')](_0x5ebdb5[_0xed07('0x7f')]);for(var _0x293b4d=0x0;_0x293b4d<_0x4e8421[_0xed07('0x38')];_0x293b4d+=0x1){_0x2c99c2=_0x4e8421[_0x293b4d][_0xed07('0x8f')]?_0xe5631f[_0x4e8421[_0x293b4d][_0xed07('0x8f')]]['metric']:_0x4e8421[_0x293b4d]['field'];_0x2c99c2=_0x4e8421[_0x293b4d][_0xed07('0x74')]?_['replace'](_0x376d01[_0x4e8421[_0x293b4d]['function']],'%s',_0x2c99c2):_0x2c99c2;_0x2c99c2=_0x4e8421[_0x293b4d][_0xed07('0x76')]?_[_0xed07('0x75')](_0x12e130[_0x4e8421[_0x293b4d][_0xed07('0x76')]],'%s',_0x2c99c2):_0x2c99c2;if(_0x4e8421[_0x293b4d][_0xed07('0x77')]){_0x3a42b9[_0xed07('0x69')](_0x2c99c2);}_0x4e8421[_0x293b4d]['orderBy']&&_0x3a42b9['order'](_0x2c99c2,_0x4e8421[_0x293b4d]['orderBy']===_0xed07('0x79')?![]:!![]);_0x3a42b9['field'](_0x2c99c2,_0x4e8421[_0x293b4d]['alias']||_0x2c99c2);}if(_0x5ebdb5[_0xed07('0x7b')]){_0x5ebdb5[_0xed07('0x7b')]=JSON['parse'](_0x5ebdb5['joins']);for(var _0x5c7a64=0x0;_0x5c7a64<_0x5ebdb5[_0xed07('0x7b')][_0xed07('0x38')];_0x5c7a64+=0x1){if(_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x42')]&&_['includes'](_0x3491fb,_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x42')])&&_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x7c')]&&_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64]['foreignTable']&&_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x7e')]){_0x3a42b9[_0x5ebdb5['joins'][_0x5c7a64][_0xed07('0x42')]](_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64]['foreignTable'],null,util[_0xed07('0x76')](_0xed07('0x90'),_0x5ebdb5['table'],_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x7c')],_0x5ebdb5['joins'][_0x5c7a64]['foreignTable'],_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x7e')]));}}}if(_0x5ebdb5[_0xed07('0x80')]){_0x5ebdb5[_0xed07('0x80')]=JSON[_0xed07('0x81')](_0x5ebdb5[_0xed07('0x80')]);_0x3a42b9[_0xed07('0x40')](_0x2ae5dd(_0x5ebdb5[_0xed07('0x80')][_0xed07('0x69')]));}_0x3cfc43=_0x3a42b9['clone']();_0x3a42b9['limit'](_0x198f5b);_0x3a42b9[_0xed07('0x1f')](0x0);return;}})[_0xed07('0x24')](function(){if(_0x29bf9d[_0xed07('0x91')]==='web'){return null;}var _0x201760=_[_0xed07('0x41')](_0x29bf9d,{'name':_0x29bf9d[_0xed07('0x92')]||_0x29bf9d[_0xed07('0x2a')]||_0x5ebdb5[_0xed07('0x2a')],'basename':_0x5bc9dd,'savename':util['format'](_0xed07('0x93'),_0x29bf9d[_0xed07('0x2a')]||_0x5ebdb5['name'],require('randomstring')[_0xed07('0x94')](0x4),_0x29bf9d['output']||'csv'),'reportId':_0x5ebdb5['id'],'reportType':_0xed07('0x95')});return db[_0xed07('0x96')]['create'](_0x201760,{'raw':!![]});})[_0xed07('0x24')](function(_0x4c23b3){if(_0x5ebdb5['table']==='cdr'){_0x3cfc43[_0xed07('0x40')](_0x5ebdb5['table']+_0xed07('0x97'),_0x29bf9d['startDate'],_0x29bf9d['endDate']);}else{_0x3cfc43[_0xed07('0x40')](_0x5ebdb5[_0xed07('0x7f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x29bf9d['startDate'],_0x29bf9d[_0xed07('0x98')]);}if(_0x4c23b3){logger['info'](_0xed07('0x99'),_0x3cfc43[_0xed07('0x85')]());require(_0xed07('0x9a'))[_0xed07('0x9b')](path[_0xed07('0x58')](__dirname,_0xed07('0x9c'),_0x4c23b3[_0xed07('0x91')]),[_0x4c23b3['id'],_0x3cfc43[_0xed07('0x85')](),path[_0xed07('0x58')](__dirname,'../../files/reports',_0x4c23b3[_0xed07('0x9d')]),_0x5bc9dd]);return _0x4c23b3;}else{var _0x2a5549=squel[_0xed07('0x8e')]();_0x2a5549['from']('('+_0x3cfc43[_0xed07('0x85')]()+')','countTable');_0x2a5549[_0xed07('0x73')]('COUNT(*)',_0xed07('0x44'));_0x3cfc43[_0xed07('0x1e')](_0x29bf9d[_0xed07('0x1e')]||_0x198f5b);_0x3cfc43['offset'](_0x29bf9d[_0xed07('0x1f')]||0x0);return dbH[_0xed07('0x86')][_0xed07('0x33')](_0x2a5549[_0xed07('0x85')](),{'type':dbH[_0xed07('0x86')][_0xed07('0x87')][_0xed07('0x9e')]})['then'](function(_0x456720){if(!_0x456720['length']){_0x113cd0=0x0;}else{_0x113cd0=_0x456720[0x0][_0xed07('0x44')]||0x0;}return dbH[_0xed07('0x86')][_0xed07('0x33')](_0x3cfc43['toString'](),{'type':dbH[_0xed07('0x86')][_0xed07('0x87')]['SELECT']});})[_0xed07('0x24')](function(_0xad4409){return{'rows':_0xad4409||[],'count':_0x113cd0};});}});}exports[_0xed07('0x9f')]=function(_0x292963,_0x1a9e4e){return runReport(_0x292963['params'],_0x292963['query'],_0x292963['options'])[_0xed07('0x24')](respondWithResult(_0x1a9e4e,null))['catch'](handleError(_0x1a9e4e,null));};exports['runReport']=runReport;exports[_0xed07('0x33')]=function(_0x163716,_0x1ce9b6){var _0x3e8b32=0xa;var _0x57bb47=[_0xed07('0x58'),_0xed07('0x88'),'right_join',_0xed07('0x5a')];var _0x2d0556={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xed07('0x5d'),'MAX':_0xed07('0x5e'),'MIN':_0xed07('0x89'),'AVG':_0xed07('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xed07('0x8a'),'GROUP_CONCAT DESC':_0xed07('0x61')};var _0x50a62f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xed07('0x63'),'HOUR':_0xed07('0x64'),'ROUND':_0xed07('0x8b'),'UNIX_TIMESTAMP':_0xed07('0xa0')};var _0x5aa118=function(_0x28554e){return!_['includes']([_0xed07('0x8c'),_0xed07('0x8d'),'IS\x20EMPTY',_0xed07('0x66')],_0x28554e);};var _0x3c400a=function(_0x468d64){if(!_0x468d64||!_0x468d64['rules'][_0xed07('0x38')]){return'';}for(var _0x1da1df='(',_0x377259=0x0;_0x377259<_0x468d64['rules'][_0xed07('0x38')];_0x377259+=0x1){_0x377259>0x0&&(_0x1da1df+='\x20'+_0x468d64['operator']+'\x20');_0x1da1df+=_0x468d64['rules'][_0x377259][_0xed07('0x69')]?_0x3c400a(_0x468d64['rules'][_0x377259][_0xed07('0x69')]):_0x468d64[_0xed07('0x67')][_0x377259][_0xed07('0x73')]+'\x20'+_0x468d64[_0xed07('0x67')][_0x377259][_0xed07('0x6a')]+(_0x5aa118(_0x468d64[_0xed07('0x67')][_0x377259][_0xed07('0x6a')])?'\x20'+_0x468d64['rules'][_0x377259][_0xed07('0x6b')]:'');}return _0x1da1df+')';};var _0x4d6f58={'where':{'id':_0x163716['params']['id']}},_0x50c2e0,_0x7ec40c,_0x1f4833,_0xcf40dc,_0x39ef0c;_0x4d6f58=_[_0xed07('0x41')]({},_0x4d6f58,_0x163716['options']);return db[_0xed07('0x2e')]['find'](_0x4d6f58)[_0xed07('0x24')](function(_0x57219a){if(_0x57219a){_0x50c2e0=_0x57219a;return _0x57219a[_0xed07('0x6c')]();}return null;})[_0xed07('0x24')](function(_0xd46710){if(_0xd46710){if(!_0xd46710[_0xed07('0x38')]){throw new db[(_0xed07('0x6d'))][(_0xed07('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x7ec40c=_0xd46710;return db[_0xed07('0x70')]['findAll']({'raw':!![]});}return null;})[_0xed07('0x24')](function(_0x12a782){if(_0x12a782){_0x1f4833=_['keyBy'](_0x12a782,'id');var _0xa50109;var _0x447158=squel[_0xed07('0x8e')]();_0x447158['from'](_0x50c2e0[_0xed07('0x7f')]);for(var _0xc26b71=0x0;_0xc26b71<_0x7ec40c[_0xed07('0x38')];_0xc26b71+=0x1){_0xa50109=_0x7ec40c[_0xc26b71][_0xed07('0x8f')]?_0x1f4833[_0x7ec40c[_0xc26b71]['MetricId']][_0xed07('0xa1')]:_0x7ec40c[_0xc26b71]['field'];_0xa50109=_0x7ec40c[_0xc26b71][_0xed07('0x74')]?_['replace'](_0x2d0556[_0x7ec40c[_0xc26b71][_0xed07('0x74')]],'%s',_0xa50109):_0xa50109;_0xa50109=_0x7ec40c[_0xc26b71][_0xed07('0x76')]?_[_0xed07('0x75')](_0x50a62f[_0x7ec40c[_0xc26b71][_0xed07('0x76')]],'%s',_0xa50109):_0xa50109;if(_0x7ec40c[_0xc26b71][_0xed07('0x77')]){_0x447158['group'](_0xa50109);}_0x7ec40c[_0xc26b71][_0xed07('0x78')]&&_0x447158[_0xed07('0x3b')](_0xa50109,_0x7ec40c[_0xc26b71]['orderBy']==='DESC'?![]:!![]);_0x447158[_0xed07('0x73')](_0xa50109,_0x7ec40c[_0xc26b71][_0xed07('0x7a')]||_0xa50109);}if(_0x50c2e0[_0xed07('0x7b')]){_0x50c2e0[_0xed07('0x7b')]=JSON[_0xed07('0x81')](_0x50c2e0[_0xed07('0x7b')]);for(var _0x59b805=0x0;_0x59b805<_0x50c2e0['joins']['length'];_0x59b805+=0x1){if(_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x42')]&&_[_0xed07('0x65')](_0x57bb47,_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x42')])&&_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7c')]&&_0x50c2e0['joins'][_0x59b805][_0xed07('0x7d')]&&_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7e')]){_0x447158[_0x50c2e0['joins'][_0x59b805][_0xed07('0x42')]](_0x50c2e0[_0xed07('0x7b')][_0x59b805]['foreignTable'],null,util[_0xed07('0x76')](_0xed07('0x90'),_0x50c2e0[_0xed07('0x7f')],_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7c')],_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7d')],_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7e')]));}}}if(_0x50c2e0['conditions']){_0x50c2e0[_0xed07('0x80')]=JSON[_0xed07('0x81')](_0x50c2e0[_0xed07('0x80')]);_0x447158['where'](_0x3c400a(_0x50c2e0[_0xed07('0x80')][_0xed07('0x69')]));}_0x39ef0c=_0x447158[_0xed07('0x82')]();_0x447158[_0xed07('0x1e')](_0x3e8b32);_0x447158[_0xed07('0x1f')](0x0);logger[_0xed07('0x83')](_0xed07('0x84'),_0x447158[_0xed07('0x85')]());return dbH[_0xed07('0x86')]['query'](_0x447158[_0xed07('0x85')](),{'type':dbH[_0xed07('0x86')]['QueryTypes'][_0xed07('0x9e')]});}})[_0xed07('0x24')](function(){return{'sql':_0x39ef0c[_0xed07('0x85')]()};})[_0xed07('0x24')](respondWithResult(_0x1ce9b6,null))[_0xed07('0x56')](handleError(_0x1ce9b6,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5549ad4..9d93a98 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 _0x8c63=['AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xf9bfe2,_0x1bae47){var _0x2ce92b=function(_0x32cc02){while(--_0x32cc02){_0xf9bfe2['push'](_0xf9bfe2['shift']());}};_0x2ce92b(++_0x1bae47);}(_0x8c63,0x6a));var _0x38c6=function(_0x5aa11a,_0x84cafc){_0x5aa11a=_0x5aa11a-0x0;var _0x59aec7=_0x8c63[_0x5aa11a];return _0x59aec7;};'use strict';var _=require(_0x38c6('0x0'));var util=require(_0x38c6('0x1'));var logger=require('../../config/logger')(_0x38c6('0x2'));var moment=require(_0x38c6('0x3'));var BPromise=require(_0x38c6('0x4'));var rp=require(_0x38c6('0x5'));var fs=require('fs');var path=require(_0x38c6('0x6'));var rimraf=require(_0x38c6('0x7'));var config=require(_0x38c6('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x38c6('0x9')]=function(_0x5cc8d7,_0x312a89){return _0x5cc8d7[_0x38c6('0xa')](_0x38c6('0xb'),attributes,{'tableName':_0x38c6('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2a4=['../../config/logger','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xc2a4,0x1d2));var _0x4c2a=function(_0x1354ed,_0x45b93d){_0x1354ed=_0x1354ed-0x0;var _0x5e3605=_0xc2a4[_0x1354ed];return _0x5e3605;};'use strict';var _=require(_0x4c2a('0x0'));var util=require(_0x4c2a('0x1'));var logger=require(_0x4c2a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4c2a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c2a('0x4'));var rimraf=require(_0x4c2a('0x5'));var config=require(_0x4c2a('0x6'));var attributes=require(_0x4c2a('0x7'));module[_0x4c2a('0x8')]=function(_0xc91c86,_0x542bcb){return _0xc91c86[_0x4c2a('0x9')](_0x4c2a('0xa'),attributes,{'tableName':_0x4c2a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index a3db7ad..b55e466 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 _0x65fb=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x123786,_0xed12f6){var _0x45f2ce=function(_0x5912e2){while(--_0x5912e2){_0x123786['push'](_0x123786['shift']());}};_0x45f2ce(++_0xed12f6);}(_0x65fb,0x1ab));var _0xb65f=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0x65fb[_0xd0cd0b];return _0x59cced;};'use strict';var _=require(_0xb65f('0x0'));var util=require(_0xb65f('0x1'));var moment=require(_0xb65f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb65f('0x3'));var fs=require('fs');var Redis=require(_0xb65f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb65f('0x5'));var logger=require('../../config/logger')(_0xb65f('0x6'));var config=require(_0xb65f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb65f('0x8')][_0xb65f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233b3b,_0x3befef,_0x12e59c){return new BPromise(function(_0xf9b55a,_0x36f063){return client['request'](_0x233b3b,_0x12e59c)[_0xb65f('0xa')](function(_0x8be2bb){logger[_0xb65f('0xb')](_0xb65f('0xc'),_0x3befef,'request\x20sent');logger[_0xb65f('0xd')](_0xb65f('0xe'),_0x3befef,_0xb65f('0xf'),JSON[_0xb65f('0x10')](_0x8be2bb));if(_0x8be2bb['error']){if(_0x8be2bb[_0xb65f('0x11')][_0xb65f('0x12')]===0x1f4){logger['error'](_0xb65f('0xc'),_0x3befef,_0x8be2bb[_0xb65f('0x11')][_0xb65f('0x13')]);return _0x36f063(_0x8be2bb[_0xb65f('0x11')][_0xb65f('0x13')]);}logger[_0xb65f('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3befef,_0x8be2bb[_0xb65f('0x11')][_0xb65f('0x13')]);return _0xf9b55a(_0x8be2bb['error'][_0xb65f('0x13')]);}else{logger[_0xb65f('0xb')](_0xb65f('0xc'),_0x3befef,_0xb65f('0xf'));_0xf9b55a(_0x8be2bb[_0xb65f('0x14')][_0xb65f('0x13')]);}})[_0xb65f('0x15')](function(_0x3a3167){logger[_0xb65f('0x11')](_0xb65f('0xc'),_0x3befef,_0x3a3167);_0x36f063(_0x3a3167);});});}
\ No newline at end of file
+var _0x9d68=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x11d447,_0x5b9c09){var _0x285004=function(_0x32ecab){while(--_0x32ecab){_0x11d447['push'](_0x11d447['shift']());}};_0x285004(++_0x5b9c09);}(_0x9d68,0xd1));var _0x89d6=function(_0x34b5ca,_0x594010){_0x34b5ca=_0x34b5ca-0x0;var _0x2d72c0=_0x9d68[_0x34b5ca];return _0x2d72c0;};'use strict';var _=require(_0x89d6('0x0'));var util=require('util');var moment=require(_0x89d6('0x1'));var BPromise=require(_0x89d6('0x2'));var rs=require(_0x89d6('0x3'));var fs=require('fs');var Redis=require(_0x89d6('0x4'));var db=require(_0x89d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x89d6('0x6'));var config=require(_0x89d6('0x7'));var jayson=require(_0x89d6('0x8'));var client=jayson[_0x89d6('0x9')][_0x89d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33ce6c,_0x2bfdb1,_0x239017){return new BPromise(function(_0x1769eb,_0x2aedf0){return client[_0x89d6('0xb')](_0x33ce6c,_0x239017)[_0x89d6('0xc')](function(_0x32bd5c){logger[_0x89d6('0xd')](_0x89d6('0xe'),_0x2bfdb1,_0x89d6('0xf'));logger[_0x89d6('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2bfdb1,_0x89d6('0xf'),JSON[_0x89d6('0x11')](_0x32bd5c));if(_0x32bd5c[_0x89d6('0x12')]){if(_0x32bd5c['error'][_0x89d6('0x13')]===0x1f4){logger['error'](_0x89d6('0xe'),_0x2bfdb1,_0x32bd5c[_0x89d6('0x12')][_0x89d6('0x14')]);return _0x2aedf0(_0x32bd5c[_0x89d6('0x12')][_0x89d6('0x14')]);}logger[_0x89d6('0x12')](_0x89d6('0xe'),_0x2bfdb1,_0x32bd5c[_0x89d6('0x12')][_0x89d6('0x14')]);return _0x1769eb(_0x32bd5c[_0x89d6('0x12')][_0x89d6('0x14')]);}else{logger[_0x89d6('0xd')](_0x89d6('0xe'),_0x2bfdb1,'request\x20sent');_0x1769eb(_0x32bd5c[_0x89d6('0x15')][_0x89d6('0x14')]);}})[_0x89d6('0x16')](function(_0x350610){logger[_0x89d6('0x12')](_0x89d6('0xe'),_0x2bfdb1,_0x350610);_0x2aedf0(_0x350610);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index cb95b84..369e385 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 _0x4aad=['get','isAuthenticated','/:id','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1ca820,_0x143eda){var _0x115869=function(_0x3a6b91){while(--_0x3a6b91){_0x1ca820['push'](_0x1ca820['shift']());}};_0x115869(++_0x143eda);}(_0x4aad,0x19d));var _0xd4aa=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x4aad[_0x3b0731];return _0x4204d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd4aa('0x0'));var timeout=require(_0xd4aa('0x1'));var express=require(_0xd4aa('0x2'));var router=express[_0xd4aa('0x3')]();var fs_extra=require(_0xd4aa('0x4'));var auth=require(_0xd4aa('0x5'));var interaction=require(_0xd4aa('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xd4aa('0x7')]('/',auth[_0xd4aa('0x8')](),controller['index']);router[_0xd4aa('0x7')](_0xd4aa('0x9'),auth[_0xd4aa('0x8')](),controller['show']);router[_0xd4aa('0x7')]('/:id/preview',auth[_0xd4aa('0x8')](),controller[_0xd4aa('0xa')]);router[_0xd4aa('0x7')](_0xd4aa('0xb'),auth[_0xd4aa('0x8')](),controller[_0xd4aa('0xc')]);router['get'](_0xd4aa('0xd'),auth['isAuthenticated'](),controller[_0xd4aa('0xe')]);router[_0xd4aa('0xf')]('/',auth[_0xd4aa('0x8')](),controller[_0xd4aa('0x10')]);router[_0xd4aa('0x11')](_0xd4aa('0x9'),auth[_0xd4aa('0x8')](),controller['update']);router[_0xd4aa('0x12')](_0xd4aa('0x9'),auth[_0xd4aa('0x8')](),controller[_0xd4aa('0x13')]);module[_0xd4aa('0x14')]=router;
\ No newline at end of file
+var _0x2c60=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','query','create','put','delete','destroy','exports','multer','util'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x2c60,0xcd));var _0x02c6=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x2c60[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require(_0x02c6('0x0'));var util=require(_0x02c6('0x1'));var path=require(_0x02c6('0x2'));var timeout=require(_0x02c6('0x3'));var express=require(_0x02c6('0x4'));var router=express[_0x02c6('0x5')]();var fs_extra=require(_0x02c6('0x6'));var auth=require(_0x02c6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x02c6('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x02c6('0x9')]);router[_0x02c6('0xa')](_0x02c6('0xb'),auth[_0x02c6('0xc')](),controller[_0x02c6('0xd')]);router[_0x02c6('0xa')](_0x02c6('0xe'),auth[_0x02c6('0xc')](),controller[_0x02c6('0xf')]);router[_0x02c6('0xa')](_0x02c6('0x10'),auth[_0x02c6('0xc')](),controller['run']);router[_0x02c6('0xa')]('/:id/query',auth[_0x02c6('0xc')](),controller[_0x02c6('0x11')]);router['post']('/',auth[_0x02c6('0xc')](),controller[_0x02c6('0x12')]);router[_0x02c6('0x13')](_0x02c6('0xb'),auth[_0x02c6('0xc')](),controller['update']);router[_0x02c6('0x14')](_0x02c6('0xb'),auth['isAuthenticated'](),controller[_0x02c6('0x15')]);module[_0x02c6('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 50ee040..6e759fe 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 _0x7c09=['exports','STRING','TEXT'];(function(_0x31041b,_0x40e1e6){var _0x12721d=function(_0x1aec2b){while(--_0x1aec2b){_0x31041b['push'](_0x31041b['shift']());}};_0x12721d(++_0x40e1e6);}(_0x7c09,0x102));var _0x97c0=function(_0x39abc6,_0x252600){_0x39abc6=_0x39abc6-0x0;var _0xc1f8b5=_0x7c09[_0x39abc6];return _0xc1f8b5;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
+var _0x326f=['STRING','TEXT','sequelize'];(function(_0x2c890a,_0x127db2){var _0x301a13=function(_0x1fae7){while(--_0x1fae7){_0x2c890a['push'](_0x2c890a['shift']());}};_0x301a13(++_0x127db2);}(_0x326f,0xd1));var _0xf326=function(_0x5a8133,_0x485c40){_0x5a8133=_0x5a8133-0x0;var _0x4d8801=_0x326f[_0x5a8133];return _0x4d8801;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 0faab8f..6fa57fe 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 _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x2d2cb9,_0x3909f3){var _0x2b9554=function(_0x37b4e8){while(--_0x37b4e8){_0x2d2cb9['push'](_0x2d2cb9['shift']());}};_0x2b9554(++_0x3909f3);}(_0xf494,0x1c6));var _0x4f49=function(_0x50721d,_0xa700f1){_0x50721d=_0x50721d-0x0;var _0x4d0ec1=_0xf494[_0x50721d];return _0x4d0ec1;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
+var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%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)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x348a50,_0xe211f1){var _0x29beb2=function(_0x1a4036){while(--_0x1a4036){_0x348a50['push'](_0x348a50['shift']());}};_0x29beb2(++_0xe211f1);}(_0x2675,0x75));var _0x5267=function(_0x5853e4,_0x1d5e9a){_0x5853e4=_0x5853e4-0x0;var _0x3228d7=_0x2675[_0x5853e4];return _0x3228d7;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 0c93865..38c26f0 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 _0xe5d8=['moment','bluebird','request-promise','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger'];(function(_0x125502,_0xfa5273){var _0xc87605=function(_0x4f3879){while(--_0x4f3879){_0x125502['push'](_0x125502['shift']());}};_0xc87605(++_0xfa5273);}(_0xe5d8,0xfe));var _0x8e5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe5d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8e5d('0x0'));var util=require('util');var logger=require(_0x8e5d('0x1'))('api');var moment=require(_0x8e5d('0x2'));var BPromise=require(_0x8e5d('0x3'));var rp=require(_0x8e5d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8e5d('0x5'));module['exports']=function(_0x19d705,_0x19ff2a){return _0x19d705['define'](_0x8e5d('0x6'),attributes,{'tableName':_0x8e5d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6f3=['request-promise','path','rimraf','../../config/environment','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0xbf3a7b,_0x42ada8){var _0x5ad5f8=function(_0x89ee1){while(--_0x89ee1){_0xbf3a7b['push'](_0xbf3a7b['shift']());}};_0x5ad5f8(++_0x42ada8);}(_0xe6f3,0xeb));var _0x3e6f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe6f3[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3e6f('0x0'));var util=require(_0x3e6f('0x1'));var logger=require(_0x3e6f('0x2'))(_0x3e6f('0x3'));var moment=require(_0x3e6f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e6f('0x5'));var fs=require('fs');var path=require(_0x3e6f('0x6'));var rimraf=require(_0x3e6f('0x7'));var config=require(_0x3e6f('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x3e6f('0x9')]=function(_0x222085,_0x1b2524){return _0x222085[_0x3e6f('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x3e6f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 5eaf85e..ef7e504 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 _0xf977=['http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b78d4,_0x5aab9a){var _0x1eaf94=function(_0x4f1577){while(--_0x4f1577){_0x1b78d4['push'](_0x1b78d4['shift']());}};_0x1eaf94(++_0x5aab9a);}(_0xf977,0x6e));var _0x7f97=function(_0x3ebd1d,_0x36374a){_0x3ebd1d=_0x3ebd1d-0x0;var _0x43cde5=_0xf977[_0x3ebd1d];return _0x43cde5;};'use strict';var _=require(_0x7f97('0x0'));var util=require(_0x7f97('0x1'));var moment=require(_0x7f97('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f97('0x3'));var db=require(_0x7f97('0x4'))['db'];var utils=require(_0x7f97('0x5'));var logger=require(_0x7f97('0x6'))(_0x7f97('0x7'));var config=require(_0x7f97('0x8'));var jayson=require(_0x7f97('0x9'));var client=jayson['client'][_0x7f97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x412302,_0x294648,_0x1898b4){return new BPromise(function(_0x2a08f4,_0x580ae2){return client['request'](_0x412302,_0x1898b4)[_0x7f97('0xb')](function(_0x467d88){logger[_0x7f97('0xc')](_0x7f97('0xd'),_0x294648,_0x7f97('0xe'));logger[_0x7f97('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x294648,_0x7f97('0xe'),JSON['stringify'](_0x467d88));if(_0x467d88[_0x7f97('0x10')]){if(_0x467d88[_0x7f97('0x10')][_0x7f97('0x11')]===0x1f4){logger[_0x7f97('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x294648,_0x467d88[_0x7f97('0x10')][_0x7f97('0x12')]);return _0x580ae2(_0x467d88[_0x7f97('0x10')][_0x7f97('0x12')]);}logger[_0x7f97('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x294648,_0x467d88['error'][_0x7f97('0x12')]);return _0x2a08f4(_0x467d88[_0x7f97('0x10')][_0x7f97('0x12')]);}else{logger['info'](_0x7f97('0xd'),_0x294648,_0x7f97('0xe'));_0x2a08f4(_0x467d88[_0x7f97('0x13')][_0x7f97('0x12')]);}})['catch'](function(_0x154dd0){logger[_0x7f97('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x294648,_0x154dd0);_0x580ae2(_0x154dd0);});});}
\ No newline at end of file
+var _0x21e0=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x21e0,0xda));var _0x021e=function(_0x305d5d,_0x41cf20){_0x305d5d=_0x305d5d-0x0;var _0x89e1dd=_0x21e0[_0x305d5d];return _0x89e1dd;};'use strict';var _=require(_0x021e('0x0'));var util=require(_0x021e('0x1'));var moment=require(_0x021e('0x2'));var BPromise=require(_0x021e('0x3'));var rs=require(_0x021e('0x4'));var fs=require('fs');var Redis=require(_0x021e('0x5'));var db=require(_0x021e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x021e('0x7'))(_0x021e('0x8'));var config=require(_0x021e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x021e('0xa')][_0x021e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cfefa,_0x17af04,_0x9bf7f0){return new BPromise(function(_0x149b8b,_0x15e899){return client[_0x021e('0xc')](_0x2cfefa,_0x9bf7f0)[_0x021e('0xd')](function(_0x4a1296){logger['info'](_0x021e('0xe'),_0x17af04,_0x021e('0xf'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x17af04,'request\x20sent',JSON[_0x021e('0x10')](_0x4a1296));if(_0x4a1296[_0x021e('0x11')]){if(_0x4a1296[_0x021e('0x11')][_0x021e('0x12')]===0x1f4){logger[_0x021e('0x11')](_0x021e('0xe'),_0x17af04,_0x4a1296[_0x021e('0x11')][_0x021e('0x13')]);return _0x15e899(_0x4a1296[_0x021e('0x11')][_0x021e('0x13')]);}logger[_0x021e('0x11')](_0x021e('0xe'),_0x17af04,_0x4a1296['error']['message']);return _0x149b8b(_0x4a1296[_0x021e('0x11')][_0x021e('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x17af04,_0x021e('0xf'));_0x149b8b(_0x4a1296[_0x021e('0x14')]['message']);}})['catch'](function(_0x1d8e87){logger[_0x021e('0x11')](_0x021e('0xe'),_0x17af04,_0x1d8e87);_0x15e899(_0x1d8e87);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 2dd9b6f..8c8a28e 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 _0x1b8e=['run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0x1b8e,0x14b));var _0xe1b8=function(_0x2a9432,_0x42f7a8){_0x2a9432=_0x2a9432-0x0;var _0xed5d00=_0x1b8e[_0x2a9432];return _0xed5d00;};'use strict';var multer=require(_0xe1b8('0x0'));var util=require(_0xe1b8('0x1'));var path=require(_0xe1b8('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1b8('0x3'));var router=express['Router']();var fs_extra=require(_0xe1b8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe1b8('0x5'));var config=require('../../config/environment');var controller=require(_0xe1b8('0x6'));router[_0xe1b8('0x7')]('/',auth['isAuthenticated'](),controller[_0xe1b8('0x8')]);router[_0xe1b8('0x7')](_0xe1b8('0x9'),auth[_0xe1b8('0xa')](),controller[_0xe1b8('0xb')]);router[_0xe1b8('0x7')](_0xe1b8('0xc'),auth[_0xe1b8('0xa')](),controller[_0xe1b8('0xd')]);router[_0xe1b8('0x7')]('/:id/run',auth[_0xe1b8('0xa')](),controller[_0xe1b8('0xe')]);router['get'](_0xe1b8('0xf'),auth['isAuthenticated'](),controller[_0xe1b8('0x10')]);router['post']('/',auth[_0xe1b8('0xa')](),controller[_0xe1b8('0x11')]);router[_0xe1b8('0x12')](_0xe1b8('0x9'),auth[_0xe1b8('0xa')](),controller[_0xe1b8('0x13')]);router[_0xe1b8('0x14')]('/:id',auth[_0xe1b8('0xa')](),controller[_0xe1b8('0x15')]);module[_0xe1b8('0x16')]=router;
\ No newline at end of file
+var _0xcf53=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x323df1,_0x5b31f4){var _0x312757=function(_0x3bcc55){while(--_0x3bcc55){_0x323df1['push'](_0x323df1['shift']());}};_0x312757(++_0x5b31f4);}(_0xcf53,0x15a));var _0x3cf5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcf53[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x3cf5('0x0'));var util=require(_0x3cf5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3cf5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3cf5('0x3'));var interaction=require(_0x3cf5('0x4'));var config=require(_0x3cf5('0x5'));var controller=require(_0x3cf5('0x6'));router[_0x3cf5('0x7')]('/',auth[_0x3cf5('0x8')](),controller[_0x3cf5('0x9')]);router[_0x3cf5('0x7')](_0x3cf5('0xa'),auth[_0x3cf5('0x8')](),controller[_0x3cf5('0xb')]);router[_0x3cf5('0x7')](_0x3cf5('0xc'),auth['isAuthenticated'](),controller[_0x3cf5('0xd')]);router[_0x3cf5('0x7')](_0x3cf5('0xe'),auth[_0x3cf5('0x8')](),controller[_0x3cf5('0xf')]);router[_0x3cf5('0x7')](_0x3cf5('0x10'),auth[_0x3cf5('0x8')](),controller[_0x3cf5('0x11')]);router[_0x3cf5('0x12')]('/',auth[_0x3cf5('0x8')](),controller[_0x3cf5('0x13')]);router[_0x3cf5('0x14')](_0x3cf5('0xa'),auth[_0x3cf5('0x8')](),controller['update']);router['delete'](_0x3cf5('0xa'),auth['isAuthenticated'](),controller['destroy']);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 4e895c5..d1e47b7 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 _0x50a2=['Loading','manual','scheduled','UNSIGNED','sequelize','moment','STRING','ENUM','pdf','xlsx','csv','DATE'];(function(_0x12e33b,_0x1dad53){var _0x157be8=function(_0x5af73d){while(--_0x5af73d){_0x12e33b['push'](_0x12e33b['shift']());}};_0x157be8(++_0x1dad53);}(_0x50a2,0x1f0));var _0x250a=function(_0x330805,_0x3345f2){_0x330805=_0x330805-0x0;var _0x2be51e=_0x50a2[_0x330805];return _0x2be51e;};'use strict';var Sequelize=require(_0x250a('0x0'));var moment=require(_0x250a('0x1'));module['exports']={'name':{'type':Sequelize[_0x250a('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x250a('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x250a('0x3')]('csv',_0x250a('0x4'),_0x250a('0x5')),'allowNull':![],'defaultValue':_0x250a('0x6')},'savename':{'type':Sequelize[_0x250a('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x250a('0x7')]},'endDate':{'type':Sequelize[_0x250a('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x250a('0x8')},'type':{'type':Sequelize[_0x250a('0x3')](_0x250a('0x9'),_0x250a('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x250a('0xb')]},'reportType':{'type':Sequelize[_0x250a('0x2')]}};
\ No newline at end of file
+var _0x1e34=['DATE','Loading','manual','scheduled','INTEGER','sequelize','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x242b15,_0x546fe1){var _0x40443a=function(_0x4ed34f){while(--_0x4ed34f){_0x242b15['push'](_0x242b15['shift']());}};_0x40443a(++_0x546fe1);}(_0x1e34,0x1d9));var _0x41e3=function(_0x456432,_0x2979c3){_0x456432=_0x456432-0x0;var _0x47706f=_0x1e34[_0x456432];return _0x47706f;};'use strict';var Sequelize=require(_0x41e3('0x0'));var moment=require('moment');module[_0x41e3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x41e3('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x41e3('0x3')](_0x41e3('0x4'),_0x41e3('0x5'),_0x41e3('0x6')),'allowNull':![],'defaultValue':_0x41e3('0x4')},'savename':{'type':Sequelize[_0x41e3('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x41e3('0x7')]},'status':{'type':Sequelize[_0x41e3('0x2')],'defaultValue':_0x41e3('0x8')},'type':{'type':Sequelize[_0x41e3('0x3')](_0x41e3('0x9'),_0x41e3('0xa')),'allowNull':![],'defaultValue':_0x41e3('0x9')},'reportId':{'type':Sequelize[_0x41e3('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x41e3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index a2df1e9..e258c86 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 _0x49e9=['%s.%s','output','toLowerCase','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','destroy','get','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','intersection','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','download','basename','savename','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty'];(function(_0x419c0c,_0x2598ad){var _0x391694=function(_0x530772){while(--_0x530772){_0x419c0c['push'](_0x419c0c['shift']());}};_0x391694(++_0x2598ad);}(_0x49e9,0xc1));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x949e('0x0'));var rp=require(_0x949e('0x1'));var moment=require(_0x949e('0x2'));var BPromise=require(_0x949e('0x3'));var Mustache=require('mustache');var util=require(_0x949e('0x4'));var path=require(_0x949e('0x5'));var sox=require(_0x949e('0x6'));var csv=require(_0x949e('0x7'));var ejs=require(_0x949e('0x8'));var fs=require('fs');var fs_extra=require(_0x949e('0x9'));var _=require(_0x949e('0xa'));var squel=require('squel');var crypto=require(_0x949e('0xb'));var jsforce=require(_0x949e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x949e('0x7'));var querystring=require('querystring');var Papa=require(_0x949e('0xd'));var Redis=require(_0x949e('0xe'));var authService=require(_0x949e('0xf'));var qs=require(_0x949e('0x10'));var as=require(_0x949e('0x11'));var hardwareService=require(_0x949e('0x12'));var logger=require(_0x949e('0x13'))('api');var utils=require(_0x949e('0x14'));var config=require(_0x949e('0x15'));var licenseUtil=require(_0x949e('0x16'));var db=require(_0x949e('0x17'))['db'];function respondWithStatusCode(_0x46212f,_0x8bdc46){_0x8bdc46=_0x8bdc46||0xcc;return function(_0x5eb80c){if(_0x5eb80c){return _0x46212f[_0x949e('0x18')](_0x8bdc46);}return _0x46212f[_0x949e('0x19')](_0x8bdc46)[_0x949e('0x1a')]();};}function respondWithResult(_0x968dfa,_0x55c212){_0x55c212=_0x55c212||0xc8;return function(_0x25a438){if(_0x25a438){return _0x968dfa[_0x949e('0x19')](_0x55c212)['json'](_0x25a438);}};}function respondWithFilteredResult(_0x56aa27,_0x1ba203){return function(_0x4d06c8){if(_0x4d06c8){var _0x35842c=typeof _0x1ba203[_0x949e('0x1b')]===_0x949e('0x1c')&&typeof _0x1ba203['limit']===_0x949e('0x1c');var _0x447b73=_0x4d06c8['count'];var _0x12696b=_0x35842c?0x0:_0x1ba203[_0x949e('0x1b')];var _0xe89613=_0x35842c?_0x4d06c8[_0x949e('0x1d')]:_0x1ba203['offset']+_0x1ba203[_0x949e('0x1e')];var _0x94ca7e;if(_0xe89613>=_0x447b73){_0xe89613=_0x447b73;_0x94ca7e=0xc8;}else{_0x94ca7e=0xce;}_0x56aa27[_0x949e('0x19')](_0x94ca7e);return _0x56aa27['set'](_0x949e('0x1f'),_0x12696b+'-'+_0xe89613+'/'+_0x447b73)[_0x949e('0x20')](_0x4d06c8);}return null;};}function patchUpdates(_0x265a1c){return function(_0x2f55c6){try{jsonpatch['apply'](_0x2f55c6,_0x265a1c,!![]);}catch(_0x4b09a6){return BPromise[_0x949e('0x21')](_0x4b09a6);}return _0x2f55c6[_0x949e('0x22')]();};}function saveUpdates(_0x52baca,_0x4a748f){return function(_0x800617){if(_0x800617){return _0x800617[_0x949e('0x23')](_0x52baca)[_0x949e('0x24')](function(_0x10181a){return _0x10181a;});}return null;};}function removeEntity(_0x5a8073,_0x2ff531){return function(_0x56333d){if(_0x56333d){return _0x56333d[_0x949e('0x25')]()[_0x949e('0x24')](function(){var _0x132a15=_0x56333d[_0x949e('0x26')]({'plain':!![]});var _0x39139a='ExtractedReports';return db['UserProfileResource'][_0x949e('0x25')]({'where':{'type':_0x39139a,'resourceId':_0x132a15['id']}})[_0x949e('0x24')](function(){return _0x56333d;});})['then'](function(){_0x5a8073[_0x949e('0x19')](0xcc)[_0x949e('0x1a')]();});}};}function handleEntityNotFound(_0x363b03,_0x409d2c){return function(_0x232ec4){if(!_0x232ec4){_0x363b03[_0x949e('0x18')](0x194);}return _0x232ec4;};}function handleError(_0x528e1a,_0x20223e){_0x20223e=_0x20223e||0x1f4;return function(_0x450be0){logger[_0x949e('0x27')](_0x450be0[_0x949e('0x28')]);if(_0x450be0[_0x949e('0x29')]){delete _0x450be0[_0x949e('0x29')];}_0x528e1a[_0x949e('0x19')](_0x20223e)[_0x949e('0x2a')](_0x450be0);};}exports[_0x949e('0x2b')]=function(_0x2b290b,_0x402965){var _0x1e6bd7={},_0xe64224={},_0x425710={'count':0x0,'rows':[]};var _0x3efc55=_[_0x949e('0x2c')](db[_0x949e('0x2d')][_0x949e('0x2e')],function(_0x338813){return{'name':_0x338813[_0x949e('0x2f')],'type':_0x338813['type'][_0x949e('0x30')]};});_0xe64224[_0x949e('0x31')]=_[_0x949e('0x2c')](_0x3efc55,_0x949e('0x29'));_0xe64224[_0x949e('0x32')]=_['keys'](_0x2b290b['query']);_0xe64224['filters']=_['intersection'](_0xe64224['model'],_0xe64224[_0x949e('0x32')]);_0x1e6bd7[_0x949e('0x33')]=_['intersection'](_0xe64224[_0x949e('0x31')],qs[_0x949e('0x34')](_0x2b290b['query'][_0x949e('0x34')]));_0x1e6bd7[_0x949e('0x33')]=_0x1e6bd7[_0x949e('0x33')][_0x949e('0x35')]?_0x1e6bd7[_0x949e('0x33')]:_0xe64224[_0x949e('0x31')];if(!_0x2b290b[_0x949e('0x32')]['hasOwnProperty'](_0x949e('0x36'))){_0x1e6bd7[_0x949e('0x1e')]=qs[_0x949e('0x1e')](_0x2b290b['query'][_0x949e('0x1e')]);_0x1e6bd7[_0x949e('0x1b')]=qs[_0x949e('0x1b')](_0x2b290b[_0x949e('0x32')][_0x949e('0x1b')]);}_0x1e6bd7[_0x949e('0x37')]=qs[_0x949e('0x38')](_0x2b290b[_0x949e('0x32')][_0x949e('0x38')]);_0x1e6bd7[_0x949e('0x39')]=qs[_0x949e('0x3a')](_[_0x949e('0x3b')](_0x2b290b[_0x949e('0x32')],_0xe64224[_0x949e('0x3a')]),_0x3efc55);if(_0x2b290b[_0x949e('0x32')][_0x949e('0x3c')]){_0x1e6bd7[_0x949e('0x39')]=_[_0x949e('0x3d')](_0x1e6bd7[_0x949e('0x39')],{'$or':_['map'](_0x3efc55,function(_0x21b71b){if(_0x21b71b[_0x949e('0x3e')]!==_0x949e('0x3f')){var _0x151211={};_0x151211[_0x21b71b[_0x949e('0x29')]]={'$like':'%'+_0x2b290b['query'][_0x949e('0x3c')]+'%'};return _0x151211;}})});}_0x1e6bd7=_['merge']({},_0x1e6bd7,_0x2b290b[_0x949e('0x40')]);var _0x318aaf={'where':_0x1e6bd7[_0x949e('0x39')]};return db[_0x949e('0x2d')][_0x949e('0x1d')](_0x318aaf)[_0x949e('0x24')](function(_0x5296fe){_0x425710[_0x949e('0x1d')]=_0x5296fe;if(_0x2b290b[_0x949e('0x32')][_0x949e('0x41')]){_0x1e6bd7[_0x949e('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x949e('0x43')](_0x1e6bd7);})[_0x949e('0x24')](function(_0x245ff9){_0x425710[_0x949e('0x44')]=_0x245ff9;return _0x425710;})[_0x949e('0x24')](respondWithFilteredResult(_0x402965,_0x1e6bd7))['catch'](handleError(_0x402965,null));};exports[_0x949e('0x45')]=function(_0x2d1dff,_0x3ec49a){var _0x7ffe80={'raw':!![],'where':{'id':_0x2d1dff[_0x949e('0x46')]['id']}},_0x2e8bba={};_0x2e8bba[_0x949e('0x31')]=_[_0x949e('0x47')](db['AnalyticExtractedReport']['rawAttributes']);_0x2e8bba[_0x949e('0x32')]=_[_0x949e('0x47')](_0x2d1dff[_0x949e('0x32')]);_0x2e8bba[_0x949e('0x3a')]=_['intersection'](_0x2e8bba[_0x949e('0x31')],_0x2e8bba[_0x949e('0x32')]);_0x7ffe80[_0x949e('0x33')]=_[_0x949e('0x48')](_0x2e8bba['model'],qs[_0x949e('0x34')](_0x2d1dff['query'][_0x949e('0x34')]));_0x7ffe80['attributes']=_0x7ffe80[_0x949e('0x33')][_0x949e('0x35')]?_0x7ffe80['attributes']:_0x2e8bba[_0x949e('0x31')];if(_0x2d1dff[_0x949e('0x32')][_0x949e('0x41')]){_0x7ffe80['include']=[{'all':!![]}];}_0x7ffe80=_['merge']({},_0x7ffe80,_0x2d1dff[_0x949e('0x40')]);return db[_0x949e('0x2d')][_0x949e('0x49')](_0x7ffe80)[_0x949e('0x24')](handleEntityNotFound(_0x3ec49a,null))['then'](respondWithResult(_0x3ec49a,null))[_0x949e('0x4a')](handleError(_0x3ec49a,null));};exports[_0x949e('0x4b')]=function(_0x49e5eb,_0x1e655d){return db['AnalyticExtractedReport'][_0x949e('0x4b')](_0x49e5eb['body'],{})[_0x949e('0x24')](function(_0x547eab){var _0x547d1e=_0x49e5eb[_0x949e('0x4c')][_0x949e('0x26')]({'plain':!![]});if(!_0x547d1e)throw new Error(_0x949e('0x4d'));if(_0x547d1e[_0x949e('0x4e')]===_0x949e('0x4c')){var _0x5d0c5b=_0x547eab[_0x949e('0x26')]({'plain':!![]});var _0x368865='ExtractedReports';return db[_0x949e('0x4f')][_0x949e('0x49')]({'where':{'name':_0x368865,'userProfileId':_0x547d1e[_0x949e('0x50')]},'raw':!![]})[_0x949e('0x24')](function(_0x37ead2){if(_0x37ead2&&_0x37ead2[_0x949e('0x51')]===0x0){return db[_0x949e('0x52')][_0x949e('0x4b')]({'name':_0x5d0c5b[_0x949e('0x29')],'resourceId':_0x5d0c5b['id'],'type':_0x37ead2[_0x949e('0x29')],'sectionId':_0x37ead2['id']},{})[_0x949e('0x24')](function(){return _0x547eab;});}else{return _0x547eab;}})['catch'](function(_0x179e04){logger[_0x949e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x179e04);throw _0x179e04;});}return _0x547eab;})[_0x949e('0x24')](respondWithResult(_0x1e655d,0xc9))[_0x949e('0x4a')](handleError(_0x1e655d,null));};exports[_0x949e('0x23')]=function(_0x2cfa2b,_0xe82b9){if(_0x2cfa2b[_0x949e('0x53')]['id']){delete _0x2cfa2b[_0x949e('0x53')]['id'];}return db[_0x949e('0x2d')][_0x949e('0x49')]({'where':{'id':_0x2cfa2b['params']['id']}})[_0x949e('0x24')](handleEntityNotFound(_0xe82b9,null))['then'](saveUpdates(_0x2cfa2b[_0x949e('0x53')],null))[_0x949e('0x24')](respondWithResult(_0xe82b9,null))[_0x949e('0x4a')](handleError(_0xe82b9,null));};exports['destroy']=function(_0x107c53,_0x1299f1){return db[_0x949e('0x2d')][_0x949e('0x49')]({'where':{'id':_0x107c53[_0x949e('0x46')]['id']}})['then'](handleEntityNotFound(_0x1299f1,null))[_0x949e('0x24')](removeEntity(_0x1299f1,null))['catch'](handleError(_0x1299f1,null));};exports[_0x949e('0x54')]=function(_0x164f04,_0x2e2457,_0x2c162b){return db[_0x949e('0x2d')]['find']({'where':{'id':_0x164f04['params']['id']},'attributes':[_0x949e('0x29'),_0x949e('0x55'),_0x949e('0x56'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x2e2457,null))[_0x949e('0x24')](function(_0x25dc25){if(_0x25dc25){if(!fs['existsSync'](path[_0x949e('0x57')](config[_0x949e('0x58')],_0x949e('0x59'),_0x25dc25[_0x949e('0x56')]))){throw new db[(_0x949e('0x5a'))]['ValidationError'](_0x949e('0x5b'));}if(_0x164f04[_0x949e('0x32')]['exists']){return _0x2e2457[_0x949e('0x18')](0xc8);}return _0x2e2457[_0x949e('0x54')](path[_0x949e('0x57')](config[_0x949e('0x58')],_0x949e('0x59'),_0x25dc25[_0x949e('0x56')]),util['format'](_0x949e('0x5c'),_0x25dc25[_0x949e('0x55')]||_0x25dc25[_0x949e('0x29')],_0x25dc25[_0x949e('0x5d')][_0x949e('0x5e')]()));}})[_0x949e('0x4a')](handleError(_0x2e2457,null));};
\ No newline at end of file
+var _0x1e6c=['savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports'];(function(_0x4b3512,_0xb29a42){var _0x47d086=function(_0x22710f){while(--_0x22710f){_0x4b3512['push'](_0x4b3512['shift']());}};_0x47d086(++_0xb29a42);}(_0x1e6c,0x137));var _0xc1e6=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0x1e6c[_0x49e584];return _0x58b1be;};'use strict';var emlformat=require(_0xc1e6('0x0'));var rimraf=require(_0xc1e6('0x1'));var zipdir=require(_0xc1e6('0x2'));var jsonpatch=require(_0xc1e6('0x3'));var rp=require(_0xc1e6('0x4'));var moment=require(_0xc1e6('0x5'));var BPromise=require(_0xc1e6('0x6'));var Mustache=require(_0xc1e6('0x7'));var util=require(_0xc1e6('0x8'));var path=require('path');var sox=require(_0xc1e6('0x9'));var csv=require(_0xc1e6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1e6('0xb'));var _=require(_0xc1e6('0xc'));var squel=require(_0xc1e6('0xd'));var crypto=require('crypto');var jsforce=require(_0xc1e6('0xe'));var deskjs=require(_0xc1e6('0xf'));var toCsv=require(_0xc1e6('0xa'));var querystring=require(_0xc1e6('0x10'));var Papa=require(_0xc1e6('0x11'));var Redis=require(_0xc1e6('0x12'));var authService=require(_0xc1e6('0x13'));var qs=require(_0xc1e6('0x14'));var as=require(_0xc1e6('0x15'));var hardwareService=require(_0xc1e6('0x16'));var logger=require('../../config/logger')(_0xc1e6('0x17'));var utils=require(_0xc1e6('0x18'));var config=require(_0xc1e6('0x19'));var licenseUtil=require(_0xc1e6('0x1a'));var db=require(_0xc1e6('0x1b'))['db'];function respondWithStatusCode(_0x339e7a,_0x14af17){_0x14af17=_0x14af17||0xcc;return function(_0xa37d70){if(_0xa37d70){return _0x339e7a[_0xc1e6('0x1c')](_0x14af17);}return _0x339e7a[_0xc1e6('0x1d')](_0x14af17)[_0xc1e6('0x1e')]();};}function respondWithResult(_0x9ec315,_0x17322f){_0x17322f=_0x17322f||0xc8;return function(_0x40f393){if(_0x40f393){return _0x9ec315['status'](_0x17322f)['json'](_0x40f393);}};}function respondWithFilteredResult(_0x5d5744,_0x502f74){return function(_0x3840aa){if(_0x3840aa){var _0x33b168=typeof _0x502f74[_0xc1e6('0x1f')]===_0xc1e6('0x20')&&typeof _0x502f74[_0xc1e6('0x21')]===_0xc1e6('0x20');var _0x193b50=_0x3840aa[_0xc1e6('0x22')];var _0x52f2a8=_0x33b168?0x0:_0x502f74['offset'];var _0x18c973=_0x33b168?_0x3840aa[_0xc1e6('0x22')]:_0x502f74[_0xc1e6('0x1f')]+_0x502f74[_0xc1e6('0x21')];var _0x2feda8;if(_0x18c973>=_0x193b50){_0x18c973=_0x193b50;_0x2feda8=0xc8;}else{_0x2feda8=0xce;}_0x5d5744['status'](_0x2feda8);return _0x5d5744['set'](_0xc1e6('0x23'),_0x52f2a8+'-'+_0x18c973+'/'+_0x193b50)['json'](_0x3840aa);}return null;};}function patchUpdates(_0x3fe2c1){return function(_0x2c7662){try{jsonpatch[_0xc1e6('0x24')](_0x2c7662,_0x3fe2c1,!![]);}catch(_0x187a9b){return BPromise[_0xc1e6('0x25')](_0x187a9b);}return _0x2c7662[_0xc1e6('0x26')]();};}function saveUpdates(_0x29a4e5,_0x19ddf4){return function(_0x1729ed){if(_0x1729ed){return _0x1729ed['update'](_0x29a4e5)[_0xc1e6('0x27')](function(_0x2f1eee){return _0x2f1eee;});}return null;};}function removeEntity(_0x5c51c2,_0x38a43e){return function(_0x166485){if(_0x166485){return _0x166485[_0xc1e6('0x28')]()[_0xc1e6('0x27')](function(){var _0x36bbe8=_0x166485[_0xc1e6('0x29')]({'plain':!![]});var _0x85c465=_0xc1e6('0x2a');return db[_0xc1e6('0x2b')][_0xc1e6('0x28')]({'where':{'type':_0x85c465,'resourceId':_0x36bbe8['id']}})['then'](function(){return _0x166485;});})['then'](function(){_0x5c51c2[_0xc1e6('0x1d')](0xcc)[_0xc1e6('0x1e')]();});}};}function handleEntityNotFound(_0x219a14,_0x21abdd){return function(_0x3e17b5){if(!_0x3e17b5){_0x219a14[_0xc1e6('0x1c')](0x194);}return _0x3e17b5;};}function handleError(_0x57c979,_0x50d157){_0x50d157=_0x50d157||0x1f4;return function(_0x5ab8f1){logger[_0xc1e6('0x2c')](_0x5ab8f1[_0xc1e6('0x2d')]);if(_0x5ab8f1[_0xc1e6('0x2e')]){delete _0x5ab8f1[_0xc1e6('0x2e')];}_0x57c979['status'](_0x50d157)[_0xc1e6('0x2f')](_0x5ab8f1);};}exports[_0xc1e6('0x30')]=function(_0x12a1f2,_0x2468bb){var _0x3e9597={},_0x8db248={},_0x5cf6f3={'count':0x0,'rows':[]};var _0x25e605=_[_0xc1e6('0x31')](db[_0xc1e6('0x32')][_0xc1e6('0x33')],function(_0x17fb5b){return{'name':_0x17fb5b[_0xc1e6('0x34')],'type':_0x17fb5b[_0xc1e6('0x35')][_0xc1e6('0x36')]};});_0x8db248[_0xc1e6('0x37')]=_[_0xc1e6('0x31')](_0x25e605,_0xc1e6('0x2e'));_0x8db248['query']=_[_0xc1e6('0x38')](_0x12a1f2['query']);_0x8db248['filters']=_[_0xc1e6('0x39')](_0x8db248[_0xc1e6('0x37')],_0x8db248[_0xc1e6('0x3a')]);_0x3e9597['attributes']=_[_0xc1e6('0x39')](_0x8db248[_0xc1e6('0x37')],qs[_0xc1e6('0x3b')](_0x12a1f2[_0xc1e6('0x3a')]['fields']));_0x3e9597[_0xc1e6('0x3c')]=_0x3e9597[_0xc1e6('0x3c')][_0xc1e6('0x3d')]?_0x3e9597[_0xc1e6('0x3c')]:_0x8db248[_0xc1e6('0x37')];if(!_0x12a1f2[_0xc1e6('0x3a')]['hasOwnProperty'](_0xc1e6('0x3e'))){_0x3e9597['limit']=qs[_0xc1e6('0x21')](_0x12a1f2['query']['limit']);_0x3e9597[_0xc1e6('0x1f')]=qs[_0xc1e6('0x1f')](_0x12a1f2[_0xc1e6('0x3a')]['offset']);}_0x3e9597[_0xc1e6('0x3f')]=qs[_0xc1e6('0x40')](_0x12a1f2['query']['sort']);_0x3e9597[_0xc1e6('0x41')]=qs[_0xc1e6('0x42')](_['pick'](_0x12a1f2[_0xc1e6('0x3a')],_0x8db248[_0xc1e6('0x42')]),_0x25e605);if(_0x12a1f2[_0xc1e6('0x3a')][_0xc1e6('0x43')]){_0x3e9597[_0xc1e6('0x41')]=_[_0xc1e6('0x44')](_0x3e9597[_0xc1e6('0x41')],{'$or':_['map'](_0x25e605,function(_0x20075e){if(_0x20075e[_0xc1e6('0x35')]!==_0xc1e6('0x45')){var _0x29b1e0={};_0x29b1e0[_0x20075e['name']]={'$like':'%'+_0x12a1f2[_0xc1e6('0x3a')]['filter']+'%'};return _0x29b1e0;}})});}_0x3e9597=_[_0xc1e6('0x44')]({},_0x3e9597,_0x12a1f2[_0xc1e6('0x46')]);var _0x1b90aa={'where':_0x3e9597['where']};return db[_0xc1e6('0x32')]['count'](_0x1b90aa)['then'](function(_0x50afc4){_0x5cf6f3[_0xc1e6('0x22')]=_0x50afc4;if(_0x12a1f2[_0xc1e6('0x3a')][_0xc1e6('0x47')]){_0x3e9597[_0xc1e6('0x48')]=[{'all':!![]}];}return db[_0xc1e6('0x32')][_0xc1e6('0x49')](_0x3e9597);})[_0xc1e6('0x27')](function(_0x4724dd){_0x5cf6f3[_0xc1e6('0x4a')]=_0x4724dd;return _0x5cf6f3;})[_0xc1e6('0x27')](respondWithFilteredResult(_0x2468bb,_0x3e9597))[_0xc1e6('0x4b')](handleError(_0x2468bb,null));};exports[_0xc1e6('0x4c')]=function(_0x57a538,_0x260c1b){var _0x5ab98f={'raw':!![],'where':{'id':_0x57a538[_0xc1e6('0x4d')]['id']}},_0x4ff6dc={};_0x4ff6dc[_0xc1e6('0x37')]=_[_0xc1e6('0x38')](db[_0xc1e6('0x32')][_0xc1e6('0x33')]);_0x4ff6dc['query']=_[_0xc1e6('0x38')](_0x57a538[_0xc1e6('0x3a')]);_0x4ff6dc['filters']=_[_0xc1e6('0x39')](_0x4ff6dc[_0xc1e6('0x37')],_0x4ff6dc[_0xc1e6('0x3a')]);_0x5ab98f[_0xc1e6('0x3c')]=_['intersection'](_0x4ff6dc[_0xc1e6('0x37')],qs[_0xc1e6('0x3b')](_0x57a538[_0xc1e6('0x3a')]['fields']));_0x5ab98f[_0xc1e6('0x3c')]=_0x5ab98f[_0xc1e6('0x3c')]['length']?_0x5ab98f[_0xc1e6('0x3c')]:_0x4ff6dc[_0xc1e6('0x37')];if(_0x57a538[_0xc1e6('0x3a')][_0xc1e6('0x47')]){_0x5ab98f[_0xc1e6('0x48')]=[{'all':!![]}];}_0x5ab98f=_[_0xc1e6('0x44')]({},_0x5ab98f,_0x57a538[_0xc1e6('0x46')]);return db[_0xc1e6('0x32')][_0xc1e6('0x4e')](_0x5ab98f)[_0xc1e6('0x27')](handleEntityNotFound(_0x260c1b,null))[_0xc1e6('0x27')](respondWithResult(_0x260c1b,null))[_0xc1e6('0x4b')](handleError(_0x260c1b,null));};exports[_0xc1e6('0x4f')]=function(_0x318a4e,_0x59e2bd){return db[_0xc1e6('0x32')][_0xc1e6('0x4f')](_0x318a4e[_0xc1e6('0x50')],{})[_0xc1e6('0x27')](function(_0x58cedc){var _0x734d2c=_0x318a4e[_0xc1e6('0x51')]['get']({'plain':!![]});if(!_0x734d2c)throw new Error(_0xc1e6('0x52'));if(_0x734d2c[_0xc1e6('0x53')]===_0xc1e6('0x51')){var _0x37f496=_0x58cedc[_0xc1e6('0x29')]({'plain':!![]});var _0xbe99a0=_0xc1e6('0x2a');return db['UserProfileSection'][_0xc1e6('0x4e')]({'where':{'name':_0xbe99a0,'userProfileId':_0x734d2c[_0xc1e6('0x54')]},'raw':!![]})[_0xc1e6('0x27')](function(_0x59fadd){if(_0x59fadd&&_0x59fadd['autoAssociation']===0x0){return db[_0xc1e6('0x2b')][_0xc1e6('0x4f')]({'name':_0x37f496[_0xc1e6('0x2e')],'resourceId':_0x37f496['id'],'type':_0x59fadd[_0xc1e6('0x2e')],'sectionId':_0x59fadd['id']},{})['then'](function(){return _0x58cedc;});}else{return _0x58cedc;}})[_0xc1e6('0x4b')](function(_0x490b84){logger['error'](_0xc1e6('0x55'),_0x490b84);throw _0x490b84;});}return _0x58cedc;})['then'](respondWithResult(_0x59e2bd,0xc9))['catch'](handleError(_0x59e2bd,null));};exports['update']=function(_0x2383f0,_0x4ddfe9){if(_0x2383f0['body']['id']){delete _0x2383f0[_0xc1e6('0x50')]['id'];}return db[_0xc1e6('0x32')][_0xc1e6('0x4e')]({'where':{'id':_0x2383f0[_0xc1e6('0x4d')]['id']}})[_0xc1e6('0x27')](handleEntityNotFound(_0x4ddfe9,null))[_0xc1e6('0x27')](saveUpdates(_0x2383f0[_0xc1e6('0x50')],null))[_0xc1e6('0x27')](respondWithResult(_0x4ddfe9,null))[_0xc1e6('0x4b')](handleError(_0x4ddfe9,null));};exports[_0xc1e6('0x28')]=function(_0x51507a,_0x56407f){return db[_0xc1e6('0x32')][_0xc1e6('0x4e')]({'where':{'id':_0x51507a[_0xc1e6('0x4d')]['id']}})[_0xc1e6('0x27')](handleEntityNotFound(_0x56407f,null))[_0xc1e6('0x27')](removeEntity(_0x56407f,null))[_0xc1e6('0x4b')](handleError(_0x56407f,null));};exports[_0xc1e6('0x56')]=function(_0x5d8418,_0x10eee2,_0x267375){return db[_0xc1e6('0x32')][_0xc1e6('0x4e')]({'where':{'id':_0x5d8418[_0xc1e6('0x4d')]['id']},'attributes':[_0xc1e6('0x2e'),_0xc1e6('0x57'),'savename',_0xc1e6('0x58')],'raw':!![]})[_0xc1e6('0x27')](handleEntityNotFound(_0x10eee2,null))['then'](function(_0x2e6566){if(_0x2e6566){if(!fs[_0xc1e6('0x59')](path[_0xc1e6('0x5a')](config[_0xc1e6('0x5b')],_0xc1e6('0x5c'),_0x2e6566[_0xc1e6('0x5d')]))){throw new db[(_0xc1e6('0x5e'))][(_0xc1e6('0x5f'))](_0xc1e6('0x60'));}if(_0x5d8418['query'][_0xc1e6('0x61')]){return _0x10eee2[_0xc1e6('0x1c')](0xc8);}return _0x10eee2[_0xc1e6('0x56')](path['join'](config['root'],_0xc1e6('0x5c'),_0x2e6566[_0xc1e6('0x5d')]),util[_0xc1e6('0x62')](_0xc1e6('0x63'),_0x2e6566[_0xc1e6('0x57')]||_0x2e6566[_0xc1e6('0x2e')],_0x2e6566[_0xc1e6('0x58')][_0xc1e6('0x64')]()));}})['catch'](handleError(_0x10eee2,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index e2339ed..8d7548e 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 _0x781b=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0xb48479,_0x5993e3){var _0x1ee04e=function(_0x32dbef){while(--_0x32dbef){_0xb48479['push'](_0xb48479['shift']());}};_0x1ee04e(++_0x5993e3);}(_0x781b,0x190));var _0xb781=function(_0x44278,_0x1bd66f){_0x44278=_0x44278-0x0;var _0x2d97f9=_0x781b[_0x44278];return _0x2d97f9;};'use strict';var _=require(_0xb781('0x0'));var util=require('util');var logger=require(_0xb781('0x1'))(_0xb781('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb781('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb781('0x4'));var config=require(_0xb781('0x5'));var attributes=require(_0xb781('0x6'));module[_0xb781('0x7')]=function(_0x4ee0b8,_0x45490a){return _0x4ee0b8[_0xb781('0x8')](_0xb781('0x9'),attributes,{'tableName':_0xb781('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf34b=['moment','bluebird','request-promise','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x583a1f,_0x4fb9da){var _0x45f430=function(_0xc90da){while(--_0xc90da){_0x583a1f['push'](_0x583a1f['shift']());}};_0x45f430(++_0x4fb9da);}(_0xf34b,0x13d));var _0xbf34=function(_0x33d129,_0x3bc274){_0x33d129=_0x33d129-0x0;var _0x54093f=_0xf34b[_0x33d129];return _0x54093f;};'use strict';var _=require('lodash');var util=require(_0xbf34('0x0'));var logger=require(_0xbf34('0x1'))(_0xbf34('0x2'));var moment=require(_0xbf34('0x3'));var BPromise=require(_0xbf34('0x4'));var rp=require(_0xbf34('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf34('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0xbf34('0x7')]=function(_0x825092,_0x7a570b){return _0x825092['define'](_0xbf34('0x8'),attributes,{'tableName':_0xbf34('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 a10737e..a6e2891 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 _0xe78b=['request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x24e57a,_0x35a7b6){var _0x75bd3b=function(_0x2a448c){while(--_0x2a448c){_0x24e57a['push'](_0x24e57a['shift']());}};_0x75bd3b(++_0x35a7b6);}(_0xe78b,0x1c2));var _0xbe78=function(_0x130a77,_0x4aa56e){_0x130a77=_0x130a77-0x0;var _0x1e4ed7=_0xe78b[_0x130a77];return _0x1e4ed7;};'use strict';var _=require(_0xbe78('0x0'));var util=require(_0xbe78('0x1'));var moment=require('moment');var BPromise=require(_0xbe78('0x2'));var rs=require(_0xbe78('0x3'));var fs=require('fs');var Redis=require(_0xbe78('0x4'));var db=require(_0xbe78('0x5'))['db'];var utils=require(_0xbe78('0x6'));var logger=require(_0xbe78('0x7'))(_0xbe78('0x8'));var config=require(_0xbe78('0x9'));var jayson=require(_0xbe78('0xa'));var client=jayson[_0xbe78('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b82a2,_0x26eb67,_0x556406){return new BPromise(function(_0x42436b,_0x940572){return client[_0xbe78('0xc')](_0x5b82a2,_0x556406)['then'](function(_0x2a9d30){logger[_0xbe78('0xd')](_0xbe78('0xe'),_0x26eb67,_0xbe78('0xf'));logger[_0xbe78('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x26eb67,'request\x20sent',JSON['stringify'](_0x2a9d30));if(_0x2a9d30[_0xbe78('0x11')]){if(_0x2a9d30[_0xbe78('0x11')][_0xbe78('0x12')]===0x1f4){logger[_0xbe78('0x11')](_0xbe78('0xe'),_0x26eb67,_0x2a9d30[_0xbe78('0x11')][_0xbe78('0x13')]);return _0x940572(_0x2a9d30[_0xbe78('0x11')][_0xbe78('0x13')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x26eb67,_0x2a9d30[_0xbe78('0x11')][_0xbe78('0x13')]);return _0x42436b(_0x2a9d30['error'][_0xbe78('0x13')]);}else{logger[_0xbe78('0xd')](_0xbe78('0xe'),_0x26eb67,_0xbe78('0xf'));_0x42436b(_0x2a9d30[_0xbe78('0x14')][_0xbe78('0x13')]);}})['catch'](function(_0x458128){logger[_0xbe78('0x11')](_0xbe78('0xe'),_0x26eb67,_0x458128);_0x940572(_0x458128);});});}
\ No newline at end of file
+var _0xb230=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb230,0x150));var _0x0b23=function(_0xe74d9b,_0x17a86c){_0xe74d9b=_0xe74d9b-0x0;var _0x57c1cc=_0xb230[_0xe74d9b];return _0x57c1cc;};'use strict';var _=require(_0x0b23('0x0'));var util=require(_0x0b23('0x1'));var moment=require(_0x0b23('0x2'));var BPromise=require(_0x0b23('0x3'));var rs=require(_0x0b23('0x4'));var fs=require('fs');var Redis=require(_0x0b23('0x5'));var db=require(_0x0b23('0x6'))['db'];var utils=require(_0x0b23('0x7'));var logger=require(_0x0b23('0x8'))(_0x0b23('0x9'));var config=require('../../config/environment');var jayson=require(_0x0b23('0xa'));var client=jayson[_0x0b23('0xb')][_0x0b23('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x135dd7,_0x2fd92d,_0x2ad939){return new BPromise(function(_0x3a7f46,_0x53e288){return client[_0x0b23('0xd')](_0x135dd7,_0x2ad939)[_0x0b23('0xe')](function(_0x5f3719){logger[_0x0b23('0xf')](_0x0b23('0x10'),_0x2fd92d,_0x0b23('0x11'));logger[_0x0b23('0x12')](_0x0b23('0x13'),_0x2fd92d,'request\x20sent',JSON[_0x0b23('0x14')](_0x5f3719));if(_0x5f3719[_0x0b23('0x15')]){if(_0x5f3719[_0x0b23('0x15')][_0x0b23('0x16')]===0x1f4){logger[_0x0b23('0x15')](_0x0b23('0x10'),_0x2fd92d,_0x5f3719[_0x0b23('0x15')][_0x0b23('0x17')]);return _0x53e288(_0x5f3719[_0x0b23('0x15')][_0x0b23('0x17')]);}logger[_0x0b23('0x15')](_0x0b23('0x10'),_0x2fd92d,_0x5f3719[_0x0b23('0x15')][_0x0b23('0x17')]);return _0x3a7f46(_0x5f3719[_0x0b23('0x15')][_0x0b23('0x17')]);}else{logger['info'](_0x0b23('0x10'),_0x2fd92d,_0x0b23('0x11'));_0x3a7f46(_0x5f3719[_0x0b23('0x18')][_0x0b23('0x17')]);}})['catch'](function(_0x37dd69){logger['error'](_0x0b23('0x10'),_0x2fd92d,_0x37dd69);_0x53e288(_0x37dd69);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index c8375a5..52aeff9 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 _0x7db8=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e9b5f,_0xbfb45b){var _0x23a694=function(_0x26243c){while(--_0x26243c){_0x4e9b5f['push'](_0x4e9b5f['shift']());}};_0x23a694(++_0xbfb45b);}(_0x7db8,0x1dd));var _0x87db=function(_0x571fb3,_0x35fa89){_0x571fb3=_0x571fb3-0x0;var _0x116e32=_0x7db8[_0x571fb3];return _0x116e32;};'use strict';var multer=require(_0x87db('0x0'));var util=require(_0x87db('0x1'));var path=require('path');var timeout=require(_0x87db('0x2'));var express=require(_0x87db('0x3'));var router=express[_0x87db('0x4')]();var fs_extra=require(_0x87db('0x5'));var auth=require(_0x87db('0x6'));var interaction=require(_0x87db('0x7'));var config=require(_0x87db('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x87db('0x9')]('/',auth[_0x87db('0xa')](),controller[_0x87db('0xb')]);router[_0x87db('0x9')](_0x87db('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x87db('0x9')](_0x87db('0xd'),auth[_0x87db('0xa')](),controller[_0x87db('0xe')]);router[_0x87db('0xf')]('/',auth['isAuthenticated'](),controller[_0x87db('0x10')]);router[_0x87db('0x11')](_0x87db('0xc'),auth['isAuthenticated'](),controller[_0x87db('0x12')]);router[_0x87db('0x13')](_0x87db('0xc'),auth[_0x87db('0xa')](),controller[_0x87db('0x14')]);module[_0x87db('0x15')]=router;
\ No newline at end of file
+var _0x0715=['Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id/download','download','post','create','/:id','update','destroy','util','connect-timeout','express'];(function(_0xc74a5e,_0x3170aa){var _0x4bc55b=function(_0xecab7b){while(--_0xecab7b){_0xc74a5e['push'](_0xc74a5e['shift']());}};_0x4bc55b(++_0x3170aa);}(_0x0715,0xa7));var _0x5071=function(_0x417af8,_0x368246){_0x417af8=_0x417af8-0x0;var _0x3f8bf8=_0x0715[_0x417af8];return _0x3f8bf8;};'use strict';var multer=require('multer');var util=require(_0x5071('0x0'));var path=require('path');var timeout=require(_0x5071('0x1'));var express=require(_0x5071('0x2'));var router=express[_0x5071('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5071('0x4'));var interaction=require(_0x5071('0x5'));var config=require('../../config/environment');var controller=require(_0x5071('0x6'));router[_0x5071('0x7')]('/',auth[_0x5071('0x8')](),controller[_0x5071('0x9')]);router['get']('/:id',auth[_0x5071('0x8')](),controller['show']);router[_0x5071('0x7')](_0x5071('0xa'),auth[_0x5071('0x8')](),controller[_0x5071('0xb')]);router[_0x5071('0xc')]('/',auth[_0x5071('0x8')](),controller[_0x5071('0xd')]);router['put'](_0x5071('0xe'),auth['isAuthenticated'](),controller[_0x5071('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5071('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 88f1ba5..c8dc4df 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 _0x3043=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2732b6,_0x5c9929){var _0x570328=function(_0x5e52ef){while(--_0x5e52ef){_0x2732b6['push'](_0x2732b6['shift']());}};_0x570328(++_0x5c9929);}(_0x3043,0x1da));var _0x3304=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x3043[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0x3304('0x0'));module[_0x3304('0x1')]={'field':{'type':Sequelize[_0x3304('0x2')]},'alias':{'type':Sequelize[_0x3304('0x3')]},'function':{'type':Sequelize[_0x3304('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x3304('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3304('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x753d=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0xf83302,_0x17aa7a){var _0x5abd74=function(_0x2b8f43){while(--_0x2b8f43){_0xf83302['push'](_0xf83302['shift']());}};_0x5abd74(++_0x17aa7a);}(_0x753d,0x1e4));var _0xd753=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x753d[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xd753('0x0'));module[_0xd753('0x1')]={'field':{'type':Sequelize[_0xd753('0x2')]},'alias':{'type':Sequelize[_0xd753('0x3')]},'function':{'type':Sequelize[_0xd753('0x3')]},'format':{'type':Sequelize[_0xd753('0x3')]},'groupBy':{'type':Sequelize[_0xd753('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd753('0x3')]},'custom':{'type':Sequelize[_0xd753('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 6fa938b..66319c2 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 _0x2847=['lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','bulkCreate','find','params','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x17ea08,_0x4b83ce){var _0x5c56bf=function(_0x506652){while(--_0x506652){_0x17ea08['push'](_0x17ea08['shift']());}};_0x5c56bf(++_0x4b83ce);}(_0x2847,0x1a0));var _0x7284=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x2847[_0xf2f332];return _0x56cce3;};'use strict';var emlformat=require(_0x7284('0x0'));var rimraf=require(_0x7284('0x1'));var zipdir=require(_0x7284('0x2'));var jsonpatch=require(_0x7284('0x3'));var rp=require(_0x7284('0x4'));var moment=require(_0x7284('0x5'));var BPromise=require(_0x7284('0x6'));var Mustache=require(_0x7284('0x7'));var util=require(_0x7284('0x8'));var path=require(_0x7284('0x9'));var sox=require(_0x7284('0xa'));var csv=require(_0x7284('0xb'));var ejs=require(_0x7284('0xc'));var fs=require('fs');var fs_extra=require(_0x7284('0xd'));var _=require(_0x7284('0xe'));var squel=require('squel');var crypto=require(_0x7284('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7284('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7284('0x11'));var Papa=require(_0x7284('0x12'));var Redis=require('ioredis');var authService=require(_0x7284('0x13'));var qs=require(_0x7284('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7284('0x15'));var logger=require(_0x7284('0x16'))(_0x7284('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7284('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48caba,_0x362423){_0x362423=_0x362423||0xcc;return function(_0x35d1c2){if(_0x35d1c2){return _0x48caba[_0x7284('0x19')](_0x362423);}return _0x48caba[_0x7284('0x1a')](_0x362423)[_0x7284('0x1b')]();};}function respondWithResult(_0x2dbca4,_0x22ccb0){_0x22ccb0=_0x22ccb0||0xc8;return function(_0x1a6ced){if(_0x1a6ced){return _0x2dbca4['status'](_0x22ccb0)[_0x7284('0x1c')](_0x1a6ced);}};}function respondWithFilteredResult(_0x27c227,_0x2d8cbe){return function(_0x272c5a){if(_0x272c5a){var _0x3fcaca=typeof _0x2d8cbe[_0x7284('0x1d')]===_0x7284('0x1e')&&typeof _0x2d8cbe[_0x7284('0x1f')]==='undefined';var _0x25cce5=_0x272c5a[_0x7284('0x20')];var _0xf10dae=_0x3fcaca?0x0:_0x2d8cbe[_0x7284('0x1d')];var _0x4fbdc2=_0x3fcaca?_0x272c5a['count']:_0x2d8cbe['offset']+_0x2d8cbe[_0x7284('0x1f')];var _0x162548;if(_0x4fbdc2>=_0x25cce5){_0x4fbdc2=_0x25cce5;_0x162548=0xc8;}else{_0x162548=0xce;}_0x27c227[_0x7284('0x1a')](_0x162548);return _0x27c227[_0x7284('0x21')](_0x7284('0x22'),_0xf10dae+'-'+_0x4fbdc2+'/'+_0x25cce5)['json'](_0x272c5a);}return null;};}function patchUpdates(_0x568dac){return function(_0x335dbd){try{jsonpatch[_0x7284('0x23')](_0x335dbd,_0x568dac,!![]);}catch(_0x2538c4){return BPromise[_0x7284('0x24')](_0x2538c4);}return _0x335dbd[_0x7284('0x25')]();};}function saveUpdates(_0x3c42e9,_0x123b25){return function(_0x5cefbf){if(_0x5cefbf){return _0x5cefbf[_0x7284('0x26')](_0x3c42e9)[_0x7284('0x27')](function(_0x28c2a9){return _0x28c2a9;});}return null;};}function removeEntity(_0xeca040,_0x3097e0){return function(_0x3bd8d3){if(_0x3bd8d3){return _0x3bd8d3[_0x7284('0x28')]()[_0x7284('0x27')](function(){_0xeca040[_0x7284('0x1a')](0xcc)[_0x7284('0x1b')]();});}};}function handleEntityNotFound(_0x444f60,_0xd2a21c){return function(_0x48256a){if(!_0x48256a){_0x444f60[_0x7284('0x19')](0x194);}return _0x48256a;};}function handleError(_0x3631f7,_0x478dd8){_0x478dd8=_0x478dd8||0x1f4;return function(_0x1b962d){logger[_0x7284('0x29')](_0x1b962d[_0x7284('0x2a')]);if(_0x1b962d[_0x7284('0x2b')]){delete _0x1b962d[_0x7284('0x2b')];}_0x3631f7[_0x7284('0x1a')](_0x478dd8)[_0x7284('0x2c')](_0x1b962d);};}exports[_0x7284('0x2d')]=function(_0x416fb5,_0x4ac437){var _0x3ca8be={},_0x1ce04e={},_0x55cc0a={'count':0x0,'rows':[]};var _0x1e2296=_[_0x7284('0x2e')](db[_0x7284('0x2f')][_0x7284('0x30')],function(_0x4b2a81){return{'name':_0x4b2a81[_0x7284('0x31')],'type':_0x4b2a81[_0x7284('0x32')]['key']};});_0x1ce04e[_0x7284('0x33')]=_[_0x7284('0x2e')](_0x1e2296,_0x7284('0x2b'));_0x1ce04e['query']=_[_0x7284('0x34')](_0x416fb5[_0x7284('0x35')]);_0x1ce04e[_0x7284('0x36')]=_[_0x7284('0x37')](_0x1ce04e[_0x7284('0x33')],_0x1ce04e['query']);_0x3ca8be[_0x7284('0x38')]=_['intersection'](_0x1ce04e[_0x7284('0x33')],qs[_0x7284('0x39')](_0x416fb5[_0x7284('0x35')][_0x7284('0x39')]));_0x3ca8be['attributes']=_0x3ca8be[_0x7284('0x38')][_0x7284('0x3a')]?_0x3ca8be['attributes']:_0x1ce04e[_0x7284('0x33')];if(!_0x416fb5[_0x7284('0x35')][_0x7284('0x3b')](_0x7284('0x3c'))){_0x3ca8be[_0x7284('0x1f')]=qs[_0x7284('0x1f')](_0x416fb5[_0x7284('0x35')][_0x7284('0x1f')]);_0x3ca8be[_0x7284('0x1d')]=qs['offset'](_0x416fb5[_0x7284('0x35')]['offset']);}_0x3ca8be[_0x7284('0x3d')]=qs[_0x7284('0x3e')](_0x416fb5[_0x7284('0x35')][_0x7284('0x3e')]);_0x3ca8be[_0x7284('0x3f')]=qs[_0x7284('0x36')](_[_0x7284('0x40')](_0x416fb5[_0x7284('0x35')],_0x1ce04e[_0x7284('0x36')]),_0x1e2296);if(_0x416fb5[_0x7284('0x35')][_0x7284('0x41')]){_0x3ca8be[_0x7284('0x3f')]=_['merge'](_0x3ca8be[_0x7284('0x3f')],{'$or':_[_0x7284('0x2e')](_0x1e2296,function(_0x2617e4){if(_0x2617e4[_0x7284('0x32')]!==_0x7284('0x42')){var _0x4a827a={};_0x4a827a[_0x2617e4[_0x7284('0x2b')]]={'$like':'%'+_0x416fb5[_0x7284('0x35')]['filter']+'%'};return _0x4a827a;}})});}_0x3ca8be=_[_0x7284('0x43')]({},_0x3ca8be,_0x416fb5[_0x7284('0x44')]);var _0x163d18={'where':_0x3ca8be[_0x7284('0x3f')]};return db[_0x7284('0x2f')][_0x7284('0x20')](_0x163d18)[_0x7284('0x27')](function(_0x4fc712){_0x55cc0a[_0x7284('0x20')]=_0x4fc712;if(_0x416fb5[_0x7284('0x35')][_0x7284('0x45')]){_0x3ca8be[_0x7284('0x46')]=[{'all':!![]}];}return db[_0x7284('0x2f')][_0x7284('0x47')](_0x3ca8be);})[_0x7284('0x27')](function(_0xf64c5b){_0x55cc0a[_0x7284('0x48')]=_0xf64c5b;return _0x55cc0a;})['then'](respondWithFilteredResult(_0x4ac437,_0x3ca8be))[_0x7284('0x49')](handleError(_0x4ac437,null));};exports[_0x7284('0x4a')]=function(_0x381fbc,_0xd13e36){var _0x4c0479={'raw':![],'where':{'id':_0x381fbc['params']['id']}},_0x360c2d={};_0x360c2d[_0x7284('0x33')]=_[_0x7284('0x34')](db[_0x7284('0x2f')]['rawAttributes']);_0x360c2d['query']=_[_0x7284('0x34')](_0x381fbc[_0x7284('0x35')]);_0x360c2d[_0x7284('0x36')]=_[_0x7284('0x37')](_0x360c2d[_0x7284('0x33')],_0x360c2d['query']);_0x4c0479[_0x7284('0x38')]=_['intersection'](_0x360c2d[_0x7284('0x33')],qs[_0x7284('0x39')](_0x381fbc['query'][_0x7284('0x39')]));_0x4c0479['attributes']=_0x4c0479['attributes'][_0x7284('0x3a')]?_0x4c0479['attributes']:_0x360c2d['model'];if(_0x381fbc[_0x7284('0x35')]['includeAll']){_0x4c0479[_0x7284('0x46')]=[{'all':!![]}];}_0x4c0479=_[_0x7284('0x43')]({},_0x4c0479,_0x381fbc[_0x7284('0x44')]);return db['AnalyticFieldReport']['find'](_0x4c0479)[_0x7284('0x27')](handleEntityNotFound(_0xd13e36,null))[_0x7284('0x27')](respondWithResult(_0xd13e36,null))['catch'](handleError(_0xd13e36,null));};exports[_0x7284('0x4b')]=function(_0x5c3ce5,_0x407224){return db[_0x7284('0x2f')]['create'](_0x5c3ce5[_0x7284('0x4c')],{})[_0x7284('0x27')](respondWithResult(_0x407224,0xc9))[_0x7284('0x49')](handleError(_0x407224,null));};exports[_0x7284('0x4d')]=function(_0xc8f44c,_0x15b2e6){return db[_0x7284('0x2f')]['bulkCreate'](_0xc8f44c[_0x7284('0x4c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x15b2e6,0xc9))['catch'](handleError(_0x15b2e6,null));};exports['update']=function(_0x114aa0,_0x17be1e){if(_0x114aa0[_0x7284('0x4c')]['id']){delete _0x114aa0[_0x7284('0x4c')]['id'];}return db[_0x7284('0x2f')][_0x7284('0x4e')]({'where':{'id':_0x114aa0[_0x7284('0x4f')]['id']}})[_0x7284('0x27')](handleEntityNotFound(_0x17be1e,null))[_0x7284('0x27')](saveUpdates(_0x114aa0[_0x7284('0x4c')],null))[_0x7284('0x27')](respondWithResult(_0x17be1e,null))[_0x7284('0x49')](handleError(_0x17be1e,null));};exports['destroy']=function(_0x27a623,_0x2568ac){return db[_0x7284('0x2f')][_0x7284('0x4e')]({'where':{'id':_0x27a623[_0x7284('0x4f')]['id']}})[_0x7284('0x27')](handleEntityNotFound(_0x2568ac,null))[_0x7284('0x27')](removeEntity(_0x2568ac,null))[_0x7284('0x49')](handleError(_0x2568ac,null));};exports[_0x7284('0x50')]=function(_0xb83aa1,_0x5b6688){return db[_0x7284('0x2f')][_0x7284('0x28')]({'where':{'id':_0xb83aa1['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5b6688,0xcc))[_0x7284('0x49')](handleError(_0x5b6688,null));};exports[_0x7284('0x51')]=function(_0xd90e5c,_0x5887c1,_0x23b6e3){return db[_0x7284('0x52')][_0x7284('0x53')]({'where':{'id':_0xd90e5c['params']['id']}})['then'](handleEntityNotFound(_0x5887c1,null))['then'](function(_0x2c6889){if(_0x2c6889){return db[_0x7284('0x54')]['transaction'](function(_0x415ad9){return db[_0x7284('0x2f')][_0x7284('0x28')]({'where':{'CustomReportId':_0xd90e5c[_0x7284('0x4f')]['id']},'transaction':_0x415ad9})[_0x7284('0x27')](function(_0x5a0c95){var _0xbcf081=_[_0x7284('0x2e')](_0xd90e5c[_0x7284('0x4c')],function(_0x139e10){delete _0x139e10['id'];_0x139e10[_0x7284('0x55')]=_0xd90e5c[_0x7284('0x4f')]['id'];return _0x139e10;});return db[_0x7284('0x2f')][_0x7284('0x4d')](_0xbcf081,{'transaction':_0x415ad9});});})[_0x7284('0x27')](function(){return db['AnalyticFieldReport'][_0x7284('0x47')]({'where':{'CustomReportId':_0xd90e5c[_0x7284('0x4f')]['id']}});});}})['then'](respondWithResult(_0x5887c1,null))[_0x7284('0x49')](handleError(_0x5887c1,null));};
\ No newline at end of file
+var _0x888b=['merge','where','type','VIRTUAL','includeAll','include','findAll','rows','params','options','find','catch','create','body','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x237bed,_0x2c9315){var _0x325fbf=function(_0x3e20f3){while(--_0x3e20f3){_0x237bed['push'](_0x237bed['shift']());}};_0x325fbf(++_0x2c9315);}(_0x888b,0x112));var _0xb888=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x888b[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xb888('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb888('0x1'));var jsonpatch=require(_0xb888('0x2'));var rp=require('request-promise');var moment=require(_0xb888('0x3'));var BPromise=require(_0xb888('0x4'));var Mustache=require(_0xb888('0x5'));var util=require(_0xb888('0x6'));var path=require('path');var sox=require(_0xb888('0x7'));var csv=require(_0xb888('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb888('0x9'));var squel=require(_0xb888('0xa'));var crypto=require('crypto');var jsforce=require(_0xb888('0xb'));var deskjs=require(_0xb888('0xc'));var toCsv=require(_0xb888('0x8'));var querystring=require('querystring');var Papa=require(_0xb888('0xd'));var Redis=require(_0xb888('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb888('0xf'));var as=require(_0xb888('0x10'));var hardwareService=require(_0xb888('0x11'));var logger=require(_0xb888('0x12'))(_0xb888('0x13'));var utils=require(_0xb888('0x14'));var config=require(_0xb888('0x15'));var licenseUtil=require(_0xb888('0x16'));var db=require(_0xb888('0x17'))['db'];function respondWithStatusCode(_0x19c938,_0x593ce9){_0x593ce9=_0x593ce9||0xcc;return function(_0x2514f2){if(_0x2514f2){return _0x19c938[_0xb888('0x18')](_0x593ce9);}return _0x19c938[_0xb888('0x19')](_0x593ce9)[_0xb888('0x1a')]();};}function respondWithResult(_0x87c46f,_0x2b0d7a){_0x2b0d7a=_0x2b0d7a||0xc8;return function(_0x1d4036){if(_0x1d4036){return _0x87c46f['status'](_0x2b0d7a)[_0xb888('0x1b')](_0x1d4036);}};}function respondWithFilteredResult(_0x52c8d4,_0x48b7a5){return function(_0x591325){if(_0x591325){var _0xe4741c=typeof _0x48b7a5['offset']==='undefined'&&typeof _0x48b7a5[_0xb888('0x1c')]===_0xb888('0x1d');var _0x167ddc=_0x591325[_0xb888('0x1e')];var _0x33bc02=_0xe4741c?0x0:_0x48b7a5['offset'];var _0x4b0882=_0xe4741c?_0x591325[_0xb888('0x1e')]:_0x48b7a5[_0xb888('0x1f')]+_0x48b7a5[_0xb888('0x1c')];var _0x36e616;if(_0x4b0882>=_0x167ddc){_0x4b0882=_0x167ddc;_0x36e616=0xc8;}else{_0x36e616=0xce;}_0x52c8d4[_0xb888('0x19')](_0x36e616);return _0x52c8d4[_0xb888('0x20')](_0xb888('0x21'),_0x33bc02+'-'+_0x4b0882+'/'+_0x167ddc)[_0xb888('0x1b')](_0x591325);}return null;};}function patchUpdates(_0x224ec9){return function(_0x51d263){try{jsonpatch[_0xb888('0x22')](_0x51d263,_0x224ec9,!![]);}catch(_0x52511d){return BPromise[_0xb888('0x23')](_0x52511d);}return _0x51d263[_0xb888('0x24')]();};}function saveUpdates(_0x308829,_0x1b10a1){return function(_0x542512){if(_0x542512){return _0x542512[_0xb888('0x25')](_0x308829)[_0xb888('0x26')](function(_0x4a1ddd){return _0x4a1ddd;});}return null;};}function removeEntity(_0x263e35,_0x19f24f){return function(_0xae41bf){if(_0xae41bf){return _0xae41bf['destroy']()[_0xb888('0x26')](function(){_0x263e35[_0xb888('0x19')](0xcc)[_0xb888('0x1a')]();});}};}function handleEntityNotFound(_0x595b5e,_0x51b591){return function(_0x53ff37){if(!_0x53ff37){_0x595b5e[_0xb888('0x18')](0x194);}return _0x53ff37;};}function handleError(_0x93e96c,_0x3004e3){_0x3004e3=_0x3004e3||0x1f4;return function(_0x3d3f13){logger[_0xb888('0x27')](_0x3d3f13[_0xb888('0x28')]);if(_0x3d3f13[_0xb888('0x29')]){delete _0x3d3f13['name'];}_0x93e96c[_0xb888('0x19')](_0x3004e3)[_0xb888('0x2a')](_0x3d3f13);};}exports[_0xb888('0x2b')]=function(_0x29c958,_0x11e195){var _0x18e2fd={},_0x3d3415={},_0x5375f5={'count':0x0,'rows':[]};var _0x595bd3=_[_0xb888('0x2c')](db[_0xb888('0x2d')][_0xb888('0x2e')],function(_0x4bc3f0){return{'name':_0x4bc3f0[_0xb888('0x2f')],'type':_0x4bc3f0['type']['key']};});_0x3d3415[_0xb888('0x30')]=_[_0xb888('0x2c')](_0x595bd3,_0xb888('0x29'));_0x3d3415[_0xb888('0x31')]=_[_0xb888('0x32')](_0x29c958['query']);_0x3d3415[_0xb888('0x33')]=_['intersection'](_0x3d3415[_0xb888('0x30')],_0x3d3415['query']);_0x18e2fd[_0xb888('0x34')]=_[_0xb888('0x35')](_0x3d3415[_0xb888('0x30')],qs[_0xb888('0x36')](_0x29c958[_0xb888('0x31')][_0xb888('0x36')]));_0x18e2fd[_0xb888('0x34')]=_0x18e2fd[_0xb888('0x34')][_0xb888('0x37')]?_0x18e2fd[_0xb888('0x34')]:_0x3d3415[_0xb888('0x30')];if(!_0x29c958[_0xb888('0x31')][_0xb888('0x38')](_0xb888('0x39'))){_0x18e2fd[_0xb888('0x1c')]=qs[_0xb888('0x1c')](_0x29c958[_0xb888('0x31')][_0xb888('0x1c')]);_0x18e2fd[_0xb888('0x1f')]=qs[_0xb888('0x1f')](_0x29c958['query'][_0xb888('0x1f')]);}_0x18e2fd[_0xb888('0x3a')]=qs[_0xb888('0x3b')](_0x29c958['query']['sort']);_0x18e2fd['where']=qs[_0xb888('0x33')](_[_0xb888('0x3c')](_0x29c958['query'],_0x3d3415[_0xb888('0x33')]),_0x595bd3);if(_0x29c958[_0xb888('0x31')][_0xb888('0x3d')]){_0x18e2fd['where']=_[_0xb888('0x3e')](_0x18e2fd[_0xb888('0x3f')],{'$or':_['map'](_0x595bd3,function(_0x147da1){if(_0x147da1[_0xb888('0x40')]!==_0xb888('0x41')){var _0x262d50={};_0x262d50[_0x147da1[_0xb888('0x29')]]={'$like':'%'+_0x29c958[_0xb888('0x31')][_0xb888('0x3d')]+'%'};return _0x262d50;}})});}_0x18e2fd=_[_0xb888('0x3e')]({},_0x18e2fd,_0x29c958['options']);var _0x434ced={'where':_0x18e2fd[_0xb888('0x3f')]};return db['AnalyticFieldReport'][_0xb888('0x1e')](_0x434ced)[_0xb888('0x26')](function(_0x2aec97){_0x5375f5[_0xb888('0x1e')]=_0x2aec97;if(_0x29c958[_0xb888('0x31')][_0xb888('0x42')]){_0x18e2fd[_0xb888('0x43')]=[{'all':!![]}];}return db[_0xb888('0x2d')][_0xb888('0x44')](_0x18e2fd);})[_0xb888('0x26')](function(_0x2c83dc){_0x5375f5[_0xb888('0x45')]=_0x2c83dc;return _0x5375f5;})['then'](respondWithFilteredResult(_0x11e195,_0x18e2fd))['catch'](handleError(_0x11e195,null));};exports['show']=function(_0x3dab72,_0x48708b){var _0x1c908={'raw':![],'where':{'id':_0x3dab72[_0xb888('0x46')]['id']}},_0x6b31f1={};_0x6b31f1[_0xb888('0x30')]=_[_0xb888('0x32')](db[_0xb888('0x2d')]['rawAttributes']);_0x6b31f1[_0xb888('0x31')]=_['keys'](_0x3dab72['query']);_0x6b31f1[_0xb888('0x33')]=_[_0xb888('0x35')](_0x6b31f1[_0xb888('0x30')],_0x6b31f1[_0xb888('0x31')]);_0x1c908[_0xb888('0x34')]=_[_0xb888('0x35')](_0x6b31f1[_0xb888('0x30')],qs[_0xb888('0x36')](_0x3dab72['query']['fields']));_0x1c908[_0xb888('0x34')]=_0x1c908[_0xb888('0x34')][_0xb888('0x37')]?_0x1c908[_0xb888('0x34')]:_0x6b31f1[_0xb888('0x30')];if(_0x3dab72[_0xb888('0x31')][_0xb888('0x42')]){_0x1c908['include']=[{'all':!![]}];}_0x1c908=_[_0xb888('0x3e')]({},_0x1c908,_0x3dab72[_0xb888('0x47')]);return db[_0xb888('0x2d')][_0xb888('0x48')](_0x1c908)[_0xb888('0x26')](handleEntityNotFound(_0x48708b,null))[_0xb888('0x26')](respondWithResult(_0x48708b,null))[_0xb888('0x49')](handleError(_0x48708b,null));};exports[_0xb888('0x4a')]=function(_0x627f66,_0x35e037){return db[_0xb888('0x2d')][_0xb888('0x4a')](_0x627f66[_0xb888('0x4b')],{})[_0xb888('0x26')](respondWithResult(_0x35e037,0xc9))['catch'](handleError(_0x35e037,null));};exports['bulkCreate']=function(_0x5d374d,_0x487eef){return db['AnalyticFieldReport']['bulkCreate'](_0x5d374d[_0xb888('0x4b')],{'raw':![],'individualHooks':!![]})[_0xb888('0x26')](respondWithResult(_0x487eef,0xc9))[_0xb888('0x49')](handleError(_0x487eef,null));};exports[_0xb888('0x25')]=function(_0x3481f2,_0x12e169){if(_0x3481f2[_0xb888('0x4b')]['id']){delete _0x3481f2[_0xb888('0x4b')]['id'];}return db[_0xb888('0x2d')][_0xb888('0x48')]({'where':{'id':_0x3481f2[_0xb888('0x46')]['id']}})[_0xb888('0x26')](handleEntityNotFound(_0x12e169,null))[_0xb888('0x26')](saveUpdates(_0x3481f2['body'],null))['then'](respondWithResult(_0x12e169,null))['catch'](handleError(_0x12e169,null));};exports[_0xb888('0x4c')]=function(_0x550ebf,_0x5b0231){return db[_0xb888('0x2d')][_0xb888('0x48')]({'where':{'id':_0x550ebf[_0xb888('0x46')]['id']}})[_0xb888('0x26')](handleEntityNotFound(_0x5b0231,null))[_0xb888('0x26')](removeEntity(_0x5b0231,null))['catch'](handleError(_0x5b0231,null));};exports[_0xb888('0x4d')]=function(_0x5d768b,_0x6bb7a3){return db[_0xb888('0x2d')][_0xb888('0x4c')]({'where':{'id':_0x5d768b[_0xb888('0x31')][_0xb888('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xb888('0x26')](respondWithResult(_0x6bb7a3,0xcc))[_0xb888('0x49')](handleError(_0x6bb7a3,null));};exports[_0xb888('0x4f')]=function(_0x2d88f1,_0x3c540c,_0x255698){return db[_0xb888('0x50')]['findOne']({'where':{'id':_0x2d88f1[_0xb888('0x46')]['id']}})[_0xb888('0x26')](handleEntityNotFound(_0x3c540c,null))[_0xb888('0x26')](function(_0x34f47b){if(_0x34f47b){return db['sequelize'][_0xb888('0x51')](function(_0x6533a){return db[_0xb888('0x2d')][_0xb888('0x4c')]({'where':{'CustomReportId':_0x2d88f1[_0xb888('0x46')]['id']},'transaction':_0x6533a})[_0xb888('0x26')](function(_0x576bed){var _0x1ec9e4=_[_0xb888('0x2c')](_0x2d88f1['body'],function(_0x39c884){delete _0x39c884['id'];_0x39c884[_0xb888('0x52')]=_0x2d88f1['params']['id'];return _0x39c884;});return db['AnalyticFieldReport'][_0xb888('0x53')](_0x1ec9e4,{'transaction':_0x6533a});});})[_0xb888('0x26')](function(){return db[_0xb888('0x2d')][_0xb888('0x44')]({'where':{'CustomReportId':_0x2d88f1[_0xb888('0x46')]['id']}});});}})['then'](respondWithResult(_0x3c540c,null))['catch'](handleError(_0x3c540c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 14e59c2..0bd7715 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 _0x4746=['request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment'];(function(_0x4412ab,_0x41d6f0){var _0x294573=function(_0x163bde){while(--_0x163bde){_0x4412ab['push'](_0x4412ab['shift']());}};_0x294573(++_0x41d6f0);}(_0x4746,0x1d1));var _0x6474=function(_0x6c2939,_0x5aa000){_0x6c2939=_0x6c2939-0x0;var _0xc39fdf=_0x4746[_0x6c2939];return _0xc39fdf;};'use strict';var _=require(_0x6474('0x0'));var util=require('util');var logger=require(_0x6474('0x1'))('api');var moment=require(_0x6474('0x2'));var BPromise=require('bluebird');var rp=require(_0x6474('0x3'));var fs=require('fs');var path=require(_0x6474('0x4'));var rimraf=require(_0x6474('0x5'));var config=require(_0x6474('0x6'));var attributes=require(_0x6474('0x7'));module[_0x6474('0x8')]=function(_0x19de40,_0x5c94aa){return _0x19de40[_0x6474('0x9')](_0x6474('0xa'),attributes,{'tableName':_0x6474('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2b8=['moment','bluebird','rimraf','../../config/environment','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0xd2b8,0xa1));var _0x8d2b=function(_0x102470,_0x31195a){_0x102470=_0x102470-0x0;var _0x21fb8b=_0xd2b8[_0x102470];return _0x21fb8b;};'use strict';var _=require(_0x8d2b('0x0'));var util=require(_0x8d2b('0x1'));var logger=require(_0x8d2b('0x2'))(_0x8d2b('0x3'));var moment=require(_0x8d2b('0x4'));var BPromise=require(_0x8d2b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d2b('0x6'));var config=require(_0x8d2b('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x8d2b('0x8')]=function(_0xdfba21,_0x3f84d5){return _0xdfba21[_0x8d2b('0x9')](_0x8d2b('0xa'),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 dae46ab..c441b91 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 _0x73b5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0x73b5,0x11b));var _0x573b=function(_0x7cce8d,_0x8d7c9c){_0x7cce8d=_0x7cce8d-0x0;var _0x381b50=_0x73b5[_0x7cce8d];return _0x381b50;};'use strict';var _=require(_0x573b('0x0'));var util=require('util');var moment=require(_0x573b('0x1'));var BPromise=require('bluebird');var rs=require(_0x573b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x573b('0x3'))['db'];var utils=require(_0x573b('0x4'));var logger=require(_0x573b('0x5'))(_0x573b('0x6'));var config=require(_0x573b('0x7'));var jayson=require(_0x573b('0x8'));var client=jayson['client'][_0x573b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4855e4,_0x5b051f,_0x3865c6){return new BPromise(function(_0x1f52a3,_0x14f237){return client[_0x573b('0xa')](_0x4855e4,_0x3865c6)[_0x573b('0xb')](function(_0x44dffc){logger[_0x573b('0xc')](_0x573b('0xd'),_0x5b051f,_0x573b('0xe'));logger['debug'](_0x573b('0xf'),_0x5b051f,'request\x20sent',JSON[_0x573b('0x10')](_0x44dffc));if(_0x44dffc[_0x573b('0x11')]){if(_0x44dffc[_0x573b('0x11')][_0x573b('0x12')]===0x1f4){logger['error'](_0x573b('0xd'),_0x5b051f,_0x44dffc[_0x573b('0x11')]['message']);return _0x14f237(_0x44dffc[_0x573b('0x11')]['message']);}logger[_0x573b('0x11')](_0x573b('0xd'),_0x5b051f,_0x44dffc[_0x573b('0x11')][_0x573b('0x13')]);return _0x1f52a3(_0x44dffc['error'][_0x573b('0x13')]);}else{logger[_0x573b('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5b051f,_0x573b('0xe'));_0x1f52a3(_0x44dffc[_0x573b('0x14')]['message']);}})[_0x573b('0x15')](function(_0x5bc04b){logger[_0x573b('0x11')](_0x573b('0xd'),_0x5b051f,_0x5bc04b);_0x14f237(_0x5bc04b);});});}
\ No newline at end of file
+var _0xd839=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x30b5f2,_0x2b8439){var _0x1509a4=function(_0x2ccee7){while(--_0x2ccee7){_0x30b5f2['push'](_0x30b5f2['shift']());}};_0x1509a4(++_0x2b8439);}(_0xd839,0x105));var _0x9d83=function(_0x2e0803,_0x20b12c){_0x2e0803=_0x2e0803-0x0;var _0x3d8c51=_0xd839[_0x2e0803];return _0x3d8c51;};'use strict';var _=require(_0x9d83('0x0'));var util=require(_0x9d83('0x1'));var moment=require(_0x9d83('0x2'));var BPromise=require(_0x9d83('0x3'));var rs=require(_0x9d83('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d83('0x5'))['db'];var utils=require(_0x9d83('0x6'));var logger=require(_0x9d83('0x7'))('rpc');var config=require(_0x9d83('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d83('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x430203,_0x53f9ac,_0x53d02a){return new BPromise(function(_0x353d2b,_0x4d7bf7){return client[_0x9d83('0xa')](_0x430203,_0x53d02a)[_0x9d83('0xb')](function(_0xf043d0){logger[_0x9d83('0xc')](_0x9d83('0xd'),_0x53f9ac,_0x9d83('0xe'));logger[_0x9d83('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x53f9ac,'request\x20sent',JSON[_0x9d83('0x10')](_0xf043d0));if(_0xf043d0[_0x9d83('0x11')]){if(_0xf043d0[_0x9d83('0x11')][_0x9d83('0x12')]===0x1f4){logger[_0x9d83('0x11')](_0x9d83('0xd'),_0x53f9ac,_0xf043d0['error'][_0x9d83('0x13')]);return _0x4d7bf7(_0xf043d0[_0x9d83('0x11')]['message']);}logger[_0x9d83('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x53f9ac,_0xf043d0[_0x9d83('0x11')][_0x9d83('0x13')]);return _0x353d2b(_0xf043d0['error']['message']);}else{logger[_0x9d83('0xc')](_0x9d83('0xd'),_0x53f9ac,_0x9d83('0xe'));_0x353d2b(_0xf043d0[_0x9d83('0x14')][_0x9d83('0x13')]);}})[_0x9d83('0x15')](function(_0x2ef226){logger[_0x9d83('0x11')](_0x9d83('0xd'),_0x53f9ac,_0x2ef226);_0x4d7bf7(_0x2ef226);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 721d049..ca4791b 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(_0x11e006,_0x187aa4){var _0x3d52aa=function(_0x25de3e){while(--_0x25de3e){_0x11e006['push'](_0x11e006['shift']());}};_0x3d52aa(++_0x187aa4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x457b1f,_0x13d5f6){var _0x2a782a=function(_0x28581a){while(--_0x28581a){_0x457b1f['push'](_0x457b1f['shift']());}};_0x2a782a(++_0x13d5f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 192efbd..94820a2 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 _0x9c2c=['TEXT','sequelize','exports'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc9c2('0x0'));module[_0xc9c2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xc9c2('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbf5c=['sequelize','exports','STRING','TEXT'];(function(_0x283b17,_0x53606e){var _0x459e07=function(_0x11884d){while(--_0x11884d){_0x283b17['push'](_0x283b17['shift']());}};_0x459e07(++_0x53606e);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x238a7a,_0x5807fe){_0x238a7a=_0x238a7a-0x0;var _0x5a1038=_0xbf5c[_0x238a7a];return _0x5a1038;};'use strict';var Sequelize=require(_0xcbf5('0x0'));module[_0xcbf5('0x1')]={'name':{'type':Sequelize[_0xcbf5('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xcbf5('0x2')]},'metric':{'type':Sequelize[_0xcbf5('0x3')]},'description':{'type':Sequelize[_0xcbf5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 9ee7c63..7fc87f8 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 _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x170291,_0x5bc16d){var _0x1b6f47=function(_0x13f911){while(--_0x13f911){_0x170291['push'](_0x170291['shift']());}};_0x1b6f47(++_0x5bc16d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x24ca[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));};
\ No newline at end of file
+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(_0x4ab28f,_0x9619a1){var _0x452c9b=function(_0x570af4){while(--_0x570af4){_0x4ab28f['push'](_0x4ab28f['shift']());}};_0x452c9b(++_0x9619a1);}(_0xe14b,0x93));var _0xbe14=function(_0x36393d,_0x38d9e8){_0x36393d=_0x36393d-0x0;var _0x1fa70a=_0xe14b[_0x36393d];return _0x1fa70a;};'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
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index fb325e9..4527e40 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 _0xeae8=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xeae8,0x66));var _0x8eae=function(_0x5e4642,_0x3cf0d9){_0x5e4642=_0x5e4642-0x0;var _0x49c9aa=_0xeae8[_0x5e4642];return _0x49c9aa;};'use strict';var _=require(_0x8eae('0x0'));var util=require(_0x8eae('0x1'));var logger=require(_0x8eae('0x2'))('api');var moment=require(_0x8eae('0x3'));var BPromise=require('bluebird');var rp=require(_0x8eae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8eae('0x5'));var config=require(_0x8eae('0x6'));var attributes=require(_0x8eae('0x7'));module[_0x8eae('0x8')]=function(_0xcc5f34,_0x123053){return _0xcc5f34[_0x8eae('0x9')](_0x8eae('0xa'),attributes,{'tableName':_0x8eae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8375=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric'];(function(_0x1f4ef4,_0x525c7a){var _0x2757e9=function(_0x4f1004){while(--_0x4f1004){_0x1f4ef4['push'](_0x1f4ef4['shift']());}};_0x2757e9(++_0x525c7a);}(_0x8375,0xa8));var _0x5837=function(_0x3e65ea,_0x72471f){_0x3e65ea=_0x3e65ea-0x0;var _0x401ae8=_0x8375[_0x3e65ea];return _0x401ae8;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var logger=require(_0x5837('0x2'))('api');var moment=require(_0x5837('0x3'));var BPromise=require(_0x5837('0x4'));var rp=require(_0x5837('0x5'));var fs=require('fs');var path=require(_0x5837('0x6'));var rimraf=require(_0x5837('0x7'));var config=require(_0x5837('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x5837('0x9')]=function(_0x19491e,_0x365da3){return _0x19491e[_0x5837('0xa')](_0x5837('0xb'),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 a246f57..ee24d87 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 _0xb2fe=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x1ddcb1,_0x3ac8da){var _0x5a35cf=function(_0x2d8ab2){while(--_0x2d8ab2){_0x1ddcb1['push'](_0x1ddcb1['shift']());}};_0x5a35cf(++_0x3ac8da);}(_0xb2fe,0x140));var _0xeb2f=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xb2fe[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xeb2f('0x0'));var util=require(_0xeb2f('0x1'));var moment=require(_0xeb2f('0x2'));var BPromise=require(_0xeb2f('0x3'));var rs=require(_0xeb2f('0x4'));var fs=require('fs');var Redis=require(_0xeb2f('0x5'));var db=require(_0xeb2f('0x6'))['db'];var utils=require(_0xeb2f('0x7'));var logger=require('../../config/logger')(_0xeb2f('0x8'));var config=require('../../config/environment');var jayson=require(_0xeb2f('0x9'));var client=jayson[_0xeb2f('0xa')][_0xeb2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fdd7a,_0x2c00af,_0x505e77){return new BPromise(function(_0x28ca39,_0x12389d){return client[_0xeb2f('0xc')](_0x2fdd7a,_0x505e77)[_0xeb2f('0xd')](function(_0x2e12d8){logger['info'](_0xeb2f('0xe'),_0x2c00af,_0xeb2f('0xf'));logger[_0xeb2f('0x10')](_0xeb2f('0x11'),_0x2c00af,_0xeb2f('0xf'),JSON[_0xeb2f('0x12')](_0x2e12d8));if(_0x2e12d8[_0xeb2f('0x13')]){if(_0x2e12d8[_0xeb2f('0x13')]['code']===0x1f4){logger[_0xeb2f('0x13')](_0xeb2f('0xe'),_0x2c00af,_0x2e12d8['error']['message']);return _0x12389d(_0x2e12d8[_0xeb2f('0x13')][_0xeb2f('0x14')]);}logger[_0xeb2f('0x13')](_0xeb2f('0xe'),_0x2c00af,_0x2e12d8['error'][_0xeb2f('0x14')]);return _0x28ca39(_0x2e12d8['error'][_0xeb2f('0x14')]);}else{logger[_0xeb2f('0x15')](_0xeb2f('0xe'),_0x2c00af,_0xeb2f('0xf'));_0x28ca39(_0x2e12d8[_0xeb2f('0x16')][_0xeb2f('0x14')]);}})[_0xeb2f('0x17')](function(_0x293483){logger[_0xeb2f('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x2c00af,_0x293483);_0x12389d(_0x293483);});});}
\ No newline at end of file
+var _0xa668=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','lodash','util','moment','bluebird'];(function(_0x3471e1,_0x297aeb){var _0x259194=function(_0x3d3e77){while(--_0x3d3e77){_0x3471e1['push'](_0x3471e1['shift']());}};_0x259194(++_0x297aeb);}(_0xa668,0xec));var _0x8a66=function(_0x32f9cf,_0x307d57){_0x32f9cf=_0x32f9cf-0x0;var _0x24ec66=_0xa668[_0x32f9cf];return _0x24ec66;};'use strict';var _=require(_0x8a66('0x0'));var util=require(_0x8a66('0x1'));var moment=require(_0x8a66('0x2'));var BPromise=require(_0x8a66('0x3'));var rs=require(_0x8a66('0x4'));var fs=require('fs');var Redis=require(_0x8a66('0x5'));var db=require(_0x8a66('0x6'))['db'];var utils=require(_0x8a66('0x7'));var logger=require(_0x8a66('0x8'))('rpc');var config=require(_0x8a66('0x9'));var jayson=require(_0x8a66('0xa'));var client=jayson[_0x8a66('0xb')][_0x8a66('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dd14b,_0x23b514,_0x51dacb){return new BPromise(function(_0x355ad5,_0x504237){return client['request'](_0x1dd14b,_0x51dacb)['then'](function(_0x31170a){logger['info'](_0x8a66('0xd'),_0x23b514,_0x8a66('0xe'));logger[_0x8a66('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x23b514,_0x8a66('0xe'),JSON['stringify'](_0x31170a));if(_0x31170a[_0x8a66('0x10')]){if(_0x31170a['error']['code']===0x1f4){logger[_0x8a66('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x23b514,_0x31170a[_0x8a66('0x10')][_0x8a66('0x11')]);return _0x504237(_0x31170a[_0x8a66('0x10')]['message']);}logger[_0x8a66('0x10')](_0x8a66('0xd'),_0x23b514,_0x31170a[_0x8a66('0x10')][_0x8a66('0x11')]);return _0x355ad5(_0x31170a[_0x8a66('0x10')][_0x8a66('0x11')]);}else{logger[_0x8a66('0x12')](_0x8a66('0xd'),_0x23b514,'request\x20sent');_0x355ad5(_0x31170a[_0x8a66('0x13')][_0x8a66('0x11')]);}})['catch'](function(_0x503f22){logger[_0x8a66('0x10')](_0x8a66('0xd'),_0x23b514,_0x503f22);_0x504237(_0x503f22);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 1668054..20fc01a 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 _0xe9e8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x3b0be7,_0x2aa163){var _0x2a469b=function(_0x180f1c){while(--_0x180f1c){_0x3b0be7['push'](_0x3b0be7['shift']());}};_0x2a469b(++_0x2aa163);}(_0xe9e8,0x179));var _0x8e9e=function(_0xbe243e,_0x1c7902){_0xbe243e=_0xbe243e-0x0;var _0xd960f7=_0xe9e8[_0xbe243e];return _0xd960f7;};'use strict';var multer=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var path=require(_0x8e9e('0x2'));var timeout=require(_0x8e9e('0x3'));var express=require(_0x8e9e('0x4'));var router=express[_0x8e9e('0x5')]();var fs_extra=require(_0x8e9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8e9e('0x7'));var config=require('../../config/environment');var controller=require(_0x8e9e('0x8'));router[_0x8e9e('0x9')]('/',auth[_0x8e9e('0xa')](),controller['index']);router['get'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xc')]);router[_0x8e9e('0xd')]('/',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xe')]);router['put']('/:id',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xf')]);router[_0x8e9e('0x10')](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x11')]);module[_0x8e9e('0x12')]=router;
\ No newline at end of file
+var _0x7217=['Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x433850,_0x5e347c){var _0x4b8501=function(_0xb66cfe){while(--_0xb66cfe){_0x433850['push'](_0x433850['shift']());}};_0x4b8501(++_0x5e347c);}(_0x7217,0x19e));var _0x7721=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7217[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 55ff038..c43b52c 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 _0x9d42=['exports','TEXT','sequelize'];(function(_0x161e81,_0x572655){var _0x901d0d=function(_0xd75d30){while(--_0xd75d30){_0x161e81['push'](_0x161e81['shift']());}};_0x901d0d(++_0x572655);}(_0x9d42,0x113));var _0x29d4=function(_0x47e57e,_0x34a5a1){_0x47e57e=_0x47e57e-0x0;var _0x1daff3=_0x9d42[_0x47e57e];return _0x1daff3;};'use strict';var Sequelize=require(_0x29d4('0x0'));module[_0x29d4('0x1')]={'tree':{'type':Sequelize[_0x29d4('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x6e2b=['TEXT','sequelize','exports'];(function(_0x4e22e5,_0x5071c6){var _0x178be0=function(_0x461bc6){while(--_0x461bc6){_0x4e22e5['push'](_0x4e22e5['shift']());}};_0x178be0(++_0x5071c6);}(_0x6e2b,0x91));var _0xb6e2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e2b[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb6e2('0x0'));module[_0xb6e2('0x1')]={'tree':{'type':Sequelize[_0xb6e2('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 259ffde..5ff182a 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 _0xb179=['fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','destroy','eml-format','rimraf','zip-dir'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xb179,0x12d));var _0x9b17=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb179[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x9b17('0x0'));var rimraf=require(_0x9b17('0x1'));var zipdir=require(_0x9b17('0x2'));var jsonpatch=require(_0x9b17('0x3'));var rp=require(_0x9b17('0x4'));var moment=require(_0x9b17('0x5'));var BPromise=require(_0x9b17('0x6'));var Mustache=require('mustache');var util=require(_0x9b17('0x7'));var path=require('path');var sox=require(_0x9b17('0x8'));var csv=require(_0x9b17('0x9'));var ejs=require(_0x9b17('0xa'));var fs=require('fs');var fs_extra=require(_0x9b17('0xb'));var _=require(_0x9b17('0xc'));var squel=require('squel');var crypto=require(_0x9b17('0xd'));var jsforce=require(_0x9b17('0xe'));var deskjs=require(_0x9b17('0xf'));var toCsv=require(_0x9b17('0x9'));var querystring=require(_0x9b17('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9b17('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9b17('0x12'));var hardwareService=require(_0x9b17('0x13'));var logger=require('../../config/logger')(_0x9b17('0x14'));var utils=require(_0x9b17('0x15'));var config=require(_0x9b17('0x16'));var licenseUtil=require(_0x9b17('0x17'));var db=require(_0x9b17('0x18'))['db'];function respondWithStatusCode(_0x3f768b,_0x36e601){_0x36e601=_0x36e601||0xcc;return function(_0x1c555a){if(_0x1c555a){return _0x3f768b[_0x9b17('0x19')](_0x36e601);}return _0x3f768b['status'](_0x36e601)[_0x9b17('0x1a')]();};}function respondWithResult(_0xf6339f,_0x2995df){_0x2995df=_0x2995df||0xc8;return function(_0x268ccd){if(_0x268ccd){return _0xf6339f['status'](_0x2995df)[_0x9b17('0x1b')](_0x268ccd);}};}function respondWithFilteredResult(_0x3def0c,_0x52c93f){return function(_0x463724){if(_0x463724){var _0x3ff132=typeof _0x52c93f[_0x9b17('0x1c')]===_0x9b17('0x1d')&&typeof _0x52c93f[_0x9b17('0x1e')]===_0x9b17('0x1d');var _0x149868=_0x463724[_0x9b17('0x1f')];var _0x57a2ce=_0x3ff132?0x0:_0x52c93f[_0x9b17('0x1c')];var _0xf4fa47=_0x3ff132?_0x463724[_0x9b17('0x1f')]:_0x52c93f[_0x9b17('0x1c')]+_0x52c93f['limit'];var _0x43af6f;if(_0xf4fa47>=_0x149868){_0xf4fa47=_0x149868;_0x43af6f=0xc8;}else{_0x43af6f=0xce;}_0x3def0c[_0x9b17('0x20')](_0x43af6f);return _0x3def0c[_0x9b17('0x21')](_0x9b17('0x22'),_0x57a2ce+'-'+_0xf4fa47+'/'+_0x149868)[_0x9b17('0x1b')](_0x463724);}return null;};}function patchUpdates(_0x5415e0){return function(_0x53986d){try{jsonpatch[_0x9b17('0x23')](_0x53986d,_0x5415e0,!![]);}catch(_0x41f521){return BPromise['reject'](_0x41f521);}return _0x53986d[_0x9b17('0x24')]();};}function saveUpdates(_0x3814a4,_0x13eed5){return function(_0xb070fe){if(_0xb070fe){return _0xb070fe['update'](_0x3814a4)['then'](function(_0x490b6d){return _0x490b6d;});}return null;};}function removeEntity(_0x1232d9,_0x5a14e8){return function(_0x4ecd2e){if(_0x4ecd2e){return _0x4ecd2e['destroy']()[_0x9b17('0x25')](function(){_0x1232d9['status'](0xcc)[_0x9b17('0x1a')]();});}};}function handleEntityNotFound(_0x3d66bc,_0x41b6e9){return function(_0xa76cdc){if(!_0xa76cdc){_0x3d66bc['sendStatus'](0x194);}return _0xa76cdc;};}function handleError(_0x99c679,_0x4bf03b){_0x4bf03b=_0x4bf03b||0x1f4;return function(_0x471348){logger[_0x9b17('0x26')](_0x471348[_0x9b17('0x27')]);if(_0x471348[_0x9b17('0x28')]){delete _0x471348['name'];}_0x99c679['status'](_0x4bf03b)[_0x9b17('0x29')](_0x471348);};}exports[_0x9b17('0x2a')]=function(_0x1f738c,_0x2fd0ff){var _0x33984a={},_0x16018f={},_0x50f08b={'count':0x0,'rows':[]};var _0x5eb6e6=_[_0x9b17('0x2b')](db[_0x9b17('0x2c')][_0x9b17('0x2d')],function(_0x43f7c7){return{'name':_0x43f7c7[_0x9b17('0x2e')],'type':_0x43f7c7[_0x9b17('0x2f')][_0x9b17('0x30')]};});_0x16018f['model']=_['map'](_0x5eb6e6,'name');_0x16018f['query']=_[_0x9b17('0x31')](_0x1f738c[_0x9b17('0x32')]);_0x16018f[_0x9b17('0x33')]=_['intersection'](_0x16018f[_0x9b17('0x34')],_0x16018f[_0x9b17('0x32')]);_0x33984a[_0x9b17('0x35')]=_[_0x9b17('0x36')](_0x16018f['model'],qs[_0x9b17('0x37')](_0x1f738c[_0x9b17('0x32')]['fields']));_0x33984a['attributes']=_0x33984a['attributes']['length']?_0x33984a[_0x9b17('0x35')]:_0x16018f[_0x9b17('0x34')];if(!_0x1f738c['query']['hasOwnProperty'](_0x9b17('0x38'))){_0x33984a[_0x9b17('0x1e')]=qs['limit'](_0x1f738c[_0x9b17('0x32')][_0x9b17('0x1e')]);_0x33984a[_0x9b17('0x1c')]=qs[_0x9b17('0x1c')](_0x1f738c[_0x9b17('0x32')][_0x9b17('0x1c')]);}_0x33984a[_0x9b17('0x39')]=qs['sort'](_0x1f738c[_0x9b17('0x32')][_0x9b17('0x3a')]);_0x33984a[_0x9b17('0x3b')]=qs[_0x9b17('0x33')](_[_0x9b17('0x3c')](_0x1f738c[_0x9b17('0x32')],_0x16018f[_0x9b17('0x33')]),_0x5eb6e6);if(_0x1f738c[_0x9b17('0x32')][_0x9b17('0x3d')]){_0x33984a['where']=_['merge'](_0x33984a[_0x9b17('0x3b')],{'$or':_[_0x9b17('0x2b')](_0x5eb6e6,function(_0x420081){if(_0x420081[_0x9b17('0x2f')]!==_0x9b17('0x3e')){var _0x204c28={};_0x204c28[_0x420081[_0x9b17('0x28')]]={'$like':'%'+_0x1f738c[_0x9b17('0x32')][_0x9b17('0x3d')]+'%'};return _0x204c28;}})});}_0x33984a=_[_0x9b17('0x3f')]({},_0x33984a,_0x1f738c['options']);var _0x1a0435={'where':_0x33984a[_0x9b17('0x3b')]};return db['AnalyticTreeReport'][_0x9b17('0x1f')](_0x1a0435)[_0x9b17('0x25')](function(_0x262806){_0x50f08b[_0x9b17('0x1f')]=_0x262806;if(_0x1f738c['query'][_0x9b17('0x40')]){_0x33984a[_0x9b17('0x41')]=[{'all':!![]}];}return db[_0x9b17('0x2c')][_0x9b17('0x42')](_0x33984a);})[_0x9b17('0x25')](function(_0x276f43){_0x50f08b[_0x9b17('0x43')]=_0x276f43;return _0x50f08b;})[_0x9b17('0x25')](respondWithFilteredResult(_0x2fd0ff,_0x33984a))['catch'](handleError(_0x2fd0ff,null));};exports[_0x9b17('0x44')]=function(_0x5d058e,_0x218aa1){var _0x4782e5={'raw':!![],'where':{'id':_0x5d058e[_0x9b17('0x45')]['id']}},_0x12ef2f={};_0x12ef2f[_0x9b17('0x34')]=_[_0x9b17('0x31')](db[_0x9b17('0x2c')]['rawAttributes']);_0x12ef2f['query']=_[_0x9b17('0x31')](_0x5d058e['query']);_0x12ef2f[_0x9b17('0x33')]=_[_0x9b17('0x36')](_0x12ef2f['model'],_0x12ef2f[_0x9b17('0x32')]);_0x4782e5[_0x9b17('0x35')]=_[_0x9b17('0x36')](_0x12ef2f[_0x9b17('0x34')],qs[_0x9b17('0x37')](_0x5d058e[_0x9b17('0x32')][_0x9b17('0x37')]));_0x4782e5[_0x9b17('0x35')]=_0x4782e5['attributes'][_0x9b17('0x46')]?_0x4782e5[_0x9b17('0x35')]:_0x12ef2f[_0x9b17('0x34')];if(_0x5d058e[_0x9b17('0x32')][_0x9b17('0x40')]){_0x4782e5[_0x9b17('0x41')]=[{'all':!![]}];}_0x4782e5=_[_0x9b17('0x3f')]({},_0x4782e5,_0x5d058e['options']);return db[_0x9b17('0x2c')][_0x9b17('0x47')](_0x4782e5)['then'](handleEntityNotFound(_0x218aa1,null))[_0x9b17('0x25')](respondWithResult(_0x218aa1,null))[_0x9b17('0x48')](handleError(_0x218aa1,null));};exports[_0x9b17('0x49')]=function(_0xc58a67,_0x4a5bbe){return db['AnalyticTreeReport'][_0x9b17('0x49')](_0xc58a67[_0x9b17('0x4a')],{})[_0x9b17('0x25')](respondWithResult(_0x4a5bbe,0xc9))[_0x9b17('0x48')](handleError(_0x4a5bbe,null));};exports['update']=function(_0x5af2b7,_0x379197){if(_0x5af2b7[_0x9b17('0x4a')]['id']){delete _0x5af2b7['body']['id'];}return db['AnalyticTreeReport'][_0x9b17('0x47')]({'where':{'id':_0x5af2b7[_0x9b17('0x45')]['id']}})[_0x9b17('0x25')](handleEntityNotFound(_0x379197,null))[_0x9b17('0x25')](saveUpdates(_0x5af2b7[_0x9b17('0x4a')],null))[_0x9b17('0x25')](respondWithResult(_0x379197,null))[_0x9b17('0x48')](handleError(_0x379197,null));};exports[_0x9b17('0x4b')]=function(_0x41cb89,_0x2094af){return db[_0x9b17('0x2c')][_0x9b17('0x47')]({'where':{'id':_0x41cb89[_0x9b17('0x45')]['id']}})[_0x9b17('0x25')](handleEntityNotFound(_0x2094af,null))[_0x9b17('0x25')](removeEntity(_0x2094af,null))[_0x9b17('0x48')](handleError(_0x2094af,null));};
\ No newline at end of file
+var _0x0c58=['includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','send','map','AnalyticTreeReport','fieldName','type','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0xad8169,_0x565e9e){var _0x8f61e7=function(_0x5ac70e){while(--_0x5ac70e){_0xad8169['push'](_0xad8169['shift']());}};_0x8f61e7(++_0x565e9e);}(_0x0c58,0x9e));var _0x80c5=function(_0x376246,_0x305977){_0x376246=_0x376246-0x0;var _0x483010=_0x0c58[_0x376246];return _0x483010;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80c5('0x0'));var zipdir=require(_0x80c5('0x1'));var jsonpatch=require(_0x80c5('0x2'));var rp=require(_0x80c5('0x3'));var moment=require('moment');var BPromise=require(_0x80c5('0x4'));var Mustache=require(_0x80c5('0x5'));var util=require(_0x80c5('0x6'));var path=require(_0x80c5('0x7'));var sox=require(_0x80c5('0x8'));var csv=require('to-csv');var ejs=require(_0x80c5('0x9'));var fs=require('fs');var fs_extra=require(_0x80c5('0xa'));var _=require(_0x80c5('0xb'));var squel=require(_0x80c5('0xc'));var crypto=require(_0x80c5('0xd'));var jsforce=require(_0x80c5('0xe'));var deskjs=require(_0x80c5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x80c5('0x10'));var Papa=require(_0x80c5('0x11'));var Redis=require(_0x80c5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80c5('0x13'));var logger=require('../../config/logger')(_0x80c5('0x14'));var utils=require('../../config/utils');var config=require(_0x80c5('0x15'));var licenseUtil=require(_0x80c5('0x16'));var db=require(_0x80c5('0x17'))['db'];function respondWithStatusCode(_0x3aea1b,_0x57b744){_0x57b744=_0x57b744||0xcc;return function(_0x303cda){if(_0x303cda){return _0x3aea1b['sendStatus'](_0x57b744);}return _0x3aea1b[_0x80c5('0x18')](_0x57b744)['end']();};}function respondWithResult(_0x2dd32f,_0x302488){_0x302488=_0x302488||0xc8;return function(_0x3b38eb){if(_0x3b38eb){return _0x2dd32f[_0x80c5('0x18')](_0x302488)['json'](_0x3b38eb);}};}function respondWithFilteredResult(_0x34642e,_0x185014){return function(_0x325727){if(_0x325727){var _0x2775c8=typeof _0x185014[_0x80c5('0x19')]===_0x80c5('0x1a')&&typeof _0x185014['limit']===_0x80c5('0x1a');var _0x516331=_0x325727[_0x80c5('0x1b')];var _0x27839c=_0x2775c8?0x0:_0x185014[_0x80c5('0x19')];var _0x45c1aa=_0x2775c8?_0x325727['count']:_0x185014[_0x80c5('0x19')]+_0x185014[_0x80c5('0x1c')];var _0x5962df;if(_0x45c1aa>=_0x516331){_0x45c1aa=_0x516331;_0x5962df=0xc8;}else{_0x5962df=0xce;}_0x34642e[_0x80c5('0x18')](_0x5962df);return _0x34642e[_0x80c5('0x1d')](_0x80c5('0x1e'),_0x27839c+'-'+_0x45c1aa+'/'+_0x516331)['json'](_0x325727);}return null;};}function patchUpdates(_0x29d606){return function(_0x5b0caf){try{jsonpatch[_0x80c5('0x1f')](_0x5b0caf,_0x29d606,!![]);}catch(_0x2bfadc){return BPromise[_0x80c5('0x20')](_0x2bfadc);}return _0x5b0caf[_0x80c5('0x21')]();};}function saveUpdates(_0xc9c594,_0x5d3dab){return function(_0x4a4b68){if(_0x4a4b68){return _0x4a4b68[_0x80c5('0x22')](_0xc9c594)['then'](function(_0x35822d){return _0x35822d;});}return null;};}function removeEntity(_0x5b749d,_0x49004c){return function(_0x243ef2){if(_0x243ef2){return _0x243ef2[_0x80c5('0x23')]()[_0x80c5('0x24')](function(){_0x5b749d['status'](0xcc)[_0x80c5('0x25')]();});}};}function handleEntityNotFound(_0x4ca865,_0x53cfaf){return function(_0x1d24f9){if(!_0x1d24f9){_0x4ca865['sendStatus'](0x194);}return _0x1d24f9;};}function handleError(_0x341689,_0x1ec328){_0x1ec328=_0x1ec328||0x1f4;return function(_0x56034b){logger[_0x80c5('0x26')](_0x56034b['stack']);if(_0x56034b['name']){delete _0x56034b['name'];}_0x341689[_0x80c5('0x18')](_0x1ec328)[_0x80c5('0x27')](_0x56034b);};}exports['index']=function(_0x5d004d,_0x2cbd81){var _0x1b7890={},_0x4a26ae={},_0x4a7628={'count':0x0,'rows':[]};var _0x39d408=_[_0x80c5('0x28')](db[_0x80c5('0x29')]['rawAttributes'],function(_0x532b94){return{'name':_0x532b94[_0x80c5('0x2a')],'type':_0x532b94[_0x80c5('0x2b')][_0x80c5('0x2c')]};});_0x4a26ae['model']=_['map'](_0x39d408,_0x80c5('0x2d'));_0x4a26ae[_0x80c5('0x2e')]=_[_0x80c5('0x2f')](_0x5d004d[_0x80c5('0x2e')]);_0x4a26ae[_0x80c5('0x30')]=_['intersection'](_0x4a26ae[_0x80c5('0x31')],_0x4a26ae[_0x80c5('0x2e')]);_0x1b7890[_0x80c5('0x32')]=_[_0x80c5('0x33')](_0x4a26ae[_0x80c5('0x31')],qs[_0x80c5('0x34')](_0x5d004d['query'][_0x80c5('0x34')]));_0x1b7890[_0x80c5('0x32')]=_0x1b7890[_0x80c5('0x32')][_0x80c5('0x35')]?_0x1b7890[_0x80c5('0x32')]:_0x4a26ae['model'];if(!_0x5d004d[_0x80c5('0x2e')][_0x80c5('0x36')](_0x80c5('0x37'))){_0x1b7890[_0x80c5('0x1c')]=qs[_0x80c5('0x1c')](_0x5d004d[_0x80c5('0x2e')][_0x80c5('0x1c')]);_0x1b7890[_0x80c5('0x19')]=qs[_0x80c5('0x19')](_0x5d004d['query']['offset']);}_0x1b7890[_0x80c5('0x38')]=qs[_0x80c5('0x39')](_0x5d004d['query'][_0x80c5('0x39')]);_0x1b7890[_0x80c5('0x3a')]=qs['filters'](_[_0x80c5('0x3b')](_0x5d004d[_0x80c5('0x2e')],_0x4a26ae[_0x80c5('0x30')]),_0x39d408);if(_0x5d004d[_0x80c5('0x2e')][_0x80c5('0x3c')]){_0x1b7890[_0x80c5('0x3a')]=_[_0x80c5('0x3d')](_0x1b7890[_0x80c5('0x3a')],{'$or':_[_0x80c5('0x28')](_0x39d408,function(_0x141e56){if(_0x141e56[_0x80c5('0x2b')]!==_0x80c5('0x3e')){var _0x519413={};_0x519413[_0x141e56[_0x80c5('0x2d')]]={'$like':'%'+_0x5d004d[_0x80c5('0x2e')][_0x80c5('0x3c')]+'%'};return _0x519413;}})});}_0x1b7890=_[_0x80c5('0x3d')]({},_0x1b7890,_0x5d004d[_0x80c5('0x3f')]);var _0xee96b5={'where':_0x1b7890[_0x80c5('0x3a')]};return db[_0x80c5('0x29')][_0x80c5('0x1b')](_0xee96b5)['then'](function(_0x85bdc0){_0x4a7628['count']=_0x85bdc0;if(_0x5d004d['query'][_0x80c5('0x40')]){_0x1b7890[_0x80c5('0x41')]=[{'all':!![]}];}return db[_0x80c5('0x29')][_0x80c5('0x42')](_0x1b7890);})[_0x80c5('0x24')](function(_0x47867f){_0x4a7628['rows']=_0x47867f;return _0x4a7628;})[_0x80c5('0x24')](respondWithFilteredResult(_0x2cbd81,_0x1b7890))[_0x80c5('0x43')](handleError(_0x2cbd81,null));};exports[_0x80c5('0x44')]=function(_0x26fc8d,_0x13f35b){var _0x1edaf0={'raw':!![],'where':{'id':_0x26fc8d[_0x80c5('0x45')]['id']}},_0x4a9ccd={};_0x4a9ccd['model']=_[_0x80c5('0x2f')](db[_0x80c5('0x29')][_0x80c5('0x46')]);_0x4a9ccd[_0x80c5('0x2e')]=_[_0x80c5('0x2f')](_0x26fc8d[_0x80c5('0x2e')]);_0x4a9ccd[_0x80c5('0x30')]=_[_0x80c5('0x33')](_0x4a9ccd[_0x80c5('0x31')],_0x4a9ccd['query']);_0x1edaf0[_0x80c5('0x32')]=_['intersection'](_0x4a9ccd['model'],qs[_0x80c5('0x34')](_0x26fc8d['query'][_0x80c5('0x34')]));_0x1edaf0[_0x80c5('0x32')]=_0x1edaf0[_0x80c5('0x32')]['length']?_0x1edaf0[_0x80c5('0x32')]:_0x4a9ccd[_0x80c5('0x31')];if(_0x26fc8d[_0x80c5('0x2e')]['includeAll']){_0x1edaf0[_0x80c5('0x41')]=[{'all':!![]}];}_0x1edaf0=_[_0x80c5('0x3d')]({},_0x1edaf0,_0x26fc8d['options']);return db[_0x80c5('0x29')][_0x80c5('0x47')](_0x1edaf0)['then'](handleEntityNotFound(_0x13f35b,null))[_0x80c5('0x24')](respondWithResult(_0x13f35b,null))[_0x80c5('0x43')](handleError(_0x13f35b,null));};exports[_0x80c5('0x48')]=function(_0x4ad946,_0x1c1ed6){return db[_0x80c5('0x29')]['create'](_0x4ad946[_0x80c5('0x49')],{})[_0x80c5('0x24')](respondWithResult(_0x1c1ed6,0xc9))[_0x80c5('0x43')](handleError(_0x1c1ed6,null));};exports[_0x80c5('0x22')]=function(_0xbb3ab6,_0x38560c){if(_0xbb3ab6[_0x80c5('0x49')]['id']){delete _0xbb3ab6[_0x80c5('0x49')]['id'];}return db[_0x80c5('0x29')][_0x80c5('0x47')]({'where':{'id':_0xbb3ab6['params']['id']}})[_0x80c5('0x24')](handleEntityNotFound(_0x38560c,null))[_0x80c5('0x24')](saveUpdates(_0xbb3ab6['body'],null))[_0x80c5('0x24')](respondWithResult(_0x38560c,null))[_0x80c5('0x43')](handleError(_0x38560c,null));};exports[_0x80c5('0x23')]=function(_0x25d4b0,_0x2f7b90){return db['AnalyticTreeReport'][_0x80c5('0x47')]({'where':{'id':_0x25d4b0[_0x80c5('0x45')]['id']}})[_0x80c5('0x24')](handleEntityNotFound(_0x2f7b90,null))[_0x80c5('0x24')](removeEntity(_0x2f7b90,null))[_0x80c5('0x43')](handleError(_0x2f7b90,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index d66100b..02a7844 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 _0x7a02=['util','api','moment','bluebird','request-promise','path','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x7a02,0xef));var _0x27a0=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x7a02[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x27a0('0x0'));var util=require(_0x27a0('0x1'));var logger=require('../../config/logger')(_0x27a0('0x2'));var moment=require(_0x27a0('0x3'));var BPromise=require(_0x27a0('0x4'));var rp=require(_0x27a0('0x5'));var fs=require('fs');var path=require(_0x27a0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x27a0('0x7'));module[_0x27a0('0x8')]=function(_0x10cc65,_0x35cd59){return _0x10cc65[_0x27a0('0x9')](_0x27a0('0xa'),attributes,{'tableName':_0x27a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e8d=['./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','api','moment','request-promise','path','rimraf'];(function(_0x72063a,_0x1b012e){var _0x41f179=function(_0x135faf){while(--_0x135faf){_0x72063a['push'](_0x72063a['shift']());}};_0x41f179(++_0x1b012e);}(_0x7e8d,0x190));var _0xd7e8=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x7e8d[_0x136619];return _0x38c4a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd7e8('0x0'));var moment=require(_0xd7e8('0x1'));var BPromise=require('bluebird');var rp=require(_0xd7e8('0x2'));var fs=require('fs');var path=require(_0xd7e8('0x3'));var rimraf=require(_0xd7e8('0x4'));var config=require('../../config/environment');var attributes=require(_0xd7e8('0x5'));module['exports']=function(_0x48ce40,_0x2361ea){return _0x48ce40[_0xd7e8('0x6')](_0xd7e8('0x7'),attributes,{'tableName':_0xd7e8('0x8'),'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 0c4d12f..6dd4c86 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(_0x24a188,_0x4efd77){var _0x493a78=function(_0x7ac91){while(--_0x7ac91){_0x24a188['push'](_0x24a188['shift']());}};_0x493a78(++_0x4efd77);}(_0xadb5,0xad));var _0x5adb=function(_0x123039,_0x558a5e){_0x123039=_0x123039-0x0;var _0x8bba42=_0xadb5[_0x123039];return _0x8bba42;};'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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x326054,_0x4cb01c){var _0x4b3213=function(_0x170961){while(--_0x170961){_0x326054['push'](_0x326054['shift']());}};_0x4b3213(++_0x4cb01c);}(_0x5f2f,0x73));var _0xf5f2=function(_0xead4e,_0x4b7d06){_0xead4e=_0xead4e-0x0;var _0xa7f386=_0x5f2f[_0xead4e];return _0xa7f386;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 271064e..f08880a 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 _0x26f0=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0xa153e,_0x38ef1){var _0x5a15db=function(_0x2d6c22){while(--_0x2d6c22){_0xa153e['push'](_0xa153e['shift']());}};_0x5a15db(++_0x38ef1);}(_0x26f0,0x7c));var _0x026f=function(_0x530ec2,_0x2e4c48){_0x530ec2=_0x530ec2-0x0;var _0x5abf5e=_0x26f0[_0x530ec2];return _0x5abf5e;};'use strict';var multer=require(_0x026f('0x0'));var util=require(_0x026f('0x1'));var path=require('path');var timeout=require(_0x026f('0x2'));var express=require(_0x026f('0x3'));var router=express[_0x026f('0x4')]();var fs_extra=require(_0x026f('0x5'));var auth=require(_0x026f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x026f('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x026f('0x8')]('/',auth[_0x026f('0x9')](),controller[_0x026f('0xa')]);router[_0x026f('0x8')](_0x026f('0xb'),auth[_0x026f('0x9')](),controller[_0x026f('0xc')]);router[_0x026f('0xd')]('/',auth['isAuthenticated'](),controller[_0x026f('0xe')]);router[_0x026f('0xf')]('/:id',auth[_0x026f('0x9')](),controller[_0x026f('0x10')]);router[_0x026f('0x11')](_0x026f('0xb'),auth[_0x026f('0x9')](),controller['destroy']);module[_0x026f('0x12')]=router;
\ No newline at end of file
+var _0x7abc=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post'];(function(_0x55fa4b,_0x51bbfc){var _0x49b0cf=function(_0x4dff47){while(--_0x4dff47){_0x55fa4b['push'](_0x55fa4b['shift']());}};_0x49b0cf(++_0x51bbfc);}(_0x7abc,0x181));var _0xc7ab=function(_0x4c207b,_0x59f530){_0x4c207b=_0x4c207b-0x0;var _0x560c4f=_0x7abc[_0x4c207b];return _0x560c4f;};'use strict';var multer=require(_0xc7ab('0x0'));var util=require('util');var path=require(_0xc7ab('0x1'));var timeout=require(_0xc7ab('0x2'));var express=require(_0xc7ab('0x3'));var router=express[_0xc7ab('0x4')]();var fs_extra=require(_0xc7ab('0x5'));var auth=require(_0xc7ab('0x6'));var interaction=require(_0xc7ab('0x7'));var config=require(_0xc7ab('0x8'));var controller=require(_0xc7ab('0x9'));router[_0xc7ab('0xa')]('/',auth[_0xc7ab('0xb')](),controller[_0xc7ab('0xc')]);router[_0xc7ab('0xa')](_0xc7ab('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc7ab('0xe')]('/',auth[_0xc7ab('0xb')](),controller['create']);router[_0xc7ab('0xf')]('/:id',auth[_0xc7ab('0xb')](),controller[_0xc7ab('0x10')]);router[_0xc7ab('0x11')](_0xc7ab('0xd'),auth[_0xc7ab('0xb')](),controller[_0xc7ab('0x12')]);module[_0xc7ab('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 5bd8555..b906312 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 _0xe189=['sequelize','STRING'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xe189,0x194));var _0x9e18=function(_0x14f6d9,_0x4bd21c){_0x14f6d9=_0x14f6d9-0x0;var _0x11953e=_0xe189[_0x14f6d9];return _0x11953e;};'use strict';var Sequelize=require(_0x9e18('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x9e18('0x1')]},'type':{'type':Sequelize[_0x9e18('0x1')]}};
\ No newline at end of file
+var _0x5a8c=['sequelize','exports','STRING'];(function(_0x3e5b1e,_0x10a1fc){var _0x265956=function(_0x2c3a03){while(--_0x2c3a03){_0x3e5b1e['push'](_0x3e5b1e['shift']());}};_0x265956(++_0x10a1fc);}(_0x5a8c,0x1da));var _0xc5a8=function(_0xe27948,_0x5bfa16){_0xe27948=_0xe27948-0x0;var _0x44e57b=_0x5a8c[_0xe27948];return _0x44e57b;};'use strict';var Sequelize=require(_0xc5a8('0x0'));module[_0xc5a8('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc5a8('0x2')]},'type':{'type':Sequelize[_0xc5a8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index ccd1908..a3fdbb9 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 _0xcec8=['offset','count','set','apply','reject','save','update','then','destroy','error','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','show','find','params','length','options','omit','createdAt','body','catch','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x213706,_0x424157){var _0x1a7df5=function(_0x2b5293){while(--_0x2b5293){_0x213706['push'](_0x213706['shift']());}};_0x1a7df5(++_0x424157);}(_0xcec8,0x146));var _0x8cec=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xcec8[_0x4178af];return _0x20f4b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cec('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8cec('0x1'));var moment=require(_0x8cec('0x2'));var BPromise=require(_0x8cec('0x3'));var Mustache=require(_0x8cec('0x4'));var util=require(_0x8cec('0x5'));var path=require(_0x8cec('0x6'));var sox=require(_0x8cec('0x7'));var csv=require(_0x8cec('0x8'));var ejs=require(_0x8cec('0x9'));var fs=require('fs');var fs_extra=require(_0x8cec('0xa'));var _=require(_0x8cec('0xb'));var squel=require(_0x8cec('0xc'));var crypto=require('crypto');var jsforce=require(_0x8cec('0xd'));var deskjs=require(_0x8cec('0xe'));var toCsv=require(_0x8cec('0x8'));var querystring=require(_0x8cec('0xf'));var Papa=require(_0x8cec('0x10'));var Redis=require(_0x8cec('0x11'));var authService=require(_0x8cec('0x12'));var qs=require(_0x8cec('0x13'));var as=require(_0x8cec('0x14'));var hardwareService=require(_0x8cec('0x15'));var logger=require(_0x8cec('0x16'))(_0x8cec('0x17'));var utils=require(_0x8cec('0x18'));var config=require(_0x8cec('0x19'));var licenseUtil=require(_0x8cec('0x1a'));var db=require(_0x8cec('0x1b'))['db'];function respondWithStatusCode(_0x178399,_0x463bfa){_0x463bfa=_0x463bfa||0xcc;return function(_0x453626){if(_0x453626){return _0x178399[_0x8cec('0x1c')](_0x463bfa);}return _0x178399[_0x8cec('0x1d')](_0x463bfa)[_0x8cec('0x1e')]();};}function respondWithResult(_0x3f74dc,_0x45b2be){_0x45b2be=_0x45b2be||0xc8;return function(_0x1a240a){if(_0x1a240a){return _0x3f74dc[_0x8cec('0x1d')](_0x45b2be)[_0x8cec('0x1f')](_0x1a240a);}};}function respondWithFilteredResult(_0x4a78ab,_0x4bd371){return function(_0x54d4ca){if(_0x54d4ca){var _0x13ed67=typeof _0x4bd371['offset']===_0x8cec('0x20')&&typeof _0x4bd371[_0x8cec('0x21')]==='undefined';var _0x24e8cf=_0x54d4ca['count'];var _0x4ac9cc=_0x13ed67?0x0:_0x4bd371[_0x8cec('0x22')];var _0x117b7a=_0x13ed67?_0x54d4ca[_0x8cec('0x23')]:_0x4bd371['offset']+_0x4bd371[_0x8cec('0x21')];var _0x29e3e3;if(_0x117b7a>=_0x24e8cf){_0x117b7a=_0x24e8cf;_0x29e3e3=0xc8;}else{_0x29e3e3=0xce;}_0x4a78ab['status'](_0x29e3e3);return _0x4a78ab[_0x8cec('0x24')]('Content-Range',_0x4ac9cc+'-'+_0x117b7a+'/'+_0x24e8cf)[_0x8cec('0x1f')](_0x54d4ca);}return null;};}function patchUpdates(_0x582492){return function(_0x3dd7d5){try{jsonpatch[_0x8cec('0x25')](_0x3dd7d5,_0x582492,!![]);}catch(_0x3c2256){return BPromise[_0x8cec('0x26')](_0x3c2256);}return _0x3dd7d5[_0x8cec('0x27')]();};}function saveUpdates(_0x45aca6,_0x520e31){return function(_0x120e8f){if(_0x120e8f){return _0x120e8f[_0x8cec('0x28')](_0x45aca6)[_0x8cec('0x29')](function(_0x4da58e){return _0x4da58e;});}return null;};}function removeEntity(_0x2672ad,_0x470954){return function(_0x488965){if(_0x488965){return _0x488965[_0x8cec('0x2a')]()['then'](function(){_0x2672ad[_0x8cec('0x1d')](0xcc)[_0x8cec('0x1e')]();});}};}function handleEntityNotFound(_0x586f4f,_0x44a5de){return function(_0x2e7fb9){if(!_0x2e7fb9){_0x586f4f['sendStatus'](0x194);}return _0x2e7fb9;};}function handleError(_0x89147a,_0x2f0b77){_0x2f0b77=_0x2f0b77||0x1f4;return function(_0x269b08){logger[_0x8cec('0x2b')](_0x269b08['stack']);if(_0x269b08[_0x8cec('0x2c')]){delete _0x269b08[_0x8cec('0x2c')];}_0x89147a[_0x8cec('0x1d')](_0x2f0b77)['send'](_0x269b08);};}exports[_0x8cec('0x2d')]=function(_0x20ab95,_0x30b523){var _0x40a72d={},_0x2f72cc={},_0x22f175={'count':0x0,'rows':[]};var _0x557812=_[_0x8cec('0x2e')](db[_0x8cec('0x2f')][_0x8cec('0x30')],function(_0xa880c){return{'name':_0xa880c[_0x8cec('0x31')],'type':_0xa880c[_0x8cec('0x32')][_0x8cec('0x33')]};});_0x2f72cc[_0x8cec('0x34')]=_[_0x8cec('0x2e')](_0x557812,_0x8cec('0x2c'));_0x2f72cc[_0x8cec('0x35')]=_[_0x8cec('0x36')](_0x20ab95[_0x8cec('0x35')]);_0x2f72cc['filters']=_[_0x8cec('0x37')](_0x2f72cc[_0x8cec('0x34')],_0x2f72cc[_0x8cec('0x35')]);_0x40a72d[_0x8cec('0x38')]=_[_0x8cec('0x37')](_0x2f72cc[_0x8cec('0x34')],qs[_0x8cec('0x39')](_0x20ab95[_0x8cec('0x35')][_0x8cec('0x39')]));_0x40a72d[_0x8cec('0x38')]=_0x40a72d[_0x8cec('0x38')]['length']?_0x40a72d[_0x8cec('0x38')]:_0x2f72cc[_0x8cec('0x34')];if(!_0x20ab95[_0x8cec('0x35')][_0x8cec('0x3a')](_0x8cec('0x3b'))){_0x40a72d['limit']=qs['limit'](_0x20ab95['query'][_0x8cec('0x21')]);_0x40a72d[_0x8cec('0x22')]=qs[_0x8cec('0x22')](_0x20ab95[_0x8cec('0x35')][_0x8cec('0x22')]);}_0x40a72d['order']=qs[_0x8cec('0x3c')](_0x20ab95[_0x8cec('0x35')][_0x8cec('0x3c')]);_0x40a72d[_0x8cec('0x3d')]=qs[_0x8cec('0x3e')](_['pick'](_0x20ab95[_0x8cec('0x35')],_0x2f72cc['filters']),_0x557812);if(_0x20ab95[_0x8cec('0x35')][_0x8cec('0x3f')]){_0x40a72d[_0x8cec('0x3d')]=_[_0x8cec('0x40')](_0x40a72d[_0x8cec('0x3d')],{'$or':_[_0x8cec('0x2e')](_0x557812,function(_0x56877b){if(_0x56877b['type']!==_0x8cec('0x41')){var _0x125c92={};_0x125c92[_0x56877b[_0x8cec('0x2c')]]={'$like':'%'+_0x20ab95[_0x8cec('0x35')]['filter']+'%'};return _0x125c92;}})});}_0x40a72d=_[_0x8cec('0x40')]({},_0x40a72d,_0x20ab95['options']);var _0x5d8bda={'where':_0x40a72d['where']};return db['Attachment'][_0x8cec('0x23')](_0x5d8bda)[_0x8cec('0x29')](function(_0x4755e5){_0x22f175[_0x8cec('0x23')]=_0x4755e5;if(_0x20ab95[_0x8cec('0x35')][_0x8cec('0x42')]){_0x40a72d[_0x8cec('0x43')]=[{'all':!![]}];}return db['Attachment'][_0x8cec('0x44')](_0x40a72d);})[_0x8cec('0x29')](function(_0xc3b39){_0x22f175['rows']=_0xc3b39;return _0x22f175;})[_0x8cec('0x29')](respondWithFilteredResult(_0x30b523,_0x40a72d))['catch'](handleError(_0x30b523,null));};exports[_0x8cec('0x45')]=function(_0x564fd8,_0x3323c3){var _0x5b2080={'raw':!![],'where':{'id':_0x564fd8['params']['id']}},_0x4a3a3d={};_0x4a3a3d[_0x8cec('0x34')]=_['keys'](db[_0x8cec('0x2f')][_0x8cec('0x30')]);_0x4a3a3d[_0x8cec('0x35')]=_[_0x8cec('0x36')](_0x564fd8[_0x8cec('0x35')]);_0x4a3a3d[_0x8cec('0x3e')]=_['intersection'](_0x4a3a3d[_0x8cec('0x34')],_0x4a3a3d[_0x8cec('0x35')]);_0x5b2080['attributes']=_['intersection'](_0x4a3a3d[_0x8cec('0x34')],qs[_0x8cec('0x39')](_0x564fd8['query']['fields']));_0x5b2080[_0x8cec('0x38')]=_0x5b2080[_0x8cec('0x38')]['length']?_0x5b2080['attributes']:_0x4a3a3d['model'];if(_0x564fd8[_0x8cec('0x35')]['includeAll']){_0x5b2080['include']=[{'all':!![]}];}_0x5b2080=_[_0x8cec('0x40')]({},_0x5b2080,_0x564fd8['options']);return db[_0x8cec('0x2f')][_0x8cec('0x46')](_0x5b2080)[_0x8cec('0x29')](handleEntityNotFound(_0x3323c3,null))[_0x8cec('0x29')](respondWithResult(_0x3323c3,null))['catch'](handleError(_0x3323c3,null));};exports['clone']=function(_0x562495,_0x5b19fc){var _0x392832={'where':{'id':_0x562495[_0x8cec('0x47')]['id']}},_0x5eaf45={};_0x5eaf45[_0x8cec('0x34')]=_['keys'](db[_0x8cec('0x2f')][_0x8cec('0x30')]);_0x392832['attributes']=_[_0x8cec('0x37')](_0x5eaf45[_0x8cec('0x34')],qs[_0x8cec('0x39')](_0x562495[_0x8cec('0x35')]['fields']));_0x392832[_0x8cec('0x38')]=_0x392832[_0x8cec('0x38')][_0x8cec('0x48')]?_0x392832[_0x8cec('0x38')]:_0x5eaf45[_0x8cec('0x34')];if(_0x562495['query'][_0x8cec('0x42')]){_0x392832['include']=[{'all':!![]}];}_0x392832=_[_0x8cec('0x40')]({},_0x392832,_0x562495[_0x8cec('0x49')]);return db[_0x8cec('0x2f')]['find'](_0x392832)[_0x8cec('0x29')](handleEntityNotFound(_0x5b19fc,null))['then'](function(_0x38c9e8){if(_0x38c9e8){var _0x438eb3=_0x38c9e8['get']({'plain':!![]});_0x438eb3=qs[_0x8cec('0x4a')](_0x438eb3,['id',_0x8cec('0x4b'),'updatedAt']);_0x562495[_0x8cec('0x4c')]=_[_0x8cec('0x4a')](_0x562495[_0x8cec('0x4c')],['id',_0x8cec('0x4b'),'updatedAt']);return db[_0x8cec('0x2f')]['create'](_['merge'](_0x438eb3,_0x562495['body']),{'include':_0x562495[_0x8cec('0x35')][_0x8cec('0x42')]?[{'all':!![]}]:undefined});}})[_0x8cec('0x29')](respondWithResult(_0x5b19fc,0xc9))[_0x8cec('0x4d')](handleError(_0x5b19fc,null));};exports[_0x8cec('0x28')]=function(_0x4853ad,_0xdeb894){if(_0x4853ad[_0x8cec('0x4c')]['id']){delete _0x4853ad[_0x8cec('0x4c')]['id'];}return db[_0x8cec('0x2f')][_0x8cec('0x46')]({'where':{'id':_0x4853ad[_0x8cec('0x47')]['id']}})['then'](handleEntityNotFound(_0xdeb894,null))[_0x8cec('0x29')](saveUpdates(_0x4853ad[_0x8cec('0x4c')],null))[_0x8cec('0x29')](respondWithResult(_0xdeb894,null))[_0x8cec('0x4d')](handleError(_0xdeb894,null));};exports['destroy']=function(_0x261d91,_0x55807e){return db[_0x8cec('0x2f')][_0x8cec('0x46')]({'where':{'id':_0x261d91['params']['id']}})[_0x8cec('0x29')](handleEntityNotFound(_0x55807e,null))['then'](removeEntity(_0x55807e,null))[_0x8cec('0x4d')](handleError(_0x55807e,null));};exports[_0x8cec('0x4e')]=function(_0x3160d2,_0x206b9e,_0x5e3e34){_0x3160d2[_0x8cec('0x4c')][_0x8cec('0x2c')]=_0x3160d2[_0x8cec('0x4f')][_0x8cec('0x50')];_0x3160d2['body'][_0x8cec('0x51')]=_0x3160d2[_0x8cec('0x4f')][_0x8cec('0x52')];_0x3160d2[_0x8cec('0x4c')][_0x8cec('0x32')]=_0x3160d2[_0x8cec('0x4f')]['mimetype'];return db[_0x8cec('0x2f')][_0x8cec('0x4e')](_0x3160d2[_0x8cec('0x4c')])[_0x8cec('0x29')](respondWithResult(_0x206b9e,0xc9))[_0x8cec('0x4d')](handleError(_0x206b9e,null));};exports['download']=function(_0x45c515,_0x2f8b10,_0x42d7b8){return db['Attachment'][_0x8cec('0x53')]({'where':{'id':_0x45c515[_0x8cec('0x47')]['id']},'raw':!![]})[_0x8cec('0x29')](handleEntityNotFound(_0x2f8b10,null))[_0x8cec('0x29')](function(_0x44739f){if(_0x44739f){var _0x3946ee=_0x44739f[_0x8cec('0x54')]!==null;var _0x33b57a=path[_0x8cec('0x55')](config[_0x8cec('0x56')],_0x8cec('0x57'));if(_0x3946ee){_0x33b57a=path['join'](_0x33b57a,_0x8cec('0x58'));}var _0x37a30c=path[_0x8cec('0x55')](_0x33b57a,_0x44739f[_0x8cec('0x51')]);return _0x2f8b10[_0x8cec('0x59')](_0x37a30c);}})['catch'](handleError(_0x2f8b10,null));};
\ No newline at end of file
+var _0x7446=['Content-Range','apply','save','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','find','clone','params','get','omit','createdAt','updatedAt','body','create','update','file','basename','filename','download','ChatOfflineMessageId','join','root','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../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','count','limit'];(function(_0x326e5e,_0x491c33){var _0x4d0fde=function(_0xcbcedc){while(--_0xcbcedc){_0x326e5e['push'](_0x326e5e['shift']());}};_0x4d0fde(++_0x491c33);}(_0x7446,0x17f));var _0x6744=function(_0x351c0e,_0x172dd0){_0x351c0e=_0x351c0e-0x0;var _0x3ac7f1=_0x7446[_0x351c0e];return _0x3ac7f1;};'use strict';var emlformat=require(_0x6744('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6744('0x1'));var jsonpatch=require(_0x6744('0x2'));var rp=require('request-promise');var moment=require(_0x6744('0x3'));var BPromise=require(_0x6744('0x4'));var Mustache=require(_0x6744('0x5'));var util=require('util');var path=require(_0x6744('0x6'));var sox=require(_0x6744('0x7'));var csv=require('to-csv');var ejs=require(_0x6744('0x8'));var fs=require('fs');var fs_extra=require(_0x6744('0x9'));var _=require('lodash');var squel=require(_0x6744('0xa'));var crypto=require(_0x6744('0xb'));var jsforce=require(_0x6744('0xc'));var deskjs=require(_0x6744('0xd'));var toCsv=require(_0x6744('0xe'));var querystring=require(_0x6744('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6744('0x10'));var qs=require(_0x6744('0x11'));var as=require(_0x6744('0x12'));var hardwareService=require(_0x6744('0x13'));var logger=require('../../config/logger')(_0x6744('0x14'));var utils=require(_0x6744('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6744('0x16'));var db=require(_0x6744('0x17'))['db'];function respondWithStatusCode(_0x32597c,_0x416c62){_0x416c62=_0x416c62||0xcc;return function(_0x139222){if(_0x139222){return _0x32597c[_0x6744('0x18')](_0x416c62);}return _0x32597c[_0x6744('0x19')](_0x416c62)[_0x6744('0x1a')]();};}function respondWithResult(_0x132ed8,_0x25b30e){_0x25b30e=_0x25b30e||0xc8;return function(_0x5e6c22){if(_0x5e6c22){return _0x132ed8[_0x6744('0x19')](_0x25b30e)[_0x6744('0x1b')](_0x5e6c22);}};}function respondWithFilteredResult(_0x38707b,_0x4d7b8d){return function(_0x17a039){if(_0x17a039){var _0x1617fa=typeof _0x4d7b8d[_0x6744('0x1c')]==='undefined'&&typeof _0x4d7b8d['limit']===_0x6744('0x1d');var _0x5f334d=_0x17a039[_0x6744('0x1e')];var _0x50d329=_0x1617fa?0x0:_0x4d7b8d[_0x6744('0x1c')];var _0x3e5e63=_0x1617fa?_0x17a039[_0x6744('0x1e')]:_0x4d7b8d[_0x6744('0x1c')]+_0x4d7b8d[_0x6744('0x1f')];var _0xcf2ce6;if(_0x3e5e63>=_0x5f334d){_0x3e5e63=_0x5f334d;_0xcf2ce6=0xc8;}else{_0xcf2ce6=0xce;}_0x38707b['status'](_0xcf2ce6);return _0x38707b['set'](_0x6744('0x20'),_0x50d329+'-'+_0x3e5e63+'/'+_0x5f334d)['json'](_0x17a039);}return null;};}function patchUpdates(_0x34b8ef){return function(_0x4bfe68){try{jsonpatch[_0x6744('0x21')](_0x4bfe68,_0x34b8ef,!![]);}catch(_0x26f083){return BPromise['reject'](_0x26f083);}return _0x4bfe68[_0x6744('0x22')]();};}function saveUpdates(_0xa8bc4a,_0x32bfb1){return function(_0x121bb6){if(_0x121bb6){return _0x121bb6['update'](_0xa8bc4a)[_0x6744('0x23')](function(_0xc0763e){return _0xc0763e;});}return null;};}function removeEntity(_0x338a79,_0x144d15){return function(_0x3680ca){if(_0x3680ca){return _0x3680ca[_0x6744('0x24')]()[_0x6744('0x23')](function(){_0x338a79[_0x6744('0x19')](0xcc)[_0x6744('0x1a')]();});}};}function handleEntityNotFound(_0x7a5983,_0x538cd4){return function(_0x747afc){if(!_0x747afc){_0x7a5983[_0x6744('0x18')](0x194);}return _0x747afc;};}function handleError(_0x26f352,_0x835999){_0x835999=_0x835999||0x1f4;return function(_0x7e46b3){logger[_0x6744('0x25')](_0x7e46b3[_0x6744('0x26')]);if(_0x7e46b3[_0x6744('0x27')]){delete _0x7e46b3[_0x6744('0x27')];}_0x26f352[_0x6744('0x19')](_0x835999)['send'](_0x7e46b3);};}exports[_0x6744('0x28')]=function(_0x19c7d8,_0x4c6bf1){var _0x522800={},_0xa23129={},_0xb783db={'count':0x0,'rows':[]};var _0x1cef4a=_[_0x6744('0x29')](db[_0x6744('0x2a')][_0x6744('0x2b')],function(_0x427394){return{'name':_0x427394['fieldName'],'type':_0x427394[_0x6744('0x2c')][_0x6744('0x2d')]};});_0xa23129['model']=_[_0x6744('0x29')](_0x1cef4a,_0x6744('0x27'));_0xa23129[_0x6744('0x2e')]=_[_0x6744('0x2f')](_0x19c7d8[_0x6744('0x2e')]);_0xa23129[_0x6744('0x30')]=_[_0x6744('0x31')](_0xa23129[_0x6744('0x32')],_0xa23129['query']);_0x522800['attributes']=_[_0x6744('0x31')](_0xa23129[_0x6744('0x32')],qs[_0x6744('0x33')](_0x19c7d8[_0x6744('0x2e')][_0x6744('0x33')]));_0x522800['attributes']=_0x522800[_0x6744('0x34')][_0x6744('0x35')]?_0x522800[_0x6744('0x34')]:_0xa23129[_0x6744('0x32')];if(!_0x19c7d8[_0x6744('0x2e')]['hasOwnProperty'](_0x6744('0x36'))){_0x522800[_0x6744('0x1f')]=qs[_0x6744('0x1f')](_0x19c7d8[_0x6744('0x2e')][_0x6744('0x1f')]);_0x522800[_0x6744('0x1c')]=qs['offset'](_0x19c7d8[_0x6744('0x2e')]['offset']);}_0x522800[_0x6744('0x37')]=qs[_0x6744('0x38')](_0x19c7d8['query'][_0x6744('0x38')]);_0x522800['where']=qs['filters'](_['pick'](_0x19c7d8['query'],_0xa23129[_0x6744('0x30')]),_0x1cef4a);if(_0x19c7d8[_0x6744('0x2e')][_0x6744('0x39')]){_0x522800[_0x6744('0x3a')]=_['merge'](_0x522800['where'],{'$or':_[_0x6744('0x29')](_0x1cef4a,function(_0x286bf2){if(_0x286bf2[_0x6744('0x2c')]!==_0x6744('0x3b')){var _0x5788b4={};_0x5788b4[_0x286bf2[_0x6744('0x27')]]={'$like':'%'+_0x19c7d8[_0x6744('0x2e')]['filter']+'%'};return _0x5788b4;}})});}_0x522800=_[_0x6744('0x3c')]({},_0x522800,_0x19c7d8[_0x6744('0x3d')]);var _0x46faf2={'where':_0x522800[_0x6744('0x3a')]};return db[_0x6744('0x2a')][_0x6744('0x1e')](_0x46faf2)[_0x6744('0x23')](function(_0x1aff13){_0xb783db[_0x6744('0x1e')]=_0x1aff13;if(_0x19c7d8[_0x6744('0x2e')][_0x6744('0x3e')]){_0x522800[_0x6744('0x3f')]=[{'all':!![]}];}return db[_0x6744('0x2a')][_0x6744('0x40')](_0x522800);})[_0x6744('0x23')](function(_0x1a434a){_0xb783db['rows']=_0x1a434a;return _0xb783db;})[_0x6744('0x23')](respondWithFilteredResult(_0x4c6bf1,_0x522800))[_0x6744('0x41')](handleError(_0x4c6bf1,null));};exports['show']=function(_0x2357a8,_0x288db7){var _0x1d3282={'raw':!![],'where':{'id':_0x2357a8['params']['id']}},_0x19c8e2={};_0x19c8e2['model']=_['keys'](db['Attachment'][_0x6744('0x2b')]);_0x19c8e2['query']=_[_0x6744('0x2f')](_0x2357a8[_0x6744('0x2e')]);_0x19c8e2[_0x6744('0x30')]=_[_0x6744('0x31')](_0x19c8e2['model'],_0x19c8e2[_0x6744('0x2e')]);_0x1d3282[_0x6744('0x34')]=_[_0x6744('0x31')](_0x19c8e2[_0x6744('0x32')],qs[_0x6744('0x33')](_0x2357a8[_0x6744('0x2e')][_0x6744('0x33')]));_0x1d3282['attributes']=_0x1d3282['attributes'][_0x6744('0x35')]?_0x1d3282['attributes']:_0x19c8e2['model'];if(_0x2357a8[_0x6744('0x2e')]['includeAll']){_0x1d3282[_0x6744('0x3f')]=[{'all':!![]}];}_0x1d3282=_['merge']({},_0x1d3282,_0x2357a8[_0x6744('0x3d')]);return db['Attachment'][_0x6744('0x42')](_0x1d3282)['then'](handleEntityNotFound(_0x288db7,null))[_0x6744('0x23')](respondWithResult(_0x288db7,null))[_0x6744('0x41')](handleError(_0x288db7,null));};exports[_0x6744('0x43')]=function(_0x5e1991,_0x2e9954){var _0x1c349f={'where':{'id':_0x5e1991[_0x6744('0x44')]['id']}},_0x30cd47={};_0x30cd47[_0x6744('0x32')]=_[_0x6744('0x2f')](db[_0x6744('0x2a')][_0x6744('0x2b')]);_0x1c349f[_0x6744('0x34')]=_[_0x6744('0x31')](_0x30cd47[_0x6744('0x32')],qs[_0x6744('0x33')](_0x5e1991[_0x6744('0x2e')][_0x6744('0x33')]));_0x1c349f[_0x6744('0x34')]=_0x1c349f['attributes'][_0x6744('0x35')]?_0x1c349f[_0x6744('0x34')]:_0x30cd47[_0x6744('0x32')];if(_0x5e1991['query']['includeAll']){_0x1c349f[_0x6744('0x3f')]=[{'all':!![]}];}_0x1c349f=_['merge']({},_0x1c349f,_0x5e1991[_0x6744('0x3d')]);return db[_0x6744('0x2a')][_0x6744('0x42')](_0x1c349f)[_0x6744('0x23')](handleEntityNotFound(_0x2e9954,null))[_0x6744('0x23')](function(_0x406dc6){if(_0x406dc6){var _0x2a0789=_0x406dc6[_0x6744('0x45')]({'plain':!![]});_0x2a0789=qs[_0x6744('0x46')](_0x2a0789,['id',_0x6744('0x47'),_0x6744('0x48')]);_0x5e1991[_0x6744('0x49')]=_['omit'](_0x5e1991[_0x6744('0x49')],['id',_0x6744('0x47'),_0x6744('0x48')]);return db[_0x6744('0x2a')][_0x6744('0x4a')](_[_0x6744('0x3c')](_0x2a0789,_0x5e1991[_0x6744('0x49')]),{'include':_0x5e1991['query'][_0x6744('0x3e')]?[{'all':!![]}]:undefined});}})[_0x6744('0x23')](respondWithResult(_0x2e9954,0xc9))['catch'](handleError(_0x2e9954,null));};exports[_0x6744('0x4b')]=function(_0x8e8a74,_0x40fb2e){if(_0x8e8a74[_0x6744('0x49')]['id']){delete _0x8e8a74[_0x6744('0x49')]['id'];}return db[_0x6744('0x2a')][_0x6744('0x42')]({'where':{'id':_0x8e8a74['params']['id']}})[_0x6744('0x23')](handleEntityNotFound(_0x40fb2e,null))[_0x6744('0x23')](saveUpdates(_0x8e8a74[_0x6744('0x49')],null))['then'](respondWithResult(_0x40fb2e,null))[_0x6744('0x41')](handleError(_0x40fb2e,null));};exports[_0x6744('0x24')]=function(_0x4354d5,_0x2df817){return db['Attachment'][_0x6744('0x42')]({'where':{'id':_0x4354d5[_0x6744('0x44')]['id']}})[_0x6744('0x23')](handleEntityNotFound(_0x2df817,null))[_0x6744('0x23')](removeEntity(_0x2df817,null))[_0x6744('0x41')](handleError(_0x2df817,null));};exports['create']=function(_0xe1c2e4,_0x452509,_0xddc70c){_0xe1c2e4[_0x6744('0x49')][_0x6744('0x27')]=_0xe1c2e4[_0x6744('0x4c')]['originalname'];_0xe1c2e4['body'][_0x6744('0x4d')]=_0xe1c2e4[_0x6744('0x4c')][_0x6744('0x4e')];_0xe1c2e4[_0x6744('0x49')][_0x6744('0x2c')]=_0xe1c2e4[_0x6744('0x4c')]['mimetype'];return db[_0x6744('0x2a')]['create'](_0xe1c2e4[_0x6744('0x49')])[_0x6744('0x23')](respondWithResult(_0x452509,0xc9))[_0x6744('0x41')](handleError(_0x452509,null));};exports[_0x6744('0x4f')]=function(_0x5f2124,_0x2af54b,_0x408cca){return db[_0x6744('0x2a')]['findOne']({'where':{'id':_0x5f2124[_0x6744('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2af54b,null))[_0x6744('0x23')](function(_0x31dfba){if(_0x31dfba){var _0x5331a6=_0x31dfba[_0x6744('0x50')]!==null;var _0x2df9ab=path[_0x6744('0x51')](config[_0x6744('0x52')],'server/files/attachments/');if(_0x5331a6){_0x2df9ab=path[_0x6744('0x51')](_0x2df9ab,'offline-chat/');}var _0x1f5f39=path['join'](_0x2df9ab,_0x31dfba['basename']);return _0x2af54b[_0x6744('0x4f')](_0x1f5f39);}})[_0x6744('0x41')](handleError(_0x2af54b,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 18aeacd..e6fc8c7 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 _0xe22d=['moment','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe22d,0x114));var _0xde22=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe22d[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xde22('0x0'));var util=require(_0xde22('0x1'));var logger=require(_0xde22('0x2'))(_0xde22('0x3'));var moment=require(_0xde22('0x4'));var BPromise=require(_0xde22('0x5'));var rp=require(_0xde22('0x6'));var fs=require('fs');var path=require(_0xde22('0x7'));var rimraf=require(_0xde22('0x8'));var config=require('../../config/environment');var attributes=require(_0xde22('0x9'));module[_0xde22('0xa')]=function(_0x23e719,_0x302d28){return _0x23e719[_0xde22('0xb')](_0xde22('0xc'),attributes,{'tableName':_0xde22('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6982=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','util','../../config/logger'];(function(_0x33d97a,_0x2b0786){var _0x4580b7=function(_0xb0b9d4){while(--_0xb0b9d4){_0x33d97a['push'](_0x33d97a['shift']());}};_0x4580b7(++_0x2b0786);}(_0x6982,0x15d));var _0x2698=function(_0x5a8d19,_0x21a494){_0x5a8d19=_0x5a8d19-0x0;var _0x23c925=_0x6982[_0x5a8d19];return _0x23c925;};'use strict';var _=require('lodash');var util=require(_0x2698('0x0'));var logger=require(_0x2698('0x1'))(_0x2698('0x2'));var moment=require(_0x2698('0x3'));var BPromise=require(_0x2698('0x4'));var rp=require(_0x2698('0x5'));var fs=require('fs');var path=require(_0x2698('0x6'));var rimraf=require(_0x2698('0x7'));var config=require(_0x2698('0x8'));var attributes=require(_0x2698('0x9'));module[_0x2698('0xa')]=function(_0x52346a,_0x446e5b){return _0x52346a['define'](_0x2698('0xb'),attributes,{'tableName':_0x2698('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index c0f2fd8..3181132 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 _0xf72b=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateAttachment','Attachment','create','body','options','raw','debug','catch','lodash','moment','randomstring'];(function(_0x5ca353,_0x21eb37){var _0x4f2fe5=function(_0x14cd1b){while(--_0x14cd1b){_0x5ca353['push'](_0x5ca353['shift']());}};_0x4f2fe5(++_0x21eb37);}(_0xf72b,0x1d9));var _0xbf72=function(_0x4b0ba0,_0x56c36e){_0x4b0ba0=_0x4b0ba0-0x0;var _0x5386fd=_0xf72b[_0x4b0ba0];return _0x5386fd;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});}exports[_0xbf72('0x14')]=function(_0x27dadc){var _0x5b5fc9=this;return new Promise(function(_0x51d4c9,_0x1b8d73){return db[_0xbf72('0x15')][_0xbf72('0x16')](_0x27dadc[_0xbf72('0x17')],{'raw':_0x27dadc[_0xbf72('0x18')]?_0x27dadc[_0xbf72('0x18')][_0xbf72('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2aecae){logger[_0xbf72('0x12')](_0xbf72('0x14'),_0x27dadc);logger[_0xbf72('0x1a')](_0xbf72('0x14'),_0x27dadc,JSON['stringify'](_0x2aecae));_0x51d4c9(_0x2aecae);})[_0xbf72('0x1b')](function(_0x1de926){logger['error'](_0xbf72('0x14'),_0x1de926[_0xbf72('0x11')],_0x27dadc);_0x1b8d73(_0x5b5fc9[_0xbf72('0xf')](0x1f4,_0x1de926['message']));});});};
\ No newline at end of file
+var _0xb0d9=['Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateAttachment','Attachment','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','info'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x347528,_0x19e795){_0x347528=_0x347528-0x0;var _0x481de7=_0xb0d9[_0x347528];return _0x481de7;};'use strict';var _=require(_0x9b0d('0x0'));var util=require(_0x9b0d('0x1'));var moment=require(_0x9b0d('0x2'));var BPromise=require(_0x9b0d('0x3'));var rs=require(_0x9b0d('0x4'));var fs=require('fs');var Redis=require(_0x9b0d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b0d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9b0d('0x7'));var client=jayson[_0x9b0d('0x8')][_0x9b0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x438e0a,_0x2c519d,_0x45c371){return new BPromise(function(_0x32ee67,_0x30cd11){return client[_0x9b0d('0xa')](_0x438e0a,_0x45c371)['then'](function(_0x479a06){logger[_0x9b0d('0xb')](_0x9b0d('0xc'),_0x2c519d,'request\x20sent');logger[_0x9b0d('0xd')](_0x9b0d('0xe'),_0x2c519d,'request\x20sent',JSON[_0x9b0d('0xf')](_0x479a06));if(_0x479a06[_0x9b0d('0x10')]){if(_0x479a06['error'][_0x9b0d('0x11')]===0x1f4){logger['error'](_0x9b0d('0xc'),_0x2c519d,_0x479a06[_0x9b0d('0x10')][_0x9b0d('0x12')]);return _0x30cd11(_0x479a06['error'][_0x9b0d('0x12')]);}logger['error'](_0x9b0d('0xc'),_0x2c519d,_0x479a06[_0x9b0d('0x10')]['message']);return _0x32ee67(_0x479a06[_0x9b0d('0x10')]['message']);}else{logger[_0x9b0d('0xb')](_0x9b0d('0xc'),_0x2c519d,_0x9b0d('0x13'));_0x32ee67(_0x479a06['result'][_0x9b0d('0x12')]);}})[_0x9b0d('0x14')](function(_0x49db91){logger['error']('Attachment,\x20%s,\x20%s',_0x2c519d,_0x49db91);_0x30cd11(_0x49db91);});});}exports[_0x9b0d('0x15')]=function(_0xd8bb89){var _0x41a5e2=this;return new Promise(function(_0x27ee1a,_0x54ccf1){return db[_0x9b0d('0x16')][_0x9b0d('0x17')](_0xd8bb89[_0x9b0d('0x18')],{'raw':_0xd8bb89[_0x9b0d('0x19')]?_0xd8bb89['options'][_0x9b0d('0x1a')]===undefined?!![]:![]:!![]})[_0x9b0d('0x1b')](function(_0xe5fb08){logger[_0x9b0d('0xb')](_0x9b0d('0x15'),_0xd8bb89);logger['debug'](_0x9b0d('0x15'),_0xd8bb89,JSON[_0x9b0d('0xf')](_0xe5fb08));_0x27ee1a(_0xe5fb08);})[_0x9b0d('0x14')](function(_0x14c01b){logger[_0x9b0d('0x10')](_0x9b0d('0x15'),_0x14c01b[_0x9b0d('0x12')],_0xd8bb89);_0x54ccf1(_0x41a5e2[_0x9b0d('0x10')](0x1f4,_0x14c01b[_0x9b0d('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 9479a6a..199e745 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x1bcc37,_0x2a8c09){_0x1bcc37=_0x1bcc37-0x0;var _0x11a909=_0xdb28[_0x1bcc37];return _0x11a909;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index aeb9210..a78a39e 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 _0x621c=['minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','/login','profile','callback','google','use','clientID','secret','callbackURL','Setting','blockDuration','then','User','find','map','emails','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x621c,0xae));var _0xc621=function(_0x4342a4,_0x5c38d7){_0x4342a4=_0x4342a4-0x0;var _0x48fce6=_0x621c[_0x4342a4];return _0x48fce6;};'use strict';var _=require(_0xc621('0x0'));var passport=require(_0xc621('0x1'));var GoogleStrategy=require(_0xc621('0x2'))[_0xc621('0x3')];var moment=require('moment');var db=require(_0xc621('0x4'))['db'];var config=require(_0xc621('0x5'));var signToken=require('../../components/auth/service')[_0xc621('0x6')];var utils=require(_0xc621('0x7'));exports['login']=passport[_0xc621('0x8')]('google',{'failureRedirect':_0xc621('0x9'),'scope':[_0xc621('0xa'),'email'],'session':![]});exports[_0xc621('0xb')]=passport[_0xc621('0x8')](_0xc621('0xc'),{'failureRedirect':_0xc621('0x9'),'session':![]});passport[_0xc621('0xd')](new GoogleStrategy({'clientID':config[_0xc621('0xc')]?config[_0xc621('0xc')][_0xc621('0xe')]:'id','clientSecret':config['google']?config[_0xc621('0xc')]['clientSecret']:_0xc621('0xf'),'callbackURL':config[_0xc621('0xc')]?config['google'][_0xc621('0x10')]:''},function(_0x236a80,_0x1c3ee8,_0x21ebed,_0xd213cc){var _0xf4744a,_0x21ec5f;return db[_0xc621('0x11')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc621('0x12')],'raw':!![]})[_0xc621('0x13')](function(_0xc5115f){_0xf4744a=_0xc5115f;return db[_0xc621('0x14')][_0xc621('0x15')]({'where':{'email':_[_0xc621('0x16')](_0x21ebed[_0xc621('0x17')],'value'),'role':{'$or':[_0xc621('0x18'),'user',_0xc621('0x19')]}}});})[_0xc621('0x13')](function(_0x18e92c){_0x21ec5f=_0x18e92c;if(_0x21ec5f){if(_0x21ec5f['disabled']){return _0xd213cc(_0xc621('0x1a'));}else if(_0xf4744a[_0xc621('0x12')]>0x0){if(_0x21ec5f[_0xc621('0x1b')]){if(moment(_0x21ec5f[_0xc621('0x1c')])[_0xc621('0x1d')](_0xf4744a[_0xc621('0x12')],_0xc621('0x1e'))>moment()){return _0xd213cc(_0xc621('0x1a'));}else{return utils[_0xc621('0x1f')](_0x21ec5f,0x0,![],null)['then'](function(){return utils[_0xc621('0x20')](_0x21ec5f);})['then'](function(){return _0xd213cc(null,_0x21ec5f);});}}else{return utils[_0xc621('0x20')](_0x21ec5f)[_0xc621('0x13')](function(){return _0xd213cc(null,_0x21ec5f);});}}else{return utils[_0xc621('0x20')](_0x21ec5f)[_0xc621('0x13')](function(){return _0xd213cc(null,_0x21ec5f);});}}return _0xd213cc(_0xc621('0x1a'));})[_0xc621('0x21')](function(_0x34c24f){_0xd213cc(_0x34c24f);});}));
\ No newline at end of file
+var _0x53d0=['../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','profile','email','callback','/login','use','clientID','clientSecret','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','passport','passport-google-oauth20','moment','../../mysqldb'];(function(_0x130209,_0x2cc129){var _0x155fb7=function(_0x891a60){while(--_0x891a60){_0x130209['push'](_0x130209['shift']());}};_0x155fb7(++_0x2cc129);}(_0x53d0,0x8c));var _0x053d=function(_0x114c76,_0xc937df){_0x114c76=_0x114c76-0x0;var _0xb5babf=_0x53d0[_0x114c76];return _0xb5babf;};'use strict';var _=require('lodash');var passport=require(_0x053d('0x0'));var GoogleStrategy=require(_0x053d('0x1'))['Strategy'];var moment=require(_0x053d('0x2'));var db=require(_0x053d('0x3'))['db'];var config=require(_0x053d('0x4'));var signToken=require(_0x053d('0x5'))[_0x053d('0x6')];var utils=require(_0x053d('0x7'));exports[_0x053d('0x8')]=passport[_0x053d('0x9')](_0x053d('0xa'),{'failureRedirect':'/login','scope':[_0x053d('0xb'),_0x053d('0xc')],'session':![]});exports[_0x053d('0xd')]=passport['authenticate'](_0x053d('0xa'),{'failureRedirect':_0x053d('0xe'),'session':![]});passport[_0x053d('0xf')](new GoogleStrategy({'clientID':config['google']?config['google'][_0x053d('0x10')]:'id','clientSecret':config[_0x053d('0xa')]?config[_0x053d('0xa')][_0x053d('0x11')]:_0x053d('0x12'),'callbackURL':config[_0x053d('0xa')]?config[_0x053d('0xa')]['callbackURL']:''},function(_0x372a67,_0x1832bf,_0x44a7f9,_0x1768a3){var _0x2a4724,_0x21492e;return db[_0x053d('0x13')][_0x053d('0x14')]({'where':{'id':0x1},'attributes':[_0x053d('0x15'),_0x053d('0x16')],'raw':!![]})[_0x053d('0x17')](function(_0x37ef8b){_0x2a4724=_0x37ef8b;return db['User']['find']({'where':{'email':_[_0x053d('0x18')](_0x44a7f9[_0x053d('0x19')],'value'),'role':{'$or':[_0x053d('0x1a'),_0x053d('0x1b'),_0x053d('0x1c')]}}});})[_0x053d('0x17')](function(_0x22103b){_0x21492e=_0x22103b;if(_0x21492e){if(_0x21492e[_0x053d('0x1d')]){return _0x1768a3(_0x053d('0x1e'));}else if(_0x2a4724[_0x053d('0x16')]>0x0){if(_0x21492e[_0x053d('0x1f')]){if(moment(_0x21492e[_0x053d('0x20')])[_0x053d('0x21')](_0x2a4724['blockDuration'],_0x053d('0x22'))>moment()){return _0x1768a3(_0x053d('0x1e'));}else{return utils['clearBlockUser'](_0x21492e,0x0,![],null)[_0x053d('0x17')](function(){return utils[_0x053d('0x23')](_0x21492e);})[_0x053d('0x17')](function(){return _0x1768a3(null,_0x21492e);});}}else{return utils[_0x053d('0x23')](_0x21492e)['then'](function(){return _0x1768a3(null,_0x21492e);});}}else{return utils[_0x053d('0x23')](_0x21492e)[_0x053d('0x17')](function(){return _0x1768a3(null,_0x21492e);});}}return _0x1768a3(_0x053d('0x1e'));})['catch'](function(_0x2f2ff2){_0x1768a3(_0x2f2ff2);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 0609bb1..fb92233 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 _0x160c=['setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login'];(function(_0x202cb2,_0x3a7144){var _0x5b9442=function(_0x418c03){while(--_0x418c03){_0x202cb2['push'](_0x202cb2['shift']());}};_0x5b9442(++_0x3a7144);}(_0x160c,0x122));var _0xc160=function(_0x393fac,_0xbf712a){_0x393fac=_0x393fac-0x0;var _0x29c3a6=_0x160c[_0x393fac];return _0x29c3a6;};'use strict';var express=require(_0xc160('0x0'));var passport=require(_0xc160('0x1'));var router=express[_0xc160('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xc160('0x3'));var authService=require(_0xc160('0x4'));router[_0xc160('0x5')]('/',controller['login']);router[_0xc160('0x5')](_0xc160('0x6'),controller[_0xc160('0x7')],authService[_0xc160('0x8')],userController[_0xc160('0x9')],authService[_0xc160('0xa')]);module[_0xc160('0xb')]=router;
\ No newline at end of file
+var _0xea52=['isMiddleware','setTokenCookie','exports','passport','Router','login','get','/callback','callback'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea52,0x162));var _0x2ea5=function(_0x4007b1,_0x206901){_0x4007b1=_0x4007b1-0x0;var _0x108d6c=_0xea52[_0x4007b1];return _0x108d6c;};'use strict';var express=require('express');var passport=require(_0x2ea5('0x0'));var router=express[_0x2ea5('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller[_0x2ea5('0x2')]);router[_0x2ea5('0x3')](_0x2ea5('0x4'),controller[_0x2ea5('0x5')],authService[_0x2ea5('0x6')],userController['login'],authService[_0x2ea5('0x7')]);module[_0x2ea5('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 8434894..86ba300 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 _0xa0b2=['catch','MailAccount','email','MailServerOut','Smtp','service','host','port','secure','authentication','pass','merge','\x22%s\x22\x20<%s>','user','request','SendMail','error','format','message','stringify','status','login','authenticate','local','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','Reset\x20Email\x20sent!','reset','User','find','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa0b2,0x18c));var _0x2a0b=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0xa0b2[_0x33ebf5];return _0x66957b;};'use strict';var util=require(_0x2a0b('0x0'));var passport=require(_0x2a0b('0x1'));var LocalStrategy=require(_0x2a0b('0x2'))[_0x2a0b('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x2a0b('0x4'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x2a0b('0x5'));var utils=require(_0x2a0b('0x6'));var client=jayson[_0x2a0b('0x7')][_0x2a0b('0x8')]({'port':0x232b});function localAuthenticate(_0x1e570a,_0x5ef522,_0x23473f,_0x448b1d){var _0x60bfb3,_0x46b888;return db[_0x2a0b('0x9')][_0x2a0b('0xa')]({'where':{'id':0x1},'attributes':[_0x2a0b('0xb'),_0x2a0b('0xc')],'raw':!![]})[_0x2a0b('0xd')](function(_0x3937fd){_0x60bfb3=_0x3937fd;return _0x1e570a[_0x2a0b('0xa')]({'attributes':['id',_0x2a0b('0xe'),_0x2a0b('0xf'),_0x2a0b('0x10'),_0x2a0b('0x11'),_0x2a0b('0x12'),_0x2a0b('0x13'),_0x2a0b('0x14'),_0x2a0b('0x15')],'where':{'name':_0x5ef522,'role':{'$or':[_0x2a0b('0x16'),'user',_0x2a0b('0x17')]}}});})[_0x2a0b('0xd')](function(_0x34dfb9){if(!_0x34dfb9||_0x34dfb9&&_0x34dfb9[_0x2a0b('0xe')]!==_0x5ef522){throw new Error(_0x2a0b('0x18'));}else{_0x46b888=_0x34dfb9;return _0x46b888;}})[_0x2a0b('0xd')](function(){_0x46b888['authenticate'](_0x23473f,function(_0x16ce27,_0x1abf42){var _0x4d0a11=_0x46b888[_0x2a0b('0x15')]+0x1;if(_0x16ce27){return _0x448b1d(_0x16ce27);}else if(!_0x1abf42){if(_0x46b888[_0x2a0b('0x12')]){return _0x448b1d(null,![],{'message':_0x2a0b('0x18')});}else if(_0x60bfb3[_0x2a0b('0xb')]>0x0){if(_0x46b888[_0x2a0b('0x13')]){if(_0x60bfb3[_0x2a0b('0xc')]>0x0){if(moment(_0x46b888['blockedAt'])[_0x2a0b('0x19')](_0x60bfb3[_0x2a0b('0xc')],'minutes')>moment()){return _0x448b1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x46b888,_0x4d0a11,![],null)['then'](function(){return _0x448b1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x448b1d(null,![],{'message':_0x2a0b('0x18')});}}else{if(_0x4d0a11>=_0x60bfb3[_0x2a0b('0xb')]){return utils[_0x2a0b('0x1a')](_0x46b888,0x0,!![],moment())[_0x2a0b('0xd')](function(){return _0x448b1d(null,![],{'message':_0x2a0b('0x18')});});}else{return utils[_0x2a0b('0x1a')](_0x46b888,_0x4d0a11,![],null)['then'](function(){return _0x448b1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x448b1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x46b888[_0x2a0b('0x12')]){return _0x448b1d(null,![],{'message':_0x2a0b('0x18')});}else if(_0x60bfb3[_0x2a0b('0xb')]>0x0){if(_0x46b888[_0x2a0b('0x13')]){if(_0x60bfb3[_0x2a0b('0xc')]>0x0){if(moment(_0x46b888['blockedAt'])[_0x2a0b('0x19')](_0x60bfb3[_0x2a0b('0xc')],_0x2a0b('0x1b'))>moment()){return _0x448b1d(null,![],{'message':_0x2a0b('0x18')});}else{return utils['clearBlockUser'](_0x46b888,0x0,![],null)[_0x2a0b('0xd')](function(){return utils[_0x2a0b('0x1c')](_0x46b888);})[_0x2a0b('0xd')](function(){return _0x448b1d(null,_0x46b888);});}}else{return _0x448b1d(null,![],{'message':_0x2a0b('0x18')});}}else{return utils[_0x2a0b('0x1a')](_0x46b888,0x0,![],null)['then'](function(){return utils['getLicense'](_0x46b888);})['then'](function(){return _0x448b1d(null,_0x46b888);})[_0x2a0b('0x1d')](function(_0x1c5911){return _0x448b1d(null,![],_0x1c5911);});}}else{if(_0x46b888['blocked']){return _0x448b1d(null,![],{'message':_0x2a0b('0x18')});}else{return utils[_0x2a0b('0x1c')](_0x46b888)[_0x2a0b('0xd')](function(){return _0x448b1d(null,_0x46b888);});}}}});})[_0x2a0b('0x1d')](function(_0x5e55cd){return _0x448b1d(null,![],_0x5e55cd);});}function sendServiceMail(_0xa7d4f6){return db[_0x2a0b('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0x2a0b('0xe'),_0x2a0b('0x1f')],'include':[{'model':db[_0x2a0b('0x20')],'as':_0x2a0b('0x21')}]})[_0x2a0b('0xd')](function(_0x3868ef){if(!_0x3868ef){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x2d445a={'tls':{'rejectUnauthorized':![]}};if(_0x3868ef[_0x2a0b('0x21')][_0x2a0b('0x22')]){_0x2d445a['service']=_0x3868ef['Smtp']['service'];}else{_0x2d445a[_0x2a0b('0x23')]=_0x3868ef[_0x2a0b('0x21')][_0x2a0b('0x23')];_0x2d445a[_0x2a0b('0x24')]=_0x3868ef[_0x2a0b('0x21')][_0x2a0b('0x24')];_0x2d445a[_0x2a0b('0x25')]=_0x3868ef['Smtp'][_0x2a0b('0x25')];}if(_0x3868ef['Smtp'][_0x2a0b('0x26')]){_0x2d445a['auth']={'user':_0x3868ef[_0x2a0b('0x21')]['user'],'pass':_0x3868ef[_0x2a0b('0x21')][_0x2a0b('0x27')]};}var _0x32092e={'account':_0x2d445a,'message':_[_0x2a0b('0x28')]({'from':util['format'](_0x2a0b('0x29'),_0x3868ef[_0x2a0b('0xe')],_0x3868ef[_0x2a0b('0x1f')]||_0x3868ef[_0x2a0b('0x21')][_0x2a0b('0x2a')])},_0xa7d4f6)};return client[_0x2a0b('0x2b')](_0x2a0b('0x2c'),_0x32092e);})[_0x2a0b('0xd')](function(_0x3d95f5){if(_0x3d95f5[_0x2a0b('0x2d')]){throw new Error(util[_0x2a0b('0x2e')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3d95f5[_0x2a0b('0x2d')][_0x2a0b('0x2f')]||JSON[_0x2a0b('0x30')](_0x3d95f5['error'])));}return!![];});}function handleError(_0x2b1111,_0x5eaf23,_0x230adb){return _0x2b1111[_0x2a0b('0x31')](_0x5eaf23||0x1f4)['send']({'message':_0x230adb?_0x230adb['message']||_0x230adb:''});}exports[_0x2a0b('0x32')]=function(_0x5dd3e6,_0x5dc94f,_0x5cd81b){passport[_0x2a0b('0x33')](_0x2a0b('0x34'),function(_0x4b7d64,_0x901a81,_0x2be60a){var _0x4244b3=_0x4b7d64||_0x2be60a;if(_0x4244b3){return handleError(_0x5dc94f,0x191,_0x4244b3);}if(!_0x901a81){return handleError(_0x5dc94f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1f9522={'payload':{'id':_0x901a81['id'],'role':_0x901a81[_0x2a0b('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1f9522)[_0x2a0b('0xd')](function(_0x12679d){_0x5dc94f[_0x2a0b('0x35')]({'id':_0x901a81['id'],'token':_0x12679d,'statusCall':'','isAlreadyLogged':_0x901a81[_0x2a0b('0x36')]});});}})(_0x5dd3e6,_0x5dc94f,_0x5cd81b);};exports['forgot']=function(_0x4d38aa,_0x31a7ae,_0x458ca2){if(!_0x4d38aa[_0x2a0b('0x37')][_0x2a0b('0x1f')]){return handleError(_0x31a7ae,0x1f4,{'message':_0x2a0b('0x38')});}var _0x92075b=rs[_0x2a0b('0x39')]();_0x4d38aa['body']['email']=_0x4d38aa['body'][_0x2a0b('0x1f')][_0x2a0b('0x3a')]()[_0x2a0b('0x3b')]();var _0x524f2f;return db[_0x2a0b('0x9')][_0x2a0b('0xa')]({'where':{'id':0x1},'attributes':[_0x2a0b('0xb'),_0x2a0b('0xc')],'raw':!![]})[_0x2a0b('0xd')](function(_0x4e4830){_0x524f2f=_0x4e4830;return db['User']['find']({'where':{'email':_0x4d38aa['body'][_0x2a0b('0x1f')]}});})[_0x2a0b('0xd')](function(_0x4de53b){if(!_0x4de53b){throw new Error(_0x2a0b('0x3c'));}if(_0x4de53b[_0x2a0b('0x12')]){throw new Error(_0x2a0b('0x3d'));}if(_0x4de53b[_0x2a0b('0x13')]){if(moment(_0x4de53b[_0x2a0b('0x14')])[_0x2a0b('0x19')](_0x524f2f[_0x2a0b('0xc')],_0x2a0b('0x1b'))>moment()){throw new Error(_0x2a0b('0x3e'));}else{_0x4de53b[_0x2a0b('0x13')]=![];_0x4de53b['blockedAt']=null;}}_0x4de53b[_0x2a0b('0x3f')]=_0x92075b;_0x4de53b[_0x2a0b('0x40')]=Date[_0x2a0b('0x41')]()+0x36ee80;return _0x4de53b[_0x2a0b('0x42')]();})[_0x2a0b('0xd')](function(){return sendServiceMail({'to':_0x4d38aa['body'][_0x2a0b('0x1f')],'subject':_0x2a0b('0x43'),'text':_0x2a0b('0x44')+_0x2a0b('0x45')+_0x2a0b('0x46')+_0x4d38aa['headers']['host']+'/reset/'+_0x92075b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x2a0b('0xd')](function(){_0x31a7ae['status'](0xc8)['send']({'message':_0x2a0b('0x47')});})['catch'](function(_0x123f9c){return handleError(_0x31a7ae,0x1f4,_0x123f9c);});};exports[_0x2a0b('0x48')]=function(_0x5b8b7c,_0x417262,_0x2b0c49){return db[_0x2a0b('0x49')][_0x2a0b('0x4a')]({'where':{'resetPasswordToken':_0x5b8b7c[_0x2a0b('0x4b')][_0x2a0b('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x2a0b('0x41')]()}}})['then'](function(_0xdc3f65){if(!_0xdc3f65){throw new Error(_0x2a0b('0x4d'));}return db[_0x2a0b('0x9')][_0x2a0b('0xa')]({'attributes':['id',_0x2a0b('0x4e'),'enforcePasswordHistory',_0x2a0b('0x4f')]})[_0x2a0b('0xd')](function(_0x2dfeb5){if(_0x2dfeb5[_0x2a0b('0x4e')])authService[_0x2a0b('0x50')](_0x5b8b7c['body']['password']);if(!_0x2dfeb5[_0x2a0b('0x51')]||!_0xdc3f65[_0x2a0b('0x52')])return _0xdc3f65;authService['validatePasswordHistory'](_0x5b8b7c[_0x2a0b('0x37')][_0x2a0b('0xf')],_0xdc3f65['previousPasswords'],_0x2dfeb5[_0x2a0b('0x4f')]);return _0xdc3f65;})[_0x2a0b('0xd')](function(){_0xdc3f65[_0x2a0b('0xf')]=_0x5b8b7c['body'][_0x2a0b('0xf')];_0xdc3f65[_0x2a0b('0x3f')]=null;_0xdc3f65[_0x2a0b('0x40')]=null;return _0xdc3f65[_0x2a0b('0x42')]();});})[_0x2a0b('0xd')](function(){_0x417262['status'](0xc8)['send']({'message':_0x2a0b('0x53')});})['catch'](function(_0x4c698c){return handleError(_0x417262,0x1f4,_0x4c698c);});};passport[_0x2a0b('0x54')](new LocalStrategy({'usernameField':_0x2a0b('0xe'),'passwordField':_0x2a0b('0xf')},function(_0x2cf695,_0x271a2a,_0x95809){return localAuthenticate(db[_0x2a0b('0x49')],_0x2cf695,_0x271a2a,_0x95809);}));
\ No newline at end of file
+var _0x2697=['json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','password','previousPasswords','save','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','name','salt','disabled','blocked','blockedAt','admin','user','then','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense','find','email','MailServerOut','Smtp','service','host','port','secure','auth','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x122e3d,_0x37718b){var _0xbb3437=function(_0xf749e){while(--_0xf749e){_0x122e3d['push'](_0x122e3d['shift']());}};_0xbb3437(++_0x37718b);}(_0x2697,0x120));var _0x7269=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0x2697[_0x4df85c];return _0x4e2a61;};'use strict';var util=require('util');var passport=require(_0x7269('0x0'));var LocalStrategy=require(_0x7269('0x1'))[_0x7269('0x2')];var jayson=require(_0x7269('0x3'));var _=require(_0x7269('0x4'));var rs=require('randomstring');var moment=require(_0x7269('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x7269('0x6'));var utils=require(_0x7269('0x7'));var client=jayson[_0x7269('0x8')][_0x7269('0x9')]({'port':0x232b});function localAuthenticate(_0x438f7c,_0x1e47e3,_0x20ddbf,_0x2c968f){var _0x328097,_0x572969;return db[_0x7269('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x7269('0xb'),_0x7269('0xc')],'raw':!![]})['then'](function(_0x3c21f9){_0x328097=_0x3c21f9;return _0x438f7c['findOne']({'attributes':['id',_0x7269('0xd'),'password',_0x7269('0xe'),'role',_0x7269('0xf'),_0x7269('0x10'),_0x7269('0x11'),'loginAttempts'],'where':{'name':_0x1e47e3,'role':{'$or':[_0x7269('0x12'),_0x7269('0x13'),'agent']}}});})[_0x7269('0x14')](function(_0x2de29b){if(!_0x2de29b||_0x2de29b&&_0x2de29b[_0x7269('0xd')]!==_0x1e47e3){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x572969=_0x2de29b;return _0x572969;}})[_0x7269('0x14')](function(){_0x572969[_0x7269('0x15')](_0x20ddbf,function(_0x2d78a0,_0x2c28f8){var _0x26547f=_0x572969[_0x7269('0x16')]+0x1;if(_0x2d78a0){return _0x2c968f(_0x2d78a0);}else if(!_0x2c28f8){if(_0x572969[_0x7269('0xf')]){return _0x2c968f(null,![],{'message':_0x7269('0x17')});}else if(_0x328097['allowedLoginAttempts']>0x0){if(_0x572969[_0x7269('0x10')]){if(_0x328097[_0x7269('0xc')]>0x0){if(moment(_0x572969[_0x7269('0x11')])[_0x7269('0x18')](_0x328097['blockDuration'],'minutes')>moment()){return _0x2c968f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7269('0x19')](_0x572969,_0x26547f,![],null)[_0x7269('0x14')](function(){return _0x2c968f(null,![],{'message':_0x7269('0x17')});});}}else{return _0x2c968f(null,![],{'message':_0x7269('0x17')});}}else{if(_0x26547f>=_0x328097[_0x7269('0xb')]){return utils[_0x7269('0x19')](_0x572969,0x0,!![],moment())[_0x7269('0x14')](function(){return _0x2c968f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x572969,_0x26547f,![],null)['then'](function(){return _0x2c968f(null,![],{'message':_0x7269('0x17')});});}}}else{return _0x2c968f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x572969[_0x7269('0xf')]){return _0x2c968f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x328097[_0x7269('0xb')]>0x0){if(_0x572969[_0x7269('0x10')]){if(_0x328097['blockDuration']>0x0){if(moment(_0x572969[_0x7269('0x11')])[_0x7269('0x18')](_0x328097['blockDuration'],_0x7269('0x1a'))>moment()){return _0x2c968f(null,![],{'message':_0x7269('0x17')});}else{return utils[_0x7269('0x19')](_0x572969,0x0,![],null)[_0x7269('0x14')](function(){return utils['getLicense'](_0x572969);})[_0x7269('0x14')](function(){return _0x2c968f(null,_0x572969);});}}else{return _0x2c968f(null,![],{'message':_0x7269('0x17')});}}else{return utils[_0x7269('0x19')](_0x572969,0x0,![],null)[_0x7269('0x14')](function(){return utils[_0x7269('0x1b')](_0x572969);})[_0x7269('0x14')](function(){return _0x2c968f(null,_0x572969);})['catch'](function(_0x198b59){return _0x2c968f(null,![],_0x198b59);});}}else{if(_0x572969[_0x7269('0x10')]){return _0x2c968f(null,![],{'message':_0x7269('0x17')});}else{return utils[_0x7269('0x1b')](_0x572969)[_0x7269('0x14')](function(){return _0x2c968f(null,_0x572969);});}}}});})['catch'](function(_0x33c43a){return _0x2c968f(null,![],_0x33c43a);});}function sendServiceMail(_0x470e5c){return db['MailAccount'][_0x7269('0x1c')]({'where':{'service':!![]},'attributes':['id','name',_0x7269('0x1d')],'include':[{'model':db[_0x7269('0x1e')],'as':_0x7269('0x1f')}]})[_0x7269('0x14')](function(_0x468d0b){if(!_0x468d0b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x43e363={'tls':{'rejectUnauthorized':![]}};if(_0x468d0b[_0x7269('0x1f')][_0x7269('0x20')]){_0x43e363[_0x7269('0x20')]=_0x468d0b['Smtp'][_0x7269('0x20')];}else{_0x43e363[_0x7269('0x21')]=_0x468d0b['Smtp']['host'];_0x43e363[_0x7269('0x22')]=_0x468d0b[_0x7269('0x1f')][_0x7269('0x22')];_0x43e363[_0x7269('0x23')]=_0x468d0b[_0x7269('0x1f')][_0x7269('0x23')];}if(_0x468d0b['Smtp']['authentication']){_0x43e363[_0x7269('0x24')]={'user':_0x468d0b[_0x7269('0x1f')]['user'],'pass':_0x468d0b[_0x7269('0x1f')]['pass']};}var _0x1f244c={'account':_0x43e363,'message':_[_0x7269('0x25')]({'from':util[_0x7269('0x26')](_0x7269('0x27'),_0x468d0b[_0x7269('0xd')],_0x468d0b[_0x7269('0x1d')]||_0x468d0b[_0x7269('0x1f')]['user'])},_0x470e5c)};return client[_0x7269('0x28')](_0x7269('0x29'),_0x1f244c);})['then'](function(_0x747178){if(_0x747178[_0x7269('0x2a')]){throw new Error(util[_0x7269('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x747178[_0x7269('0x2a')][_0x7269('0x2b')]||JSON[_0x7269('0x2c')](_0x747178[_0x7269('0x2a')])));}return!![];});}function handleError(_0x487f25,_0x285274,_0xe5d1b9){return _0x487f25[_0x7269('0x2d')](_0x285274||0x1f4)[_0x7269('0x2e')]({'message':_0xe5d1b9?_0xe5d1b9[_0x7269('0x2b')]||_0xe5d1b9:''});}exports['login']=function(_0x1deb1a,_0x223faf,_0x301a10){passport['authenticate']('local',function(_0x399efe,_0x51a7ba,_0x2873fa){var _0x492a1e=_0x399efe||_0x2873fa;if(_0x492a1e){return handleError(_0x223faf,0x191,_0x492a1e);}if(!_0x51a7ba){return handleError(_0x223faf,0x194,{'message':_0x7269('0x2f')});}else{var _0x4d4a04={'payload':{'id':_0x51a7ba['id'],'role':_0x51a7ba['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4d4a04)[_0x7269('0x14')](function(_0x2265ac){_0x223faf[_0x7269('0x30')]({'id':_0x51a7ba['id'],'token':_0x2265ac,'statusCall':'','isAlreadyLogged':_0x51a7ba[_0x7269('0x31')]});});}})(_0x1deb1a,_0x223faf,_0x301a10);};exports[_0x7269('0x32')]=function(_0x470982,_0x1fd570,_0x1ffa92){if(!_0x470982[_0x7269('0x33')][_0x7269('0x1d')]){return handleError(_0x1fd570,0x1f4,{'message':_0x7269('0x34')});}var _0x4eb641=rs[_0x7269('0x35')]();_0x470982[_0x7269('0x33')][_0x7269('0x1d')]=_0x470982[_0x7269('0x33')][_0x7269('0x1d')][_0x7269('0x36')]()[_0x7269('0x37')]();var _0x2a67c3;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x7269('0xb'),_0x7269('0xc')],'raw':!![]})['then'](function(_0x54676d){_0x2a67c3=_0x54676d;return db['User'][_0x7269('0x1c')]({'where':{'email':_0x470982[_0x7269('0x33')]['email']}});})[_0x7269('0x14')](function(_0x1c4901){if(!_0x1c4901){throw new Error(_0x7269('0x38'));}if(_0x1c4901[_0x7269('0xf')]){throw new Error(_0x7269('0x39'));}if(_0x1c4901['blocked']){if(moment(_0x1c4901['blockedAt'])[_0x7269('0x18')](_0x2a67c3[_0x7269('0xc')],_0x7269('0x1a'))>moment()){throw new Error(_0x7269('0x3a'));}else{_0x1c4901[_0x7269('0x10')]=![];_0x1c4901['blockedAt']=null;}}_0x1c4901[_0x7269('0x3b')]=_0x4eb641;_0x1c4901[_0x7269('0x3c')]=Date['now']()+0x36ee80;return _0x1c4901['save']();})['then'](function(){return sendServiceMail({'to':_0x470982[_0x7269('0x33')][_0x7269('0x1d')],'subject':_0x7269('0x3d'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x7269('0x3e')+_0x7269('0x3f')+_0x470982[_0x7269('0x40')][_0x7269('0x21')]+'/reset/'+_0x4eb641+'\x0a\x0a'+_0x7269('0x41')});})[_0x7269('0x14')](function(){_0x1fd570[_0x7269('0x2d')](0xc8)[_0x7269('0x2e')]({'message':_0x7269('0x42')});})[_0x7269('0x43')](function(_0x80dba9){return handleError(_0x1fd570,0x1f4,_0x80dba9);});};exports[_0x7269('0x44')]=function(_0x5f34d3,_0x23d91b,_0x51de71){return db[_0x7269('0x45')][_0x7269('0x1c')]({'where':{'resetPasswordToken':_0x5f34d3[_0x7269('0x46')][_0x7269('0x47')],'resetPasswordExpires':{'$gt':Date[_0x7269('0x48')]()}}})['then'](function(_0x52b0f0){if(!_0x52b0f0){throw new Error(_0x7269('0x49'));}return db[_0x7269('0xa')]['findOne']({'attributes':['id',_0x7269('0x4a'),_0x7269('0x4b'),_0x7269('0x4c')]})['then'](function(_0x13c173){if(_0x13c173[_0x7269('0x4a')])authService[_0x7269('0x4d')](_0x5f34d3['body']['password']);if(!_0x13c173[_0x7269('0x4b')]||!_0x52b0f0['previousPasswords'])return _0x52b0f0;authService[_0x7269('0x4e')](_0x5f34d3['body'][_0x7269('0x4f')],_0x52b0f0[_0x7269('0x50')],_0x13c173[_0x7269('0x4c')]);return _0x52b0f0;})[_0x7269('0x14')](function(){_0x52b0f0['password']=_0x5f34d3[_0x7269('0x33')]['password'];_0x52b0f0[_0x7269('0x3b')]=null;_0x52b0f0[_0x7269('0x3c')]=null;return _0x52b0f0[_0x7269('0x51')]();});})[_0x7269('0x14')](function(){_0x23d91b[_0x7269('0x2d')](0xc8)[_0x7269('0x2e')]({'message':_0x7269('0x52')});})[_0x7269('0x43')](function(_0x1e5ef1){return handleError(_0x23d91b,0x1f4,_0x1e5ef1);});};passport[_0x7269('0x53')](new LocalStrategy({'usernameField':'name','passwordField':_0x7269('0x4f')},function(_0x101470,_0x1bfc00,_0x1e564c){return localAuthenticate(db[_0x7269('0x45')],_0x101470,_0x1bfc00,_0x1e564c);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index b9c5bea..08e9b90 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 _0x85a0=['/forgot','express','Router','./authLocal.controller','post','login'];(function(_0x41bee9,_0x488434){var _0xe48148=function(_0x1d8e50){while(--_0x1d8e50){_0x41bee9['push'](_0x41bee9['shift']());}};_0xe48148(++_0x488434);}(_0x85a0,0x199));var _0x085a=function(_0x4dac50,_0x1e67da){_0x4dac50=_0x4dac50-0x0;var _0xc707cf=_0x85a0[_0x4dac50];return _0xc707cf;};'use strict';var express=require(_0x085a('0x0'));var router=express[_0x085a('0x1')]();var controller=require(_0x085a('0x2'));router[_0x085a('0x3')]('/',controller[_0x085a('0x4')]);router['post'](_0x085a('0x5'),controller['forgot']);router['post']('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0x655b=['login','/forgot','forgot','/reset/:token','reset','exports','Router','post'];(function(_0x4508d4,_0x25d42f){var _0x220dab=function(_0x1e03e7){while(--_0x1e03e7){_0x4508d4['push'](_0x4508d4['shift']());}};_0x220dab(++_0x25d42f);}(_0x655b,0xfe));var _0xb655=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x655b[_0x5f1391];return _0x50ebe3;};'use strict';var express=require('express');var router=express[_0xb655('0x0')]();var controller=require('./authLocal.controller');router[_0xb655('0x1')]('/',controller[_0xb655('0x2')]);router[_0xb655('0x1')](_0xb655('0x3'),controller[_0xb655('0x4')]);router[_0xb655('0x1')](_0xb655('0x5'),controller[_0xb655('0x6')]);module[_0xb655('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 99393c2..491307d 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 _0x7856=['STRING','sequelize','exports'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0x7856,0xa6));var _0x6785=function(_0x356d11,_0x5b8639){_0x356d11=_0x356d11-0x0;var _0x3a1bab=_0x7856[_0x356d11];return _0x3a1bab;};'use strict';var Sequelize=require(_0x6785('0x0'));module[_0x6785('0x1')]={'name':{'type':Sequelize[_0x6785('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x6785('0x2')]},'description':{'type':Sequelize[_0x6785('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x09c4=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x21a9cf,_0x51f954){var _0x5d4ba7=function(_0x18d186){while(--_0x18d186){_0x21a9cf['push'](_0x21a9cf['shift']());}};_0x5d4ba7(++_0x51f954);}(_0x09c4,0x10d));var _0x409c=function(_0x550e29,_0x4047f){_0x550e29=_0x550e29-0x0;var _0x3515b6=_0x09c4[_0x550e29];return _0x3515b6;};'use strict';var Sequelize=require(_0x409c('0x0'));module[_0x409c('0x1')]={'name':{'type':Sequelize[_0x409c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x409c('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x409c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x409c('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 25ca344..132b426 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 _0x1eab=['hasOwnProperty','order','sort','where','filters','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','Action','getActions','pick','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x1211ca,_0x5c51c4){var _0xe206ad=function(_0x55e619){while(--_0x55e619){_0x1211ca['push'](_0x1211ca['shift']());}};_0xe206ad(++_0x5c51c4);}(_0x1eab,0x118));var _0xb1ea=function(_0x271ae0,_0x2e639b){_0x271ae0=_0x271ae0-0x0;var _0x383cfd=_0x1eab[_0x271ae0];return _0x383cfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1ea('0x0'));var zipdir=require(_0xb1ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1ea('0x2'));var moment=require(_0xb1ea('0x3'));var BPromise=require(_0xb1ea('0x4'));var Mustache=require(_0xb1ea('0x5'));var util=require('util');var path=require(_0xb1ea('0x6'));var sox=require(_0xb1ea('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1ea('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb1ea('0x9'));var jsforce=require(_0xb1ea('0xa'));var deskjs=require(_0xb1ea('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb1ea('0xc'));var Papa=require(_0xb1ea('0xd'));var Redis=require(_0xb1ea('0xe'));var authService=require(_0xb1ea('0xf'));var qs=require(_0xb1ea('0x10'));var as=require(_0xb1ea('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1ea('0x12'))(_0xb1ea('0x13'));var utils=require('../../config/utils');var config=require(_0xb1ea('0x14'));var licenseUtil=require(_0xb1ea('0x15'));var db=require(_0xb1ea('0x16'))['db'];function respondWithStatusCode(_0x15fb56,_0x2911aa){_0x2911aa=_0x2911aa||0xcc;return function(_0x5adec2){if(_0x5adec2){return _0x15fb56[_0xb1ea('0x17')](_0x2911aa);}return _0x15fb56[_0xb1ea('0x18')](_0x2911aa)[_0xb1ea('0x19')]();};}function respondWithResult(_0x20f869,_0x5e9b3d){_0x5e9b3d=_0x5e9b3d||0xc8;return function(_0x5dc937){if(_0x5dc937){return _0x20f869[_0xb1ea('0x18')](_0x5e9b3d)[_0xb1ea('0x1a')](_0x5dc937);}};}function respondWithFilteredResult(_0x186513,_0x3c8a36){return function(_0x3f431e){if(_0x3f431e){var _0x1fb520=typeof _0x3c8a36[_0xb1ea('0x1b')]==='undefined'&&typeof _0x3c8a36[_0xb1ea('0x1c')]===_0xb1ea('0x1d');var _0x2556f1=_0x3f431e[_0xb1ea('0x1e')];var _0x8b04c7=_0x1fb520?0x0:_0x3c8a36[_0xb1ea('0x1b')];var _0x5ddcba=_0x1fb520?_0x3f431e[_0xb1ea('0x1e')]:_0x3c8a36[_0xb1ea('0x1b')]+_0x3c8a36[_0xb1ea('0x1c')];var _0x3b2f22;if(_0x5ddcba>=_0x2556f1){_0x5ddcba=_0x2556f1;_0x3b2f22=0xc8;}else{_0x3b2f22=0xce;}_0x186513[_0xb1ea('0x18')](_0x3b2f22);return _0x186513[_0xb1ea('0x1f')](_0xb1ea('0x20'),_0x8b04c7+'-'+_0x5ddcba+'/'+_0x2556f1)[_0xb1ea('0x1a')](_0x3f431e);}return null;};}function patchUpdates(_0x1776e1){return function(_0x6680f6){try{jsonpatch[_0xb1ea('0x21')](_0x6680f6,_0x1776e1,!![]);}catch(_0x5a7604){return BPromise[_0xb1ea('0x22')](_0x5a7604);}return _0x6680f6[_0xb1ea('0x23')]();};}function saveUpdates(_0x3cdd79,_0x5ea4cf){return function(_0x20d2f5){if(_0x20d2f5){return _0x20d2f5[_0xb1ea('0x24')](_0x3cdd79)[_0xb1ea('0x25')](function(_0x5ddad5){return _0x5ddad5;});}return null;};}function removeEntity(_0x354efd,_0x1aad43){return function(_0x5176f7){if(_0x5176f7){return _0x5176f7[_0xb1ea('0x26')]()[_0xb1ea('0x25')](function(){_0x354efd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35872f,_0x9db7bb){return function(_0x1de299){if(!_0x1de299){_0x35872f[_0xb1ea('0x17')](0x194);}return _0x1de299;};}function handleError(_0x11e516,_0x4f83cc){_0x4f83cc=_0x4f83cc||0x1f4;return function(_0x516bdc){logger[_0xb1ea('0x27')](_0x516bdc['stack']);if(_0x516bdc[_0xb1ea('0x28')]){delete _0x516bdc[_0xb1ea('0x28')];}_0x11e516[_0xb1ea('0x18')](_0x4f83cc)[_0xb1ea('0x29')](_0x516bdc);};}exports[_0xb1ea('0x2a')]=function(_0x5a6f09,_0x36e04a){var _0x415bea={},_0x6fd6ff={},_0x34a1a2={'count':0x0,'rows':[]};var _0x2b09c9=_[_0xb1ea('0x2b')](db[_0xb1ea('0x2c')][_0xb1ea('0x2d')],function(_0x4cc4d1){return{'name':_0x4cc4d1[_0xb1ea('0x2e')],'type':_0x4cc4d1[_0xb1ea('0x2f')][_0xb1ea('0x30')]};});_0x6fd6ff[_0xb1ea('0x31')]=_['map'](_0x2b09c9,'name');_0x6fd6ff[_0xb1ea('0x32')]=_[_0xb1ea('0x33')](_0x5a6f09['query']);_0x6fd6ff['filters']=_[_0xb1ea('0x34')](_0x6fd6ff[_0xb1ea('0x31')],_0x6fd6ff['query']);_0x415bea[_0xb1ea('0x35')]=_[_0xb1ea('0x34')](_0x6fd6ff[_0xb1ea('0x31')],qs[_0xb1ea('0x36')](_0x5a6f09['query'][_0xb1ea('0x36')]));_0x415bea[_0xb1ea('0x35')]=_0x415bea[_0xb1ea('0x35')][_0xb1ea('0x37')]?_0x415bea[_0xb1ea('0x35')]:_0x6fd6ff[_0xb1ea('0x31')];if(!_0x5a6f09[_0xb1ea('0x32')][_0xb1ea('0x38')]('nolimit')){_0x415bea['limit']=qs[_0xb1ea('0x1c')](_0x5a6f09[_0xb1ea('0x32')][_0xb1ea('0x1c')]);_0x415bea[_0xb1ea('0x1b')]=qs[_0xb1ea('0x1b')](_0x5a6f09[_0xb1ea('0x32')]['offset']);}_0x415bea[_0xb1ea('0x39')]=qs['sort'](_0x5a6f09[_0xb1ea('0x32')][_0xb1ea('0x3a')]);_0x415bea[_0xb1ea('0x3b')]=qs[_0xb1ea('0x3c')](_['pick'](_0x5a6f09['query'],_0x6fd6ff['filters']),_0x2b09c9);if(_0x5a6f09[_0xb1ea('0x32')]['filter']){_0x415bea[_0xb1ea('0x3b')]=_[_0xb1ea('0x3d')](_0x415bea['where'],{'$or':_['map'](_0x2b09c9,function(_0x45c73a){if(_0x45c73a[_0xb1ea('0x2f')]!=='VIRTUAL'){var _0x47a304={};_0x47a304[_0x45c73a['name']]={'$like':'%'+_0x5a6f09[_0xb1ea('0x32')][_0xb1ea('0x3e')]+'%'};return _0x47a304;}})});}_0x415bea=_['merge']({},_0x415bea,_0x5a6f09['options']);var _0x50a649={'where':_0x415bea[_0xb1ea('0x3b')]};return db['Automation'][_0xb1ea('0x1e')](_0x50a649)[_0xb1ea('0x25')](function(_0x589407){_0x34a1a2[_0xb1ea('0x1e')]=_0x589407;if(_0x5a6f09[_0xb1ea('0x32')][_0xb1ea('0x3f')]){_0x415bea[_0xb1ea('0x40')]=[{'all':!![]}];}return db[_0xb1ea('0x2c')][_0xb1ea('0x41')](_0x415bea);})['then'](function(_0x4e961b){_0x34a1a2[_0xb1ea('0x42')]=_0x4e961b;return _0x34a1a2;})[_0xb1ea('0x25')](respondWithFilteredResult(_0x36e04a,_0x415bea))[_0xb1ea('0x43')](handleError(_0x36e04a,null));};exports[_0xb1ea('0x44')]=function(_0x267538,_0x55c518){var _0x473dae={'raw':![],'where':{'id':_0x267538[_0xb1ea('0x45')]['id']}},_0x27d81c={};_0x27d81c['model']=_[_0xb1ea('0x33')](db[_0xb1ea('0x2c')]['rawAttributes']);_0x27d81c[_0xb1ea('0x32')]=_['keys'](_0x267538['query']);_0x27d81c[_0xb1ea('0x3c')]=_[_0xb1ea('0x34')](_0x27d81c['model'],_0x27d81c[_0xb1ea('0x32')]);_0x473dae[_0xb1ea('0x35')]=_[_0xb1ea('0x34')](_0x27d81c['model'],qs[_0xb1ea('0x36')](_0x267538[_0xb1ea('0x32')][_0xb1ea('0x36')]));_0x473dae['attributes']=_0x473dae[_0xb1ea('0x35')][_0xb1ea('0x37')]?_0x473dae[_0xb1ea('0x35')]:_0x27d81c[_0xb1ea('0x31')];if(_0x267538['query'][_0xb1ea('0x3f')]){_0x473dae[_0xb1ea('0x40')]=[{'all':!![]}];}_0x473dae=_[_0xb1ea('0x3d')]({},_0x473dae,_0x267538[_0xb1ea('0x46')]);return db[_0xb1ea('0x2c')]['find'](_0x473dae)['then'](handleEntityNotFound(_0x55c518,null))['then'](respondWithResult(_0x55c518,null))[_0xb1ea('0x43')](handleError(_0x55c518,null));};exports[_0xb1ea('0x47')]=function(_0x161c1e,_0x2a91f6){return db[_0xb1ea('0x2c')][_0xb1ea('0x47')](_0x161c1e[_0xb1ea('0x48')],{})['then'](respondWithResult(_0x2a91f6,0xc9))[_0xb1ea('0x43')](handleError(_0x2a91f6,null));};exports['update']=function(_0x4085bb,_0x457694){if(_0x4085bb[_0xb1ea('0x48')]['id']){delete _0x4085bb[_0xb1ea('0x48')]['id'];}return db[_0xb1ea('0x2c')][_0xb1ea('0x49')]({'where':{'id':_0x4085bb[_0xb1ea('0x45')]['id']}})[_0xb1ea('0x25')](handleEntityNotFound(_0x457694,null))[_0xb1ea('0x25')](saveUpdates(_0x4085bb['body'],null))['then'](respondWithResult(_0x457694,null))[_0xb1ea('0x43')](handleError(_0x457694,null));};exports['destroy']=function(_0x2e44a4,_0x1287a3){return db[_0xb1ea('0x2c')]['find']({'where':{'id':_0x2e44a4[_0xb1ea('0x45')]['id']}})[_0xb1ea('0x25')](handleEntityNotFound(_0x1287a3,null))[_0xb1ea('0x25')](removeEntity(_0x1287a3,null))[_0xb1ea('0x43')](handleError(_0x1287a3,null));};exports[_0xb1ea('0x4a')]=function(_0x67335d,_0x14a4d3,_0x417c4d){return db[_0xb1ea('0x4b')][_0xb1ea('0x49')]({'where':{'id':_0x67335d[_0xb1ea('0x45')]['id']}})[_0xb1ea('0x25')](handleEntityNotFound(_0x14a4d3,null))[_0xb1ea('0x25')](function(_0x439b08){if(_0x439b08){return _0x439b08[_0xb1ea('0x4a')](_0x67335d[_0xb1ea('0x48')][_0xb1ea('0x4c')],_[_0xb1ea('0x4d')](_0x67335d[_0xb1ea('0x48')],[_0xb1ea('0x4c'),'id'])||{});}})[_0xb1ea('0x25')](respondWithResult(_0x14a4d3,null))['catch'](handleError(_0x14a4d3,null));};exports[_0xb1ea('0x4e')]=function(_0x146ca1,_0x2d304e,_0x1b0cd4){var _0x1d69f4={};var _0x57416b={};var _0xfc1930;var _0x40e27f;return db[_0xb1ea('0x2c')][_0xb1ea('0x4f')]({'where':{'id':_0x146ca1['params']['id']}})[_0xb1ea('0x25')](handleEntityNotFound(_0x2d304e,null))[_0xb1ea('0x25')](function(_0x151981){if(_0x151981){_0xfc1930=_0x151981;_0x57416b[_0xb1ea('0x31')]=_[_0xb1ea('0x33')](db[_0xb1ea('0x4b')]['rawAttributes']);_0x57416b[_0xb1ea('0x32')]=_[_0xb1ea('0x33')](_0x146ca1['query']);_0x57416b[_0xb1ea('0x3c')]=_[_0xb1ea('0x34')](_0x57416b[_0xb1ea('0x31')],_0x57416b['query']);_0x1d69f4[_0xb1ea('0x35')]=_[_0xb1ea('0x34')](_0x57416b['model'],qs[_0xb1ea('0x36')](_0x146ca1[_0xb1ea('0x32')][_0xb1ea('0x36')]));_0x1d69f4['attributes']=_0x1d69f4['attributes']['length']?_0x1d69f4[_0xb1ea('0x35')]:_0x57416b[_0xb1ea('0x31')];_0x1d69f4[_0xb1ea('0x39')]=qs[_0xb1ea('0x3a')](_0x146ca1[_0xb1ea('0x32')][_0xb1ea('0x3a')]);_0x1d69f4[_0xb1ea('0x3b')]=qs[_0xb1ea('0x3c')](_['pick'](_0x146ca1['query'],_0x57416b[_0xb1ea('0x3c')]));if(_0x146ca1[_0xb1ea('0x32')][_0xb1ea('0x3e')]){_0x1d69f4[_0xb1ea('0x3b')]=_[_0xb1ea('0x3d')](_0x1d69f4[_0xb1ea('0x3b')],{'$or':_[_0xb1ea('0x2b')](_0x1d69f4['attributes'],function(_0x476514){var _0x4cdcdb={};_0x4cdcdb[_0x476514]={'$like':'%'+_0x146ca1[_0xb1ea('0x32')][_0xb1ea('0x3e')]+'%'};return _0x4cdcdb;})});}_0x1d69f4=_[_0xb1ea('0x3d')]({},_0x1d69f4,_0x146ca1[_0xb1ea('0x46')]);return _0xfc1930[_0xb1ea('0x4e')](_0x1d69f4);}})[_0xb1ea('0x25')](function(_0x52d614){if(_0x52d614){_0x40e27f=_0x52d614[_0xb1ea('0x37')];if(!_0x146ca1[_0xb1ea('0x32')][_0xb1ea('0x38')](_0xb1ea('0x50'))){_0x1d69f4['limit']=qs['limit'](_0x146ca1['query']['limit']);_0x1d69f4[_0xb1ea('0x1b')]=qs[_0xb1ea('0x1b')](_0x146ca1[_0xb1ea('0x32')]['offset']);}return _0xfc1930[_0xb1ea('0x4e')](_0x1d69f4);}})[_0xb1ea('0x25')](function(_0x55b739){if(_0x55b739){return _0x55b739?{'count':_0x40e27f,'rows':_0x55b739}:null;}})[_0xb1ea('0x25')](respondWithResult(_0x2d304e,null))[_0xb1ea('0x43')](handleError(_0x2d304e,null));};exports['addActions']=function(_0x58e3c9,_0x22a1d2,_0x55bb54){return db[_0xb1ea('0x51')][_0xb1ea('0x49')]({'where':{'id':_0x58e3c9[_0xb1ea('0x45')]['id']}})['then'](handleEntityNotFound(_0x22a1d2,null))[_0xb1ea('0x25')](function(_0xc36f58){if(_0xc36f58){return _0xc36f58['addActions'](_0x58e3c9[_0xb1ea('0x48')]['ids'],_[_0xb1ea('0x4d')](_0x58e3c9[_0xb1ea('0x48')],[_0xb1ea('0x4c'),'id'])||{});}})[_0xb1ea('0x25')](respondWithResult(_0x22a1d2,null))[_0xb1ea('0x43')](handleError(_0x22a1d2,null));};exports[_0xb1ea('0x52')]=function(_0x4bcf18,_0x18e99e,_0x2db8f9){var _0x3283ba={};var _0x1a6004={};var _0x4951cc;var _0x363768;return db['Automation'][_0xb1ea('0x4f')]({'where':{'id':_0x4bcf18[_0xb1ea('0x45')]['id']}})[_0xb1ea('0x25')](handleEntityNotFound(_0x18e99e,null))['then'](function(_0x5daa2e){if(_0x5daa2e){_0x4951cc=_0x5daa2e;_0x1a6004['model']=_[_0xb1ea('0x33')](db[_0xb1ea('0x51')][_0xb1ea('0x2d')]);_0x1a6004['query']=_['keys'](_0x4bcf18[_0xb1ea('0x32')]);_0x1a6004['filters']=_[_0xb1ea('0x34')](_0x1a6004['model'],_0x1a6004[_0xb1ea('0x32')]);_0x3283ba['attributes']=_['intersection'](_0x1a6004[_0xb1ea('0x31')],qs[_0xb1ea('0x36')](_0x4bcf18[_0xb1ea('0x32')][_0xb1ea('0x36')]));_0x3283ba[_0xb1ea('0x35')]=_0x3283ba[_0xb1ea('0x35')][_0xb1ea('0x37')]?_0x3283ba[_0xb1ea('0x35')]:_0x1a6004['model'];_0x3283ba[_0xb1ea('0x39')]=qs[_0xb1ea('0x3a')](_0x4bcf18[_0xb1ea('0x32')][_0xb1ea('0x3a')]);_0x3283ba[_0xb1ea('0x3b')]=qs[_0xb1ea('0x3c')](_[_0xb1ea('0x53')](_0x4bcf18[_0xb1ea('0x32')],_0x1a6004[_0xb1ea('0x3c')]));if(_0x4bcf18[_0xb1ea('0x32')][_0xb1ea('0x3e')]){_0x3283ba[_0xb1ea('0x3b')]=_[_0xb1ea('0x3d')](_0x3283ba[_0xb1ea('0x3b')],{'$or':_['map'](_0x3283ba['attributes'],function(_0x5963c8){var _0x5051e3={};_0x5051e3[_0x5963c8]={'$like':'%'+_0x4bcf18[_0xb1ea('0x32')][_0xb1ea('0x3e')]+'%'};return _0x5051e3;})});}_0x3283ba=_['merge']({},_0x3283ba,_0x4bcf18[_0xb1ea('0x46')]);return _0x4951cc[_0xb1ea('0x52')](_0x3283ba);}})[_0xb1ea('0x25')](function(_0x4b2f92){if(_0x4b2f92){_0x363768=_0x4b2f92[_0xb1ea('0x37')];if(!_0x4bcf18[_0xb1ea('0x32')][_0xb1ea('0x38')](_0xb1ea('0x50'))){_0x3283ba[_0xb1ea('0x1c')]=qs[_0xb1ea('0x1c')](_0x4bcf18[_0xb1ea('0x32')][_0xb1ea('0x1c')]);_0x3283ba[_0xb1ea('0x1b')]=qs[_0xb1ea('0x1b')](_0x4bcf18[_0xb1ea('0x32')][_0xb1ea('0x1b')]);}return _0x4951cc['getActions'](_0x3283ba);}})[_0xb1ea('0x25')](function(_0x3c045f){if(_0x3c045f){return _0x3c045f?{'count':_0x363768,'rows':_0x3c045f}:null;}})[_0xb1ea('0x25')](respondWithResult(_0x18e99e,null))[_0xb1ea('0x43')](handleError(_0x18e99e,null));};
\ No newline at end of file
+var _0xefb6=['model','query','intersection','attributes','fields','length','nolimit','order','filters','filter','where','include','findAll','rows','catch','show','params','keys','includeAll','merge','options','find','create','body','addConditions','Condition','ids','findOne','sort','pick','hasOwnProperty','getConditions','addActions','Action','omit','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type'];(function(_0x3c4505,_0xffe1f8){var _0x18f0cc=function(_0x21a4d4){while(--_0x21a4d4){_0x3c4505['push'](_0x3c4505['shift']());}};_0x18f0cc(++_0xffe1f8);}(_0xefb6,0x1c8));var _0x6efb=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0xefb6[_0x402c8f];return _0x11e809;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6efb('0x0'));var zipdir=require(_0x6efb('0x1'));var jsonpatch=require(_0x6efb('0x2'));var rp=require(_0x6efb('0x3'));var moment=require(_0x6efb('0x4'));var BPromise=require(_0x6efb('0x5'));var Mustache=require('mustache');var util=require(_0x6efb('0x6'));var path=require(_0x6efb('0x7'));var sox=require(_0x6efb('0x8'));var csv=require(_0x6efb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6efb('0xa'));var _=require(_0x6efb('0xb'));var squel=require(_0x6efb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6efb('0x9'));var querystring=require('querystring');var Papa=require(_0x6efb('0xd'));var Redis=require(_0x6efb('0xe'));var authService=require(_0x6efb('0xf'));var qs=require(_0x6efb('0x10'));var as=require(_0x6efb('0x11'));var hardwareService=require(_0x6efb('0x12'));var logger=require(_0x6efb('0x13'))(_0x6efb('0x14'));var utils=require(_0x6efb('0x15'));var config=require(_0x6efb('0x16'));var licenseUtil=require(_0x6efb('0x17'));var db=require(_0x6efb('0x18'))['db'];function respondWithStatusCode(_0xbb7e96,_0x334a1e){_0x334a1e=_0x334a1e||0xcc;return function(_0x238e7c){if(_0x238e7c){return _0xbb7e96[_0x6efb('0x19')](_0x334a1e);}return _0xbb7e96[_0x6efb('0x1a')](_0x334a1e)['end']();};}function respondWithResult(_0x3ca387,_0x5c898d){_0x5c898d=_0x5c898d||0xc8;return function(_0x47d405){if(_0x47d405){return _0x3ca387[_0x6efb('0x1a')](_0x5c898d)[_0x6efb('0x1b')](_0x47d405);}};}function respondWithFilteredResult(_0x12274d,_0x27c972){return function(_0x414490){if(_0x414490){var _0x9151f=typeof _0x27c972[_0x6efb('0x1c')]===_0x6efb('0x1d')&&typeof _0x27c972['limit']===_0x6efb('0x1d');var _0x1b6eec=_0x414490[_0x6efb('0x1e')];var _0xec1fb5=_0x9151f?0x0:_0x27c972['offset'];var _0x4f9422=_0x9151f?_0x414490[_0x6efb('0x1e')]:_0x27c972[_0x6efb('0x1c')]+_0x27c972[_0x6efb('0x1f')];var _0x4a2d46;if(_0x4f9422>=_0x1b6eec){_0x4f9422=_0x1b6eec;_0x4a2d46=0xc8;}else{_0x4a2d46=0xce;}_0x12274d[_0x6efb('0x1a')](_0x4a2d46);return _0x12274d[_0x6efb('0x20')]('Content-Range',_0xec1fb5+'-'+_0x4f9422+'/'+_0x1b6eec)[_0x6efb('0x1b')](_0x414490);}return null;};}function patchUpdates(_0x1956a7){return function(_0x38d64e){try{jsonpatch[_0x6efb('0x21')](_0x38d64e,_0x1956a7,!![]);}catch(_0x7185b4){return BPromise[_0x6efb('0x22')](_0x7185b4);}return _0x38d64e[_0x6efb('0x23')]();};}function saveUpdates(_0x26cf2a,_0x201dcf){return function(_0x13cd62){if(_0x13cd62){return _0x13cd62[_0x6efb('0x24')](_0x26cf2a)[_0x6efb('0x25')](function(_0x5bc366){return _0x5bc366;});}return null;};}function removeEntity(_0x4440ff,_0x32ee0e){return function(_0x5766ae){if(_0x5766ae){return _0x5766ae[_0x6efb('0x26')]()['then'](function(){_0x4440ff[_0x6efb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e9dfa,_0x150594){return function(_0x5a517c){if(!_0x5a517c){_0x2e9dfa['sendStatus'](0x194);}return _0x5a517c;};}function handleError(_0x28bf22,_0x105e41){_0x105e41=_0x105e41||0x1f4;return function(_0x24cdca){logger['error'](_0x24cdca[_0x6efb('0x27')]);if(_0x24cdca[_0x6efb('0x28')]){delete _0x24cdca[_0x6efb('0x28')];}_0x28bf22['status'](_0x105e41)[_0x6efb('0x29')](_0x24cdca);};}exports[_0x6efb('0x2a')]=function(_0x53cd1a,_0x3fe231){var _0x4a062e={},_0x1a1aff={},_0x4bf77d={'count':0x0,'rows':[]};var _0x3eb8ec=_[_0x6efb('0x2b')](db[_0x6efb('0x2c')][_0x6efb('0x2d')],function(_0x471d16){return{'name':_0x471d16[_0x6efb('0x2e')],'type':_0x471d16[_0x6efb('0x2f')]['key']};});_0x1a1aff[_0x6efb('0x30')]=_['map'](_0x3eb8ec,_0x6efb('0x28'));_0x1a1aff[_0x6efb('0x31')]=_['keys'](_0x53cd1a[_0x6efb('0x31')]);_0x1a1aff['filters']=_[_0x6efb('0x32')](_0x1a1aff[_0x6efb('0x30')],_0x1a1aff[_0x6efb('0x31')]);_0x4a062e[_0x6efb('0x33')]=_[_0x6efb('0x32')](_0x1a1aff['model'],qs['fields'](_0x53cd1a[_0x6efb('0x31')][_0x6efb('0x34')]));_0x4a062e['attributes']=_0x4a062e[_0x6efb('0x33')][_0x6efb('0x35')]?_0x4a062e[_0x6efb('0x33')]:_0x1a1aff[_0x6efb('0x30')];if(!_0x53cd1a[_0x6efb('0x31')]['hasOwnProperty'](_0x6efb('0x36'))){_0x4a062e[_0x6efb('0x1f')]=qs['limit'](_0x53cd1a['query'][_0x6efb('0x1f')]);_0x4a062e[_0x6efb('0x1c')]=qs[_0x6efb('0x1c')](_0x53cd1a[_0x6efb('0x31')][_0x6efb('0x1c')]);}_0x4a062e[_0x6efb('0x37')]=qs['sort'](_0x53cd1a[_0x6efb('0x31')]['sort']);_0x4a062e['where']=qs[_0x6efb('0x38')](_['pick'](_0x53cd1a[_0x6efb('0x31')],_0x1a1aff['filters']),_0x3eb8ec);if(_0x53cd1a[_0x6efb('0x31')][_0x6efb('0x39')]){_0x4a062e[_0x6efb('0x3a')]=_['merge'](_0x4a062e[_0x6efb('0x3a')],{'$or':_[_0x6efb('0x2b')](_0x3eb8ec,function(_0x3e3731){if(_0x3e3731[_0x6efb('0x2f')]!=='VIRTUAL'){var _0x34b46c={};_0x34b46c[_0x3e3731['name']]={'$like':'%'+_0x53cd1a[_0x6efb('0x31')][_0x6efb('0x39')]+'%'};return _0x34b46c;}})});}_0x4a062e=_['merge']({},_0x4a062e,_0x53cd1a['options']);var _0xd94007={'where':_0x4a062e[_0x6efb('0x3a')]};return db[_0x6efb('0x2c')][_0x6efb('0x1e')](_0xd94007)['then'](function(_0x2dadb1){_0x4bf77d[_0x6efb('0x1e')]=_0x2dadb1;if(_0x53cd1a['query']['includeAll']){_0x4a062e[_0x6efb('0x3b')]=[{'all':!![]}];}return db[_0x6efb('0x2c')][_0x6efb('0x3c')](_0x4a062e);})[_0x6efb('0x25')](function(_0x14bc95){_0x4bf77d[_0x6efb('0x3d')]=_0x14bc95;return _0x4bf77d;})[_0x6efb('0x25')](respondWithFilteredResult(_0x3fe231,_0x4a062e))[_0x6efb('0x3e')](handleError(_0x3fe231,null));};exports[_0x6efb('0x3f')]=function(_0x5e0dc0,_0x201cab){var _0x27e602={'raw':![],'where':{'id':_0x5e0dc0[_0x6efb('0x40')]['id']}},_0x1206c8={};_0x1206c8['model']=_[_0x6efb('0x41')](db[_0x6efb('0x2c')][_0x6efb('0x2d')]);_0x1206c8[_0x6efb('0x31')]=_['keys'](_0x5e0dc0[_0x6efb('0x31')]);_0x1206c8[_0x6efb('0x38')]=_[_0x6efb('0x32')](_0x1206c8[_0x6efb('0x30')],_0x1206c8[_0x6efb('0x31')]);_0x27e602['attributes']=_[_0x6efb('0x32')](_0x1206c8[_0x6efb('0x30')],qs[_0x6efb('0x34')](_0x5e0dc0['query'][_0x6efb('0x34')]));_0x27e602['attributes']=_0x27e602[_0x6efb('0x33')][_0x6efb('0x35')]?_0x27e602[_0x6efb('0x33')]:_0x1206c8[_0x6efb('0x30')];if(_0x5e0dc0['query'][_0x6efb('0x42')]){_0x27e602['include']=[{'all':!![]}];}_0x27e602=_[_0x6efb('0x43')]({},_0x27e602,_0x5e0dc0[_0x6efb('0x44')]);return db[_0x6efb('0x2c')][_0x6efb('0x45')](_0x27e602)[_0x6efb('0x25')](handleEntityNotFound(_0x201cab,null))[_0x6efb('0x25')](respondWithResult(_0x201cab,null))[_0x6efb('0x3e')](handleError(_0x201cab,null));};exports['create']=function(_0x21fb7f,_0x22b314){return db['Automation'][_0x6efb('0x46')](_0x21fb7f[_0x6efb('0x47')],{})['then'](respondWithResult(_0x22b314,0xc9))[_0x6efb('0x3e')](handleError(_0x22b314,null));};exports[_0x6efb('0x24')]=function(_0x5a05ec,_0x59136c){if(_0x5a05ec[_0x6efb('0x47')]['id']){delete _0x5a05ec[_0x6efb('0x47')]['id'];}return db[_0x6efb('0x2c')][_0x6efb('0x45')]({'where':{'id':_0x5a05ec[_0x6efb('0x40')]['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x59136c,null))['then'](saveUpdates(_0x5a05ec[_0x6efb('0x47')],null))[_0x6efb('0x25')](respondWithResult(_0x59136c,null))[_0x6efb('0x3e')](handleError(_0x59136c,null));};exports['destroy']=function(_0x13be93,_0x1f8d9b){return db[_0x6efb('0x2c')][_0x6efb('0x45')]({'where':{'id':_0x13be93['params']['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x1f8d9b,null))[_0x6efb('0x25')](removeEntity(_0x1f8d9b,null))[_0x6efb('0x3e')](handleError(_0x1f8d9b,null));};exports[_0x6efb('0x48')]=function(_0x5af036,_0x54b8be,_0x9de016){return db[_0x6efb('0x49')]['find']({'where':{'id':_0x5af036['params']['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x54b8be,null))[_0x6efb('0x25')](function(_0x295204){if(_0x295204){return _0x295204['addConditions'](_0x5af036[_0x6efb('0x47')][_0x6efb('0x4a')],_['omit'](_0x5af036[_0x6efb('0x47')],['ids','id'])||{});}})[_0x6efb('0x25')](respondWithResult(_0x54b8be,null))[_0x6efb('0x3e')](handleError(_0x54b8be,null));};exports['getConditions']=function(_0x49030e,_0x142055,_0xdde676){var _0x362603={};var _0x35b96d={};var _0x2c82d1;var _0x3c798c;return db[_0x6efb('0x2c')][_0x6efb('0x4b')]({'where':{'id':_0x49030e[_0x6efb('0x40')]['id']}})['then'](handleEntityNotFound(_0x142055,null))['then'](function(_0x2a9233){if(_0x2a9233){_0x2c82d1=_0x2a9233;_0x35b96d['model']=_['keys'](db[_0x6efb('0x49')][_0x6efb('0x2d')]);_0x35b96d[_0x6efb('0x31')]=_[_0x6efb('0x41')](_0x49030e[_0x6efb('0x31')]);_0x35b96d[_0x6efb('0x38')]=_[_0x6efb('0x32')](_0x35b96d[_0x6efb('0x30')],_0x35b96d[_0x6efb('0x31')]);_0x362603['attributes']=_[_0x6efb('0x32')](_0x35b96d['model'],qs[_0x6efb('0x34')](_0x49030e['query'][_0x6efb('0x34')]));_0x362603[_0x6efb('0x33')]=_0x362603[_0x6efb('0x33')][_0x6efb('0x35')]?_0x362603[_0x6efb('0x33')]:_0x35b96d['model'];_0x362603[_0x6efb('0x37')]=qs[_0x6efb('0x4c')](_0x49030e[_0x6efb('0x31')][_0x6efb('0x4c')]);_0x362603[_0x6efb('0x3a')]=qs['filters'](_[_0x6efb('0x4d')](_0x49030e[_0x6efb('0x31')],_0x35b96d['filters']));if(_0x49030e['query'][_0x6efb('0x39')]){_0x362603[_0x6efb('0x3a')]=_[_0x6efb('0x43')](_0x362603[_0x6efb('0x3a')],{'$or':_[_0x6efb('0x2b')](_0x362603[_0x6efb('0x33')],function(_0x5af569){var _0x744cf6={};_0x744cf6[_0x5af569]={'$like':'%'+_0x49030e[_0x6efb('0x31')][_0x6efb('0x39')]+'%'};return _0x744cf6;})});}_0x362603=_[_0x6efb('0x43')]({},_0x362603,_0x49030e['options']);return _0x2c82d1['getConditions'](_0x362603);}})[_0x6efb('0x25')](function(_0x48652f){if(_0x48652f){_0x3c798c=_0x48652f[_0x6efb('0x35')];if(!_0x49030e['query'][_0x6efb('0x4e')](_0x6efb('0x36'))){_0x362603[_0x6efb('0x1f')]=qs[_0x6efb('0x1f')](_0x49030e[_0x6efb('0x31')][_0x6efb('0x1f')]);_0x362603[_0x6efb('0x1c')]=qs[_0x6efb('0x1c')](_0x49030e['query'][_0x6efb('0x1c')]);}return _0x2c82d1[_0x6efb('0x4f')](_0x362603);}})['then'](function(_0x168eaf){if(_0x168eaf){return _0x168eaf?{'count':_0x3c798c,'rows':_0x168eaf}:null;}})[_0x6efb('0x25')](respondWithResult(_0x142055,null))[_0x6efb('0x3e')](handleError(_0x142055,null));};exports[_0x6efb('0x50')]=function(_0x603cc0,_0x5f1cfb,_0x4e0747){return db[_0x6efb('0x51')]['find']({'where':{'id':_0x603cc0[_0x6efb('0x40')]['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x5f1cfb,null))['then'](function(_0x480ced){if(_0x480ced){return _0x480ced[_0x6efb('0x50')](_0x603cc0['body']['ids'],_[_0x6efb('0x52')](_0x603cc0['body'],[_0x6efb('0x4a'),'id'])||{});}})[_0x6efb('0x25')](respondWithResult(_0x5f1cfb,null))[_0x6efb('0x3e')](handleError(_0x5f1cfb,null));};exports[_0x6efb('0x53')]=function(_0x646063,_0x22050c,_0x4f8e72){var _0xa73b4e={};var _0x5201cd={};var _0x1e5c5a;var _0x33ebf7;return db[_0x6efb('0x2c')][_0x6efb('0x4b')]({'where':{'id':_0x646063[_0x6efb('0x40')]['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x22050c,null))['then'](function(_0x18e94e){if(_0x18e94e){_0x1e5c5a=_0x18e94e;_0x5201cd[_0x6efb('0x30')]=_[_0x6efb('0x41')](db['Action'][_0x6efb('0x2d')]);_0x5201cd[_0x6efb('0x31')]=_[_0x6efb('0x41')](_0x646063[_0x6efb('0x31')]);_0x5201cd[_0x6efb('0x38')]=_['intersection'](_0x5201cd['model'],_0x5201cd['query']);_0xa73b4e['attributes']=_[_0x6efb('0x32')](_0x5201cd[_0x6efb('0x30')],qs[_0x6efb('0x34')](_0x646063[_0x6efb('0x31')][_0x6efb('0x34')]));_0xa73b4e[_0x6efb('0x33')]=_0xa73b4e[_0x6efb('0x33')][_0x6efb('0x35')]?_0xa73b4e[_0x6efb('0x33')]:_0x5201cd['model'];_0xa73b4e[_0x6efb('0x37')]=qs[_0x6efb('0x4c')](_0x646063[_0x6efb('0x31')][_0x6efb('0x4c')]);_0xa73b4e[_0x6efb('0x3a')]=qs[_0x6efb('0x38')](_['pick'](_0x646063[_0x6efb('0x31')],_0x5201cd[_0x6efb('0x38')]));if(_0x646063[_0x6efb('0x31')][_0x6efb('0x39')]){_0xa73b4e[_0x6efb('0x3a')]=_[_0x6efb('0x43')](_0xa73b4e[_0x6efb('0x3a')],{'$or':_[_0x6efb('0x2b')](_0xa73b4e[_0x6efb('0x33')],function(_0x4d0daf){var _0x1e371c={};_0x1e371c[_0x4d0daf]={'$like':'%'+_0x646063[_0x6efb('0x31')][_0x6efb('0x39')]+'%'};return _0x1e371c;})});}_0xa73b4e=_['merge']({},_0xa73b4e,_0x646063[_0x6efb('0x44')]);return _0x1e5c5a[_0x6efb('0x53')](_0xa73b4e);}})[_0x6efb('0x25')](function(_0x215bf7){if(_0x215bf7){_0x33ebf7=_0x215bf7[_0x6efb('0x35')];if(!_0x646063[_0x6efb('0x31')][_0x6efb('0x4e')](_0x6efb('0x36'))){_0xa73b4e[_0x6efb('0x1f')]=qs['limit'](_0x646063['query']['limit']);_0xa73b4e[_0x6efb('0x1c')]=qs[_0x6efb('0x1c')](_0x646063[_0x6efb('0x31')]['offset']);}return _0x1e5c5a[_0x6efb('0x53')](_0xa73b4e);}})['then'](function(_0x4bcc0b){if(_0x4bcc0b){return _0x4bcc0b?{'count':_0x33ebf7,'rows':_0x4bcc0b}:null;}})[_0x6efb('0x25')](respondWithResult(_0x22050c,null))[_0x6efb('0x3e')](handleError(_0x22050c,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 77de281..bf70cb6 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 _0xd949=['rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','api','moment','request-promise','path'];(function(_0x9b4f1e,_0x50dfbc){var _0x204ac9=function(_0x455781){while(--_0x455781){_0x9b4f1e['push'](_0x9b4f1e['shift']());}};_0x204ac9(++_0x50dfbc);}(_0xd949,0x166));var _0x9d94=function(_0x47d830,_0x134494){_0x47d830=_0x47d830-0x0;var _0x8fa212=_0xd949[_0x47d830];return _0x8fa212;};'use strict';var _=require(_0x9d94('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9d94('0x1'));var moment=require(_0x9d94('0x2'));var BPromise=require('bluebird');var rp=require(_0x9d94('0x3'));var fs=require('fs');var path=require(_0x9d94('0x4'));var rimraf=require(_0x9d94('0x5'));var config=require(_0x9d94('0x6'));var attributes=require(_0x9d94('0x7'));module[_0x9d94('0x8')]=function(_0x45fb8a,_0xa0a8fa){return _0x45fb8a['define'](_0x9d94('0x9'),attributes,{'tableName':_0x9d94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfedd=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x30ff0d,_0x385305){var _0x958560=function(_0xfd1229){while(--_0xfd1229){_0x30ff0d['push'](_0x30ff0d['shift']());}};_0x958560(++_0x385305);}(_0xfedd,0x9c));var _0xdfed=function(_0x55490e,_0x23f25c){_0x55490e=_0x55490e-0x0;var _0x4e4708=_0xfedd[_0x55490e];return _0x4e4708;};'use strict';var _=require(_0xdfed('0x0'));var util=require(_0xdfed('0x1'));var logger=require(_0xdfed('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdfed('0x3'));var rp=require(_0xdfed('0x4'));var fs=require('fs');var path=require(_0xdfed('0x5'));var rimraf=require(_0xdfed('0x6'));var config=require(_0xdfed('0x7'));var attributes=require(_0xdfed('0x8'));module[_0xdfed('0x9')]=function(_0x4bc5a9,_0x4c47bd){return _0x4bc5a9[_0xdfed('0xa')](_0xdfed('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index a7bfefd..5266ab8 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 _0x7275=['util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x57978e,_0xc9bb61){var _0x11e501=function(_0x268212){while(--_0x268212){_0x57978e['push'](_0x57978e['shift']());}};_0x11e501(++_0xc9bb61);}(_0x7275,0x143));var _0x5727=function(_0x2b15d8,_0x1dd7ef){_0x2b15d8=_0x2b15d8-0x0;var _0x4db55e=_0x7275[_0x2b15d8];return _0x4db55e;};'use strict';var _=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var moment=require(_0x5727('0x2'));var BPromise=require('bluebird');var rs=require(_0x5727('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5727('0x4'))['db'];var utils=require(_0x5727('0x5'));var logger=require('../../config/logger')(_0x5727('0x6'));var config=require(_0x5727('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x336262,_0x49184a,_0x33a6fe){return new BPromise(function(_0x4de37c,_0x129402){return client['request'](_0x336262,_0x33a6fe)[_0x5727('0x8')](function(_0x18e712){logger['info'](_0x5727('0x9'),_0x49184a,_0x5727('0xa'));logger['debug'](_0x5727('0xb'),_0x49184a,_0x5727('0xa'),JSON['stringify'](_0x18e712));if(_0x18e712[_0x5727('0xc')]){if(_0x18e712[_0x5727('0xc')][_0x5727('0xd')]===0x1f4){logger[_0x5727('0xc')](_0x5727('0x9'),_0x49184a,_0x18e712[_0x5727('0xc')]['message']);return _0x129402(_0x18e712[_0x5727('0xc')][_0x5727('0xe')]);}logger[_0x5727('0xc')](_0x5727('0x9'),_0x49184a,_0x18e712[_0x5727('0xc')][_0x5727('0xe')]);return _0x4de37c(_0x18e712[_0x5727('0xc')]['message']);}else{logger[_0x5727('0xf')](_0x5727('0x9'),_0x49184a,_0x5727('0xa'));_0x4de37c(_0x18e712[_0x5727('0x10')][_0x5727('0xe')]);}})[_0x5727('0x11')](function(_0x273dc9){logger['error'](_0x5727('0x9'),_0x49184a,_0x273dc9);_0x129402(_0x273dc9);});});}
\ No newline at end of file
+var _0xc1d3=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x178dbe,_0x969fba){var _0x2c6ea5=function(_0x3fcac7){while(--_0x3fcac7){_0x178dbe['push'](_0x178dbe['shift']());}};_0x2c6ea5(++_0x969fba);}(_0xc1d3,0x147));var _0x3c1d=function(_0x2ec3c3,_0xc744cd){_0x2ec3c3=_0x2ec3c3-0x0;var _0x5b374a=_0xc1d3[_0x2ec3c3];return _0x5b374a;};'use strict';var _=require(_0x3c1d('0x0'));var util=require(_0x3c1d('0x1'));var moment=require(_0x3c1d('0x2'));var BPromise=require(_0x3c1d('0x3'));var rs=require(_0x3c1d('0x4'));var fs=require('fs');var Redis=require(_0x3c1d('0x5'));var db=require(_0x3c1d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3c1d('0x7'));var config=require(_0x3c1d('0x8'));var jayson=require(_0x3c1d('0x9'));var client=jayson['client'][_0x3c1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36863b,_0x3bef1a,_0x28793c){return new BPromise(function(_0x1796a0,_0x58e08c){return client[_0x3c1d('0xb')](_0x36863b,_0x28793c)[_0x3c1d('0xc')](function(_0x33cb1b){logger[_0x3c1d('0xd')](_0x3c1d('0xe'),_0x3bef1a,_0x3c1d('0xf'));logger[_0x3c1d('0x10')](_0x3c1d('0x11'),_0x3bef1a,'request\x20sent',JSON[_0x3c1d('0x12')](_0x33cb1b));if(_0x33cb1b[_0x3c1d('0x13')]){if(_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x14')]===0x1f4){logger[_0x3c1d('0x13')]('Automation,\x20%s,\x20%s',_0x3bef1a,_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x15')]);return _0x58e08c(_0x33cb1b['error'][_0x3c1d('0x15')]);}logger['error']('Automation,\x20%s,\x20%s',_0x3bef1a,_0x33cb1b['error'][_0x3c1d('0x15')]);return _0x1796a0(_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x15')]);}else{logger[_0x3c1d('0xd')](_0x3c1d('0xe'),_0x3bef1a,_0x3c1d('0xf'));_0x1796a0(_0x33cb1b['result']['message']);}})[_0x3c1d('0x16')](function(_0x5ab3b0){logger[_0x3c1d('0x13')](_0x3c1d('0xe'),_0x3bef1a,_0x5ab3b0);_0x58e08c(_0x5ab3b0);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 1d3c5a2..d5b8b42 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 _0x7846=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','/:id','destroy'];(function(_0x17b85e,_0x3cf19a){var _0x34c9e0=function(_0x4eb448){while(--_0x4eb448){_0x17b85e['push'](_0x17b85e['shift']());}};_0x34c9e0(++_0x3cf19a);}(_0x7846,0xf4));var _0x6784=function(_0x2caf3a,_0x1d65d6){_0x2caf3a=_0x2caf3a-0x0;var _0x34f044=_0x7846[_0x2caf3a];return _0x34f044;};'use strict';var multer=require('multer');var util=require(_0x6784('0x0'));var path=require(_0x6784('0x1'));var timeout=require(_0x6784('0x2'));var express=require(_0x6784('0x3'));var router=express[_0x6784('0x4')]();var fs_extra=require(_0x6784('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6784('0x6'));var config=require(_0x6784('0x7'));var controller=require(_0x6784('0x8'));router[_0x6784('0x9')]('/',auth[_0x6784('0xa')](),controller[_0x6784('0xb')]);router[_0x6784('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6784('0xc')]);router[_0x6784('0x9')](_0x6784('0xd'),auth[_0x6784('0xa')](),controller[_0x6784('0xe')]);router[_0x6784('0x9')](_0x6784('0xf'),auth[_0x6784('0xa')](),controller[_0x6784('0x10')]);router[_0x6784('0x11')]('/',auth[_0x6784('0xa')](),controller[_0x6784('0x12')]);router[_0x6784('0x11')](_0x6784('0xd'),auth[_0x6784('0xa')](),controller[_0x6784('0x13')]);router['post'](_0x6784('0xf'),auth[_0x6784('0xa')](),controller[_0x6784('0x14')]);router[_0x6784('0x15')]('/:id',auth[_0x6784('0xa')](),controller[_0x6784('0x16')]);router[_0x6784('0x17')](_0x6784('0x18'),auth[_0x6784('0xa')](),controller[_0x6784('0x19')]);module[_0x6784('0x1a')]=router;
\ No newline at end of file
+var _0x9cff=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x9cff,0x1b0));var _0xf9cf=function(_0xa9af46,_0x32ab25){_0xa9af46=_0xa9af46-0x0;var _0x24822d=_0x9cff[_0xa9af46];return _0x24822d;};'use strict';var multer=require('multer');var util=require(_0xf9cf('0x0'));var path=require(_0xf9cf('0x1'));var timeout=require(_0xf9cf('0x2'));var express=require('express');var router=express[_0xf9cf('0x3')]();var fs_extra=require(_0xf9cf('0x4'));var auth=require(_0xf9cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf9cf('0x6'));var controller=require(_0xf9cf('0x7'));router[_0xf9cf('0x8')]('/',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xa')]);router[_0xf9cf('0x8')](_0xf9cf('0xb'),auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xc')]);router[_0xf9cf('0x8')](_0xf9cf('0xd'),auth['isAuthenticated'](),controller[_0xf9cf('0xe')]);router[_0xf9cf('0x8')]('/:id/actions',auth[_0xf9cf('0x9')](),controller['getActions']);router['post']('/',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xf')]);router['post'](_0xf9cf('0xd'),auth['isAuthenticated'](),controller[_0xf9cf('0x10')]);router['post'](_0xf9cf('0x11'),auth['isAuthenticated'](),controller[_0xf9cf('0x12')]);router[_0xf9cf('0x13')](_0xf9cf('0xb'),auth[_0xf9cf('0x9')](),controller[_0xf9cf('0x14')]);router[_0xf9cf('0x15')](_0xf9cf('0xb'),auth['isAuthenticated'](),controller[_0xf9cf('0x16')]);module[_0xf9cf('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 15a2e3b..be9c658 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 _0x7285=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x23869b,_0x28d453){var _0x378f88=function(_0x1e6c40){while(--_0x1e6c40){_0x23869b['push'](_0x23869b['shift']());}};_0x378f88(++_0x28d453);}(_0x7285,0x102));var _0x5728=function(_0x4ddeb2,_0x4ed0b6){_0x4ddeb2=_0x4ddeb2-0x0;var _0x12dce6=_0x7285[_0x4ddeb2];return _0x12dce6;};'use strict';var Sequelize=require('sequelize');module[_0x5728('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5728('0x1')]('ivr'),'allowNull':![],'defaultValue':_0x5728('0x2')},'description':{'type':Sequelize[_0x5728('0x3')]},'active':{'type':Sequelize[_0x5728('0x4')],'defaultValue':0x0,'comment':_0x5728('0x5')},'limitCalls':{'type':Sequelize[_0x5728('0x6')](0x4)[_0x5728('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5728('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5728('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x5728('0x6')](0x3)[_0x5728('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5728('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5728('0x6')](0x3)[_0x5728('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5728('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5728('0x6')](0x5)[_0x5728('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5728('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x5728('0x6')](0x3)[_0x5728('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5728('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5728('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5728('0x6')](0x3)[_0x5728('0x7')],'defaultValue':0x3,'comment':_0x5728('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5728('0x6')](0x5)[_0x5728('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5728('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5728('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5728('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x5728('0x1')](_0x5728('0xe'),'never','onlyIfOpen'),'defaultValue':_0x5728('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5728('0xf')},'dialAMDInitialSilence':{'type':Sequelize[_0x5728('0x6')](0x9)[_0x5728('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5728('0x10')},'dialAMDGreeting':{'type':Sequelize[_0x5728('0x6')](0x9)[_0x5728('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5728('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5728('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5728('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5728('0x6')](0x9)[_0x5728('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5728('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5728('0x6')](0x9)[_0x5728('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5728('0x6')](0x9)[_0x5728('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5728('0x13')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5728('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5728('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5728('0x6')](0x9)[_0x5728('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5728('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5728('0x1')](_0x5728('0x16'),_0x5728('0x17')),'defaultValue':_0x5728('0x16')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x5728('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5728('0x18')},'dialCutDigit':{'type':Sequelize[_0x5728('0x6')](0x3)[_0x5728('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5728('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5728('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5728('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5728('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5728('0x1b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5728('0x6')](0x3)[_0x5728('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5728('0x6')](0x5)[_0x5728('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5728('0x1c')},'dialMachineMaxRetry':{'type':Sequelize[_0x5728('0x6')](0x3)[_0x5728('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5728('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5728('0x6')](0x5)[_0x5728('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5728('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5728('0x1e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5728('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5728('0x1f')}};
\ No newline at end of file
+var _0x2675=['STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports'];(function(_0x303c0a,_0x1b2e62){var _0x233310=function(_0x358546){while(--_0x358546){_0x303c0a['push'](_0x303c0a['shift']());}};_0x233310(++_0x1b2e62);}(_0x2675,0x1ab));var _0x5267=function(_0x49e066,_0x27e060){_0x49e066=_0x49e066-0x0;var _0x49ba9b=_0x2675[_0x49e066];return _0x49ba9b;};'use strict';var Sequelize=require(_0x5267('0x0'));module[_0x5267('0x1')]={'name':{'type':Sequelize[_0x5267('0x2')],'unique':_0x5267('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5267('0x4')](_0x5267('0x5')),'allowNull':![],'defaultValue':_0x5267('0x5')},'description':{'type':Sequelize[_0x5267('0x2')]},'active':{'type':Sequelize[_0x5267('0x6')],'defaultValue':0x0,'comment':_0x5267('0x7')},'limitCalls':{'type':Sequelize[_0x5267('0x8')](0x4)[_0x5267('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5267('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5267('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x10')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5267('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5267('0x2')],'defaultValue':_0x5267('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5267('0x13'),'never',_0x5267('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5267('0x6')],'defaultValue':0x0,'comment':_0x5267('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x5267('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5267('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x5267('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5267('0x8')](0x9)[_0x5267('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x5267('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5267('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x5267('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5267('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5267('0x8')](0x9)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5267('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5267('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5267('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5267('0x8')](0x9)[_0x5267('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5267('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5267('0x4')](_0x5267('0x1c'),'ASC'),'defaultValue':_0x5267('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5267('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5267('0x1d')},'dialCutDigit':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5267('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 7251a4c..fe20d45 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 _0x218f=['createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CmHopper','rawAttributes','nolimit','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','cm_hopper','fromQuery','ContactId','ListId','select','phone','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','into','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','Campaign','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','role','IvrCampaigns','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit'];(function(_0x1303b5,_0x1f3d11){var _0x59f0f4=function(_0x273773){while(--_0x273773){_0x1303b5['push'](_0x1303b5['shift']());}};_0x59f0f4(++_0x1f3d11);}(_0x218f,0x139));var _0xf218=function(_0x1f00cc,_0x2b4ced){_0x1f00cc=_0x1f00cc-0x0;var _0x68036b=_0x218f[_0x1f00cc];return _0x68036b;};'use strict';var emlformat=require(_0xf218('0x0'));var rimraf=require(_0xf218('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf218('0x2'));var moment=require(_0xf218('0x3'));var BPromise=require(_0xf218('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf218('0x5'));var sox=require(_0xf218('0x6'));var csv=require(_0xf218('0x7'));var ejs=require(_0xf218('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf218('0x9'));var squel=require(_0xf218('0xa'));var crypto=require(_0xf218('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf218('0xc'));var toCsv=require(_0xf218('0x7'));var querystring=require(_0xf218('0xd'));var Papa=require('papaparse');var Redis=require(_0xf218('0xe'));var authService=require(_0xf218('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf218('0x10'));var hardwareService=require(_0xf218('0x11'));var logger=require(_0xf218('0x12'))(_0xf218('0x13'));var utils=require('../../config/utils');var config=require(_0xf218('0x14'));var licenseUtil=require(_0xf218('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d4d63,_0x585e90){_0x585e90=_0x585e90||0xcc;return function(_0x22fedc){if(_0x22fedc){return _0x5d4d63[_0xf218('0x16')](_0x585e90);}return _0x5d4d63[_0xf218('0x17')](_0x585e90)[_0xf218('0x18')]();};}function respondWithResult(_0x5e81df,_0x461928){_0x461928=_0x461928||0xc8;return function(_0x186bd6){if(_0x186bd6){return _0x5e81df[_0xf218('0x17')](_0x461928)[_0xf218('0x19')](_0x186bd6);}};}function respondWithFilteredResult(_0x3d0771,_0x47c1f0){return function(_0x276bfa){if(_0x276bfa){var _0x22efaa=typeof _0x47c1f0[_0xf218('0x1a')]===_0xf218('0x1b')&&typeof _0x47c1f0[_0xf218('0x1c')]===_0xf218('0x1b');var _0x1c4f23=_0x276bfa['count'];var _0x2174de=_0x22efaa?0x0:_0x47c1f0[_0xf218('0x1a')];var _0x340f20=_0x22efaa?_0x276bfa[_0xf218('0x1d')]:_0x47c1f0[_0xf218('0x1a')]+_0x47c1f0[_0xf218('0x1c')];var _0x5c52a4;if(_0x340f20>=_0x1c4f23){_0x340f20=_0x1c4f23;_0x5c52a4=0xc8;}else{_0x5c52a4=0xce;}_0x3d0771['status'](_0x5c52a4);return _0x3d0771['set']('Content-Range',_0x2174de+'-'+_0x340f20+'/'+_0x1c4f23)['json'](_0x276bfa);}return null;};}function patchUpdates(_0x60a1dd){return function(_0x372d06){try{jsonpatch[_0xf218('0x1e')](_0x372d06,_0x60a1dd,!![]);}catch(_0x4ec4c5){return BPromise['reject'](_0x4ec4c5);}return _0x372d06['save']();};}function saveUpdates(_0x4dd0bf,_0x407d6f){return function(_0x21536e){if(_0x21536e){return _0x21536e[_0xf218('0x1f')](_0x4dd0bf)[_0xf218('0x20')](function(_0x490666){return _0x490666;});}return null;};}function removeEntity(_0x271f41,_0xbd5ee7){return function(_0x409b65){if(_0x409b65){return _0x409b65['destroy']()[_0xf218('0x20')](function(){var _0x6fcbc9=_0x409b65[_0xf218('0x21')]({'plain':!![]});var _0x275c2c='IvrCampaigns';return db[_0xf218('0x22')][_0xf218('0x23')]({'where':{'type':_0x275c2c,'resourceId':_0x6fcbc9['id']}})[_0xf218('0x20')](function(){return _0x409b65;});})[_0xf218('0x20')](function(){_0x271f41[_0xf218('0x17')](0xcc)[_0xf218('0x18')]();});}};}function handleEntityNotFound(_0x273ace,_0x21a392){return function(_0x5beea7){if(!_0x5beea7){_0x273ace[_0xf218('0x16')](0x194);}return _0x5beea7;};}function handleError(_0x537429,_0x196ae4){_0x196ae4=_0x196ae4||0x1f4;return function(_0x272b65){logger[_0xf218('0x24')](_0x272b65[_0xf218('0x25')]);if(_0x272b65[_0xf218('0x26')]){delete _0x272b65[_0xf218('0x26')];}_0x537429[_0xf218('0x17')](_0x196ae4)['send'](_0x272b65);};}exports[_0xf218('0x27')]=function(_0x2ad6ee,_0x1fdb33){var _0x5019be={},_0x196006={},_0x2e41d1={'count':0x0,'rows':[]};var _0x31cc80=_[_0xf218('0x28')](db[_0xf218('0x29')]['rawAttributes'],function(_0xfe859c){return{'name':_0xfe859c[_0xf218('0x2a')],'type':_0xfe859c[_0xf218('0x2b')][_0xf218('0x2c')]};});_0x196006[_0xf218('0x2d')]=_[_0xf218('0x28')](_0x31cc80,_0xf218('0x26'));_0x196006[_0xf218('0x2e')]=_[_0xf218('0x2f')](_0x2ad6ee[_0xf218('0x2e')]);_0x196006[_0xf218('0x30')]=_[_0xf218('0x31')](_0x196006[_0xf218('0x2d')],_0x196006[_0xf218('0x2e')]);_0x5019be['attributes']=_['intersection'](_0x196006[_0xf218('0x2d')],qs[_0xf218('0x32')](_0x2ad6ee[_0xf218('0x2e')]['fields']));_0x5019be[_0xf218('0x33')]=_0x5019be[_0xf218('0x33')][_0xf218('0x34')]?_0x5019be[_0xf218('0x33')]:_0x196006['model'];if(!_0x2ad6ee[_0xf218('0x2e')][_0xf218('0x35')]('nolimit')){_0x5019be[_0xf218('0x1c')]=qs[_0xf218('0x1c')](_0x2ad6ee['query'][_0xf218('0x1c')]);_0x5019be[_0xf218('0x1a')]=qs['offset'](_0x2ad6ee[_0xf218('0x2e')]['offset']);}_0x5019be[_0xf218('0x36')]=qs['sort'](_0x2ad6ee[_0xf218('0x2e')][_0xf218('0x37')]);_0x5019be[_0xf218('0x38')]=qs[_0xf218('0x30')](_[_0xf218('0x39')](_0x2ad6ee['query'],_0x196006['filters']),_0x31cc80);if(_0x2ad6ee['query'][_0xf218('0x3a')]){_0x5019be['where']=_[_0xf218('0x3b')](_0x5019be[_0xf218('0x38')],{'$or':_[_0xf218('0x28')](_0x31cc80,function(_0x30bb40){if(_0x30bb40['type']!==_0xf218('0x3c')){var _0x44af9d={};_0x44af9d[_0x30bb40[_0xf218('0x26')]]={'$like':'%'+_0x2ad6ee[_0xf218('0x2e')]['filter']+'%'};return _0x44af9d;}})});}_0x5019be=_['merge']({},_0x5019be,_0x2ad6ee[_0xf218('0x3d')]);var _0xc2f54a={'where':_0x5019be[_0xf218('0x38')]};return db[_0xf218('0x29')]['count'](_0xc2f54a)[_0xf218('0x20')](function(_0x16e38c){_0x2e41d1['count']=_0x16e38c;if(_0x2ad6ee[_0xf218('0x2e')][_0xf218('0x3e')]){_0x5019be[_0xf218('0x3f')]=[{'all':!![]}];}return db[_0xf218('0x29')][_0xf218('0x40')](_0x5019be);})['then'](function(_0x3389d7){_0x2e41d1[_0xf218('0x41')]=_0x3389d7;return _0x2e41d1;})['then'](respondWithFilteredResult(_0x1fdb33,_0x5019be))[_0xf218('0x42')](handleError(_0x1fdb33,null));};exports[_0xf218('0x43')]=function(_0x1c60d7,_0x4c9222){var _0x58d2ff={'raw':![],'where':{'id':_0x1c60d7[_0xf218('0x44')]['id']}},_0x2e4381={};_0x2e4381[_0xf218('0x2d')]=_[_0xf218('0x2f')](db[_0xf218('0x29')]['rawAttributes']);_0x2e4381[_0xf218('0x2e')]=_[_0xf218('0x2f')](_0x1c60d7[_0xf218('0x2e')]);_0x2e4381[_0xf218('0x30')]=_['intersection'](_0x2e4381['model'],_0x2e4381['query']);_0x58d2ff[_0xf218('0x33')]=_[_0xf218('0x31')](_0x2e4381[_0xf218('0x2d')],qs[_0xf218('0x32')](_0x1c60d7[_0xf218('0x2e')][_0xf218('0x32')]));_0x58d2ff[_0xf218('0x33')]=_0x58d2ff[_0xf218('0x33')]['length']?_0x58d2ff['attributes']:_0x2e4381[_0xf218('0x2d')];if(_0x1c60d7[_0xf218('0x2e')][_0xf218('0x3e')]){_0x58d2ff[_0xf218('0x3f')]=[{'all':!![]}];}_0x58d2ff=_[_0xf218('0x3b')]({},_0x58d2ff,_0x1c60d7[_0xf218('0x3d')]);return db[_0xf218('0x29')]['find'](_0x58d2ff)[_0xf218('0x20')](handleEntityNotFound(_0x4c9222,null))['then'](respondWithResult(_0x4c9222,null))[_0xf218('0x42')](handleError(_0x4c9222,null));};exports['create']=function(_0x574965,_0x369cb7){return db[_0xf218('0x29')][_0xf218('0x45')](_0x574965[_0xf218('0x46')],{})['then'](function(_0x4226c1){var _0x40e74d=_0x574965[_0xf218('0x47')][_0xf218('0x21')]({'plain':!![]});if(!_0x40e74d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40e74d[_0xf218('0x48')]===_0xf218('0x47')){var _0x340c8f=_0x4226c1[_0xf218('0x21')]({'plain':!![]});var _0x4a6ee8=_0xf218('0x49');return db['UserProfileSection'][_0xf218('0x4a')]({'where':{'name':_0x4a6ee8,'userProfileId':_0x40e74d[_0xf218('0x4b')]},'raw':!![]})['then'](function(_0x13f119){if(_0x13f119&&_0x13f119[_0xf218('0x4c')]===0x0){return db[_0xf218('0x22')][_0xf218('0x45')]({'name':_0x340c8f[_0xf218('0x26')],'resourceId':_0x340c8f['id'],'type':_0x13f119['name'],'sectionId':_0x13f119['id']},{})[_0xf218('0x20')](function(){return _0x4226c1;});}else{return _0x4226c1;}})['catch'](function(_0x18726f){logger['error'](_0xf218('0x4d'),_0x18726f);throw _0x18726f;});}return _0x4226c1;})[_0xf218('0x20')](respondWithResult(_0x369cb7,0xc9))[_0xf218('0x42')](handleError(_0x369cb7,null));};exports[_0xf218('0x4e')]=function(_0x14e69d,_0x42ba6b){var _0x5b28e4={'where':{'id':_0x14e69d[_0xf218('0x44')]['id']}},_0xd6231f={};_0xd6231f[_0xf218('0x2d')]=_[_0xf218('0x2f')](db['Campaign']['rawAttributes']);_0x5b28e4[_0xf218('0x33')]=_['intersection'](_0xd6231f[_0xf218('0x2d')],qs['fields'](_0x14e69d['query'][_0xf218('0x32')]));_0x5b28e4[_0xf218('0x33')]=_0x5b28e4[_0xf218('0x33')][_0xf218('0x34')]?_0x5b28e4[_0xf218('0x33')]:_0xd6231f[_0xf218('0x2d')];if(_0x14e69d[_0xf218('0x2e')][_0xf218('0x3e')]){_0x5b28e4[_0xf218('0x3f')]=[{'all':!![]}];}_0x5b28e4=_[_0xf218('0x3b')]({},_0x5b28e4,_0x14e69d[_0xf218('0x3d')]);return db[_0xf218('0x29')]['find'](_0x5b28e4)[_0xf218('0x20')](handleEntityNotFound(_0x42ba6b,null))[_0xf218('0x20')](function(_0xca0b77){if(_0xca0b77){var _0x567532=_0xca0b77[_0xf218('0x21')]({'plain':!![]});_0x567532=qs[_0xf218('0x4f')](_0x567532,['id',_0xf218('0x50'),_0xf218('0x51')]);_0x14e69d[_0xf218('0x46')]=_['omit'](_0x14e69d[_0xf218('0x46')],['id','createdAt',_0xf218('0x51')]);return db[_0xf218('0x29')][_0xf218('0x45')](_[_0xf218('0x3b')](_0x567532,_0x14e69d[_0xf218('0x46')]),{'include':_0x14e69d[_0xf218('0x2e')][_0xf218('0x3e')]?[{'all':!![]}]:undefined})[_0xf218('0x20')](function(_0x138de7){var _0x5e184e=_0x14e69d[_0xf218('0x47')][_0xf218('0x21')]({'plain':!![]});if(!_0x5e184e)throw new Error(_0xf218('0x52'));if(_0x5e184e[_0xf218('0x48')]===_0xf218('0x47')){var _0xa4d458=_0x138de7[_0xf218('0x21')]({'plain':!![]});var _0x1702fb=_0xf218('0x49');return db[_0xf218('0x53')][_0xf218('0x4a')]({'where':{'name':_0x1702fb,'userProfileId':_0x5e184e[_0xf218('0x4b')]},'raw':!![]})['then'](function(_0x17fc43){if(_0x17fc43&&_0x17fc43[_0xf218('0x4c')]===0x0){return db[_0xf218('0x22')][_0xf218('0x45')]({'name':_0xa4d458[_0xf218('0x26')],'resourceId':_0xa4d458['id'],'type':_0x17fc43[_0xf218('0x26')],'sectionId':_0x17fc43['id']},{})[_0xf218('0x20')](function(){return _0x138de7;});}else{return _0x138de7;}})[_0xf218('0x42')](function(_0x32f83a){logger['error'](_0xf218('0x4d'),_0x32f83a);throw _0x32f83a;});}return _0x138de7;});}})[_0xf218('0x20')](respondWithResult(_0x42ba6b,0xc9))['catch'](handleError(_0x42ba6b,null));};exports[_0xf218('0x1f')]=function(_0x116295,_0xa75067){if(_0x116295[_0xf218('0x46')]['id']){delete _0x116295[_0xf218('0x46')]['id'];}return db['Campaign'][_0xf218('0x4a')]({'where':{'id':_0x116295['params']['id']}})[_0xf218('0x20')](handleEntityNotFound(_0xa75067,null))[_0xf218('0x20')](saveUpdates(_0x116295[_0xf218('0x46')],null))[_0xf218('0x20')](respondWithResult(_0xa75067,null))[_0xf218('0x42')](handleError(_0xa75067,null));};exports[_0xf218('0x23')]=function(_0x2cd065,_0x472410){return db[_0xf218('0x29')]['find']({'where':{'id':_0x2cd065[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x472410,null))[_0xf218('0x20')](removeEntity(_0x472410,null))[_0xf218('0x42')](handleError(_0x472410,null));};exports['getHoppers']=function(_0x343b4e,_0x1879c4,_0x2c0ae0){var _0x167ea7={'raw':!![],'where':{}};var _0x5b95f8={};var _0x42882f={'count':0x0,'rows':[]};return db[_0xf218('0x29')]['findOne']({'where':{'id':_0x343b4e[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x1879c4,null))[_0xf218('0x20')](function(_0x49e82b){if(_0x49e82b){_0x5b95f8[_0xf218('0x2d')]=_[_0xf218('0x2f')](db[_0xf218('0x54')][_0xf218('0x55')]);_0x5b95f8[_0xf218('0x2e')]=_[_0xf218('0x2f')](_0x343b4e[_0xf218('0x2e')]);_0x5b95f8['filters']=_[_0xf218('0x31')](_0x5b95f8[_0xf218('0x2d')],_0x5b95f8['query']);_0x167ea7[_0xf218('0x33')]=_[_0xf218('0x31')](_0x5b95f8[_0xf218('0x2d')],qs[_0xf218('0x32')](_0x343b4e[_0xf218('0x2e')][_0xf218('0x32')]));_0x167ea7[_0xf218('0x33')]=_0x167ea7[_0xf218('0x33')][_0xf218('0x34')]?_0x167ea7[_0xf218('0x33')]:_0x5b95f8[_0xf218('0x2d')];if(!_0x343b4e['query'][_0xf218('0x35')](_0xf218('0x56'))){_0x167ea7[_0xf218('0x1c')]=qs[_0xf218('0x1c')](_0x343b4e[_0xf218('0x2e')][_0xf218('0x1c')]);_0x167ea7[_0xf218('0x1a')]=qs[_0xf218('0x1a')](_0x343b4e[_0xf218('0x2e')]['offset']);}_0x167ea7[_0xf218('0x36')]=qs['sort'](_0x343b4e[_0xf218('0x2e')][_0xf218('0x37')]);_0x167ea7['where']=qs['filters'](_[_0xf218('0x39')](_0x343b4e[_0xf218('0x2e')],_0x5b95f8[_0xf218('0x30')]));_0x167ea7[_0xf218('0x38')][_0xf218('0x57')]=_0x49e82b['id'];if(_0x343b4e[_0xf218('0x2e')][_0xf218('0x3a')]){_0x167ea7[_0xf218('0x38')]=_['merge'](_0x167ea7[_0xf218('0x38')],{'$or':_[_0xf218('0x28')](_0x167ea7[_0xf218('0x33')],function(_0x32d6a4){var _0x5dabb3={};_0x5dabb3[_0x32d6a4]={'$like':'%'+_0x343b4e[_0xf218('0x2e')][_0xf218('0x3a')]+'%'};return _0x5dabb3;})});}_0x167ea7=_[_0xf218('0x3b')]({},_0x167ea7,_0x343b4e[_0xf218('0x3d')]);return db[_0xf218('0x54')]['count']({'where':_0x167ea7[_0xf218('0x38')]})['then'](function(_0x1419a7){_0x42882f[_0xf218('0x1d')]=_0x1419a7;if(_0x343b4e[_0xf218('0x2e')][_0xf218('0x3e')]){_0x167ea7[_0xf218('0x3f')]=[{'all':!![]}];}return db[_0xf218('0x54')][_0xf218('0x40')](_0x167ea7);})[_0xf218('0x20')](function(_0x364bf6){_0x42882f[_0xf218('0x41')]=_0x364bf6;return _0x42882f;});}})[_0xf218('0x20')](respondWithFilteredResult(_0x1879c4,_0x167ea7))[_0xf218('0x42')](handleError(_0x1879c4,null));};exports[_0xf218('0x58')]=function(_0x161519,_0x1b727f,_0x2cc9b9){var _0x5e4de5={'raw':!![],'where':{}};var _0x4121a1={};var _0x4f998f={'count':0x0,'rows':[]};return db[_0xf218('0x29')][_0xf218('0x59')]({'where':{'id':_0x161519[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x1b727f,null))['then'](function(_0x1556ab){if(_0x1556ab){_0x4121a1['model']=_['keys'](db[_0xf218('0x5a')]['rawAttributes']);_0x4121a1[_0xf218('0x2e')]=_[_0xf218('0x2f')](_0x161519['query']);_0x4121a1[_0xf218('0x30')]=_[_0xf218('0x31')](_0x4121a1['model'],_0x4121a1[_0xf218('0x2e')]);_0x5e4de5['attributes']=_[_0xf218('0x31')](_0x4121a1[_0xf218('0x2d')],qs[_0xf218('0x32')](_0x161519[_0xf218('0x2e')][_0xf218('0x32')]));_0x5e4de5[_0xf218('0x33')]=_0x5e4de5[_0xf218('0x33')][_0xf218('0x34')]?_0x5e4de5[_0xf218('0x33')]:_0x4121a1[_0xf218('0x2d')];if(!_0x161519[_0xf218('0x2e')][_0xf218('0x35')](_0xf218('0x56'))){_0x5e4de5[_0xf218('0x1c')]=qs['limit'](_0x161519[_0xf218('0x2e')][_0xf218('0x1c')]);_0x5e4de5[_0xf218('0x1a')]=qs['offset'](_0x161519[_0xf218('0x2e')][_0xf218('0x1a')]);}_0x5e4de5[_0xf218('0x36')]=qs[_0xf218('0x37')](_0x161519[_0xf218('0x2e')]['sort']);_0x5e4de5[_0xf218('0x38')]=qs[_0xf218('0x30')](_[_0xf218('0x39')](_0x161519['query'],_0x4121a1[_0xf218('0x30')]));_0x5e4de5[_0xf218('0x38')][_0xf218('0x57')]=_0x1556ab['id'];if(_0x161519[_0xf218('0x2e')][_0xf218('0x3a')]){_0x5e4de5['where']=_[_0xf218('0x3b')](_0x5e4de5[_0xf218('0x38')],{'$or':_['map'](_0x5e4de5['attributes'],function(_0xef26ca){var _0x38b714={};_0x38b714[_0xef26ca]={'$like':'%'+_0x161519[_0xf218('0x2e')][_0xf218('0x3a')]+'%'};return _0x38b714;})});}_0x5e4de5=_[_0xf218('0x3b')]({},_0x5e4de5,_0x161519[_0xf218('0x3d')]);return db[_0xf218('0x5a')][_0xf218('0x1d')]({'where':_0x5e4de5[_0xf218('0x38')]})[_0xf218('0x20')](function(_0xb6d716){_0x4f998f[_0xf218('0x1d')]=_0xb6d716;if(_0x161519[_0xf218('0x2e')][_0xf218('0x3e')]){_0x5e4de5['include']=[{'all':!![]}];}return db[_0xf218('0x5a')][_0xf218('0x40')](_0x5e4de5);})[_0xf218('0x20')](function(_0xabba67){_0x4f998f[_0xf218('0x41')]=_0xabba67;return _0x4f998f;});}})[_0xf218('0x20')](respondWithFilteredResult(_0x1b727f,_0x5e4de5))['catch'](handleError(_0x1b727f,null));};exports[_0xf218('0x5b')]=function(_0x58f944,_0x51fbab,_0x267aed){var _0x424605={'raw':!![],'where':{}};var _0xff599={};var _0x52b676={'count':0x0,'rows':[]};return db[_0xf218('0x29')][_0xf218('0x59')]({'where':{'id':_0x58f944[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x51fbab,null))[_0xf218('0x20')](function(_0x1f0cdc){if(_0x1f0cdc){_0xff599[_0xf218('0x2d')]=_[_0xf218('0x2f')](db[_0xf218('0x5c')]['rawAttributes']);_0xff599[_0xf218('0x2e')]=_[_0xf218('0x2f')](_0x58f944[_0xf218('0x2e')]);_0xff599['filters']=_['intersection'](_0xff599[_0xf218('0x2d')],_0xff599['query']);_0x424605[_0xf218('0x33')]=_[_0xf218('0x31')](_0xff599['model'],qs['fields'](_0x58f944[_0xf218('0x2e')][_0xf218('0x32')]));_0x424605[_0xf218('0x33')]=_0x424605[_0xf218('0x33')][_0xf218('0x34')]?_0x424605[_0xf218('0x33')]:_0xff599[_0xf218('0x2d')];if(!_0x58f944[_0xf218('0x2e')][_0xf218('0x35')](_0xf218('0x56'))){_0x424605[_0xf218('0x1c')]=qs[_0xf218('0x1c')](_0x58f944[_0xf218('0x2e')][_0xf218('0x1c')]);_0x424605['offset']=qs[_0xf218('0x1a')](_0x58f944[_0xf218('0x2e')][_0xf218('0x1a')]);}_0x424605[_0xf218('0x36')]=qs['sort'](_0x58f944[_0xf218('0x2e')]['sort']);_0x424605[_0xf218('0x38')]=qs[_0xf218('0x30')](_['pick'](_0x58f944[_0xf218('0x2e')],_0xff599[_0xf218('0x30')]));_0x424605['where'][_0xf218('0x57')]=_0x1f0cdc['id'];if(_0x58f944[_0xf218('0x2e')][_0xf218('0x3a')]){_0x424605[_0xf218('0x38')]=_[_0xf218('0x3b')](_0x424605[_0xf218('0x38')],{'$or':_['map'](_0x424605[_0xf218('0x33')],function(_0x579760){var _0x25d91e={};_0x25d91e[_0x579760]={'$like':'%'+_0x58f944[_0xf218('0x2e')]['filter']+'%'};return _0x25d91e;})});}_0x424605=_[_0xf218('0x3b')]({},_0x424605,_0x58f944[_0xf218('0x3d')]);return db[_0xf218('0x5c')]['count']({'where':_0x424605[_0xf218('0x38')]})[_0xf218('0x20')](function(_0x1b0500){_0x52b676[_0xf218('0x1d')]=_0x1b0500;if(_0x58f944[_0xf218('0x2e')][_0xf218('0x3e')]){_0x424605[_0xf218('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x424605);})[_0xf218('0x20')](function(_0x1727aa){_0x52b676[_0xf218('0x41')]=_0x1727aa;return _0x52b676;});}})['then'](respondWithFilteredResult(_0x51fbab,_0x424605))['catch'](handleError(_0x51fbab,null));};exports[_0xf218('0x5d')]=function(_0xf2560a,_0x1232b1,_0xd8abfc){var _0x4bf8af={'raw':!![],'where':{}};var _0x4694f8={};var _0x23a8e5={'count':0x0,'rows':[]};return db[_0xf218('0x29')][_0xf218('0x59')]({'where':{'id':_0xf2560a[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x1232b1,null))[_0xf218('0x20')](function(_0x507d16){if(_0x507d16){_0x4694f8[_0xf218('0x2d')]=_[_0xf218('0x2f')](db[_0xf218('0x5e')][_0xf218('0x55')]);_0x4694f8['query']=_[_0xf218('0x2f')](_0xf2560a['query']);_0x4694f8['filters']=_[_0xf218('0x31')](_0x4694f8['model'],_0x4694f8['query']);_0x4bf8af[_0xf218('0x33')]=_[_0xf218('0x31')](_0x4694f8[_0xf218('0x2d')],qs[_0xf218('0x32')](_0xf2560a[_0xf218('0x2e')][_0xf218('0x32')]));_0x4bf8af[_0xf218('0x33')]=_0x4bf8af[_0xf218('0x33')]['length']?_0x4bf8af[_0xf218('0x33')]:_0x4694f8[_0xf218('0x2d')];if(!_0xf2560a[_0xf218('0x2e')][_0xf218('0x35')](_0xf218('0x56'))){_0x4bf8af[_0xf218('0x1c')]=qs[_0xf218('0x1c')](_0xf2560a['query'][_0xf218('0x1c')]);_0x4bf8af[_0xf218('0x1a')]=qs[_0xf218('0x1a')](_0xf2560a[_0xf218('0x2e')][_0xf218('0x1a')]);}_0x4bf8af[_0xf218('0x36')]=qs['sort'](_0xf2560a[_0xf218('0x2e')][_0xf218('0x37')]);_0x4bf8af['where']=qs[_0xf218('0x30')](_[_0xf218('0x39')](_0xf2560a['query'],_0x4694f8[_0xf218('0x30')]));_0x4bf8af[_0xf218('0x38')][_0xf218('0x57')]=_0x507d16['id'];if(_0xf2560a[_0xf218('0x2e')][_0xf218('0x3a')]){_0x4bf8af['where']=_[_0xf218('0x3b')](_0x4bf8af[_0xf218('0x38')],{'$or':_[_0xf218('0x28')](_0x4bf8af[_0xf218('0x33')],function(_0x3c187f){var _0x237cb3={};_0x237cb3[_0x3c187f]={'$like':'%'+_0xf2560a[_0xf218('0x2e')][_0xf218('0x3a')]+'%'};return _0x237cb3;})});}_0x4bf8af=_[_0xf218('0x3b')]({},_0x4bf8af,_0xf2560a[_0xf218('0x3d')]);return db[_0xf218('0x5e')][_0xf218('0x1d')]({'where':_0x4bf8af['where']})['then'](function(_0x165507){_0x23a8e5[_0xf218('0x1d')]=_0x165507;if(_0xf2560a[_0xf218('0x2e')][_0xf218('0x3e')]){_0x4bf8af['include']=[{'all':!![]}];}return db[_0xf218('0x5e')]['findAll'](_0x4bf8af);})[_0xf218('0x20')](function(_0x3cf6be){_0x23a8e5['rows']=_0x3cf6be;return _0x23a8e5;});}})[_0xf218('0x20')](respondWithFilteredResult(_0x1232b1,_0x4bf8af))['catch'](handleError(_0x1232b1,null));};exports[_0xf218('0x5f')]=function(_0x1b6d2e,_0x434c72,_0x16184a){var _0x398461={};var _0x1b46a8={};var _0x640a4c;var _0x548995;return db[_0xf218('0x29')][_0xf218('0x59')]({'where':{'id':_0x1b6d2e[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x434c72,null))[_0xf218('0x20')](function(_0x143ea7){if(_0x143ea7){_0x640a4c=_0x143ea7;_0x1b46a8['model']=_['keys'](db[_0xf218('0x60')][_0xf218('0x55')]);_0x1b46a8[_0xf218('0x2e')]=_[_0xf218('0x2f')](_0x1b6d2e[_0xf218('0x2e')]);_0x1b46a8[_0xf218('0x30')]=_['intersection'](_0x1b46a8[_0xf218('0x2d')],_0x1b46a8[_0xf218('0x2e')]);_0x398461[_0xf218('0x33')]=_['intersection'](_0x1b46a8[_0xf218('0x2d')],qs[_0xf218('0x32')](_0x1b6d2e[_0xf218('0x2e')]['fields']));_0x398461[_0xf218('0x33')]=_0x398461['attributes']['length']?_0x398461[_0xf218('0x33')]:_0x1b46a8[_0xf218('0x2d')];_0x398461[_0xf218('0x36')]=qs[_0xf218('0x37')](_0x1b6d2e[_0xf218('0x2e')][_0xf218('0x37')]);_0x398461['where']=qs['filters'](_[_0xf218('0x39')](_0x1b6d2e[_0xf218('0x2e')],_0x1b46a8[_0xf218('0x30')]));if(_0x1b6d2e[_0xf218('0x2e')]['filter']){_0x398461[_0xf218('0x38')]=_[_0xf218('0x3b')](_0x398461[_0xf218('0x38')],{'$or':_['map'](_0x398461[_0xf218('0x33')],function(_0x5eff2d){var _0x26d588={};_0x26d588[_0x5eff2d]={'$like':'%'+_0x1b6d2e['query']['filter']+'%'};return _0x26d588;})});}_0x398461=_[_0xf218('0x3b')]({},_0x398461,_0x1b6d2e[_0xf218('0x3d')]);return _0x640a4c[_0xf218('0x5f')](_0x398461);}})[_0xf218('0x20')](function(_0x4d2982){if(_0x4d2982){_0x548995=_0x4d2982[_0xf218('0x34')];if(!_0x1b6d2e[_0xf218('0x2e')][_0xf218('0x35')](_0xf218('0x56'))){_0x398461[_0xf218('0x1c')]=qs[_0xf218('0x1c')](_0x1b6d2e[_0xf218('0x2e')]['limit']);_0x398461[_0xf218('0x1a')]=qs[_0xf218('0x1a')](_0x1b6d2e[_0xf218('0x2e')][_0xf218('0x1a')]);}return _0x640a4c[_0xf218('0x5f')](_0x398461);}})[_0xf218('0x20')](function(_0x55f80f){if(_0x55f80f){return _0x55f80f?{'count':_0x548995,'rows':_0x55f80f}:null;}})['then'](respondWithResult(_0x434c72,null))[_0xf218('0x42')](handleError(_0x434c72,null));};exports[_0xf218('0x61')]=function(_0x40ac6f,_0x3964d4,_0x44658c){var _0xc0c0e5,_0x396a0a;return db[_0xf218('0x29')][_0xf218('0x4a')]({'where':{'id':_0x40ac6f[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x3964d4,null))[_0xf218('0x20')](function(_0x14e7df){if(_0x14e7df){_0x396a0a=_0x14e7df;return _0x14e7df[_0xf218('0x61')](_0x40ac6f[_0xf218('0x46')][_0xf218('0x62')],_[_0xf218('0x4f')](_0x40ac6f['body'],[_0xf218('0x62'),'id'])||{});}return null;})[_0xf218('0x63')](function(_0x439c44){var _0x5064cf;_0xc0c0e5=_0x439c44||[];var _0x3e96c2=[];if(_0x439c44){for(var _0x13e32d=0x0;_0x13e32d<_0x439c44[_0xf218('0x34')];_0x13e32d+=0x1){var _0x48fe5b=_0x439c44[_0x13e32d]['get']({'plain':!![]});_0x396a0a[_0xf218('0x64')]=_0x40ac6f[_0xf218('0x46')][_0xf218('0x64')]?_0x40ac6f['body'][_0xf218('0x64')]:_0x396a0a[_0xf218('0x64')];switch(_0x396a0a['dialCheckDuplicateType']){case'always':_0x5064cf=squel['insert']()['into'](_0xf218('0x65'))[_0xf218('0x66')](['phone','scheduledAt',_0xf218('0x67'),_0xf218('0x68'),_0xf218('0x57'),_0xf218('0x50'),_0xf218('0x51')],squel[_0xf218('0x69')]()['field'](_0xf218('0x6a'),_0xf218('0x6a'))[_0xf218('0x6b')](_0xf218('0x6c'),_0xf218('0x6d'))[_0xf218('0x6b')]('id',_0xf218('0x67'))[_0xf218('0x6b')](_0x48fe5b[_0xf218('0x6e')]['toString'](),_0xf218('0x68'))[_0xf218('0x6b')](_0x40ac6f[_0xf218('0x44')]['id'][_0xf218('0x6f')](),_0xf218('0x57'))[_0xf218('0x6b')](_0xf218('0x6c'),_0xf218('0x50'))[_0xf218('0x6b')](_0xf218('0x6c'),_0xf218('0x51'))[_0xf218('0x70')](_0xf218('0x71'))[_0xf218('0x38')](_0xf218('0x72'))[_0xf218('0x38')](_0xf218('0x73'),_0x48fe5b['CmListId'][_0xf218('0x6f')]())[_0xf218('0x38')](_0xf218('0x74'))[_0xf218('0x38')](_0xf218('0x75'),squel[_0xf218('0x69')]()[_0xf218('0x6b')](_0xf218('0x76'))[_0xf218('0x70')]('cm_hopper_final')[_0xf218('0x38')]('CampaignId\x20=\x20?',_0x40ac6f[_0xf218('0x44')]['id'][_0xf218('0x6f')]()))['where'](_0xf218('0x75'),squel['select']()[_0xf218('0x6b')](_0xf218('0x77'))['from']('cm_hopper')[_0xf218('0x38')](_0xf218('0x78'),_0x40ac6f[_0xf218('0x44')]['id'][_0xf218('0x6f')]())))[_0xf218('0x6f')]();break;case _0xf218('0x79'):_0x5064cf=squel[_0xf218('0x7a')]()[_0xf218('0x7b')](_0xf218('0x65'))[_0xf218('0x66')]([_0xf218('0x6a'),'scheduledAt',_0xf218('0x67'),'ListId',_0xf218('0x57'),_0xf218('0x50'),_0xf218('0x51')],squel[_0xf218('0x69')]()[_0xf218('0x6b')](_0xf218('0x6a'),_0xf218('0x6a'))[_0xf218('0x6b')]('NOW()','scheduledAt')[_0xf218('0x6b')]('id',_0xf218('0x67'))[_0xf218('0x6b')](_0x48fe5b[_0xf218('0x6e')]['toString'](),_0xf218('0x68'))[_0xf218('0x6b')](_0x40ac6f['params']['id']['toString'](),'CampaignId')[_0xf218('0x6b')](_0xf218('0x6c'),_0xf218('0x50'))[_0xf218('0x6b')](_0xf218('0x6c'),'updatedAt')[_0xf218('0x70')](_0xf218('0x71'))[_0xf218('0x38')](_0xf218('0x72'))[_0xf218('0x38')]('ListId\x20=\x20?',_0x48fe5b[_0xf218('0x6e')]['toString']())[_0xf218('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0xf218('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf218('0x69')]()[_0xf218('0x6b')](_0xf218('0x77'))[_0xf218('0x70')](_0xf218('0x65'))[_0xf218('0x38')](_0xf218('0x78'),_0x40ac6f[_0xf218('0x44')]['id'][_0xf218('0x6f')]())))[_0xf218('0x6f')]();break;default:_0x5064cf=squel['insert']()[_0xf218('0x7b')](_0xf218('0x65'))[_0xf218('0x66')]([_0xf218('0x6a'),_0xf218('0x6d'),_0xf218('0x67'),_0xf218('0x68'),'CampaignId',_0xf218('0x50'),_0xf218('0x51')],squel[_0xf218('0x69')]()['field'](_0xf218('0x6a'),_0xf218('0x6a'))[_0xf218('0x6b')](_0xf218('0x6c'),_0xf218('0x6d'))[_0xf218('0x6b')]('id',_0xf218('0x67'))[_0xf218('0x6b')](_0x48fe5b['CmListId'][_0xf218('0x6f')](),'ListId')['field'](_0x40ac6f[_0xf218('0x44')]['id']['toString'](),_0xf218('0x57'))[_0xf218('0x6b')](_0xf218('0x6c'),'createdAt')['field'](_0xf218('0x6c'),_0xf218('0x51'))[_0xf218('0x70')]('cm_contacts')['where'](_0xf218('0x72'))[_0xf218('0x38')](_0xf218('0x73'),_0x48fe5b[_0xf218('0x6e')][_0xf218('0x6f')]())[_0xf218('0x38')](_0xf218('0x74')))[_0xf218('0x6f')]();}_0x3e96c2[_0xf218('0x7c')](db['sequelize'][_0xf218('0x2e')](_0x5064cf));}return BPromise[_0xf218('0x7d')](_0x3e96c2);}})['then'](function(){return _0xc0c0e5;})[_0xf218('0x20')](respondWithResult(_0x3964d4,null))['catch'](handleError(_0x3964d4,null));};exports[_0xf218('0x7e')]=function(_0x5bdaa3,_0x4ee4c1,_0x345d96){return db[_0xf218('0x29')][_0xf218('0x4a')]({'where':{'id':_0x5bdaa3[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x4ee4c1,null))[_0xf218('0x20')](function(_0x2f74af){if(_0x2f74af){return _0x2f74af[_0xf218('0x7e')](_0x5bdaa3[_0xf218('0x2e')][_0xf218('0x62')]);}})[_0xf218('0x20')](function(_0x2ede61){if(_0x2ede61){return db[_0xf218('0x54')][_0xf218('0x23')]({'where':{'ListId':_0x5bdaa3[_0xf218('0x2e')][_0xf218('0x62')],'CampaignId':_0x5bdaa3[_0xf218('0x44')]['id']}})[_0xf218('0x20')](function(){return _0x2ede61;});}})[_0xf218('0x20')](respondWithStatusCode(_0x4ee4c1,null))['catch'](handleError(_0x4ee4c1,null));};exports[_0xf218('0x7f')]=function(_0x53133d,_0x545321,_0x113416){var _0xa7935a={};var _0xf79e45={};var _0x14d435;var _0x55f83b;return db['Campaign']['findOne']({'where':{'id':_0x53133d[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x545321,null))[_0xf218('0x20')](function(_0x58189e){if(_0x58189e){_0x14d435=_0x58189e;_0xf79e45[_0xf218('0x2d')]=_[_0xf218('0x2f')](db[_0xf218('0x60')][_0xf218('0x55')]);_0xf79e45[_0xf218('0x2e')]=_['keys'](_0x53133d['query']);_0xf79e45['filters']=_[_0xf218('0x31')](_0xf79e45[_0xf218('0x2d')],_0xf79e45[_0xf218('0x2e')]);_0xa7935a['attributes']=_[_0xf218('0x31')](_0xf79e45[_0xf218('0x2d')],qs['fields'](_0x53133d[_0xf218('0x2e')][_0xf218('0x32')]));_0xa7935a['attributes']=_0xa7935a[_0xf218('0x33')]['length']?_0xa7935a['attributes']:_0xf79e45[_0xf218('0x2d')];_0xa7935a[_0xf218('0x36')]=qs[_0xf218('0x37')](_0x53133d[_0xf218('0x2e')][_0xf218('0x37')]);_0xa7935a[_0xf218('0x38')]=qs[_0xf218('0x30')](_[_0xf218('0x39')](_0x53133d['query'],_0xf79e45['filters']));if(_0x53133d[_0xf218('0x2e')]['filter']){_0xa7935a['where']=_[_0xf218('0x3b')](_0xa7935a['where'],{'$or':_[_0xf218('0x28')](_0xa7935a[_0xf218('0x33')],function(_0x3fb180){var _0x48531c={};_0x48531c[_0x3fb180]={'$like':'%'+_0x53133d[_0xf218('0x2e')][_0xf218('0x3a')]+'%'};return _0x48531c;})});}_0xa7935a=_[_0xf218('0x3b')]({},_0xa7935a,_0x53133d[_0xf218('0x3d')]);return _0x14d435[_0xf218('0x7f')](_0xa7935a);}})['then'](function(_0x2de61c){if(_0x2de61c){_0x55f83b=_0x2de61c[_0xf218('0x34')];if(!_0x53133d[_0xf218('0x2e')][_0xf218('0x35')](_0xf218('0x56'))){_0xa7935a['limit']=qs[_0xf218('0x1c')](_0x53133d[_0xf218('0x2e')]['limit']);_0xa7935a[_0xf218('0x1a')]=qs[_0xf218('0x1a')](_0x53133d[_0xf218('0x2e')]['offset']);}return _0x14d435[_0xf218('0x7f')](_0xa7935a);}})[_0xf218('0x20')](function(_0x4c1528){if(_0x4c1528){return _0x4c1528?{'count':_0x55f83b,'rows':_0x4c1528}:null;}})[_0xf218('0x20')](respondWithResult(_0x545321,null))[_0xf218('0x42')](handleError(_0x545321,null));};exports[_0xf218('0x80')]=function(_0x381cb3,_0x82df99,_0x131df3){var _0x67308c,_0x32eda8;return db[_0xf218('0x29')][_0xf218('0x4a')]({'where':{'id':_0x381cb3[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x82df99,null))[_0xf218('0x20')](function(_0x356d84){if(_0x356d84){_0x32eda8=_0x356d84;return _0x356d84[_0xf218('0x80')](_0x381cb3[_0xf218('0x46')][_0xf218('0x62')],_[_0xf218('0x4f')](_0x381cb3['body'],[_0xf218('0x62'),'id'])||{});}return null;})[_0xf218('0x63')](function(_0x5a8ec1){var _0x3f9645;_0x67308c=_0x5a8ec1||[];var _0x38ed22=[];if(_0x5a8ec1){for(var _0x215d80=0x0;_0x215d80<_0x5a8ec1[_0xf218('0x34')];_0x215d80+=0x1){var _0x5a6ca8=_0x5a8ec1[_0x215d80][_0xf218('0x21')]({'plain':!![]});_0x3f9645=squel['insert']()[_0xf218('0x7b')](_0xf218('0x81'))['fromQuery'](['phone',_0xf218('0x67'),_0xf218('0x68'),_0xf218('0x57'),_0xf218('0x50'),_0xf218('0x51')],squel[_0xf218('0x69')]()['field']('phone',_0xf218('0x6a'))[_0xf218('0x6b')]('id',_0xf218('0x67'))[_0xf218('0x6b')](_0x5a6ca8[_0xf218('0x6e')][_0xf218('0x6f')](),_0xf218('0x68'))[_0xf218('0x6b')](_0x381cb3[_0xf218('0x44')]['id'][_0xf218('0x6f')](),'CampaignId')[_0xf218('0x6b')](_0xf218('0x6c'),_0xf218('0x50'))[_0xf218('0x6b')](_0xf218('0x6c'),_0xf218('0x51'))['from']('cm_contacts')['where'](_0xf218('0x72'))[_0xf218('0x38')](_0xf218('0x73'),_0x5a6ca8[_0xf218('0x6e')]['toString']())['where'](_0xf218('0x74')))[_0xf218('0x6f')]();_0x38ed22['push'](db['sequelize'][_0xf218('0x2e')](_0x3f9645));}return BPromise[_0xf218('0x7d')](_0x38ed22);}})[_0xf218('0x20')](function(){return _0x67308c;})[_0xf218('0x20')](respondWithResult(_0x82df99,null))[_0xf218('0x42')](handleError(_0x82df99,null));};exports[_0xf218('0x82')]=function(_0x37688f,_0x3bb6f6,_0x4d5fa4){return db['Campaign'][_0xf218('0x4a')]({'where':{'id':_0x37688f[_0xf218('0x44')]['id']}})[_0xf218('0x20')](handleEntityNotFound(_0x3bb6f6,null))[_0xf218('0x20')](function(_0x2f0af8){if(_0x2f0af8){return _0x2f0af8[_0xf218('0x82')](_0x37688f[_0xf218('0x2e')][_0xf218('0x62')]);}})[_0xf218('0x20')](function(_0x4a7643){if(_0x4a7643){return db[_0xf218('0x5e')][_0xf218('0x23')]({'where':{'ListId':_0x37688f[_0xf218('0x2e')]['ids'],'CampaignId':_0x37688f['params']['id']}})[_0xf218('0x20')](function(){return _0x4a7643;});}})[_0xf218('0x20')](respondWithStatusCode(_0x3bb6f6,null))[_0xf218('0x42')](handleError(_0x3bb6f6,null));};
\ No newline at end of file
+var _0x7792=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','stack','name','send','index','map','Campaign','rawAttributes','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','userProfileId','autoAssociation','error','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','NOW()','field','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','insert','fromQuery','ListId','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x460f81,_0x553431){var _0x423f0d=function(_0x267a6b){while(--_0x267a6b){_0x460f81['push'](_0x460f81['shift']());}};_0x423f0d(++_0x553431);}(_0x7792,0x184));var _0x2779=function(_0x229f5e,_0x433f0f){_0x229f5e=_0x229f5e-0x0;var _0x2d62ff=_0x7792[_0x229f5e];return _0x2d62ff;};'use strict';var emlformat=require(_0x2779('0x0'));var rimraf=require(_0x2779('0x1'));var zipdir=require(_0x2779('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2779('0x3'));var moment=require(_0x2779('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2779('0x5'));var util=require(_0x2779('0x6'));var path=require(_0x2779('0x7'));var sox=require(_0x2779('0x8'));var csv=require('to-csv');var ejs=require(_0x2779('0x9'));var fs=require('fs');var fs_extra=require(_0x2779('0xa'));var _=require(_0x2779('0xb'));var squel=require(_0x2779('0xc'));var crypto=require(_0x2779('0xd'));var jsforce=require(_0x2779('0xe'));var deskjs=require(_0x2779('0xf'));var toCsv=require(_0x2779('0x10'));var querystring=require(_0x2779('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2779('0x12'));var qs=require(_0x2779('0x13'));var as=require(_0x2779('0x14'));var hardwareService=require(_0x2779('0x15'));var logger=require('../../config/logger')(_0x2779('0x16'));var utils=require(_0x2779('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2779('0x18'));var db=require(_0x2779('0x19'))['db'];function respondWithStatusCode(_0x285786,_0xd98fe0){_0xd98fe0=_0xd98fe0||0xcc;return function(_0x503fac){if(_0x503fac){return _0x285786[_0x2779('0x1a')](_0xd98fe0);}return _0x285786[_0x2779('0x1b')](_0xd98fe0)['end']();};}function respondWithResult(_0x3e28a1,_0x22122b){_0x22122b=_0x22122b||0xc8;return function(_0x3ac775){if(_0x3ac775){return _0x3e28a1[_0x2779('0x1b')](_0x22122b)[_0x2779('0x1c')](_0x3ac775);}};}function respondWithFilteredResult(_0xdca5d5,_0xffe5b1){return function(_0x1cfd85){if(_0x1cfd85){var _0xb29e28=typeof _0xffe5b1[_0x2779('0x1d')]===_0x2779('0x1e')&&typeof _0xffe5b1[_0x2779('0x1f')]===_0x2779('0x1e');var _0x103498=_0x1cfd85[_0x2779('0x20')];var _0x27ea78=_0xb29e28?0x0:_0xffe5b1[_0x2779('0x1d')];var _0x492fe0=_0xb29e28?_0x1cfd85[_0x2779('0x20')]:_0xffe5b1[_0x2779('0x1d')]+_0xffe5b1[_0x2779('0x1f')];var _0x2786aa;if(_0x492fe0>=_0x103498){_0x492fe0=_0x103498;_0x2786aa=0xc8;}else{_0x2786aa=0xce;}_0xdca5d5['status'](_0x2786aa);return _0xdca5d5[_0x2779('0x21')](_0x2779('0x22'),_0x27ea78+'-'+_0x492fe0+'/'+_0x103498)[_0x2779('0x1c')](_0x1cfd85);}return null;};}function patchUpdates(_0x989416){return function(_0x206644){try{jsonpatch['apply'](_0x206644,_0x989416,!![]);}catch(_0x2ddfd3){return BPromise[_0x2779('0x23')](_0x2ddfd3);}return _0x206644[_0x2779('0x24')]();};}function saveUpdates(_0x441648,_0x6ff722){return function(_0x4d6d5a){if(_0x4d6d5a){return _0x4d6d5a[_0x2779('0x25')](_0x441648)[_0x2779('0x26')](function(_0xdbc38a){return _0xdbc38a;});}return null;};}function removeEntity(_0x45e2da,_0x5a728d){return function(_0x338336){if(_0x338336){return _0x338336[_0x2779('0x27')]()[_0x2779('0x26')](function(){var _0x289af4=_0x338336[_0x2779('0x28')]({'plain':!![]});var _0x10b63e=_0x2779('0x29');return db[_0x2779('0x2a')][_0x2779('0x27')]({'where':{'type':_0x10b63e,'resourceId':_0x289af4['id']}})[_0x2779('0x26')](function(){return _0x338336;});})[_0x2779('0x26')](function(){_0x45e2da[_0x2779('0x1b')](0xcc)[_0x2779('0x2b')]();});}};}function handleEntityNotFound(_0x375a68,_0x327e43){return function(_0x51dced){if(!_0x51dced){_0x375a68['sendStatus'](0x194);}return _0x51dced;};}function handleError(_0x34b4ea,_0x32081c){_0x32081c=_0x32081c||0x1f4;return function(_0x4cf2f4){logger['error'](_0x4cf2f4[_0x2779('0x2c')]);if(_0x4cf2f4[_0x2779('0x2d')]){delete _0x4cf2f4['name'];}_0x34b4ea['status'](_0x32081c)[_0x2779('0x2e')](_0x4cf2f4);};}exports[_0x2779('0x2f')]=function(_0x3ce4cd,_0xaf4276){var _0x3f4f9c={},_0x56a5e2={},_0x26baf7={'count':0x0,'rows':[]};var _0x48b092=_[_0x2779('0x30')](db[_0x2779('0x31')][_0x2779('0x32')],function(_0x35a9bf){return{'name':_0x35a9bf['fieldName'],'type':_0x35a9bf[_0x2779('0x33')]['key']};});_0x56a5e2['model']=_[_0x2779('0x30')](_0x48b092,_0x2779('0x2d'));_0x56a5e2[_0x2779('0x34')]=_['keys'](_0x3ce4cd['query']);_0x56a5e2[_0x2779('0x35')]=_['intersection'](_0x56a5e2[_0x2779('0x36')],_0x56a5e2[_0x2779('0x34')]);_0x3f4f9c[_0x2779('0x37')]=_[_0x2779('0x38')](_0x56a5e2['model'],qs[_0x2779('0x39')](_0x3ce4cd[_0x2779('0x34')][_0x2779('0x39')]));_0x3f4f9c[_0x2779('0x37')]=_0x3f4f9c[_0x2779('0x37')][_0x2779('0x3a')]?_0x3f4f9c[_0x2779('0x37')]:_0x56a5e2[_0x2779('0x36')];if(!_0x3ce4cd[_0x2779('0x34')][_0x2779('0x3b')]('nolimit')){_0x3f4f9c[_0x2779('0x1f')]=qs['limit'](_0x3ce4cd[_0x2779('0x34')][_0x2779('0x1f')]);_0x3f4f9c[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0x3ce4cd[_0x2779('0x34')][_0x2779('0x1d')]);}_0x3f4f9c[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x3ce4cd[_0x2779('0x34')]['sort']);_0x3f4f9c[_0x2779('0x3e')]=qs[_0x2779('0x35')](_[_0x2779('0x3f')](_0x3ce4cd['query'],_0x56a5e2[_0x2779('0x35')]),_0x48b092);if(_0x3ce4cd[_0x2779('0x34')][_0x2779('0x40')]){_0x3f4f9c['where']=_[_0x2779('0x41')](_0x3f4f9c['where'],{'$or':_[_0x2779('0x30')](_0x48b092,function(_0xd03271){if(_0xd03271[_0x2779('0x33')]!=='VIRTUAL'){var _0x4af19a={};_0x4af19a[_0xd03271[_0x2779('0x2d')]]={'$like':'%'+_0x3ce4cd[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x4af19a;}})});}_0x3f4f9c=_[_0x2779('0x41')]({},_0x3f4f9c,_0x3ce4cd['options']);var _0xfe97b4={'where':_0x3f4f9c[_0x2779('0x3e')]};return db['Campaign'][_0x2779('0x20')](_0xfe97b4)[_0x2779('0x26')](function(_0x2a24f8){_0x26baf7[_0x2779('0x20')]=_0x2a24f8;if(_0x3ce4cd[_0x2779('0x34')]['includeAll']){_0x3f4f9c[_0x2779('0x42')]=[{'all':!![]}];}return db[_0x2779('0x31')][_0x2779('0x43')](_0x3f4f9c);})[_0x2779('0x26')](function(_0x1b711c){_0x26baf7[_0x2779('0x44')]=_0x1b711c;return _0x26baf7;})[_0x2779('0x26')](respondWithFilteredResult(_0xaf4276,_0x3f4f9c))[_0x2779('0x45')](handleError(_0xaf4276,null));};exports[_0x2779('0x46')]=function(_0x26ddee,_0x38ced1){var _0x15be23={'raw':![],'where':{'id':_0x26ddee[_0x2779('0x47')]['id']}},_0x6de4c0={};_0x6de4c0[_0x2779('0x36')]=_[_0x2779('0x48')](db[_0x2779('0x31')][_0x2779('0x32')]);_0x6de4c0[_0x2779('0x34')]=_[_0x2779('0x48')](_0x26ddee[_0x2779('0x34')]);_0x6de4c0[_0x2779('0x35')]=_[_0x2779('0x38')](_0x6de4c0[_0x2779('0x36')],_0x6de4c0[_0x2779('0x34')]);_0x15be23['attributes']=_[_0x2779('0x38')](_0x6de4c0[_0x2779('0x36')],qs['fields'](_0x26ddee[_0x2779('0x34')]['fields']));_0x15be23[_0x2779('0x37')]=_0x15be23[_0x2779('0x37')][_0x2779('0x3a')]?_0x15be23[_0x2779('0x37')]:_0x6de4c0[_0x2779('0x36')];if(_0x26ddee[_0x2779('0x34')][_0x2779('0x49')]){_0x15be23[_0x2779('0x42')]=[{'all':!![]}];}_0x15be23=_[_0x2779('0x41')]({},_0x15be23,_0x26ddee[_0x2779('0x4a')]);return db[_0x2779('0x31')][_0x2779('0x4b')](_0x15be23)[_0x2779('0x26')](handleEntityNotFound(_0x38ced1,null))[_0x2779('0x26')](respondWithResult(_0x38ced1,null))[_0x2779('0x45')](handleError(_0x38ced1,null));};exports[_0x2779('0x4c')]=function(_0x381c9c,_0x4bb1ba){return db[_0x2779('0x31')]['create'](_0x381c9c[_0x2779('0x4d')],{})[_0x2779('0x26')](function(_0xdd93ad){var _0x3bb6d2=_0x381c9c[_0x2779('0x4e')]['get']({'plain':!![]});if(!_0x3bb6d2)throw new Error(_0x2779('0x4f'));if(_0x3bb6d2[_0x2779('0x50')]===_0x2779('0x4e')){var _0x11a94f=_0xdd93ad[_0x2779('0x28')]({'plain':!![]});var _0x3c67bf=_0x2779('0x29');return db['UserProfileSection'][_0x2779('0x4b')]({'where':{'name':_0x3c67bf,'userProfileId':_0x3bb6d2['userProfileId']},'raw':!![]})['then'](function(_0x468c25){if(_0x468c25&&_0x468c25['autoAssociation']===0x0){return db[_0x2779('0x2a')][_0x2779('0x4c')]({'name':_0x11a94f[_0x2779('0x2d')],'resourceId':_0x11a94f['id'],'type':_0x468c25['name'],'sectionId':_0x468c25['id']},{})[_0x2779('0x26')](function(){return _0xdd93ad;});}else{return _0xdd93ad;}})[_0x2779('0x45')](function(_0x16dee7){logger['error'](_0x2779('0x51'),_0x16dee7);throw _0x16dee7;});}return _0xdd93ad;})['then'](respondWithResult(_0x4bb1ba,0xc9))[_0x2779('0x45')](handleError(_0x4bb1ba,null));};exports[_0x2779('0x52')]=function(_0x190f4a,_0x10a90a){var _0x282d06={'where':{'id':_0x190f4a[_0x2779('0x47')]['id']}},_0x1f6940={};_0x1f6940[_0x2779('0x36')]=_[_0x2779('0x48')](db[_0x2779('0x31')][_0x2779('0x32')]);_0x282d06['attributes']=_[_0x2779('0x38')](_0x1f6940[_0x2779('0x36')],qs[_0x2779('0x39')](_0x190f4a[_0x2779('0x34')][_0x2779('0x39')]));_0x282d06[_0x2779('0x37')]=_0x282d06[_0x2779('0x37')][_0x2779('0x3a')]?_0x282d06[_0x2779('0x37')]:_0x1f6940[_0x2779('0x36')];if(_0x190f4a[_0x2779('0x34')]['includeAll']){_0x282d06[_0x2779('0x42')]=[{'all':!![]}];}_0x282d06=_[_0x2779('0x41')]({},_0x282d06,_0x190f4a[_0x2779('0x4a')]);return db[_0x2779('0x31')][_0x2779('0x4b')](_0x282d06)[_0x2779('0x26')](handleEntityNotFound(_0x10a90a,null))['then'](function(_0x33924c){if(_0x33924c){var _0x1103ed=_0x33924c[_0x2779('0x28')]({'plain':!![]});_0x1103ed=qs[_0x2779('0x53')](_0x1103ed,['id',_0x2779('0x54'),_0x2779('0x55')]);_0x190f4a[_0x2779('0x4d')]=_[_0x2779('0x53')](_0x190f4a[_0x2779('0x4d')],['id',_0x2779('0x54'),_0x2779('0x55')]);return db['Campaign'][_0x2779('0x4c')](_[_0x2779('0x41')](_0x1103ed,_0x190f4a['body']),{'include':_0x190f4a[_0x2779('0x34')][_0x2779('0x49')]?[{'all':!![]}]:undefined})[_0x2779('0x26')](function(_0x463ba1){var _0x465c4a=_0x190f4a['user']['get']({'plain':!![]});if(!_0x465c4a)throw new Error(_0x2779('0x4f'));if(_0x465c4a[_0x2779('0x50')]===_0x2779('0x4e')){var _0x23f7f1=_0x463ba1['get']({'plain':!![]});var _0x306a8b=_0x2779('0x29');return db[_0x2779('0x56')]['find']({'where':{'name':_0x306a8b,'userProfileId':_0x465c4a[_0x2779('0x57')]},'raw':!![]})['then'](function(_0x28804d){if(_0x28804d&&_0x28804d[_0x2779('0x58')]===0x0){return db['UserProfileResource'][_0x2779('0x4c')]({'name':_0x23f7f1[_0x2779('0x2d')],'resourceId':_0x23f7f1['id'],'type':_0x28804d[_0x2779('0x2d')],'sectionId':_0x28804d['id']},{})[_0x2779('0x26')](function(){return _0x463ba1;});}else{return _0x463ba1;}})['catch'](function(_0x5b19b7){logger[_0x2779('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b19b7);throw _0x5b19b7;});}return _0x463ba1;});}})[_0x2779('0x26')](respondWithResult(_0x10a90a,0xc9))[_0x2779('0x45')](handleError(_0x10a90a,null));};exports['update']=function(_0x2559b8,_0xa02fd0){if(_0x2559b8[_0x2779('0x4d')]['id']){delete _0x2559b8[_0x2779('0x4d')]['id'];}return db[_0x2779('0x31')][_0x2779('0x4b')]({'where':{'id':_0x2559b8[_0x2779('0x47')]['id']}})['then'](handleEntityNotFound(_0xa02fd0,null))[_0x2779('0x26')](saveUpdates(_0x2559b8[_0x2779('0x4d')],null))[_0x2779('0x26')](respondWithResult(_0xa02fd0,null))[_0x2779('0x45')](handleError(_0xa02fd0,null));};exports[_0x2779('0x27')]=function(_0x125de4,_0x382c0f){return db['Campaign']['find']({'where':{'id':_0x125de4[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x382c0f,null))['then'](removeEntity(_0x382c0f,null))['catch'](handleError(_0x382c0f,null));};exports[_0x2779('0x5a')]=function(_0xb8a57b,_0x1479a2,_0x56ba09){var _0x4b3b98={'raw':!![],'where':{}};var _0x2b4252={};var _0x5c5a22={'count':0x0,'rows':[]};return db[_0x2779('0x31')][_0x2779('0x5b')]({'where':{'id':_0xb8a57b['params']['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x1479a2,null))[_0x2779('0x26')](function(_0x1e14ed){if(_0x1e14ed){_0x2b4252[_0x2779('0x36')]=_['keys'](db[_0x2779('0x5c')][_0x2779('0x32')]);_0x2b4252[_0x2779('0x34')]=_['keys'](_0xb8a57b[_0x2779('0x34')]);_0x2b4252[_0x2779('0x35')]=_[_0x2779('0x38')](_0x2b4252[_0x2779('0x36')],_0x2b4252[_0x2779('0x34')]);_0x4b3b98['attributes']=_[_0x2779('0x38')](_0x2b4252['model'],qs[_0x2779('0x39')](_0xb8a57b[_0x2779('0x34')][_0x2779('0x39')]));_0x4b3b98['attributes']=_0x4b3b98[_0x2779('0x37')][_0x2779('0x3a')]?_0x4b3b98[_0x2779('0x37')]:_0x2b4252[_0x2779('0x36')];if(!_0xb8a57b[_0x2779('0x34')][_0x2779('0x3b')]('nolimit')){_0x4b3b98[_0x2779('0x1f')]=qs[_0x2779('0x1f')](_0xb8a57b[_0x2779('0x34')][_0x2779('0x1f')]);_0x4b3b98[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0xb8a57b[_0x2779('0x34')][_0x2779('0x1d')]);}_0x4b3b98['order']=qs['sort'](_0xb8a57b[_0x2779('0x34')][_0x2779('0x3d')]);_0x4b3b98['where']=qs[_0x2779('0x35')](_[_0x2779('0x3f')](_0xb8a57b[_0x2779('0x34')],_0x2b4252[_0x2779('0x35')]));_0x4b3b98[_0x2779('0x3e')][_0x2779('0x5d')]=_0x1e14ed['id'];if(_0xb8a57b[_0x2779('0x34')]['filter']){_0x4b3b98[_0x2779('0x3e')]=_[_0x2779('0x41')](_0x4b3b98[_0x2779('0x3e')],{'$or':_[_0x2779('0x30')](_0x4b3b98[_0x2779('0x37')],function(_0x27873d){var _0x13fc70={};_0x13fc70[_0x27873d]={'$like':'%'+_0xb8a57b[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x13fc70;})});}_0x4b3b98=_[_0x2779('0x41')]({},_0x4b3b98,_0xb8a57b[_0x2779('0x4a')]);return db[_0x2779('0x5c')]['count']({'where':_0x4b3b98[_0x2779('0x3e')]})[_0x2779('0x26')](function(_0x3b5a32){_0x5c5a22[_0x2779('0x20')]=_0x3b5a32;if(_0xb8a57b[_0x2779('0x34')][_0x2779('0x49')]){_0x4b3b98[_0x2779('0x42')]=[{'all':!![]}];}return db[_0x2779('0x5c')][_0x2779('0x43')](_0x4b3b98);})[_0x2779('0x26')](function(_0x4b3719){_0x5c5a22[_0x2779('0x44')]=_0x4b3719;return _0x5c5a22;});}})[_0x2779('0x26')](respondWithFilteredResult(_0x1479a2,_0x4b3b98))[_0x2779('0x45')](handleError(_0x1479a2,null));};exports[_0x2779('0x5e')]=function(_0x579bbd,_0x4f1779,_0x38754f){var _0x178984={'raw':!![],'where':{}};var _0x21d08c={};var _0x3c5f54={'count':0x0,'rows':[]};return db[_0x2779('0x31')]['findOne']({'where':{'id':_0x579bbd[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x4f1779,null))[_0x2779('0x26')](function(_0x4b04e1){if(_0x4b04e1){_0x21d08c['model']=_[_0x2779('0x48')](db[_0x2779('0x5f')]['rawAttributes']);_0x21d08c[_0x2779('0x34')]=_[_0x2779('0x48')](_0x579bbd[_0x2779('0x34')]);_0x21d08c[_0x2779('0x35')]=_[_0x2779('0x38')](_0x21d08c[_0x2779('0x36')],_0x21d08c[_0x2779('0x34')]);_0x178984['attributes']=_[_0x2779('0x38')](_0x21d08c[_0x2779('0x36')],qs[_0x2779('0x39')](_0x579bbd['query'][_0x2779('0x39')]));_0x178984[_0x2779('0x37')]=_0x178984[_0x2779('0x37')][_0x2779('0x3a')]?_0x178984['attributes']:_0x21d08c['model'];if(!_0x579bbd[_0x2779('0x34')]['hasOwnProperty'](_0x2779('0x60'))){_0x178984[_0x2779('0x1f')]=qs['limit'](_0x579bbd[_0x2779('0x34')][_0x2779('0x1f')]);_0x178984[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0x579bbd['query'][_0x2779('0x1d')]);}_0x178984[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x579bbd[_0x2779('0x34')][_0x2779('0x3d')]);_0x178984[_0x2779('0x3e')]=qs['filters'](_[_0x2779('0x3f')](_0x579bbd[_0x2779('0x34')],_0x21d08c[_0x2779('0x35')]));_0x178984[_0x2779('0x3e')][_0x2779('0x5d')]=_0x4b04e1['id'];if(_0x579bbd['query'][_0x2779('0x40')]){_0x178984[_0x2779('0x3e')]=_[_0x2779('0x41')](_0x178984[_0x2779('0x3e')],{'$or':_['map'](_0x178984['attributes'],function(_0x13655f){var _0xa49cdb={};_0xa49cdb[_0x13655f]={'$like':'%'+_0x579bbd[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0xa49cdb;})});}_0x178984=_[_0x2779('0x41')]({},_0x178984,_0x579bbd[_0x2779('0x4a')]);return db[_0x2779('0x5f')][_0x2779('0x20')]({'where':_0x178984[_0x2779('0x3e')]})[_0x2779('0x26')](function(_0x42c715){_0x3c5f54[_0x2779('0x20')]=_0x42c715;if(_0x579bbd[_0x2779('0x34')]['includeAll']){_0x178984['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x178984);})[_0x2779('0x26')](function(_0x2ca465){_0x3c5f54[_0x2779('0x44')]=_0x2ca465;return _0x3c5f54;});}})['then'](respondWithFilteredResult(_0x4f1779,_0x178984))['catch'](handleError(_0x4f1779,null));};exports[_0x2779('0x61')]=function(_0x54a231,_0x9bf0e5,_0x388e64){var _0x2163e2={'raw':!![],'where':{}};var _0x1e4d3c={};var _0x32b16f={'count':0x0,'rows':[]};return db[_0x2779('0x31')][_0x2779('0x5b')]({'where':{'id':_0x54a231[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x9bf0e5,null))[_0x2779('0x26')](function(_0x2c4223){if(_0x2c4223){_0x1e4d3c[_0x2779('0x36')]=_[_0x2779('0x48')](db['CmHopperFinal']['rawAttributes']);_0x1e4d3c['query']=_[_0x2779('0x48')](_0x54a231['query']);_0x1e4d3c[_0x2779('0x35')]=_[_0x2779('0x38')](_0x1e4d3c[_0x2779('0x36')],_0x1e4d3c[_0x2779('0x34')]);_0x2163e2[_0x2779('0x37')]=_[_0x2779('0x38')](_0x1e4d3c['model'],qs[_0x2779('0x39')](_0x54a231[_0x2779('0x34')]['fields']));_0x2163e2[_0x2779('0x37')]=_0x2163e2[_0x2779('0x37')][_0x2779('0x3a')]?_0x2163e2[_0x2779('0x37')]:_0x1e4d3c[_0x2779('0x36')];if(!_0x54a231[_0x2779('0x34')][_0x2779('0x3b')](_0x2779('0x60'))){_0x2163e2[_0x2779('0x1f')]=qs[_0x2779('0x1f')](_0x54a231['query'][_0x2779('0x1f')]);_0x2163e2[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0x54a231[_0x2779('0x34')][_0x2779('0x1d')]);}_0x2163e2[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x54a231['query'][_0x2779('0x3d')]);_0x2163e2[_0x2779('0x3e')]=qs['filters'](_[_0x2779('0x3f')](_0x54a231['query'],_0x1e4d3c['filters']));_0x2163e2[_0x2779('0x3e')][_0x2779('0x5d')]=_0x2c4223['id'];if(_0x54a231[_0x2779('0x34')][_0x2779('0x40')]){_0x2163e2['where']=_[_0x2779('0x41')](_0x2163e2[_0x2779('0x3e')],{'$or':_[_0x2779('0x30')](_0x2163e2['attributes'],function(_0x1c5e83){var _0x2af93a={};_0x2af93a[_0x1c5e83]={'$like':'%'+_0x54a231[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x2af93a;})});}_0x2163e2=_[_0x2779('0x41')]({},_0x2163e2,_0x54a231[_0x2779('0x4a')]);return db['CmHopperFinal'][_0x2779('0x20')]({'where':_0x2163e2[_0x2779('0x3e')]})[_0x2779('0x26')](function(_0xec2725){_0x32b16f['count']=_0xec2725;if(_0x54a231[_0x2779('0x34')]['includeAll']){_0x2163e2[_0x2779('0x42')]=[{'all':!![]}];}return db[_0x2779('0x62')]['findAll'](_0x2163e2);})['then'](function(_0x457072){_0x32b16f[_0x2779('0x44')]=_0x457072;return _0x32b16f;});}})['then'](respondWithFilteredResult(_0x9bf0e5,_0x2163e2))[_0x2779('0x45')](handleError(_0x9bf0e5,null));};exports[_0x2779('0x63')]=function(_0x3f2bae,_0x2906e9,_0x1df165){var _0x5b37a8={'raw':!![],'where':{}};var _0x42b8fd={};var _0x596df3={'count':0x0,'rows':[]};return db[_0x2779('0x31')][_0x2779('0x5b')]({'where':{'id':_0x3f2bae[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x2906e9,null))['then'](function(_0x37c7dd){if(_0x37c7dd){_0x42b8fd[_0x2779('0x36')]=_['keys'](db[_0x2779('0x64')][_0x2779('0x32')]);_0x42b8fd[_0x2779('0x34')]=_['keys'](_0x3f2bae[_0x2779('0x34')]);_0x42b8fd[_0x2779('0x35')]=_[_0x2779('0x38')](_0x42b8fd[_0x2779('0x36')],_0x42b8fd[_0x2779('0x34')]);_0x5b37a8['attributes']=_[_0x2779('0x38')](_0x42b8fd['model'],qs['fields'](_0x3f2bae[_0x2779('0x34')][_0x2779('0x39')]));_0x5b37a8[_0x2779('0x37')]=_0x5b37a8[_0x2779('0x37')][_0x2779('0x3a')]?_0x5b37a8[_0x2779('0x37')]:_0x42b8fd['model'];if(!_0x3f2bae[_0x2779('0x34')][_0x2779('0x3b')]('nolimit')){_0x5b37a8[_0x2779('0x1f')]=qs[_0x2779('0x1f')](_0x3f2bae[_0x2779('0x34')][_0x2779('0x1f')]);_0x5b37a8[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0x3f2bae[_0x2779('0x34')][_0x2779('0x1d')]);}_0x5b37a8[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x3f2bae[_0x2779('0x34')][_0x2779('0x3d')]);_0x5b37a8[_0x2779('0x3e')]=qs['filters'](_[_0x2779('0x3f')](_0x3f2bae[_0x2779('0x34')],_0x42b8fd[_0x2779('0x35')]));_0x5b37a8[_0x2779('0x3e')][_0x2779('0x5d')]=_0x37c7dd['id'];if(_0x3f2bae[_0x2779('0x34')][_0x2779('0x40')]){_0x5b37a8[_0x2779('0x3e')]=_[_0x2779('0x41')](_0x5b37a8['where'],{'$or':_[_0x2779('0x30')](_0x5b37a8[_0x2779('0x37')],function(_0x3aeef2){var _0x5b2981={};_0x5b2981[_0x3aeef2]={'$like':'%'+_0x3f2bae[_0x2779('0x34')]['filter']+'%'};return _0x5b2981;})});}_0x5b37a8=_[_0x2779('0x41')]({},_0x5b37a8,_0x3f2bae[_0x2779('0x4a')]);return db[_0x2779('0x64')][_0x2779('0x20')]({'where':_0x5b37a8['where']})[_0x2779('0x26')](function(_0x469b33){_0x596df3['count']=_0x469b33;if(_0x3f2bae[_0x2779('0x34')][_0x2779('0x49')]){_0x5b37a8[_0x2779('0x42')]=[{'all':!![]}];}return db[_0x2779('0x64')][_0x2779('0x43')](_0x5b37a8);})[_0x2779('0x26')](function(_0x2e5ebc){_0x596df3['rows']=_0x2e5ebc;return _0x596df3;});}})[_0x2779('0x26')](respondWithFilteredResult(_0x2906e9,_0x5b37a8))['catch'](handleError(_0x2906e9,null));};exports['getLists']=function(_0x11c7ba,_0x583f0e,_0x27a26e){var _0x5a5e41={};var _0x10bafc={};var _0xd42767;var _0x5e21f2;return db['Campaign'][_0x2779('0x5b')]({'where':{'id':_0x11c7ba[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x583f0e,null))[_0x2779('0x26')](function(_0x259b2f){if(_0x259b2f){_0xd42767=_0x259b2f;_0x10bafc[_0x2779('0x36')]=_[_0x2779('0x48')](db[_0x2779('0x65')][_0x2779('0x32')]);_0x10bafc['query']=_[_0x2779('0x48')](_0x11c7ba['query']);_0x10bafc[_0x2779('0x35')]=_[_0x2779('0x38')](_0x10bafc[_0x2779('0x36')],_0x10bafc[_0x2779('0x34')]);_0x5a5e41['attributes']=_[_0x2779('0x38')](_0x10bafc[_0x2779('0x36')],qs[_0x2779('0x39')](_0x11c7ba['query']['fields']));_0x5a5e41[_0x2779('0x37')]=_0x5a5e41['attributes']['length']?_0x5a5e41[_0x2779('0x37')]:_0x10bafc[_0x2779('0x36')];_0x5a5e41['order']=qs['sort'](_0x11c7ba[_0x2779('0x34')][_0x2779('0x3d')]);_0x5a5e41['where']=qs['filters'](_[_0x2779('0x3f')](_0x11c7ba[_0x2779('0x34')],_0x10bafc[_0x2779('0x35')]));if(_0x11c7ba[_0x2779('0x34')][_0x2779('0x40')]){_0x5a5e41[_0x2779('0x3e')]=_['merge'](_0x5a5e41[_0x2779('0x3e')],{'$or':_[_0x2779('0x30')](_0x5a5e41[_0x2779('0x37')],function(_0x568212){var _0x704b83={};_0x704b83[_0x568212]={'$like':'%'+_0x11c7ba[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x704b83;})});}_0x5a5e41=_[_0x2779('0x41')]({},_0x5a5e41,_0x11c7ba[_0x2779('0x4a')]);return _0xd42767[_0x2779('0x66')](_0x5a5e41);}})[_0x2779('0x26')](function(_0x23cfeb){if(_0x23cfeb){_0x5e21f2=_0x23cfeb[_0x2779('0x3a')];if(!_0x11c7ba[_0x2779('0x34')][_0x2779('0x3b')](_0x2779('0x60'))){_0x5a5e41[_0x2779('0x1f')]=qs[_0x2779('0x1f')](_0x11c7ba['query'][_0x2779('0x1f')]);_0x5a5e41[_0x2779('0x1d')]=qs['offset'](_0x11c7ba[_0x2779('0x34')][_0x2779('0x1d')]);}return _0xd42767[_0x2779('0x66')](_0x5a5e41);}})['then'](function(_0x17e53f){if(_0x17e53f){return _0x17e53f?{'count':_0x5e21f2,'rows':_0x17e53f}:null;}})[_0x2779('0x26')](respondWithResult(_0x583f0e,null))[_0x2779('0x45')](handleError(_0x583f0e,null));};exports[_0x2779('0x67')]=function(_0x24451c,_0x23e3e2,_0x1dfccd){var _0x1d1167,_0x47b241;return db[_0x2779('0x31')][_0x2779('0x4b')]({'where':{'id':_0x24451c[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x23e3e2,null))[_0x2779('0x26')](function(_0x409d51){if(_0x409d51){_0x47b241=_0x409d51;return _0x409d51[_0x2779('0x67')](_0x24451c['body'][_0x2779('0x68')],_[_0x2779('0x53')](_0x24451c[_0x2779('0x4d')],[_0x2779('0x68'),'id'])||{});}return null;})[_0x2779('0x69')](function(_0x315141){var _0x4fbf08;_0x1d1167=_0x315141||[];var _0x1b643c=[];if(_0x315141){for(var _0x2cc7b2=0x0;_0x2cc7b2<_0x315141['length'];_0x2cc7b2+=0x1){var _0x464df7=_0x315141[_0x2cc7b2]['get']({'plain':!![]});_0x47b241['dialCheckDuplicateType']=_0x24451c[_0x2779('0x4d')][_0x2779('0x6a')]?_0x24451c['body'][_0x2779('0x6a')]:_0x47b241[_0x2779('0x6a')];switch(_0x47b241['dialCheckDuplicateType']){case'always':_0x4fbf08=squel['insert']()[_0x2779('0x6b')](_0x2779('0x6c'))['fromQuery']([_0x2779('0x6d'),_0x2779('0x6e'),_0x2779('0x6f'),'ListId',_0x2779('0x5d'),'createdAt',_0x2779('0x55')],squel['select']()['field'](_0x2779('0x6d'),_0x2779('0x6d'))['field'](_0x2779('0x70'),'scheduledAt')['field']('id',_0x2779('0x6f'))[_0x2779('0x71')](_0x464df7['CmListId']['toString'](),'ListId')['field'](_0x24451c['params']['id'][_0x2779('0x72')](),_0x2779('0x5d'))[_0x2779('0x71')](_0x2779('0x70'),'createdAt')[_0x2779('0x71')]('NOW()',_0x2779('0x55'))[_0x2779('0x73')](_0x2779('0x74'))[_0x2779('0x3e')](_0x2779('0x75'))[_0x2779('0x3e')]('ListId\x20=\x20?',_0x464df7[_0x2779('0x76')]['toString']())[_0x2779('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x2779('0x3e')](_0x2779('0x77'),squel['select']()[_0x2779('0x71')](_0x2779('0x78'))[_0x2779('0x73')]('cm_hopper_final')[_0x2779('0x3e')](_0x2779('0x79'),_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')]()))['where'](_0x2779('0x77'),squel[_0x2779('0x7a')]()['field'](_0x2779('0x7b'))[_0x2779('0x73')](_0x2779('0x6c'))[_0x2779('0x3e')](_0x2779('0x79'),_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')]())))[_0x2779('0x72')]();break;case'onlyIfOpen':_0x4fbf08=squel[_0x2779('0x7c')]()[_0x2779('0x6b')](_0x2779('0x6c'))[_0x2779('0x7d')]([_0x2779('0x6d'),_0x2779('0x6e'),_0x2779('0x6f'),_0x2779('0x7e'),_0x2779('0x5d'),_0x2779('0x54'),_0x2779('0x55')],squel['select']()[_0x2779('0x71')](_0x2779('0x6d'),_0x2779('0x6d'))[_0x2779('0x71')](_0x2779('0x70'),'scheduledAt')[_0x2779('0x71')]('id',_0x2779('0x6f'))[_0x2779('0x71')](_0x464df7[_0x2779('0x76')]['toString'](),'ListId')[_0x2779('0x71')](_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')](),_0x2779('0x5d'))[_0x2779('0x71')](_0x2779('0x70'),'createdAt')['field']('NOW()',_0x2779('0x55'))['from'](_0x2779('0x74'))[_0x2779('0x3e')]('deletedAt\x20IS\x20NULL')[_0x2779('0x3e')]('ListId\x20=\x20?',_0x464df7['CmListId'][_0x2779('0x72')]())[_0x2779('0x3e')](_0x2779('0x7f'))[_0x2779('0x3e')](_0x2779('0x77'),squel['select']()['field'](_0x2779('0x7b'))[_0x2779('0x73')](_0x2779('0x6c'))[_0x2779('0x3e')](_0x2779('0x79'),_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')]())))[_0x2779('0x72')]();break;default:_0x4fbf08=squel[_0x2779('0x7c')]()['into'](_0x2779('0x6c'))['fromQuery']([_0x2779('0x6d'),'scheduledAt',_0x2779('0x6f'),_0x2779('0x7e'),_0x2779('0x5d'),_0x2779('0x54'),_0x2779('0x55')],squel[_0x2779('0x7a')]()[_0x2779('0x71')]('phone',_0x2779('0x6d'))[_0x2779('0x71')](_0x2779('0x70'),_0x2779('0x6e'))['field']('id',_0x2779('0x6f'))[_0x2779('0x71')](_0x464df7['CmListId'][_0x2779('0x72')](),_0x2779('0x7e'))[_0x2779('0x71')](_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')](),_0x2779('0x5d'))[_0x2779('0x71')]('NOW()',_0x2779('0x54'))[_0x2779('0x71')]('NOW()',_0x2779('0x55'))[_0x2779('0x73')](_0x2779('0x74'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x2779('0x80'),_0x464df7['CmListId'][_0x2779('0x72')]())[_0x2779('0x3e')](_0x2779('0x7f')))[_0x2779('0x72')]();}_0x1b643c[_0x2779('0x81')](db[_0x2779('0x82')]['query'](_0x4fbf08));}return BPromise[_0x2779('0x83')](_0x1b643c);}})['then'](function(){return _0x1d1167;})['then'](respondWithResult(_0x23e3e2,null))['catch'](handleError(_0x23e3e2,null));};exports[_0x2779('0x84')]=function(_0x55f2eb,_0x5c4738,_0x29c619){return db[_0x2779('0x31')][_0x2779('0x4b')]({'where':{'id':_0x55f2eb[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x5c4738,null))[_0x2779('0x26')](function(_0x176423){if(_0x176423){return _0x176423[_0x2779('0x84')](_0x55f2eb[_0x2779('0x34')][_0x2779('0x68')]);}})['then'](function(_0x48e793){if(_0x48e793){return db[_0x2779('0x5c')][_0x2779('0x27')]({'where':{'ListId':_0x55f2eb['query'][_0x2779('0x68')],'CampaignId':_0x55f2eb[_0x2779('0x47')]['id']}})[_0x2779('0x26')](function(){return _0x48e793;});}})[_0x2779('0x26')](respondWithStatusCode(_0x5c4738,null))['catch'](handleError(_0x5c4738,null));};exports[_0x2779('0x85')]=function(_0x37ccd1,_0xd7f97e,_0x404c4d){var _0x76886d={};var _0xc8f55f={};var _0x3283e0;var _0x5b3437;return db[_0x2779('0x31')][_0x2779('0x5b')]({'where':{'id':_0x37ccd1['params']['id']}})[_0x2779('0x26')](handleEntityNotFound(_0xd7f97e,null))[_0x2779('0x26')](function(_0x127b37){if(_0x127b37){_0x3283e0=_0x127b37;_0xc8f55f['model']=_[_0x2779('0x48')](db[_0x2779('0x65')][_0x2779('0x32')]);_0xc8f55f['query']=_[_0x2779('0x48')](_0x37ccd1[_0x2779('0x34')]);_0xc8f55f[_0x2779('0x35')]=_['intersection'](_0xc8f55f['model'],_0xc8f55f[_0x2779('0x34')]);_0x76886d[_0x2779('0x37')]=_[_0x2779('0x38')](_0xc8f55f[_0x2779('0x36')],qs[_0x2779('0x39')](_0x37ccd1['query'][_0x2779('0x39')]));_0x76886d['attributes']=_0x76886d[_0x2779('0x37')]['length']?_0x76886d[_0x2779('0x37')]:_0xc8f55f[_0x2779('0x36')];_0x76886d[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x37ccd1[_0x2779('0x34')]['sort']);_0x76886d[_0x2779('0x3e')]=qs['filters'](_['pick'](_0x37ccd1[_0x2779('0x34')],_0xc8f55f[_0x2779('0x35')]));if(_0x37ccd1[_0x2779('0x34')][_0x2779('0x40')]){_0x76886d[_0x2779('0x3e')]=_[_0x2779('0x41')](_0x76886d[_0x2779('0x3e')],{'$or':_[_0x2779('0x30')](_0x76886d['attributes'],function(_0x15a51f){var _0x689b92={};_0x689b92[_0x15a51f]={'$like':'%'+_0x37ccd1[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x689b92;})});}_0x76886d=_['merge']({},_0x76886d,_0x37ccd1['options']);return _0x3283e0[_0x2779('0x85')](_0x76886d);}})[_0x2779('0x26')](function(_0x2d0a87){if(_0x2d0a87){_0x5b3437=_0x2d0a87[_0x2779('0x3a')];if(!_0x37ccd1[_0x2779('0x34')]['hasOwnProperty'](_0x2779('0x60'))){_0x76886d['limit']=qs[_0x2779('0x1f')](_0x37ccd1[_0x2779('0x34')][_0x2779('0x1f')]);_0x76886d['offset']=qs['offset'](_0x37ccd1['query']['offset']);}return _0x3283e0[_0x2779('0x85')](_0x76886d);}})['then'](function(_0x5a3ec8){if(_0x5a3ec8){return _0x5a3ec8?{'count':_0x5b3437,'rows':_0x5a3ec8}:null;}})['then'](respondWithResult(_0xd7f97e,null))['catch'](handleError(_0xd7f97e,null));};exports['addBlackLists']=function(_0xbf82b1,_0xc6e727,_0x4a8957){var _0x3b9d5e,_0x4ee401;return db[_0x2779('0x31')]['find']({'where':{'id':_0xbf82b1['params']['id']}})[_0x2779('0x26')](handleEntityNotFound(_0xc6e727,null))['then'](function(_0x58841c){if(_0x58841c){_0x4ee401=_0x58841c;return _0x58841c[_0x2779('0x86')](_0xbf82b1[_0x2779('0x4d')]['ids'],_[_0x2779('0x53')](_0xbf82b1[_0x2779('0x4d')],[_0x2779('0x68'),'id'])||{});}return null;})[_0x2779('0x69')](function(_0x5c8203){var _0x5be33e;_0x3b9d5e=_0x5c8203||[];var _0x37c8c7=[];if(_0x5c8203){for(var _0x51c6f5=0x0;_0x51c6f5<_0x5c8203[_0x2779('0x3a')];_0x51c6f5+=0x1){var _0x252b5a=_0x5c8203[_0x51c6f5]['get']({'plain':!![]});_0x5be33e=squel[_0x2779('0x7c')]()[_0x2779('0x6b')]('cm_hopper_black')['fromQuery']([_0x2779('0x6d'),_0x2779('0x6f'),'ListId',_0x2779('0x5d'),_0x2779('0x54'),'updatedAt'],squel[_0x2779('0x7a')]()['field'](_0x2779('0x6d'),'phone')['field']('id',_0x2779('0x6f'))[_0x2779('0x71')](_0x252b5a[_0x2779('0x76')][_0x2779('0x72')](),_0x2779('0x7e'))['field'](_0xbf82b1[_0x2779('0x47')]['id'][_0x2779('0x72')](),_0x2779('0x5d'))[_0x2779('0x71')](_0x2779('0x70'),_0x2779('0x54'))[_0x2779('0x71')](_0x2779('0x70'),_0x2779('0x55'))[_0x2779('0x73')]('cm_contacts')['where'](_0x2779('0x75'))[_0x2779('0x3e')](_0x2779('0x80'),_0x252b5a['CmListId'][_0x2779('0x72')]())['where'](_0x2779('0x7f')))['toString']();_0x37c8c7[_0x2779('0x81')](db[_0x2779('0x82')][_0x2779('0x34')](_0x5be33e));}return BPromise[_0x2779('0x83')](_0x37c8c7);}})[_0x2779('0x26')](function(){return _0x3b9d5e;})[_0x2779('0x26')](respondWithResult(_0xc6e727,null))[_0x2779('0x45')](handleError(_0xc6e727,null));};exports[_0x2779('0x87')]=function(_0x398ce7,_0x4a960d,_0x20753b){return db[_0x2779('0x31')][_0x2779('0x4b')]({'where':{'id':_0x398ce7['params']['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x4a960d,null))[_0x2779('0x26')](function(_0x5eafab){if(_0x5eafab){return _0x5eafab[_0x2779('0x87')](_0x398ce7[_0x2779('0x34')][_0x2779('0x68')]);}})[_0x2779('0x26')](function(_0x34f9fc){if(_0x34f9fc){return db[_0x2779('0x64')][_0x2779('0x27')]({'where':{'ListId':_0x398ce7['query'][_0x2779('0x68')],'CampaignId':_0x398ce7['params']['id']}})[_0x2779('0x26')](function(){return _0x34f9fc;});}})[_0x2779('0x26')](respondWithStatusCode(_0x4a960d,null))['catch'](handleError(_0x4a960d,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7e09217..c120076 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(_0x507ef4,_0x4441f9){var _0x2c6986=function(_0xd1fc6c){while(--_0xd1fc6c){_0x507ef4['push'](_0x507ef4['shift']());}};_0x2c6986(++_0x4441f9);}(_0x7a54,0x106));var _0x47a5=function(_0x292532,_0x244b41){_0x292532=_0x292532-0x0;var _0x1571ec=_0x7a54[_0x292532];return _0x1571ec;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x221927,_0x1cd547){var _0x5c7399=function(_0x19b6ca){while(--_0x19b6ca){_0x221927['push'](_0x221927['shift']());}};_0x5c7399(++_0x1cd547);}(_0x7a54,0x106));var _0x47a5=function(_0x531d6f,_0x4fb825){_0x531d6f=_0x531d6f-0x0;var _0x2bdce7=_0x7a54[_0x531d6f];return _0x2bdce7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 8198690..3dab695 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 _0x3f49=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','options','where','attributes','limit','include','map','model','GetCampaign','debug','lodash','util','bluebird'];(function(_0x275df6,_0x273871){var _0x1573c6=function(_0x104bcf){while(--_0x104bcf){_0x275df6['push'](_0x275df6['shift']());}};_0x1573c6(++_0x273871);}(_0x3f49,0x11f));var _0x93f4=function(_0x1bc36c,_0x10239a){_0x1bc36c=_0x1bc36c-0x0;var _0x8ce4e0=_0x3f49[_0x1bc36c];return _0x8ce4e0;};'use strict';var _=require(_0x93f4('0x0'));var util=require(_0x93f4('0x1'));var moment=require('moment');var BPromise=require(_0x93f4('0x2'));var rs=require(_0x93f4('0x3'));var fs=require('fs');var Redis=require(_0x93f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x93f4('0x5'));var logger=require(_0x93f4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x93f4('0x7'));var client=jayson[_0x93f4('0x8')][_0x93f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a86ad,_0x956b50,_0x5d22d9){return new BPromise(function(_0x144f31,_0x5e5b4d){return client[_0x93f4('0xa')](_0x5a86ad,_0x5d22d9)[_0x93f4('0xb')](function(_0x325984){logger[_0x93f4('0xc')](_0x93f4('0xd'),_0x956b50,_0x93f4('0xe'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x956b50,_0x93f4('0xe'),JSON[_0x93f4('0xf')](_0x325984));if(_0x325984[_0x93f4('0x10')]){if(_0x325984[_0x93f4('0x10')][_0x93f4('0x11')]===0x1f4){logger[_0x93f4('0x10')](_0x93f4('0xd'),_0x956b50,_0x325984[_0x93f4('0x10')]['message']);return _0x5e5b4d(_0x325984[_0x93f4('0x10')]['message']);}logger['error'](_0x93f4('0xd'),_0x956b50,_0x325984[_0x93f4('0x10')][_0x93f4('0x12')]);return _0x144f31(_0x325984['error']['message']);}else{logger[_0x93f4('0xc')](_0x93f4('0xd'),_0x956b50,_0x93f4('0xe'));_0x144f31(_0x325984['result'][_0x93f4('0x12')]);}})[_0x93f4('0x13')](function(_0x53151e){logger[_0x93f4('0x10')]('Campaign,\x20%s,\x20%s',_0x956b50,_0x53151e);_0x5e5b4d(_0x53151e);});});}exports['GetCampaign']=function(_0x1d4773){var _0x5b6488=this;return new Promise(function(_0x38d8b6,_0x556fc6){return db['Campaign']['findAll']({'raw':_0x1d4773[_0x93f4('0x14')]?_0x1d4773[_0x93f4('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1d4773[_0x93f4('0x14')]?_0x1d4773['options'][_0x93f4('0x15')]||null:null,'attributes':_0x1d4773[_0x93f4('0x14')]?_0x1d4773[_0x93f4('0x14')][_0x93f4('0x16')]||null:null,'limit':_0x1d4773['options']?_0x1d4773['options'][_0x93f4('0x17')]||null:null,'include':_0x1d4773[_0x93f4('0x14')]?_0x1d4773['options']['include']?_['map'](_0x1d4773[_0x93f4('0x14')][_0x93f4('0x18')],function(_0x475f0b){return{'model':db[_0x475f0b['model']],'as':_0x475f0b['as'],'attributes':_0x475f0b[_0x93f4('0x16')],'include':_0x475f0b['include']?_[_0x93f4('0x19')](_0x475f0b[_0x93f4('0x18')],function(_0x5afabf){return{'model':db[_0x5afabf[_0x93f4('0x1a')]],'as':_0x5afabf['as'],'attributes':_0x5afabf[_0x93f4('0x16')],'include':_0x5afabf[_0x93f4('0x18')]?_[_0x93f4('0x19')](_0x5afabf['include'],function(_0x454b5b){return{'model':db[_0x454b5b[_0x93f4('0x1a')]],'as':_0x454b5b['as'],'attributes':_0x454b5b[_0x93f4('0x16')]};}):[]};}):[]};}):[]:[]})[_0x93f4('0xb')](function(_0x590d52){logger[_0x93f4('0xc')](_0x93f4('0x1b'),_0x1d4773);logger[_0x93f4('0x1c')](_0x93f4('0x1b'),_0x1d4773,JSON[_0x93f4('0xf')](_0x590d52));_0x38d8b6(_0x590d52);})[_0x93f4('0x13')](function(_0x47776e){logger[_0x93f4('0x10')]('GetCampaign',_0x47776e[_0x93f4('0x12')],_0x1d4773);_0x556fc6(_0x5b6488[_0x93f4('0x10')](0x1f4,_0x47776e['message']));});});};
\ No newline at end of file
+var _0xc6d8=['request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','model','attributes','map','include','then','GetCampaign','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x35ec9a,_0x174edd){var _0x491fa3=function(_0x45eea8){while(--_0x45eea8){_0x35ec9a['push'](_0x35ec9a['shift']());}};_0x491fa3(++_0x174edd);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x426cad,_0x45810d){_0x426cad=_0x426cad-0x0;var _0x50c00f=_0xc6d8[_0x426cad];return _0x50c00f;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Campaign,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['GetCampaign']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['Campaign'][_0x8c6d('0x13')]({'raw':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')][_0x8c6d('0x15')]===undefined?!![]:![]:!![],'where':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['where']||null:null,'attributes':_0x3e5495['options']?_0x3e5495[_0x8c6d('0x14')]['attributes']||null:null,'limit':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['limit']||null:null,'include':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')]['include']?_['map'](_0x3e5495['options']['include'],function(_0x2a85b5){return{'model':db[_0x2a85b5[_0x8c6d('0x16')]],'as':_0x2a85b5['as'],'attributes':_0x2a85b5[_0x8c6d('0x17')],'include':_0x2a85b5['include']?_[_0x8c6d('0x18')](_0x2a85b5['include'],function(_0x15a9c4){return{'model':db[_0x15a9c4['model']],'as':_0x15a9c4['as'],'attributes':_0x15a9c4[_0x8c6d('0x17')],'include':_0x15a9c4[_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x15a9c4[_0x8c6d('0x19')],function(_0x1e6755){return{'model':db[_0x1e6755[_0x8c6d('0x16')]],'as':_0x1e6755['as'],'attributes':_0x1e6755[_0x8c6d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6d('0x1a')](function(_0x3eab38){logger['info']('GetCampaign',_0x3e5495);logger[_0x8c6d('0xd')](_0x8c6d('0x1b'),_0x3e5495,JSON[_0x8c6d('0xf')](_0x3eab38));_0x4c2f8d(_0x3eab38);})[_0x8c6d('0x12')](function(_0x370626){logger[_0x8c6d('0x10')](_0x8c6d('0x1b'),_0x370626[_0x8c6d('0x11')],_0x3e5495);_0x21b8ee(_0x5a22de[_0x8c6d('0x10')](0x1f4,_0x370626[_0x8c6d('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 9375345..7b1f9bd 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 _0x2d70=['getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','put','delete','destroy','removeLists','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show'];(function(_0x271059,_0x2d63fc){var _0x4d0010=function(_0x14cc4d){while(--_0x14cc4d){_0x271059['push'](_0x271059['shift']());}};_0x4d0010(++_0x2d63fc);}(_0x2d70,0xd2));var _0x02d7=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x2d70[_0x4667b2];return _0x1070f2;};'use strict';var multer=require(_0x02d7('0x0'));var util=require('util');var path=require(_0x02d7('0x1'));var timeout=require(_0x02d7('0x2'));var express=require(_0x02d7('0x3'));var router=express['Router']();var fs_extra=require(_0x02d7('0x4'));var auth=require(_0x02d7('0x5'));var interaction=require(_0x02d7('0x6'));var config=require(_0x02d7('0x7'));var controller=require(_0x02d7('0x8'));router[_0x02d7('0x9')]('/',auth[_0x02d7('0xa')](),controller[_0x02d7('0xb')]);router[_0x02d7('0x9')](_0x02d7('0xc'),auth[_0x02d7('0xa')](),controller[_0x02d7('0xd')]);router[_0x02d7('0x9')]('/:id/hoppers',auth[_0x02d7('0xa')](),controller[_0x02d7('0xe')]);router[_0x02d7('0x9')]('/:id/hopper_histories',auth[_0x02d7('0xa')](),controller[_0x02d7('0xf')]);router[_0x02d7('0x9')](_0x02d7('0x10'),auth[_0x02d7('0xa')](),controller[_0x02d7('0x11')]);router[_0x02d7('0x9')](_0x02d7('0x12'),auth[_0x02d7('0xa')](),controller[_0x02d7('0x13')]);router[_0x02d7('0x9')](_0x02d7('0x14'),auth[_0x02d7('0xa')](),controller[_0x02d7('0x15')]);router['get'](_0x02d7('0x16'),auth[_0x02d7('0xa')](),controller[_0x02d7('0x17')]);router[_0x02d7('0x18')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x02d7('0x19'),auth[_0x02d7('0xa')](),controller[_0x02d7('0x1a')]);router[_0x02d7('0x18')]('/:id/lists',auth[_0x02d7('0xa')](),controller['addLists']);router[_0x02d7('0x18')](_0x02d7('0x16'),auth[_0x02d7('0xa')](),controller[_0x02d7('0x1b')]);router[_0x02d7('0x1c')](_0x02d7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x02d7('0x1d')](_0x02d7('0xc'),auth['isAuthenticated'](),controller[_0x02d7('0x1e')]);router[_0x02d7('0x1d')](_0x02d7('0x14'),auth[_0x02d7('0xa')](),controller[_0x02d7('0x1f')]);router[_0x02d7('0x1d')](_0x02d7('0x16'),auth[_0x02d7('0xa')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0x9aee=['../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','show','get','getHoppers','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addBlackLists','put','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x24a863,_0x255d66){var _0x564910=function(_0x3d59d){while(--_0x3d59d){_0x24a863['push'](_0x24a863['shift']());}};_0x564910(++_0x255d66);}(_0x9aee,0x71));var _0xe9ae=function(_0x515d8c,_0x305407){_0x515d8c=_0x515d8c-0x0;var _0x1297e7=_0x9aee[_0x515d8c];return _0x1297e7;};'use strict';var multer=require(_0xe9ae('0x0'));var util=require(_0xe9ae('0x1'));var path=require(_0xe9ae('0x2'));var timeout=require(_0xe9ae('0x3'));var express=require(_0xe9ae('0x4'));var router=express[_0xe9ae('0x5')]();var fs_extra=require(_0xe9ae('0x6'));var auth=require(_0xe9ae('0x7'));var interaction=require(_0xe9ae('0x8'));var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth[_0xe9ae('0x9')](),controller['index']);router['get'](_0xe9ae('0xa'),auth['isAuthenticated'](),controller[_0xe9ae('0xb')]);router[_0xe9ae('0xc')]('/:id/hoppers',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0xd')]);router[_0xe9ae('0xc')]('/:id/hopper_histories',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0xe')]);router[_0xe9ae('0xc')]('/:id/hopper_finals',auth[_0xe9ae('0x9')](),controller['getHopperFinals']);router[_0xe9ae('0xc')](_0xe9ae('0xf'),auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x10')]);router[_0xe9ae('0xc')](_0xe9ae('0x11'),auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x12')]);router['get'](_0xe9ae('0x13'),auth[_0xe9ae('0x9')](),controller['getBlackLists']);router[_0xe9ae('0x14')]('/',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x15')]);router[_0xe9ae('0x14')](_0xe9ae('0x16'),auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x17')]);router[_0xe9ae('0x14')](_0xe9ae('0x11'),auth['isAuthenticated'](),controller['addLists']);router[_0xe9ae('0x14')]('/:id/blacklists',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x18')]);router[_0xe9ae('0x19')](_0xe9ae('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe9ae('0xa'),auth[_0xe9ae('0x9')](),controller['destroy']);router[_0xe9ae('0x1a')]('/:id/lists',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x1b')]);router[_0xe9ae('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xe9ae('0x1c')]);module[_0xe9ae('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 89a47b9..485b78e 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 _0x3a88=['VIRTUAL','getDataValue','key','sequelize','STRING'];(function(_0x104ef5,_0x2d0d89){var _0x11907e=function(_0x303536){while(--_0x303536){_0x104ef5['push'](_0x104ef5['shift']());}};_0x11907e(++_0x2d0d89);}(_0x3a88,0x148));var _0x83a8=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x3a88[_0x31a371];return _0x2a5bd6;};'use strict';var Sequelize=require(_0x83a8('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x83a8('0x1')]},'name':{'type':Sequelize[_0x83a8('0x2')],'get':function(){return this[_0x83a8('0x3')](_0x83a8('0x4'));}}};
\ No newline at end of file
+var _0xe94f=['key','sequelize','exports','STRING','VIRTUAL'];(function(_0x2b9075,_0x25b39c){var _0x256ac2=function(_0x388e28){while(--_0x388e28){_0x2b9075['push'](_0x2b9075['shift']());}};_0x256ac2(++_0x25b39c);}(_0xe94f,0x178));var _0xfe94=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0xe94f[_0x51e79c];return _0x2467be;};'use strict';var Sequelize=require(_0xfe94('0x0'));module[_0xfe94('0x1')]={'key':{'type':Sequelize[_0xfe94('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xfe94('0x2')]},'name':{'type':Sequelize[_0xfe94('0x3')],'get':function(){return this['getDataValue'](_0xfe94('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 30cb5aa..1567ddc 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 _0x9bc7=['set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CannedAnswers','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','offset'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x9bc7,0x1ab));var _0x79bc=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9bc7[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79bc('0x0'));var zipdir=require(_0x79bc('0x1'));var jsonpatch=require(_0x79bc('0x2'));var rp=require(_0x79bc('0x3'));var moment=require(_0x79bc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x79bc('0x5'));var path=require(_0x79bc('0x6'));var sox=require(_0x79bc('0x7'));var csv=require(_0x79bc('0x8'));var ejs=require(_0x79bc('0x9'));var fs=require('fs');var fs_extra=require(_0x79bc('0xa'));var _=require(_0x79bc('0xb'));var squel=require(_0x79bc('0xc'));var crypto=require(_0x79bc('0xd'));var jsforce=require(_0x79bc('0xe'));var deskjs=require(_0x79bc('0xf'));var toCsv=require(_0x79bc('0x8'));var querystring=require(_0x79bc('0x10'));var Papa=require(_0x79bc('0x11'));var Redis=require('ioredis');var authService=require(_0x79bc('0x12'));var qs=require(_0x79bc('0x13'));var as=require(_0x79bc('0x14'));var hardwareService=require(_0x79bc('0x15'));var logger=require(_0x79bc('0x16'))(_0x79bc('0x17'));var utils=require(_0x79bc('0x18'));var config=require(_0x79bc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x79bc('0x1a'))['db'];function respondWithStatusCode(_0x736d6,_0x44ec78){_0x44ec78=_0x44ec78||0xcc;return function(_0x588f2f){if(_0x588f2f){return _0x736d6['sendStatus'](_0x44ec78);}return _0x736d6[_0x79bc('0x1b')](_0x44ec78)[_0x79bc('0x1c')]();};}function respondWithResult(_0x209c03,_0x4eddd0){_0x4eddd0=_0x4eddd0||0xc8;return function(_0x314012){if(_0x314012){return _0x209c03[_0x79bc('0x1b')](_0x4eddd0)[_0x79bc('0x1d')](_0x314012);}};}function respondWithFilteredResult(_0x3d3e8b,_0x2ce107){return function(_0x436149){if(_0x436149){var _0x2eff35=typeof _0x2ce107['offset']==='undefined'&&typeof _0x2ce107[_0x79bc('0x1e')]==='undefined';var _0x44c478=_0x436149[_0x79bc('0x1f')];var _0x20d3ea=_0x2eff35?0x0:_0x2ce107[_0x79bc('0x20')];var _0x2ac62c=_0x2eff35?_0x436149[_0x79bc('0x1f')]:_0x2ce107['offset']+_0x2ce107[_0x79bc('0x1e')];var _0x1623c7;if(_0x2ac62c>=_0x44c478){_0x2ac62c=_0x44c478;_0x1623c7=0xc8;}else{_0x1623c7=0xce;}_0x3d3e8b['status'](_0x1623c7);return _0x3d3e8b[_0x79bc('0x21')](_0x79bc('0x22'),_0x20d3ea+'-'+_0x2ac62c+'/'+_0x44c478)[_0x79bc('0x1d')](_0x436149);}return null;};}function patchUpdates(_0x481285){return function(_0x18b122){try{jsonpatch[_0x79bc('0x23')](_0x18b122,_0x481285,!![]);}catch(_0x28e5ec){return BPromise[_0x79bc('0x24')](_0x28e5ec);}return _0x18b122[_0x79bc('0x25')]();};}function saveUpdates(_0x5c7d09,_0x2db509){return function(_0x4b4965){if(_0x4b4965){return _0x4b4965[_0x79bc('0x26')](_0x5c7d09)[_0x79bc('0x27')](function(_0x5a8f3b){return _0x5a8f3b;});}return null;};}function removeEntity(_0x9ee21c,_0x46b519){return function(_0x17edfa){if(_0x17edfa){return _0x17edfa[_0x79bc('0x28')]()[_0x79bc('0x27')](function(){var _0x2ecc8b=_0x17edfa[_0x79bc('0x29')]({'plain':!![]});var _0x11d3b9='CannedAnswers';return db[_0x79bc('0x2a')][_0x79bc('0x28')]({'where':{'type':_0x11d3b9,'resourceId':_0x2ecc8b['id']}})[_0x79bc('0x27')](function(){return _0x17edfa;});})[_0x79bc('0x27')](function(){_0x9ee21c[_0x79bc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9869,_0x4d801b){return function(_0x50de59){if(!_0x50de59){_0x1f9869['sendStatus'](0x194);}return _0x50de59;};}function handleError(_0x2a5d67,_0x5580ba){_0x5580ba=_0x5580ba||0x1f4;return function(_0x3b86d8){logger[_0x79bc('0x2b')](_0x3b86d8[_0x79bc('0x2c')]);if(_0x3b86d8[_0x79bc('0x2d')]){delete _0x3b86d8[_0x79bc('0x2d')];}_0x2a5d67['status'](_0x5580ba)[_0x79bc('0x2e')](_0x3b86d8);};}exports[_0x79bc('0x2f')]=function(_0x52f779,_0x3c9f42){var _0x3c0773={},_0x4e6f84={},_0xd6e003={'count':0x0,'rows':[]};var _0x16b987=_[_0x79bc('0x30')](db[_0x79bc('0x31')][_0x79bc('0x32')],function(_0x2e2a5a){return{'name':_0x2e2a5a[_0x79bc('0x33')],'type':_0x2e2a5a[_0x79bc('0x34')][_0x79bc('0x35')]};});_0x4e6f84['model']=_[_0x79bc('0x30')](_0x16b987,_0x79bc('0x2d'));_0x4e6f84[_0x79bc('0x36')]=_[_0x79bc('0x37')](_0x52f779['query']);_0x4e6f84[_0x79bc('0x38')]=_['intersection'](_0x4e6f84[_0x79bc('0x39')],_0x4e6f84[_0x79bc('0x36')]);_0x3c0773[_0x79bc('0x3a')]=_[_0x79bc('0x3b')](_0x4e6f84[_0x79bc('0x39')],qs[_0x79bc('0x3c')](_0x52f779[_0x79bc('0x36')][_0x79bc('0x3c')]));_0x3c0773['attributes']=_0x3c0773['attributes'][_0x79bc('0x3d')]?_0x3c0773[_0x79bc('0x3a')]:_0x4e6f84[_0x79bc('0x39')];if(!_0x52f779[_0x79bc('0x36')][_0x79bc('0x3e')]('nolimit')){_0x3c0773[_0x79bc('0x1e')]=qs[_0x79bc('0x1e')](_0x52f779[_0x79bc('0x36')]['limit']);_0x3c0773[_0x79bc('0x20')]=qs[_0x79bc('0x20')](_0x52f779['query'][_0x79bc('0x20')]);}_0x3c0773[_0x79bc('0x3f')]=qs['sort'](_0x52f779['query'][_0x79bc('0x40')]);_0x3c0773[_0x79bc('0x41')]=qs[_0x79bc('0x38')](_[_0x79bc('0x42')](_0x52f779[_0x79bc('0x36')],_0x4e6f84[_0x79bc('0x38')]),_0x16b987);if(_0x52f779[_0x79bc('0x36')][_0x79bc('0x43')]){_0x3c0773[_0x79bc('0x41')]=_[_0x79bc('0x44')](_0x3c0773['where'],{'$or':[{'key':{'$like':'%'+_0x52f779[_0x79bc('0x36')][_0x79bc('0x43')]+'%'}},{'value':{'$like':'%'+_0x52f779[_0x79bc('0x36')]['filter']+'%'}}]});}_0x3c0773=_[_0x79bc('0x44')]({},_0x3c0773,_0x52f779[_0x79bc('0x45')]);var _0x3f7313={'where':_0x3c0773[_0x79bc('0x41')]};return db['CannedAnswer'][_0x79bc('0x1f')](_0x3f7313)[_0x79bc('0x27')](function(_0x261d7f){_0xd6e003[_0x79bc('0x1f')]=_0x261d7f;if(_0x52f779['query'][_0x79bc('0x46')]){_0x3c0773[_0x79bc('0x47')]=[{'all':!![]}];}return db[_0x79bc('0x31')][_0x79bc('0x48')](_0x3c0773);})[_0x79bc('0x27')](function(_0x12788d){_0xd6e003[_0x79bc('0x49')]=_0x12788d;return _0xd6e003;})['then'](respondWithFilteredResult(_0x3c9f42,_0x3c0773))[_0x79bc('0x4a')](handleError(_0x3c9f42,null));};exports[_0x79bc('0x4b')]=function(_0xc93c7d,_0x7d644f){var _0x48aba3={'raw':!![],'where':{'id':_0xc93c7d[_0x79bc('0x4c')]['id']}},_0x5300a7={};_0x5300a7[_0x79bc('0x39')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x5300a7[_0x79bc('0x36')]=_[_0x79bc('0x37')](_0xc93c7d['query']);_0x5300a7[_0x79bc('0x38')]=_[_0x79bc('0x3b')](_0x5300a7[_0x79bc('0x39')],_0x5300a7['query']);_0x48aba3[_0x79bc('0x3a')]=_[_0x79bc('0x3b')](_0x5300a7[_0x79bc('0x39')],qs['fields'](_0xc93c7d['query'][_0x79bc('0x3c')]));_0x48aba3[_0x79bc('0x3a')]=_0x48aba3[_0x79bc('0x3a')][_0x79bc('0x3d')]?_0x48aba3[_0x79bc('0x3a')]:_0x5300a7[_0x79bc('0x39')];if(_0xc93c7d[_0x79bc('0x36')][_0x79bc('0x46')]){_0x48aba3[_0x79bc('0x47')]=[{'all':!![]}];}_0x48aba3=_['merge']({},_0x48aba3,_0xc93c7d['options']);return db[_0x79bc('0x31')][_0x79bc('0x4d')](_0x48aba3)[_0x79bc('0x27')](handleEntityNotFound(_0x7d644f,null))[_0x79bc('0x27')](respondWithResult(_0x7d644f,null))[_0x79bc('0x4a')](handleError(_0x7d644f,null));};exports['update']=function(_0x156ca1,_0x13843c){if(_0x156ca1['body']['id']){delete _0x156ca1[_0x79bc('0x4e')]['id'];}return db[_0x79bc('0x31')][_0x79bc('0x4d')]({'where':{'id':_0x156ca1[_0x79bc('0x4c')]['id']}})[_0x79bc('0x27')](handleEntityNotFound(_0x13843c,null))[_0x79bc('0x27')](saveUpdates(_0x156ca1[_0x79bc('0x4e')],null))[_0x79bc('0x27')](respondWithResult(_0x13843c,null))[_0x79bc('0x4a')](handleError(_0x13843c,null));};exports[_0x79bc('0x28')]=function(_0x13b86a,_0x18c94d){return db[_0x79bc('0x31')][_0x79bc('0x4d')]({'where':{'id':_0x13b86a[_0x79bc('0x4c')]['id']}})[_0x79bc('0x27')](handleEntityNotFound(_0x18c94d,null))[_0x79bc('0x27')](removeEntity(_0x18c94d,null))[_0x79bc('0x4a')](handleError(_0x18c94d,null));};exports['create']=function(_0x37c878,_0x3037cc){var _0x48e446={'key':_0x37c878[_0x79bc('0x4e')][_0x79bc('0x35')]};if(_0x37c878[_0x79bc('0x4e')][_0x79bc('0x4f')]){_0x48e446['MailAccountId']=_0x37c878[_0x79bc('0x4e')][_0x79bc('0x4f')];}else if(_0x37c878[_0x79bc('0x4e')][_0x79bc('0x50')]){_0x48e446[_0x79bc('0x50')]=_0x37c878[_0x79bc('0x4e')][_0x79bc('0x50')];}else if(_0x37c878['body'][_0x79bc('0x51')]){_0x48e446[_0x79bc('0x51')]=_0x37c878[_0x79bc('0x4e')]['OpenchannelAccountId'];}else if(_0x37c878[_0x79bc('0x4e')]['ChatWebsiteId']){_0x48e446['ChatWebsiteId']=_0x37c878['body'][_0x79bc('0x52')];}return db[_0x79bc('0x31')][_0x79bc('0x4d')]({'where':_0x48e446})[_0x79bc('0x27')](function(_0x543577){if(_0x543577){throw new db[(_0x79bc('0x53'))][(_0x79bc('0x54'))](_0x79bc('0x55'));}return db[_0x79bc('0x31')]['create'](_0x37c878[_0x79bc('0x4e')]);})['then'](function(_0x5632f1){var _0x46d0c7=_0x37c878[_0x79bc('0x56')][_0x79bc('0x29')]({'plain':!![]});if(!_0x46d0c7)throw new Error(_0x79bc('0x57'));if(_0x46d0c7['role']===_0x79bc('0x56')){var _0xd61955=_0x5632f1[_0x79bc('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x79bc('0x4d')]({'where':{'name':_0x79bc('0x58'),'userProfileId':_0x46d0c7[_0x79bc('0x59')]},'raw':!![]})['then'](function(_0x11ec38){if(_0x11ec38&&_0x11ec38['autoAssociation']===0x0){return db[_0x79bc('0x2a')][_0x79bc('0x5a')]({'name':_0xd61955[_0x79bc('0x2d')],'resourceId':_0xd61955['id'],'type':_0x11ec38[_0x79bc('0x2d')],'sectionId':_0x11ec38['id']},{})[_0x79bc('0x27')](function(){return _0x5632f1;});}else{return _0x5632f1;}})[_0x79bc('0x4a')](function(_0x170615){logger[_0x79bc('0x2b')](_0x79bc('0x5b'),_0x170615);throw _0x170615;});}return _0x5632f1;})[_0x79bc('0x27')](respondWithResult(_0x3037cc,0xc9))[_0x79bc('0x4a')](handleError(_0x3037cc,null));};
\ No newline at end of file
+var _0x29dd=['../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','stack','name','index','map','CannedAnswer','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','includeAll','findAll','rows','catch','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','error','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x29dd,0x13d));var _0xd29d=function(_0x2bea1d,_0xc4d88a){_0x2bea1d=_0x2bea1d-0x0;var _0x22cee5=_0x29dd[_0x2bea1d];return _0x22cee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd29d('0x0'));var zipdir=require(_0xd29d('0x1'));var jsonpatch=require(_0xd29d('0x2'));var rp=require(_0xd29d('0x3'));var moment=require('moment');var BPromise=require(_0xd29d('0x4'));var Mustache=require(_0xd29d('0x5'));var util=require(_0xd29d('0x6'));var path=require(_0xd29d('0x7'));var sox=require(_0xd29d('0x8'));var csv=require(_0xd29d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd29d('0xa'));var _=require(_0xd29d('0xb'));var squel=require(_0xd29d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd29d('0xd'));var toCsv=require(_0xd29d('0x9'));var querystring=require(_0xd29d('0xe'));var Papa=require(_0xd29d('0xf'));var Redis=require(_0xd29d('0x10'));var authService=require(_0xd29d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd29d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd29d('0x13'));var utils=require(_0xd29d('0x14'));var config=require(_0xd29d('0x15'));var licenseUtil=require(_0xd29d('0x16'));var db=require(_0xd29d('0x17'))['db'];function respondWithStatusCode(_0x5b77cc,_0x212076){_0x212076=_0x212076||0xcc;return function(_0x1c41c9){if(_0x1c41c9){return _0x5b77cc['sendStatus'](_0x212076);}return _0x5b77cc[_0xd29d('0x18')](_0x212076)[_0xd29d('0x19')]();};}function respondWithResult(_0xbf4306,_0x3ae90f){_0x3ae90f=_0x3ae90f||0xc8;return function(_0x5b3727){if(_0x5b3727){return _0xbf4306[_0xd29d('0x18')](_0x3ae90f)[_0xd29d('0x1a')](_0x5b3727);}};}function respondWithFilteredResult(_0x3ddb24,_0x4e9ae1){return function(_0x1f96fb){if(_0x1f96fb){var _0x12855e=typeof _0x4e9ae1[_0xd29d('0x1b')]===_0xd29d('0x1c')&&typeof _0x4e9ae1[_0xd29d('0x1d')]===_0xd29d('0x1c');var _0x587c97=_0x1f96fb[_0xd29d('0x1e')];var _0x1d90ee=_0x12855e?0x0:_0x4e9ae1[_0xd29d('0x1b')];var _0x2e7897=_0x12855e?_0x1f96fb[_0xd29d('0x1e')]:_0x4e9ae1[_0xd29d('0x1b')]+_0x4e9ae1['limit'];var _0x30bdd5;if(_0x2e7897>=_0x587c97){_0x2e7897=_0x587c97;_0x30bdd5=0xc8;}else{_0x30bdd5=0xce;}_0x3ddb24[_0xd29d('0x18')](_0x30bdd5);return _0x3ddb24[_0xd29d('0x1f')](_0xd29d('0x20'),_0x1d90ee+'-'+_0x2e7897+'/'+_0x587c97)[_0xd29d('0x1a')](_0x1f96fb);}return null;};}function patchUpdates(_0x4be369){return function(_0x4558ca){try{jsonpatch[_0xd29d('0x21')](_0x4558ca,_0x4be369,!![]);}catch(_0x4a9541){return BPromise[_0xd29d('0x22')](_0x4a9541);}return _0x4558ca['save']();};}function saveUpdates(_0x1645ee,_0x5c3507){return function(_0x23d78c){if(_0x23d78c){return _0x23d78c[_0xd29d('0x23')](_0x1645ee)[_0xd29d('0x24')](function(_0x1cd80b){return _0x1cd80b;});}return null;};}function removeEntity(_0x352fab,_0x682fd2){return function(_0x367767){if(_0x367767){return _0x367767[_0xd29d('0x25')]()[_0xd29d('0x24')](function(){var _0x4a755b=_0x367767[_0xd29d('0x26')]({'plain':!![]});var _0x2bef3f='CannedAnswers';return db['UserProfileResource'][_0xd29d('0x25')]({'where':{'type':_0x2bef3f,'resourceId':_0x4a755b['id']}})[_0xd29d('0x24')](function(){return _0x367767;});})[_0xd29d('0x24')](function(){_0x352fab[_0xd29d('0x18')](0xcc)[_0xd29d('0x19')]();});}};}function handleEntityNotFound(_0x2ee346,_0x59e7d6){return function(_0x1e4bba){if(!_0x1e4bba){_0x2ee346['sendStatus'](0x194);}return _0x1e4bba;};}function handleError(_0x242517,_0x129bdf){_0x129bdf=_0x129bdf||0x1f4;return function(_0x2f6d82){logger['error'](_0x2f6d82[_0xd29d('0x27')]);if(_0x2f6d82[_0xd29d('0x28')]){delete _0x2f6d82['name'];}_0x242517[_0xd29d('0x18')](_0x129bdf)['send'](_0x2f6d82);};}exports[_0xd29d('0x29')]=function(_0x52421f,_0x41f563){var _0x128d1c={},_0x194fca={},_0x3ea0a8={'count':0x0,'rows':[]};var _0x1ec288=_[_0xd29d('0x2a')](db[_0xd29d('0x2b')][_0xd29d('0x2c')],function(_0x2ca882){return{'name':_0x2ca882['fieldName'],'type':_0x2ca882[_0xd29d('0x2d')]['key']};});_0x194fca[_0xd29d('0x2e')]=_['map'](_0x1ec288,'name');_0x194fca[_0xd29d('0x2f')]=_[_0xd29d('0x30')](_0x52421f['query']);_0x194fca[_0xd29d('0x31')]=_[_0xd29d('0x32')](_0x194fca[_0xd29d('0x2e')],_0x194fca[_0xd29d('0x2f')]);_0x128d1c['attributes']=_[_0xd29d('0x32')](_0x194fca[_0xd29d('0x2e')],qs[_0xd29d('0x33')](_0x52421f[_0xd29d('0x2f')][_0xd29d('0x33')]));_0x128d1c['attributes']=_0x128d1c[_0xd29d('0x34')][_0xd29d('0x35')]?_0x128d1c[_0xd29d('0x34')]:_0x194fca['model'];if(!_0x52421f['query'][_0xd29d('0x36')](_0xd29d('0x37'))){_0x128d1c[_0xd29d('0x1d')]=qs[_0xd29d('0x1d')](_0x52421f['query'][_0xd29d('0x1d')]);_0x128d1c[_0xd29d('0x1b')]=qs[_0xd29d('0x1b')](_0x52421f[_0xd29d('0x2f')][_0xd29d('0x1b')]);}_0x128d1c[_0xd29d('0x38')]=qs[_0xd29d('0x39')](_0x52421f[_0xd29d('0x2f')][_0xd29d('0x39')]);_0x128d1c['where']=qs['filters'](_['pick'](_0x52421f[_0xd29d('0x2f')],_0x194fca[_0xd29d('0x31')]),_0x1ec288);if(_0x52421f[_0xd29d('0x2f')][_0xd29d('0x3a')]){_0x128d1c['where']=_[_0xd29d('0x3b')](_0x128d1c[_0xd29d('0x3c')],{'$or':[{'key':{'$like':'%'+_0x52421f[_0xd29d('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0x52421f['query'][_0xd29d('0x3a')]+'%'}}]});}_0x128d1c=_[_0xd29d('0x3b')]({},_0x128d1c,_0x52421f[_0xd29d('0x3d')]);var _0x16469e={'where':_0x128d1c[_0xd29d('0x3c')]};return db['CannedAnswer'][_0xd29d('0x1e')](_0x16469e)[_0xd29d('0x24')](function(_0x2cef3d){_0x3ea0a8[_0xd29d('0x1e')]=_0x2cef3d;if(_0x52421f['query'][_0xd29d('0x3e')]){_0x128d1c['include']=[{'all':!![]}];}return db[_0xd29d('0x2b')][_0xd29d('0x3f')](_0x128d1c);})[_0xd29d('0x24')](function(_0x307fd9){_0x3ea0a8[_0xd29d('0x40')]=_0x307fd9;return _0x3ea0a8;})[_0xd29d('0x24')](respondWithFilteredResult(_0x41f563,_0x128d1c))[_0xd29d('0x41')](handleError(_0x41f563,null));};exports['show']=function(_0x417e7f,_0x14b636){var _0x4ae26d={'raw':!![],'where':{'id':_0x417e7f[_0xd29d('0x42')]['id']}},_0x2e3e4a={};_0x2e3e4a[_0xd29d('0x2e')]=_[_0xd29d('0x30')](db[_0xd29d('0x2b')][_0xd29d('0x2c')]);_0x2e3e4a['query']=_['keys'](_0x417e7f[_0xd29d('0x2f')]);_0x2e3e4a['filters']=_[_0xd29d('0x32')](_0x2e3e4a[_0xd29d('0x2e')],_0x2e3e4a[_0xd29d('0x2f')]);_0x4ae26d['attributes']=_[_0xd29d('0x32')](_0x2e3e4a[_0xd29d('0x2e')],qs['fields'](_0x417e7f[_0xd29d('0x2f')][_0xd29d('0x33')]));_0x4ae26d[_0xd29d('0x34')]=_0x4ae26d[_0xd29d('0x34')]['length']?_0x4ae26d['attributes']:_0x2e3e4a[_0xd29d('0x2e')];if(_0x417e7f[_0xd29d('0x2f')][_0xd29d('0x3e')]){_0x4ae26d[_0xd29d('0x43')]=[{'all':!![]}];}_0x4ae26d=_[_0xd29d('0x3b')]({},_0x4ae26d,_0x417e7f[_0xd29d('0x3d')]);return db[_0xd29d('0x2b')][_0xd29d('0x44')](_0x4ae26d)['then'](handleEntityNotFound(_0x14b636,null))[_0xd29d('0x24')](respondWithResult(_0x14b636,null))['catch'](handleError(_0x14b636,null));};exports[_0xd29d('0x23')]=function(_0x379837,_0x1a533d){if(_0x379837['body']['id']){delete _0x379837[_0xd29d('0x45')]['id'];}return db[_0xd29d('0x2b')][_0xd29d('0x44')]({'where':{'id':_0x379837['params']['id']}})[_0xd29d('0x24')](handleEntityNotFound(_0x1a533d,null))[_0xd29d('0x24')](saveUpdates(_0x379837[_0xd29d('0x45')],null))[_0xd29d('0x24')](respondWithResult(_0x1a533d,null))['catch'](handleError(_0x1a533d,null));};exports['destroy']=function(_0x532817,_0x2999d6){return db[_0xd29d('0x2b')][_0xd29d('0x44')]({'where':{'id':_0x532817[_0xd29d('0x42')]['id']}})[_0xd29d('0x24')](handleEntityNotFound(_0x2999d6,null))[_0xd29d('0x24')](removeEntity(_0x2999d6,null))[_0xd29d('0x41')](handleError(_0x2999d6,null));};exports[_0xd29d('0x46')]=function(_0x4de7f5,_0x4e0465){var _0x386f5d={'key':_0x4de7f5[_0xd29d('0x45')]['key']};if(_0x4de7f5[_0xd29d('0x45')]['MailAccountId']){_0x386f5d[_0xd29d('0x47')]=_0x4de7f5[_0xd29d('0x45')][_0xd29d('0x47')];}else if(_0x4de7f5[_0xd29d('0x45')]['SmsAccountId']){_0x386f5d[_0xd29d('0x48')]=_0x4de7f5['body']['SmsAccountId'];}else if(_0x4de7f5[_0xd29d('0x45')]['OpenchannelAccountId']){_0x386f5d['OpenchannelAccountId']=_0x4de7f5[_0xd29d('0x45')][_0xd29d('0x49')];}else if(_0x4de7f5[_0xd29d('0x45')][_0xd29d('0x4a')]){_0x386f5d[_0xd29d('0x4a')]=_0x4de7f5[_0xd29d('0x45')][_0xd29d('0x4a')];}return db[_0xd29d('0x2b')][_0xd29d('0x44')]({'where':_0x386f5d})[_0xd29d('0x24')](function(_0xa66974){if(_0xa66974){throw new db[(_0xd29d('0x4b'))][(_0xd29d('0x4c'))](_0xd29d('0x4d'));}return db[_0xd29d('0x2b')]['create'](_0x4de7f5[_0xd29d('0x45')]);})['then'](function(_0x46bb3d){var _0x153c11=_0x4de7f5[_0xd29d('0x4e')][_0xd29d('0x26')]({'plain':!![]});if(!_0x153c11)throw new Error(_0xd29d('0x4f'));if(_0x153c11[_0xd29d('0x50')]==='user'){var _0x190b63=_0x46bb3d[_0xd29d('0x26')]({'plain':!![]});return db[_0xd29d('0x51')][_0xd29d('0x44')]({'where':{'name':_0xd29d('0x52'),'userProfileId':_0x153c11[_0xd29d('0x53')]},'raw':!![]})[_0xd29d('0x24')](function(_0x1a50db){if(_0x1a50db&&_0x1a50db['autoAssociation']===0x0){return db['UserProfileResource'][_0xd29d('0x46')]({'name':_0x190b63[_0xd29d('0x28')],'resourceId':_0x190b63['id'],'type':_0x1a50db['name'],'sectionId':_0x1a50db['id']},{})[_0xd29d('0x24')](function(){return _0x46bb3d;});}else{return _0x46bb3d;}})['catch'](function(_0x431120){logger[_0xd29d('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x431120);throw _0x431120;});}return _0x46bb3d;})[_0xd29d('0x24')](respondWithResult(_0x4e0465,0xc9))['catch'](handleError(_0x4e0465,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 350f084..fc7cbae 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 _0x62d5=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x62d5,0xbc));var _0x562d=function(_0xafa225,_0xd29c03){_0xafa225=_0xafa225-0x0;var _0x4f546a=_0x62d5[_0xafa225];return _0x4f546a;};'use strict';var _=require(_0x562d('0x0'));var util=require(_0x562d('0x1'));var logger=require(_0x562d('0x2'))(_0x562d('0x3'));var moment=require('moment');var BPromise=require(_0x562d('0x4'));var rp=require(_0x562d('0x5'));var fs=require('fs');var path=require(_0x562d('0x6'));var rimraf=require('rimraf');var config=require(_0x562d('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x562d('0x8')]=function(_0x28d7c6,_0x505f16){return _0x28d7c6[_0x562d('0x9')](_0x562d('0xa'),attributes,{'tableName':_0x562d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x562d('0xc'),'collate':_0x562d('0xd')});};
\ No newline at end of file
+var _0xdc78=['moment','request-promise','path','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x3761c6,_0x2a5f2f){var _0x16ec0b=function(_0x1c04a3){while(--_0x1c04a3){_0x3761c6['push'](_0x3761c6['shift']());}};_0x16ec0b(++_0x2a5f2f);}(_0xdc78,0x14d));var _0x8dc7=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0xdc78[_0x5d860f];return _0x236490;};'use strict';var _=require(_0x8dc7('0x0'));var util=require('util');var logger=require(_0x8dc7('0x1'))(_0x8dc7('0x2'));var moment=require(_0x8dc7('0x3'));var BPromise=require('bluebird');var rp=require(_0x8dc7('0x4'));var fs=require('fs');var path=require(_0x8dc7('0x5'));var rimraf=require('rimraf');var config=require(_0x8dc7('0x6'));var attributes=require(_0x8dc7('0x7'));module['exports']=function(_0x44088c,_0x3ad5db){return _0x44088c[_0x8dc7('0x8')](_0x8dc7('0x9'),attributes,{'tableName':_0x8dc7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8dc7('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 5155c46..4abe925 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(_0x54489d,_0x3fc85b){var _0x3b6f73=function(_0x176886){while(--_0x176886){_0x54489d['push'](_0x54489d['shift']());}};_0x3b6f73(++_0x3fc85b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x46cece,_0x1729fd){var _0x382eea=function(_0x251d3b){while(--_0x251d3b){_0x46cece['push'](_0x46cece['shift']());}};_0x382eea(++_0x1729fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 0755faa..a4f7334 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 _0x026e=['../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3c7007,_0x1bc65a){var _0x4c6f08=function(_0x172a85){while(--_0x172a85){_0x3c7007['push'](_0x3c7007['shift']());}};_0x4c6f08(++_0x1bc65a);}(_0x026e,0x188));var _0xe026=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x026e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe026('0x0'));var util=require(_0xe026('0x1'));var path=require('path');var timeout=require(_0xe026('0x2'));var express=require(_0xe026('0x3'));var router=express[_0xe026('0x4')]();var fs_extra=require(_0xe026('0x5'));var auth=require(_0xe026('0x6'));var interaction=require(_0xe026('0x7'));var config=require(_0xe026('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xe026('0x9')](),controller[_0xe026('0xa')]);router[_0xe026('0xb')](_0xe026('0xc'),auth[_0xe026('0x9')](),controller[_0xe026('0xd')]);router[_0xe026('0xe')]('/',auth[_0xe026('0x9')](),controller[_0xe026('0xf')]);router[_0xe026('0x10')](_0xe026('0xc'),auth[_0xe026('0x9')](),controller[_0xe026('0x11')]);router[_0xe026('0x12')](_0xe026('0xc'),auth[_0xe026('0x9')](),controller['destroy']);module[_0xe026('0x13')]=router;
\ No newline at end of file
+var _0xe488=['./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3d3d96,_0x28998e){var _0x2e479a=function(_0x1349ba){while(--_0x1349ba){_0x3d3d96['push'](_0x3d3d96['shift']());}};_0x2e479a(++_0x28998e);}(_0xe488,0x19a));var _0x8e48=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xe488[_0x43aee5];return _0x76d1d0;};'use strict';var multer=require(_0x8e48('0x0'));var util=require(_0x8e48('0x1'));var path=require(_0x8e48('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e48('0x3'));var router=express[_0x8e48('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8e48('0x5'));var interaction=require(_0x8e48('0x6'));var config=require(_0x8e48('0x7'));var controller=require(_0x8e48('0x8'));router[_0x8e48('0x9')]('/',auth[_0x8e48('0xa')](),controller[_0x8e48('0xb')]);router[_0x8e48('0x9')](_0x8e48('0xc'),auth[_0x8e48('0xa')](),controller['show']);router[_0x8e48('0xd')]('/',auth[_0x8e48('0xa')](),controller[_0x8e48('0xe')]);router[_0x8e48('0xf')](_0x8e48('0xc'),auth['isAuthenticated'](),controller[_0x8e48('0x10')]);router[_0x8e48('0x11')](_0x8e48('0xc'),auth[_0x8e48('0xa')](),controller[_0x8e48('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 97e6286..07674ba 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 _0x9b5b=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x2f27ff,_0xf08829){var _0x23ca86=function(_0x212a57){while(--_0x212a57){_0x2f27ff['push'](_0x2f27ff['shift']());}};_0x23ca86(++_0xf08829);}(_0x9b5b,0x7f));var _0xb9b5=function(_0x22a544,_0x4b9c1a){_0x22a544=_0x22a544-0x0;var _0x1e7a05=_0x9b5b[_0x22a544];return _0x1e7a05;};'use strict';var Sequelize=require(_0xb9b5('0x0'));module[_0xb9b5('0x1')]={'calldate':{'type':Sequelize[_0xb9b5('0x2')],'allowNull':![],'defaultValue':_0xb9b5('0x3')},'clid':{'type':Sequelize[_0xb9b5('0x4')]},'src':{'type':Sequelize[_0xb9b5('0x4')]},'dst':{'type':Sequelize[_0xb9b5('0x4')]},'dcontext':{'type':Sequelize[_0xb9b5('0x4')]},'channel':{'type':Sequelize[_0xb9b5('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xb9b5('0x4')]},'lastdata':{'type':Sequelize[_0xb9b5('0x4')]},'duration':{'type':Sequelize[_0xb9b5('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb9b5('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb9b5('0x4')]},'linkedid':{'type':Sequelize[_0xb9b5('0x4')]},'sequence':{'type':Sequelize[_0xb9b5('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb9b5('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6584=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x318abe,_0x48c571){var _0x28f734=function(_0x27bac8){while(--_0x27bac8){_0x318abe['push'](_0x318abe['shift']());}};_0x28f734(++_0x48c571);}(_0x6584,0x175));var _0x4658=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x6584[_0x32b993];return _0x482780;};'use strict';var Sequelize=require(_0x4658('0x0'));module[_0x4658('0x1')]={'calldate':{'type':Sequelize[_0x4658('0x2')],'allowNull':![],'defaultValue':_0x4658('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x4658('0x4')]},'dst':{'type':Sequelize[_0x4658('0x4')]},'dcontext':{'type':Sequelize[_0x4658('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x4658('0x4')]},'lastdata':{'type':Sequelize[_0x4658('0x4')]},'duration':{'type':Sequelize[_0x4658('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4658('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4658('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4658('0x4')]},'userfield':{'type':Sequelize[_0x4658('0x4')]},'uniqueid':{'type':Sequelize[_0x4658('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x4658('0x4')]},'peeraccount':{'type':Sequelize[_0x4658('0x4')]},'type':{'type':Sequelize['STRING']},'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 1109169..ee60b21 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 _0xa23f=['../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','sendStatus','stack','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','length','find','create','body','params','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0xa23f,0x7c));var _0xfa23=function(_0x22c3c1,_0x4f7c0d){_0x22c3c1=_0x22c3c1-0x0;var _0x51b308=_0xa23f[_0x22c3c1];return _0x51b308;};'use strict';var emlformat=require(_0xfa23('0x0'));var rimraf=require(_0xfa23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa23('0x2'));var moment=require(_0xfa23('0x3'));var BPromise=require(_0xfa23('0x4'));var Mustache=require(_0xfa23('0x5'));var util=require('util');var path=require(_0xfa23('0x6'));var sox=require('sox');var csv=require(_0xfa23('0x7'));var ejs=require(_0xfa23('0x8'));var fs=require('fs');var fs_extra=require(_0xfa23('0x9'));var _=require(_0xfa23('0xa'));var squel=require('squel');var crypto=require(_0xfa23('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa23('0xc'));var toCsv=require(_0xfa23('0x7'));var querystring=require(_0xfa23('0xd'));var Papa=require(_0xfa23('0xe'));var Redis=require(_0xfa23('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfa23('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa23('0x11'))('api');var utils=require(_0xfa23('0x12'));var config=require(_0xfa23('0x13'));var licenseUtil=require(_0xfa23('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5ffe,_0x42380){_0x42380=_0x42380||0xcc;return function(_0x46f991){if(_0x46f991){return _0x1e5ffe['sendStatus'](_0x42380);}return _0x1e5ffe['status'](_0x42380)[_0xfa23('0x15')]();};}function respondWithResult(_0x23712b,_0x3f50f0){_0x3f50f0=_0x3f50f0||0xc8;return function(_0x36252c){if(_0x36252c){return _0x23712b['status'](_0x3f50f0)[_0xfa23('0x16')](_0x36252c);}};}function respondWithFilteredResult(_0xb7d11a,_0x2095a5){return function(_0x9611e0){if(_0x9611e0){var _0x542d9a=typeof _0x2095a5[_0xfa23('0x17')]===_0xfa23('0x18')&&typeof _0x2095a5[_0xfa23('0x19')]===_0xfa23('0x18');var _0x3fa5f6=_0x9611e0['count'];var _0x59610c=_0x542d9a?0x0:_0x2095a5['offset'];var _0x445bd0=_0x542d9a?_0x9611e0[_0xfa23('0x1a')]:_0x2095a5['offset']+_0x2095a5[_0xfa23('0x19')];var _0x2c456b;if(_0x445bd0>=_0x3fa5f6){_0x445bd0=_0x3fa5f6;_0x2c456b=0xc8;}else{_0x2c456b=0xce;}_0xb7d11a[_0xfa23('0x1b')](_0x2c456b);return _0xb7d11a['set'](_0xfa23('0x1c'),_0x59610c+'-'+_0x445bd0+'/'+_0x3fa5f6)[_0xfa23('0x16')](_0x9611e0);}return null;};}function patchUpdates(_0x47c323){return function(_0x16e4f9){try{jsonpatch[_0xfa23('0x1d')](_0x16e4f9,_0x47c323,!![]);}catch(_0x148f3b){return BPromise[_0xfa23('0x1e')](_0x148f3b);}return _0x16e4f9[_0xfa23('0x1f')]();};}function saveUpdates(_0x10ef95,_0x31eedb){return function(_0x485838){if(_0x485838){return _0x485838[_0xfa23('0x20')](_0x10ef95)[_0xfa23('0x21')](function(_0x34a2ce){return _0x34a2ce;});}return null;};}function removeEntity(_0xe4680f,_0x542cde){return function(_0x4500a2){if(_0x4500a2){return _0x4500a2['destroy']()[_0xfa23('0x21')](function(){_0xe4680f[_0xfa23('0x1b')](0xcc)[_0xfa23('0x15')]();});}};}function handleEntityNotFound(_0x26bdce,_0x3362f3){return function(_0x1340d9){if(!_0x1340d9){_0x26bdce[_0xfa23('0x22')](0x194);}return _0x1340d9;};}function handleError(_0x499407,_0x5e1780){_0x5e1780=_0x5e1780||0x1f4;return function(_0x2ae826){logger['error'](_0x2ae826[_0xfa23('0x23')]);if(_0x2ae826['name']){delete _0x2ae826['name'];}_0x499407[_0xfa23('0x1b')](_0x5e1780)[_0xfa23('0x24')](_0x2ae826);};}exports[_0xfa23('0x25')]=function(_0x3b00a8,_0x374169){var _0x24da31={},_0x3c9d9d={},_0x4c1ab0={'count':0x0,'rows':[]};var _0x591797=_['map'](db[_0xfa23('0x26')][_0xfa23('0x27')],function(_0x5df1f9){return{'name':_0x5df1f9[_0xfa23('0x28')],'type':_0x5df1f9[_0xfa23('0x29')][_0xfa23('0x2a')]};});_0x3c9d9d[_0xfa23('0x2b')]=_[_0xfa23('0x2c')](_0x591797,_0xfa23('0x2d'));_0x3c9d9d[_0xfa23('0x2e')]=_[_0xfa23('0x2f')](_0x3b00a8[_0xfa23('0x2e')]);_0x3c9d9d['filters']=_[_0xfa23('0x30')](_0x3c9d9d['model'],_0x3c9d9d[_0xfa23('0x2e')]);_0x24da31[_0xfa23('0x31')]=_[_0xfa23('0x30')](_0x3c9d9d[_0xfa23('0x2b')],qs[_0xfa23('0x32')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x32')]));_0x24da31[_0xfa23('0x31')]=_0x24da31[_0xfa23('0x31')]['length']?_0x24da31[_0xfa23('0x31')]:_0x3c9d9d['model'];if(!_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x33')](_0xfa23('0x34'))){_0x24da31[_0xfa23('0x19')]=qs[_0xfa23('0x19')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x19')]);_0x24da31['offset']=qs[_0xfa23('0x17')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x17')]);}_0x24da31[_0xfa23('0x35')]=qs['sort'](_0x3b00a8['query']['sort']);_0x24da31[_0xfa23('0x36')]=qs[_0xfa23('0x37')](_['pick'](_0x3b00a8[_0xfa23('0x2e')],_0x3c9d9d[_0xfa23('0x37')]),_0x591797);if(_0x3b00a8[_0xfa23('0x2e')]['filter']){_0x24da31[_0xfa23('0x36')]=_['merge'](_0x24da31[_0xfa23('0x36')],{'$or':_[_0xfa23('0x2c')](_0x591797,function(_0x329985){if(_0x329985[_0xfa23('0x29')]!==_0xfa23('0x38')){var _0x80827f={};_0x80827f[_0x329985['name']]={'$like':'%'+_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x39')]+'%'};return _0x80827f;}})});}_0x24da31=_[_0xfa23('0x3a')]({},_0x24da31,_0x3b00a8[_0xfa23('0x3b')]);var _0x48c3a4={'where':_0x24da31[_0xfa23('0x36')]};return db[_0xfa23('0x26')][_0xfa23('0x1a')](_0x48c3a4)[_0xfa23('0x21')](function(_0x113552){_0x4c1ab0[_0xfa23('0x1a')]=_0x113552;if(_0x3b00a8['query'][_0xfa23('0x3c')]){_0x24da31['include']=[{'all':!![]}];}return db['Cdr'][_0xfa23('0x3d')](_0x24da31);})[_0xfa23('0x21')](function(_0x5937e0){_0x4c1ab0[_0xfa23('0x3e')]=_0x5937e0;return _0x4c1ab0;})[_0xfa23('0x21')](respondWithFilteredResult(_0x374169,_0x24da31))[_0xfa23('0x3f')](handleError(_0x374169,null));};exports['show']=function(_0x3de346,_0x37f4c5){var _0xb73ed9={'raw':!![],'where':{'id':_0x3de346['params']['id']}},_0x539271={};_0x539271[_0xfa23('0x2b')]=_['keys'](db[_0xfa23('0x26')][_0xfa23('0x27')]);_0x539271[_0xfa23('0x2e')]=_['keys'](_0x3de346[_0xfa23('0x2e')]);_0x539271[_0xfa23('0x37')]=_[_0xfa23('0x30')](_0x539271[_0xfa23('0x2b')],_0x539271['query']);_0xb73ed9[_0xfa23('0x31')]=_[_0xfa23('0x30')](_0x539271[_0xfa23('0x2b')],qs['fields'](_0x3de346['query'][_0xfa23('0x32')]));_0xb73ed9['attributes']=_0xb73ed9[_0xfa23('0x31')][_0xfa23('0x40')]?_0xb73ed9[_0xfa23('0x31')]:_0x539271[_0xfa23('0x2b')];if(_0x3de346[_0xfa23('0x2e')][_0xfa23('0x3c')]){_0xb73ed9['include']=[{'all':!![]}];}_0xb73ed9=_[_0xfa23('0x3a')]({},_0xb73ed9,_0x3de346[_0xfa23('0x3b')]);return db[_0xfa23('0x26')][_0xfa23('0x41')](_0xb73ed9)[_0xfa23('0x21')](handleEntityNotFound(_0x37f4c5,null))[_0xfa23('0x21')](respondWithResult(_0x37f4c5,null))['catch'](handleError(_0x37f4c5,null));};exports[_0xfa23('0x42')]=function(_0x36a02c,_0x6ba64c){return db[_0xfa23('0x26')][_0xfa23('0x42')](_0x36a02c['body'],{})[_0xfa23('0x21')](respondWithResult(_0x6ba64c,0xc9))[_0xfa23('0x3f')](handleError(_0x6ba64c,null));};exports[_0xfa23('0x20')]=function(_0x5e4633,_0x253faf){if(_0x5e4633[_0xfa23('0x43')]['id']){delete _0x5e4633[_0xfa23('0x43')]['id'];}return db[_0xfa23('0x26')][_0xfa23('0x41')]({'where':{'id':_0x5e4633[_0xfa23('0x44')]['id']}})[_0xfa23('0x21')](handleEntityNotFound(_0x253faf,null))['then'](saveUpdates(_0x5e4633[_0xfa23('0x43')],null))['then'](respondWithResult(_0x253faf,null))[_0xfa23('0x3f')](handleError(_0x253faf,null));};exports[_0xfa23('0x45')]=function(_0x3824a9,_0xf24dd5){return db[_0xfa23('0x26')][_0xfa23('0x41')]({'where':{'id':_0x3824a9['params']['id']}})[_0xfa23('0x21')](handleEntityNotFound(_0xf24dd5,null))[_0xfa23('0x21')](removeEntity(_0xf24dd5,null))[_0xfa23('0x3f')](handleError(_0xf24dd5,null));};exports[_0xfa23('0x46')]=function(_0x13c37d,_0x22be14){return db[_0xfa23('0x26')]['describe']()[_0xfa23('0x21')](respondWithResult(_0x22be14,null))[_0xfa23('0x3f')](handleError(_0x22be14,null));};
\ No newline at end of file
+var _0xf006=['fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0xf006,0x146));var _0x6f00=function(_0x50723d,_0x1f48eb){_0x50723d=_0x50723d-0x0;var _0x3a1534=_0xf006[_0x50723d];return _0x3a1534;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f00('0x0'));var jsonpatch=require(_0x6f00('0x1'));var rp=require('request-promise');var moment=require(_0x6f00('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f00('0x3'));var util=require('util');var path=require('path');var sox=require(_0x6f00('0x4'));var csv=require(_0x6f00('0x5'));var ejs=require(_0x6f00('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x5'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var as=require(_0x6f00('0x10'));var hardwareService=require(_0x6f00('0x11'));var logger=require(_0x6f00('0x12'))(_0x6f00('0x13'));var utils=require('../../config/utils');var config=require(_0x6f00('0x14'));var licenseUtil=require(_0x6f00('0x15'));var db=require(_0x6f00('0x16'))['db'];function respondWithStatusCode(_0x36a2ec,_0x289fe9){_0x289fe9=_0x289fe9||0xcc;return function(_0x5e3264){if(_0x5e3264){return _0x36a2ec[_0x6f00('0x17')](_0x289fe9);}return _0x36a2ec['status'](_0x289fe9)[_0x6f00('0x18')]();};}function respondWithResult(_0x5047f5,_0x324e67){_0x324e67=_0x324e67||0xc8;return function(_0x220e68){if(_0x220e68){return _0x5047f5[_0x6f00('0x19')](_0x324e67)[_0x6f00('0x1a')](_0x220e68);}};}function respondWithFilteredResult(_0xa6e7a1,_0x411203){return function(_0x46bc2c){if(_0x46bc2c){var _0x4d8aee=typeof _0x411203[_0x6f00('0x1b')]==='undefined'&&typeof _0x411203[_0x6f00('0x1c')]==='undefined';var _0x534275=_0x46bc2c[_0x6f00('0x1d')];var _0x6cf83f=_0x4d8aee?0x0:_0x411203[_0x6f00('0x1b')];var _0x340f78=_0x4d8aee?_0x46bc2c[_0x6f00('0x1d')]:_0x411203[_0x6f00('0x1b')]+_0x411203[_0x6f00('0x1c')];var _0x295640;if(_0x340f78>=_0x534275){_0x340f78=_0x534275;_0x295640=0xc8;}else{_0x295640=0xce;}_0xa6e7a1[_0x6f00('0x19')](_0x295640);return _0xa6e7a1[_0x6f00('0x1e')](_0x6f00('0x1f'),_0x6cf83f+'-'+_0x340f78+'/'+_0x534275)[_0x6f00('0x1a')](_0x46bc2c);}return null;};}function patchUpdates(_0x4e11de){return function(_0x4f3031){try{jsonpatch['apply'](_0x4f3031,_0x4e11de,!![]);}catch(_0x2a5286){return BPromise[_0x6f00('0x20')](_0x2a5286);}return _0x4f3031[_0x6f00('0x21')]();};}function saveUpdates(_0x57340f,_0xe301e5){return function(_0x9066ff){if(_0x9066ff){return _0x9066ff[_0x6f00('0x22')](_0x57340f)[_0x6f00('0x23')](function(_0x388983){return _0x388983;});}return null;};}function removeEntity(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(_0x1ea061){return _0x1ea061['destroy']()[_0x6f00('0x23')](function(){_0x1cbf1c[_0x6f00('0x19')](0xcc)[_0x6f00('0x18')]();});}};}function handleEntityNotFound(_0x4d41ef,_0x37f062){return function(_0x4f7e29){if(!_0x4f7e29){_0x4d41ef[_0x6f00('0x17')](0x194);}return _0x4f7e29;};}function handleError(_0x511293,_0x434735){_0x434735=_0x434735||0x1f4;return function(_0x39375d){logger[_0x6f00('0x24')](_0x39375d[_0x6f00('0x25')]);if(_0x39375d[_0x6f00('0x26')]){delete _0x39375d['name'];}_0x511293[_0x6f00('0x19')](_0x434735)[_0x6f00('0x27')](_0x39375d);};}exports[_0x6f00('0x28')]=function(_0x4366a4,_0x2671fe){var _0x235a86={},_0xff36ce={},_0x451849={'count':0x0,'rows':[]};var _0x22f107=_[_0x6f00('0x29')](db[_0x6f00('0x2a')][_0x6f00('0x2b')],function(_0x29555d){return{'name':_0x29555d[_0x6f00('0x2c')],'type':_0x29555d['type']['key']};});_0xff36ce['model']=_['map'](_0x22f107,'name');_0xff36ce['query']=_[_0x6f00('0x2d')](_0x4366a4['query']);_0xff36ce[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0xff36ce[_0x6f00('0x30')],_0xff36ce[_0x6f00('0x31')]);_0x235a86[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0xff36ce['model'],qs[_0x6f00('0x33')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x33')]));_0x235a86[_0x6f00('0x32')]=_0x235a86[_0x6f00('0x32')]['length']?_0x235a86['attributes']:_0xff36ce['model'];if(!_0x4366a4[_0x6f00('0x31')][_0x6f00('0x34')](_0x6f00('0x35'))){_0x235a86[_0x6f00('0x1c')]=qs[_0x6f00('0x1c')](_0x4366a4['query'][_0x6f00('0x1c')]);_0x235a86[_0x6f00('0x1b')]=qs[_0x6f00('0x1b')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x1b')]);}_0x235a86[_0x6f00('0x36')]=qs[_0x6f00('0x37')](_0x4366a4['query'][_0x6f00('0x37')]);_0x235a86[_0x6f00('0x38')]=qs[_0x6f00('0x2e')](_['pick'](_0x4366a4[_0x6f00('0x31')],_0xff36ce[_0x6f00('0x2e')]),_0x22f107);if(_0x4366a4[_0x6f00('0x31')]['filter']){_0x235a86[_0x6f00('0x38')]=_['merge'](_0x235a86[_0x6f00('0x38')],{'$or':_['map'](_0x22f107,function(_0x3dc8e3){if(_0x3dc8e3[_0x6f00('0x39')]!==_0x6f00('0x3a')){var _0x896b3f={};_0x896b3f[_0x3dc8e3['name']]={'$like':'%'+_0x4366a4[_0x6f00('0x31')]['filter']+'%'};return _0x896b3f;}})});}_0x235a86=_[_0x6f00('0x3b')]({},_0x235a86,_0x4366a4['options']);var _0x7785e1={'where':_0x235a86[_0x6f00('0x38')]};return db[_0x6f00('0x2a')][_0x6f00('0x1d')](_0x7785e1)['then'](function(_0x53dc8c){_0x451849[_0x6f00('0x1d')]=_0x53dc8c;if(_0x4366a4['query'][_0x6f00('0x3c')]){_0x235a86[_0x6f00('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x6f00('0x3e')](_0x235a86);})['then'](function(_0x4cac2c){_0x451849[_0x6f00('0x3f')]=_0x4cac2c;return _0x451849;})[_0x6f00('0x23')](respondWithFilteredResult(_0x2671fe,_0x235a86))[_0x6f00('0x40')](handleError(_0x2671fe,null));};exports[_0x6f00('0x41')]=function(_0x56399a,_0x38ee25){var _0x4523f2={'raw':!![],'where':{'id':_0x56399a[_0x6f00('0x42')]['id']}},_0x2bb5aa={};_0x2bb5aa[_0x6f00('0x30')]=_[_0x6f00('0x2d')](db['Cdr'][_0x6f00('0x2b')]);_0x2bb5aa[_0x6f00('0x31')]=_[_0x6f00('0x2d')](_0x56399a[_0x6f00('0x31')]);_0x2bb5aa[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],_0x2bb5aa[_0x6f00('0x31')]);_0x4523f2[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],qs[_0x6f00('0x33')](_0x56399a['query'][_0x6f00('0x33')]));_0x4523f2[_0x6f00('0x32')]=_0x4523f2['attributes'][_0x6f00('0x43')]?_0x4523f2['attributes']:_0x2bb5aa[_0x6f00('0x30')];if(_0x56399a[_0x6f00('0x31')][_0x6f00('0x3c')]){_0x4523f2[_0x6f00('0x3d')]=[{'all':!![]}];}_0x4523f2=_['merge']({},_0x4523f2,_0x56399a[_0x6f00('0x44')]);return db['Cdr'][_0x6f00('0x45')](_0x4523f2)['then'](handleEntityNotFound(_0x38ee25,null))[_0x6f00('0x23')](respondWithResult(_0x38ee25,null))[_0x6f00('0x40')](handleError(_0x38ee25,null));};exports[_0x6f00('0x46')]=function(_0x9b003,_0x470ff3){return db[_0x6f00('0x2a')][_0x6f00('0x46')](_0x9b003[_0x6f00('0x47')],{})['then'](respondWithResult(_0x470ff3,0xc9))[_0x6f00('0x40')](handleError(_0x470ff3,null));};exports['update']=function(_0x265666,_0x31fb17){if(_0x265666[_0x6f00('0x47')]['id']){delete _0x265666['body']['id'];}return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x265666[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x31fb17,null))[_0x6f00('0x23')](saveUpdates(_0x265666['body'],null))[_0x6f00('0x23')](respondWithResult(_0x31fb17,null))['catch'](handleError(_0x31fb17,null));};exports[_0x6f00('0x48')]=function(_0x222b4c,_0x4c6e06){return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x222b4c[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c6e06,null))[_0x6f00('0x23')](removeEntity(_0x4c6e06,null))['catch'](handleError(_0x4c6e06,null));};exports[_0x6f00('0x49')]=function(_0x7f80ed,_0x3100ee){return db[_0x6f00('0x2a')][_0x6f00('0x49')]()[_0x6f00('0x23')](respondWithResult(_0x3100ee,null))[_0x6f00('0x40')](handleError(_0x3100ee,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 436ec62..fa45554 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3f5262,_0x1ad642){var _0x113366=function(_0x3facd9){while(--_0x3facd9){_0x3f5262['push'](_0x3f5262['shift']());}};_0x113366(++_0x1ad642);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x51ebc4,_0x2a4d0e){var _0x4dba4d=function(_0x54daaa){while(--_0x54daaa){_0x51ebc4['push'](_0x51ebc4['shift']());}};_0x4dba4d(++_0x2a4d0e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 559c5c3..6487303 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 _0xf28f=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','lodash'];(function(_0x2d8fbf,_0x319810){var _0x46bd15=function(_0x44b807){while(--_0x44b807){_0x2d8fbf['push'](_0x2d8fbf['shift']());}};_0x46bd15(++_0x319810);}(_0xf28f,0x92));var _0xff28=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xf28f[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xff28('0x0'));var util=require(_0xff28('0x1'));var moment=require(_0xff28('0x2'));var BPromise=require(_0xff28('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff28('0x4'));var db=require(_0xff28('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff28('0x6'))(_0xff28('0x7'));var config=require(_0xff28('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xff28('0x9')][_0xff28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57a365,_0xd55879,_0x6ba9c5){return new BPromise(function(_0xef5d83,_0x27c1a6){return client[_0xff28('0xb')](_0x57a365,_0x6ba9c5)['then'](function(_0x452cd8){logger[_0xff28('0xc')]('Cdr,\x20%s,\x20%s',_0xd55879,_0xff28('0xd'));logger['debug'](_0xff28('0xe'),_0xd55879,_0xff28('0xd'),JSON[_0xff28('0xf')](_0x452cd8));if(_0x452cd8[_0xff28('0x10')]){if(_0x452cd8[_0xff28('0x10')][_0xff28('0x11')]===0x1f4){logger[_0xff28('0x10')](_0xff28('0x12'),_0xd55879,_0x452cd8[_0xff28('0x10')][_0xff28('0x13')]);return _0x27c1a6(_0x452cd8[_0xff28('0x10')]['message']);}logger[_0xff28('0x10')](_0xff28('0x12'),_0xd55879,_0x452cd8[_0xff28('0x10')][_0xff28('0x13')]);return _0xef5d83(_0x452cd8[_0xff28('0x10')][_0xff28('0x13')]);}else{logger[_0xff28('0xc')](_0xff28('0x12'),_0xd55879,_0xff28('0xd'));_0xef5d83(_0x452cd8[_0xff28('0x14')][_0xff28('0x13')]);}})['catch'](function(_0x3c302e){logger[_0xff28('0x10')](_0xff28('0x12'),_0xd55879,_0x3c302e);_0x27c1a6(_0x3c302e);});});}
\ No newline at end of file
+var _0x62b9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','Cdr,\x20%s,\x20%s','result','catch','util','bluebird'];(function(_0x200e46,_0x5acacf){var _0x18467d=function(_0x30e26a){while(--_0x30e26a){_0x200e46['push'](_0x200e46['shift']());}};_0x18467d(++_0x5acacf);}(_0x62b9,0xa9));var _0x962b=function(_0xf0b34,_0x1dd2da){_0xf0b34=_0xf0b34-0x0;var _0x35e678=_0x62b9[_0xf0b34];return _0x35e678;};'use strict';var _=require('lodash');var util=require(_0x962b('0x0'));var moment=require('moment');var BPromise=require(_0x962b('0x1'));var rs=require(_0x962b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x962b('0x3'))['db'];var utils=require(_0x962b('0x4'));var logger=require(_0x962b('0x5'))(_0x962b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46d6c7,_0x46d1d4,_0xd40ced){return new BPromise(function(_0x458254,_0x5be397){return client[_0x962b('0x7')](_0x46d6c7,_0xd40ced)[_0x962b('0x8')](function(_0x1e8c4e){logger[_0x962b('0x9')]('Cdr,\x20%s,\x20%s',_0x46d1d4,_0x962b('0xa'));logger[_0x962b('0xb')](_0x962b('0xc'),_0x46d1d4,_0x962b('0xa'),JSON['stringify'](_0x1e8c4e));if(_0x1e8c4e[_0x962b('0xd')]){if(_0x1e8c4e[_0x962b('0xd')][_0x962b('0xe')]===0x1f4){logger[_0x962b('0xd')]('Cdr,\x20%s,\x20%s',_0x46d1d4,_0x1e8c4e[_0x962b('0xd')]['message']);return _0x5be397(_0x1e8c4e[_0x962b('0xd')][_0x962b('0xf')]);}logger[_0x962b('0xd')](_0x962b('0x10'),_0x46d1d4,_0x1e8c4e[_0x962b('0xd')][_0x962b('0xf')]);return _0x458254(_0x1e8c4e[_0x962b('0xd')][_0x962b('0xf')]);}else{logger[_0x962b('0x9')]('Cdr,\x20%s,\x20%s',_0x46d1d4,_0x962b('0xa'));_0x458254(_0x1e8c4e[_0x962b('0x11')][_0x962b('0xf')]);}})[_0x962b('0x12')](function(_0x28c7bf){logger[_0x962b('0xd')]('Cdr,\x20%s,\x20%s',_0x46d1d4,_0x28c7bf);_0x5be397(_0x28c7bf);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index aa44268..e1cc707 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _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(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 077ddc8..a79b988 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 _0xee19=['sequelize','exports','noop','TEXT','STRING'];(function(_0x857c02,_0x3cc0b3){var _0x5bbbab=function(_0x4c7733){while(--_0x4c7733){_0x857c02['push'](_0x857c02['shift']());}};_0x5bbbab(++_0x3cc0b3);}(_0xee19,0x131));var _0x9ee1=function(_0x41bc59,_0x770db7){_0x41bc59=_0x41bc59-0x0;var _0x278319=_0xee19[_0x41bc59];return _0x278319;};'use strict';var Sequelize=require(_0x9ee1('0x0'));module[_0x9ee1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9ee1('0x2')},'appdata':{'type':Sequelize[_0x9ee1('0x3')]()},'description':{'type':Sequelize[_0x9ee1('0x4')]},'interval':{'type':Sequelize[_0x9ee1('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xf0e4=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x1fe7fe,_0x41cc8a){var _0x119376=function(_0x4e66d9){while(--_0x4e66d9){_0x1fe7fe['push'](_0x1fe7fe['shift']());}};_0x119376(++_0x41cc8a);}(_0xf0e4,0xb1));var _0x4f0e=function(_0x16268d,_0x340078){_0x16268d=_0x16268d-0x0;var _0x36799c=_0xf0e4[_0x16268d];return _0x36799c;};'use strict';var Sequelize=require(_0x4f0e('0x0'));module[_0x4f0e('0x1')]={'priority':{'type':Sequelize[_0x4f0e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4f0e('0x3')],'allowNull':![],'defaultValue':_0x4f0e('0x4')},'appdata':{'type':Sequelize[_0x4f0e('0x5')]()},'description':{'type':Sequelize[_0x4f0e('0x3')]},'interval':{'type':Sequelize[_0x4f0e('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index d9ff54b..f812e2f 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 _0x235a=['offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','model','includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x235a,0x1ef));var _0xa235=function(_0x448391,_0x500aa6){_0x448391=_0x448391-0x0;var _0x8f3854=_0x235a[_0x448391];return _0x8f3854;};'use strict';var emlformat=require(_0xa235('0x0'));var rimraf=require(_0xa235('0x1'));var zipdir=require(_0xa235('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa235('0x3'));var moment=require('moment');var BPromise=require(_0xa235('0x4'));var Mustache=require(_0xa235('0x5'));var util=require(_0xa235('0x6'));var path=require(_0xa235('0x7'));var sox=require(_0xa235('0x8'));var csv=require(_0xa235('0x9'));var ejs=require(_0xa235('0xa'));var fs=require('fs');var fs_extra=require(_0xa235('0xb'));var _=require('lodash');var squel=require(_0xa235('0xc'));var crypto=require(_0xa235('0xd'));var jsforce=require(_0xa235('0xe'));var deskjs=require(_0xa235('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa235('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa235('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa235('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa235('0x13'));var config=require(_0xa235('0x14'));var licenseUtil=require(_0xa235('0x15'));var db=require(_0xa235('0x16'))['db'];function respondWithStatusCode(_0x5330db,_0x5510ff){_0x5510ff=_0x5510ff||0xcc;return function(_0x47aad7){if(_0x47aad7){return _0x5330db[_0xa235('0x17')](_0x5510ff);}return _0x5330db[_0xa235('0x18')](_0x5510ff)[_0xa235('0x19')]();};}function respondWithResult(_0x3bf6fc,_0x36b4b1){_0x36b4b1=_0x36b4b1||0xc8;return function(_0x44ea6a){if(_0x44ea6a){return _0x3bf6fc[_0xa235('0x18')](_0x36b4b1)[_0xa235('0x1a')](_0x44ea6a);}};}function respondWithFilteredResult(_0x1369de,_0x4aceee){return function(_0x352463){if(_0x352463){var _0x20cd67=typeof _0x4aceee[_0xa235('0x1b')]===_0xa235('0x1c')&&typeof _0x4aceee[_0xa235('0x1d')]===_0xa235('0x1c');var _0x5c6e95=_0x352463['count'];var _0x446ea2=_0x20cd67?0x0:_0x4aceee[_0xa235('0x1b')];var _0x2b3769=_0x20cd67?_0x352463['count']:_0x4aceee[_0xa235('0x1b')]+_0x4aceee[_0xa235('0x1d')];var _0x3ca514;if(_0x2b3769>=_0x5c6e95){_0x2b3769=_0x5c6e95;_0x3ca514=0xc8;}else{_0x3ca514=0xce;}_0x1369de[_0xa235('0x18')](_0x3ca514);return _0x1369de[_0xa235('0x1e')](_0xa235('0x1f'),_0x446ea2+'-'+_0x2b3769+'/'+_0x5c6e95)[_0xa235('0x1a')](_0x352463);}return null;};}function patchUpdates(_0x483771){return function(_0x5a3bea){try{jsonpatch[_0xa235('0x20')](_0x5a3bea,_0x483771,!![]);}catch(_0x21940f){return BPromise[_0xa235('0x21')](_0x21940f);}return _0x5a3bea[_0xa235('0x22')]();};}function saveUpdates(_0x2e38e,_0x3deeea){return function(_0x3d9f70){if(_0x3d9f70){return _0x3d9f70[_0xa235('0x23')](_0x2e38e)[_0xa235('0x24')](function(_0x216083){return _0x216083;});}return null;};}function removeEntity(_0x3219f1,_0x20292c){return function(_0xee45e1){if(_0xee45e1){return _0xee45e1[_0xa235('0x25')]()[_0xa235('0x24')](function(){_0x3219f1[_0xa235('0x18')](0xcc)[_0xa235('0x19')]();});}};}function handleEntityNotFound(_0x13c868,_0x976c9f){return function(_0x1cb892){if(!_0x1cb892){_0x13c868[_0xa235('0x17')](0x194);}return _0x1cb892;};}function handleError(_0x57f591,_0xe1176c){_0xe1176c=_0xe1176c||0x1f4;return function(_0x533b15){logger[_0xa235('0x26')](_0x533b15['stack']);if(_0x533b15[_0xa235('0x27')]){delete _0x533b15[_0xa235('0x27')];}_0x57f591[_0xa235('0x18')](_0xe1176c)[_0xa235('0x28')](_0x533b15);};}exports[_0xa235('0x29')]=function(_0x5d811a,_0x2585c7){var _0x612f2={'raw':!![],'where':{'id':_0x5d811a['params']['id']}},_0x55a21e={};_0x55a21e['model']=_['keys'](db[_0xa235('0x2a')][_0xa235('0x2b')]);_0x55a21e[_0xa235('0x2c')]=_[_0xa235('0x2d')](_0x5d811a[_0xa235('0x2c')]);_0x55a21e[_0xa235('0x2e')]=_[_0xa235('0x2f')](_0x55a21e['model'],_0x55a21e['query']);_0x612f2[_0xa235('0x30')]=_[_0xa235('0x2f')](_0x55a21e['model'],qs[_0xa235('0x31')](_0x5d811a[_0xa235('0x2c')][_0xa235('0x31')]));_0x612f2[_0xa235('0x30')]=_0x612f2[_0xa235('0x30')][_0xa235('0x32')]?_0x612f2[_0xa235('0x30')]:_0x55a21e[_0xa235('0x33')];if(_0x5d811a['query'][_0xa235('0x34')]){_0x612f2['include']=[{'all':!![]}];}_0x612f2=_[_0xa235('0x35')]({},_0x612f2,_0x5d811a[_0xa235('0x36')]);return db[_0xa235('0x2a')][_0xa235('0x37')](_0x612f2)[_0xa235('0x24')](handleEntityNotFound(_0x2585c7,null))[_0xa235('0x24')](respondWithResult(_0x2585c7,null))[_0xa235('0x38')](handleError(_0x2585c7,null));};exports[_0xa235('0x23')]=function(_0xa1b9d2,_0x34bba1){if(_0xa1b9d2[_0xa235('0x39')]['id']){delete _0xa1b9d2[_0xa235('0x39')]['id'];}return db[_0xa235('0x2a')]['find']({'where':{'id':_0xa1b9d2['params']['id']}})['then'](handleEntityNotFound(_0x34bba1,null))[_0xa235('0x24')](saveUpdates(_0xa1b9d2['body'],null))[_0xa235('0x24')](respondWithResult(_0x34bba1,null))[_0xa235('0x38')](handleError(_0x34bba1,null));};exports[_0xa235('0x25')]=function(_0x21a835,_0x473af7){return db[_0xa235('0x2a')][_0xa235('0x37')]({'where':{'id':_0x21a835['params']['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x473af7,null))[_0xa235('0x24')](removeEntity(_0x473af7,null))['catch'](handleError(_0x473af7,null));};
\ No newline at end of file
+var _0xe3ed=['Content-Range','apply','reject','save','then','destroy','error','stack','name','params','model','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set'];(function(_0x36c28f,_0x331ff7){var _0x1cda15=function(_0x4a2ff5){while(--_0x4a2ff5){_0x36c28f['push'](_0x36c28f['shift']());}};_0x1cda15(++_0x331ff7);}(_0xe3ed,0x8d));var _0xde3e=function(_0x532880,_0xaf724d){_0x532880=_0x532880-0x0;var _0x418bbe=_0xe3ed[_0x532880];return _0x418bbe;};'use strict';var emlformat=require(_0xde3e('0x0'));var rimraf=require(_0xde3e('0x1'));var zipdir=require(_0xde3e('0x2'));var jsonpatch=require(_0xde3e('0x3'));var rp=require(_0xde3e('0x4'));var moment=require(_0xde3e('0x5'));var BPromise=require(_0xde3e('0x6'));var Mustache=require(_0xde3e('0x7'));var util=require('util');var path=require(_0xde3e('0x8'));var sox=require(_0xde3e('0x9'));var csv=require('to-csv');var ejs=require(_0xde3e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde3e('0xb'));var squel=require(_0xde3e('0xc'));var crypto=require('crypto');var jsforce=require(_0xde3e('0xd'));var deskjs=require(_0xde3e('0xe'));var toCsv=require(_0xde3e('0xf'));var querystring=require(_0xde3e('0x10'));var Papa=require(_0xde3e('0x11'));var Redis=require('ioredis');var authService=require(_0xde3e('0x12'));var qs=require(_0xde3e('0x13'));var as=require(_0xde3e('0x14'));var hardwareService=require(_0xde3e('0x15'));var logger=require('../../config/logger')(_0xde3e('0x16'));var utils=require(_0xde3e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xde3e('0x18'));var db=require(_0xde3e('0x19'))['db'];function respondWithStatusCode(_0x5d0240,_0x22ffc2){_0x22ffc2=_0x22ffc2||0xcc;return function(_0x4e0f23){if(_0x4e0f23){return _0x5d0240[_0xde3e('0x1a')](_0x22ffc2);}return _0x5d0240[_0xde3e('0x1b')](_0x22ffc2)[_0xde3e('0x1c')]();};}function respondWithResult(_0x4fe882,_0x167fa7){_0x167fa7=_0x167fa7||0xc8;return function(_0x1fee7b){if(_0x1fee7b){return _0x4fe882['status'](_0x167fa7)['json'](_0x1fee7b);}};}function respondWithFilteredResult(_0x120077,_0x11db96){return function(_0x6543f7){if(_0x6543f7){var _0x552fc4=typeof _0x11db96['offset']===_0xde3e('0x1d')&&typeof _0x11db96['limit']==='undefined';var _0xc3ee05=_0x6543f7[_0xde3e('0x1e')];var _0x4aa02c=_0x552fc4?0x0:_0x11db96[_0xde3e('0x1f')];var _0x276e83=_0x552fc4?_0x6543f7[_0xde3e('0x1e')]:_0x11db96['offset']+_0x11db96['limit'];var _0x4fa0d2;if(_0x276e83>=_0xc3ee05){_0x276e83=_0xc3ee05;_0x4fa0d2=0xc8;}else{_0x4fa0d2=0xce;}_0x120077[_0xde3e('0x1b')](_0x4fa0d2);return _0x120077[_0xde3e('0x20')](_0xde3e('0x21'),_0x4aa02c+'-'+_0x276e83+'/'+_0xc3ee05)['json'](_0x6543f7);}return null;};}function patchUpdates(_0x2ceb3e){return function(_0x11dd22){try{jsonpatch[_0xde3e('0x22')](_0x11dd22,_0x2ceb3e,!![]);}catch(_0x8c8ace){return BPromise[_0xde3e('0x23')](_0x8c8ace);}return _0x11dd22[_0xde3e('0x24')]();};}function saveUpdates(_0x26c5ca,_0x1eda88){return function(_0x443e8d){if(_0x443e8d){return _0x443e8d['update'](_0x26c5ca)[_0xde3e('0x25')](function(_0x334093){return _0x334093;});}return null;};}function removeEntity(_0x37615f,_0x57df9e){return function(_0x361511){if(_0x361511){return _0x361511[_0xde3e('0x26')]()[_0xde3e('0x25')](function(){_0x37615f['status'](0xcc)[_0xde3e('0x1c')]();});}};}function handleEntityNotFound(_0x78647,_0x1d9432){return function(_0xd795ac){if(!_0xd795ac){_0x78647[_0xde3e('0x1a')](0x194);}return _0xd795ac;};}function handleError(_0x5ec4b6,_0x5313cb){_0x5313cb=_0x5313cb||0x1f4;return function(_0x6c0db0){logger[_0xde3e('0x27')](_0x6c0db0[_0xde3e('0x28')]);if(_0x6c0db0['name']){delete _0x6c0db0[_0xde3e('0x29')];}_0x5ec4b6[_0xde3e('0x1b')](_0x5313cb)['send'](_0x6c0db0);};}exports['show']=function(_0x245fbc,_0x3c83c8){var _0x582c8d={'raw':!![],'where':{'id':_0x245fbc[_0xde3e('0x2a')]['id']}},_0x2e4c62={};_0x2e4c62[_0xde3e('0x2b')]=_['keys'](db['ChatApplication'][_0xde3e('0x2c')]);_0x2e4c62['query']=_['keys'](_0x245fbc[_0xde3e('0x2d')]);_0x2e4c62[_0xde3e('0x2e')]=_[_0xde3e('0x2f')](_0x2e4c62[_0xde3e('0x2b')],_0x2e4c62[_0xde3e('0x2d')]);_0x582c8d[_0xde3e('0x30')]=_[_0xde3e('0x2f')](_0x2e4c62[_0xde3e('0x2b')],qs[_0xde3e('0x31')](_0x245fbc[_0xde3e('0x2d')][_0xde3e('0x31')]));_0x582c8d[_0xde3e('0x30')]=_0x582c8d[_0xde3e('0x30')][_0xde3e('0x32')]?_0x582c8d[_0xde3e('0x30')]:_0x2e4c62[_0xde3e('0x2b')];if(_0x245fbc[_0xde3e('0x2d')]['includeAll']){_0x582c8d[_0xde3e('0x33')]=[{'all':!![]}];}_0x582c8d=_[_0xde3e('0x34')]({},_0x582c8d,_0x245fbc[_0xde3e('0x35')]);return db[_0xde3e('0x36')][_0xde3e('0x37')](_0x582c8d)[_0xde3e('0x25')](handleEntityNotFound(_0x3c83c8,null))[_0xde3e('0x25')](respondWithResult(_0x3c83c8,null))[_0xde3e('0x38')](handleError(_0x3c83c8,null));};exports['update']=function(_0x50f1e3,_0x47793d){if(_0x50f1e3['body']['id']){delete _0x50f1e3['body']['id'];}return db[_0xde3e('0x36')][_0xde3e('0x37')]({'where':{'id':_0x50f1e3[_0xde3e('0x2a')]['id']}})[_0xde3e('0x25')](handleEntityNotFound(_0x47793d,null))[_0xde3e('0x25')](saveUpdates(_0x50f1e3[_0xde3e('0x39')],null))['then'](respondWithResult(_0x47793d,null))['catch'](handleError(_0x47793d,null));};exports[_0xde3e('0x26')]=function(_0x24adee,_0x1ade0c){return db[_0xde3e('0x36')][_0xde3e('0x37')]({'where':{'id':_0x24adee[_0xde3e('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1ade0c,null))[_0xde3e('0x25')](removeEntity(_0x1ade0c,null))['catch'](handleError(_0x1ade0c,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index a8fd45f..e56b5bd 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 _0x5e93=['request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a2266,_0x53e92f){var _0x1d7b9f=function(_0x3dafff){while(--_0x3dafff){_0x4a2266['push'](_0x4a2266['shift']());}};_0x1d7b9f(++_0x53e92f);}(_0x5e93,0x174));var _0x35e9=function(_0x5b560a,_0x47d8a7){_0x5b560a=_0x5b560a-0x0;var _0x3cc47d=_0x5e93[_0x5b560a];return _0x3cc47d;};'use strict';var _=require(_0x35e9('0x0'));var util=require(_0x35e9('0x1'));var logger=require(_0x35e9('0x2'))(_0x35e9('0x3'));var moment=require(_0x35e9('0x4'));var BPromise=require(_0x35e9('0x5'));var rp=require(_0x35e9('0x6'));var fs=require('fs');var path=require(_0x35e9('0x7'));var rimraf=require(_0x35e9('0x8'));var config=require(_0x35e9('0x9'));var attributes=require(_0x35e9('0xa'));module[_0x35e9('0xb')]=function(_0x47d2a8,_0x115d4c){return _0x47d2a8[_0x35e9('0xc')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x35e9('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4f88=['chat_applications','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication'];(function(_0x1a7536,_0x30c791){var _0x4660d9=function(_0x1db222){while(--_0x1db222){_0x1a7536['push'](_0x1a7536['shift']());}};_0x4660d9(++_0x30c791);}(_0x4f88,0xf3));var _0x84f8=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x4f88[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var logger=require('../../config/logger')(_0x84f8('0x2'));var moment=require(_0x84f8('0x3'));var BPromise=require(_0x84f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x84f8('0x5'));var config=require(_0x84f8('0x6'));var attributes=require(_0x84f8('0x7'));module[_0x84f8('0x8')]=function(_0x79dcec,_0x1ac0c8){return _0x79dcec['define'](_0x84f8('0x9'),attributes,{'tableName':_0x84f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index b2d7e17..fb497d6 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 _0x7c21=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','ChatApplication,\x20%s,\x20%s','message','info'];(function(_0x6f77d6,_0x32ddb6){var _0x454143=function(_0x1bbb3b){while(--_0x1bbb3b){_0x6f77d6['push'](_0x6f77d6['shift']());}};_0x454143(++_0x32ddb6);}(_0x7c21,0x141));var _0x17c2=function(_0x5bd696,_0x32ab61){_0x5bd696=_0x5bd696-0x0;var _0x5d6af7=_0x7c21[_0x5bd696];return _0x5d6af7;};'use strict';var _=require(_0x17c2('0x0'));var util=require(_0x17c2('0x1'));var moment=require('moment');var BPromise=require(_0x17c2('0x2'));var rs=require(_0x17c2('0x3'));var fs=require('fs');var Redis=require(_0x17c2('0x4'));var db=require(_0x17c2('0x5'))['db'];var utils=require(_0x17c2('0x6'));var logger=require('../../config/logger')(_0x17c2('0x7'));var config=require(_0x17c2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x17c2('0x9')][_0x17c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x104969,_0x107f61,_0x3869a0){return new BPromise(function(_0x3433d4,_0x76b2de){return client[_0x17c2('0xb')](_0x104969,_0x3869a0)['then'](function(_0x15d882){logger['info']('ChatApplication,\x20%s,\x20%s',_0x107f61,_0x17c2('0xc'));logger[_0x17c2('0xd')](_0x17c2('0xe'),_0x107f61,'request\x20sent',JSON['stringify'](_0x15d882));if(_0x15d882[_0x17c2('0xf')]){if(_0x15d882[_0x17c2('0xf')]['code']===0x1f4){logger[_0x17c2('0xf')](_0x17c2('0x10'),_0x107f61,_0x15d882[_0x17c2('0xf')][_0x17c2('0x11')]);return _0x76b2de(_0x15d882[_0x17c2('0xf')][_0x17c2('0x11')]);}logger['error'](_0x17c2('0x10'),_0x107f61,_0x15d882[_0x17c2('0xf')]['message']);return _0x3433d4(_0x15d882[_0x17c2('0xf')][_0x17c2('0x11')]);}else{logger[_0x17c2('0x12')](_0x17c2('0x10'),_0x107f61,_0x17c2('0xc'));_0x3433d4(_0x15d882['result'][_0x17c2('0x11')]);}})[_0x17c2('0x13')](function(_0x477673){logger['error'](_0x17c2('0x10'),_0x107f61,_0x477673);_0x76b2de(_0x477673);});});}
\ No newline at end of file
+var _0xed1d=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xed1d,0x127));var _0xded1=function(_0x3cf76d,_0xb29031){_0x3cf76d=_0x3cf76d-0x0;var _0xb2c522=_0xed1d[_0x3cf76d];return _0xb2c522;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xded1('0x0'));var BPromise=require(_0xded1('0x1'));var rs=require(_0xded1('0x2'));var fs=require('fs');var Redis=require(_0xded1('0x3'));var db=require(_0xded1('0x4'))['db'];var utils=require(_0xded1('0x5'));var logger=require(_0xded1('0x6'))(_0xded1('0x7'));var config=require(_0xded1('0x8'));var jayson=require(_0xded1('0x9'));var client=jayson[_0xded1('0xa')][_0xded1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f79d4,_0x5a4dc6,_0x1aee31){return new BPromise(function(_0x37d971,_0x51febd){return client[_0xded1('0xc')](_0x1f79d4,_0x1aee31)['then'](function(_0x13d98f){logger[_0xded1('0xd')](_0xded1('0xe'),_0x5a4dc6,_0xded1('0xf'));logger[_0xded1('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5a4dc6,_0xded1('0xf'),JSON[_0xded1('0x11')](_0x13d98f));if(_0x13d98f[_0xded1('0x12')]){if(_0x13d98f[_0xded1('0x12')][_0xded1('0x13')]===0x1f4){logger[_0xded1('0x12')](_0xded1('0xe'),_0x5a4dc6,_0x13d98f[_0xded1('0x12')][_0xded1('0x14')]);return _0x51febd(_0x13d98f[_0xded1('0x12')][_0xded1('0x14')]);}logger[_0xded1('0x12')](_0xded1('0xe'),_0x5a4dc6,_0x13d98f[_0xded1('0x12')][_0xded1('0x14')]);return _0x37d971(_0x13d98f[_0xded1('0x12')][_0xded1('0x14')]);}else{logger['info'](_0xded1('0xe'),_0x5a4dc6,'request\x20sent');_0x37d971(_0x13d98f['result'][_0xded1('0x14')]);}})[_0xded1('0x15')](function(_0x556c5e){logger[_0xded1('0x12')]('ChatApplication,\x20%s,\x20%s',_0x5a4dc6,_0x556c5e);_0x51febd(_0x556c5e);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 195dbe3..3adfa67 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 _0xb985=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','update','exports'];(function(_0x52fdcd,_0x15cddd){var _0x110eab=function(_0x325338){while(--_0x325338){_0x52fdcd['push'](_0x52fdcd['shift']());}};_0x110eab(++_0x15cddd);}(_0xb985,0x142));var _0x5b98=function(_0x4e2148,_0x382a2c){_0x4e2148=_0x4e2148-0x0;var _0x323345=_0xb985[_0x4e2148];return _0x323345;};'use strict';var multer=require(_0x5b98('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5b98('0x1'));var express=require(_0x5b98('0x2'));var router=express[_0x5b98('0x3')]();var fs_extra=require(_0x5b98('0x4'));var auth=require(_0x5b98('0x5'));var interaction=require(_0x5b98('0x6'));var config=require(_0x5b98('0x7'));var controller=require(_0x5b98('0x8'));router[_0x5b98('0x9')](_0x5b98('0xa'),auth[_0x5b98('0xb')](),controller['show']);router['put']('/:id',auth[_0x5b98('0xb')](),controller[_0x5b98('0xc')]);router['delete'](_0x5b98('0xa'),auth[_0x5b98('0xb')](),controller['destroy']);module[_0x5b98('0xd')]=router;
\ No newline at end of file
+var _0x665f=['show','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x572a16,_0x4d5089){var _0x4a0803=function(_0x55b517){while(--_0x55b517){_0x572a16['push'](_0x572a16['shift']());}};_0x4a0803(++_0x4d5089);}(_0x665f,0x1c4));var _0xf665=function(_0xb74774,_0x33681d){_0xb74774=_0xb74774-0x0;var _0x57e076=_0x665f[_0xb74774];return _0x57e076;};'use strict';var multer=require('multer');var util=require(_0xf665('0x0'));var path=require(_0xf665('0x1'));var timeout=require(_0xf665('0x2'));var express=require(_0xf665('0x3'));var router=express['Router']();var fs_extra=require(_0xf665('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf665('0x5'));var config=require('../../config/environment');var controller=require(_0xf665('0x6'));router[_0xf665('0x7')](_0xf665('0x8'),auth[_0xf665('0x9')](),controller[_0xf665('0xa')]);router[_0xf665('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf665('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf665('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 1d32305..b157cee 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 _0x4d0a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4d0a,0x176));var _0xa4d0=function(_0xe37698,_0x19fa57){_0xe37698=_0xe37698-0x0;var _0xdb2276=_0x4d0a[_0xe37698];return _0xdb2276;};'use strict';var Sequelize=require(_0xa4d0('0x0'));module[_0xa4d0('0x1')]={'name':{'type':Sequelize[_0xa4d0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xa4d0('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x02bd=['sequelize','exports','STRING'];(function(_0x3be174,_0x393350){var _0x5ec09c=function(_0x28a9aa){while(--_0x28a9aa){_0x3be174['push'](_0x3be174['shift']());}};_0x5ec09c(++_0x393350);}(_0x02bd,0x6c));var _0xd02b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x02bd[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xd02b('0x0'));module[_0xd02b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd02b('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 740918e..fd63adc 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 _0x7c16=['nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','includeAll','catch','show','include','create','body','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','removeMembers','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x593e5c,_0x14f512){var _0x31c87a=function(_0x4820c4){while(--_0x4820c4){_0x593e5c['push'](_0x593e5c['shift']());}};_0x31c87a(++_0x14f512);}(_0x7c16,0x7e));var _0x67c1=function(_0x1298ed,_0x39ba63){_0x1298ed=_0x1298ed-0x0;var _0x56b532=_0x7c16[_0x1298ed];return _0x56b532;};'use strict';var emlformat=require(_0x67c1('0x0'));var rimraf=require(_0x67c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x67c1('0x2'));var rp=require(_0x67c1('0x3'));var moment=require(_0x67c1('0x4'));var BPromise=require(_0x67c1('0x5'));var Mustache=require(_0x67c1('0x6'));var util=require(_0x67c1('0x7'));var path=require('path');var sox=require(_0x67c1('0x8'));var csv=require(_0x67c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x67c1('0xa'));var _=require(_0x67c1('0xb'));var squel=require(_0x67c1('0xc'));var crypto=require('crypto');var jsforce=require(_0x67c1('0xd'));var deskjs=require(_0x67c1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x67c1('0xf'));var Redis=require(_0x67c1('0x10'));var authService=require(_0x67c1('0x11'));var qs=require(_0x67c1('0x12'));var as=require(_0x67c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x67c1('0x14'));var utils=require(_0x67c1('0x15'));var config=require(_0x67c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x67c1('0x17'))['db'];config[_0x67c1('0x18')]=_[_0x67c1('0x19')](config[_0x67c1('0x18')],{'host':_0x67c1('0x1a'),'port':0x18eb});var socket=require(_0x67c1('0x1b'))(new Redis(config[_0x67c1('0x18')]));require(_0x67c1('0x1c'))['register'](socket);function respondWithStatusCode(_0x1ad911,_0x3e2037){_0x3e2037=_0x3e2037||0xcc;return function(_0x31a60f){if(_0x31a60f){return _0x1ad911['sendStatus'](_0x3e2037);}return _0x1ad911[_0x67c1('0x1d')](_0x3e2037)[_0x67c1('0x1e')]();};}function respondWithResult(_0x30894e,_0x3d5b84){_0x3d5b84=_0x3d5b84||0xc8;return function(_0xf4fb80){if(_0xf4fb80){return _0x30894e[_0x67c1('0x1d')](_0x3d5b84)[_0x67c1('0x1f')](_0xf4fb80);}};}function respondWithFilteredResult(_0x50520d,_0x44819c){return function(_0x5c9b99){if(_0x5c9b99){var _0xd1d412=typeof _0x44819c[_0x67c1('0x20')]==='undefined'&&typeof _0x44819c[_0x67c1('0x21')]===_0x67c1('0x22');var _0x4941a1=_0x5c9b99[_0x67c1('0x23')];var _0x16132e=_0xd1d412?0x0:_0x44819c[_0x67c1('0x20')];var _0x31b457=_0xd1d412?_0x5c9b99[_0x67c1('0x23')]:_0x44819c[_0x67c1('0x20')]+_0x44819c['limit'];var _0x1683bc;if(_0x31b457>=_0x4941a1){_0x31b457=_0x4941a1;_0x1683bc=0xc8;}else{_0x1683bc=0xce;}_0x50520d[_0x67c1('0x1d')](_0x1683bc);return _0x50520d[_0x67c1('0x24')]('Content-Range',_0x16132e+'-'+_0x31b457+'/'+_0x4941a1)[_0x67c1('0x1f')](_0x5c9b99);}return null;};}function patchUpdates(_0x350b3c){return function(_0x302ffc){try{jsonpatch[_0x67c1('0x25')](_0x302ffc,_0x350b3c,!![]);}catch(_0x467b39){return BPromise[_0x67c1('0x26')](_0x467b39);}return _0x302ffc['save']();};}function saveUpdates(_0xb8323f,_0x416f3f){return function(_0x3efbbe){if(_0x3efbbe){return _0x3efbbe[_0x67c1('0x27')](_0xb8323f)['then'](function(_0x38982a){return _0x38982a;});}return null;};}function removeEntity(_0x3c356a,_0x2e9f31){return function(_0x474c6f){if(_0x474c6f){return _0x474c6f[_0x67c1('0x28')]()['then'](function(){_0x3c356a[_0x67c1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a02e6,_0xb1a62d){return function(_0x4734a4){if(!_0x4734a4){_0x3a02e6['sendStatus'](0x194);}return _0x4734a4;};}function handleError(_0x467565,_0x15afd7){_0x15afd7=_0x15afd7||0x1f4;return function(_0x29280f){logger[_0x67c1('0x29')](_0x29280f[_0x67c1('0x2a')]);if(_0x29280f[_0x67c1('0x2b')]){delete _0x29280f[_0x67c1('0x2b')];}_0x467565[_0x67c1('0x1d')](_0x15afd7)[_0x67c1('0x2c')](_0x29280f);};}exports[_0x67c1('0x2d')]=function(_0x1db4ae,_0x35ef8a){var _0x9642f5={},_0x3e39e0={},_0x39606a={'count':0x0,'rows':[]};var _0x3aa9c5=_[_0x67c1('0x2e')](db[_0x67c1('0x2f')][_0x67c1('0x30')],function(_0x444c49){return{'name':_0x444c49[_0x67c1('0x31')],'type':_0x444c49[_0x67c1('0x32')][_0x67c1('0x33')]};});_0x3e39e0[_0x67c1('0x34')]=_[_0x67c1('0x2e')](_0x3aa9c5,'name');_0x3e39e0['query']=_[_0x67c1('0x35')](_0x1db4ae[_0x67c1('0x36')]);_0x3e39e0['filters']=_[_0x67c1('0x37')](_0x3e39e0['model'],_0x3e39e0[_0x67c1('0x36')]);_0x9642f5['attributes']=_[_0x67c1('0x37')](_0x3e39e0[_0x67c1('0x34')],qs[_0x67c1('0x38')](_0x1db4ae['query'][_0x67c1('0x38')]));_0x9642f5[_0x67c1('0x39')]=_0x9642f5[_0x67c1('0x39')][_0x67c1('0x3a')]?_0x9642f5[_0x67c1('0x39')]:_0x3e39e0[_0x67c1('0x34')];if(!_0x1db4ae[_0x67c1('0x36')][_0x67c1('0x3b')](_0x67c1('0x3c'))){_0x9642f5[_0x67c1('0x21')]=qs[_0x67c1('0x21')](_0x1db4ae['query'][_0x67c1('0x21')]);_0x9642f5[_0x67c1('0x20')]=qs[_0x67c1('0x20')](_0x1db4ae[_0x67c1('0x36')][_0x67c1('0x20')]);}_0x9642f5[_0x67c1('0x3d')]=qs[_0x67c1('0x3e')](_0x1db4ae['query'][_0x67c1('0x3e')]);_0x9642f5[_0x67c1('0x3f')]=qs['filters'](_[_0x67c1('0x40')](_0x1db4ae[_0x67c1('0x36')],_0x3e39e0[_0x67c1('0x41')]),_0x3aa9c5);if(_0x1db4ae[_0x67c1('0x36')][_0x67c1('0x42')]){_0x9642f5[_0x67c1('0x3f')]=_[_0x67c1('0x43')](_0x9642f5[_0x67c1('0x3f')],{'$or':_[_0x67c1('0x2e')](_0x3aa9c5,function(_0x1c42ff){if(_0x1c42ff[_0x67c1('0x32')]!==_0x67c1('0x44')){var _0x2e9641={};_0x2e9641[_0x1c42ff[_0x67c1('0x2b')]]={'$like':'%'+_0x1db4ae[_0x67c1('0x36')]['filter']+'%'};return _0x2e9641;}})});}_0x9642f5=_[_0x67c1('0x43')]({},_0x9642f5,_0x1db4ae[_0x67c1('0x45')]);var _0x59f6e3={'where':_0x9642f5[_0x67c1('0x3f')]};return db[_0x67c1('0x2f')][_0x67c1('0x23')](_0x59f6e3)[_0x67c1('0x46')](function(_0x5725b0){_0x39606a[_0x67c1('0x23')]=_0x5725b0;if(_0x1db4ae[_0x67c1('0x36')][_0x67c1('0x47')]){_0x9642f5['include']=[{'all':!![]}];}return db[_0x67c1('0x2f')]['findAll'](_0x9642f5);})[_0x67c1('0x46')](function(_0x12e873){_0x39606a['rows']=_0x12e873;return _0x39606a;})[_0x67c1('0x46')](respondWithFilteredResult(_0x35ef8a,_0x9642f5))[_0x67c1('0x48')](handleError(_0x35ef8a,null));};exports[_0x67c1('0x49')]=function(_0x502e56,_0x3ecea8){var _0xd5ac0f={'raw':!![],'where':{'id':_0x502e56['params']['id']}},_0x6dcf8={};_0x6dcf8[_0x67c1('0x34')]=_['keys'](db[_0x67c1('0x2f')]['rawAttributes']);_0x6dcf8['query']=_[_0x67c1('0x35')](_0x502e56[_0x67c1('0x36')]);_0x6dcf8[_0x67c1('0x41')]=_[_0x67c1('0x37')](_0x6dcf8[_0x67c1('0x34')],_0x6dcf8[_0x67c1('0x36')]);_0xd5ac0f['attributes']=_[_0x67c1('0x37')](_0x6dcf8[_0x67c1('0x34')],qs[_0x67c1('0x38')](_0x502e56[_0x67c1('0x36')][_0x67c1('0x38')]));_0xd5ac0f[_0x67c1('0x39')]=_0xd5ac0f[_0x67c1('0x39')][_0x67c1('0x3a')]?_0xd5ac0f['attributes']:_0x6dcf8['model'];if(_0x502e56[_0x67c1('0x36')][_0x67c1('0x47')]){_0xd5ac0f[_0x67c1('0x4a')]=[{'all':!![]}];}_0xd5ac0f=_[_0x67c1('0x43')]({},_0xd5ac0f,_0x502e56[_0x67c1('0x45')]);return db[_0x67c1('0x2f')]['find'](_0xd5ac0f)['then'](handleEntityNotFound(_0x3ecea8,null))[_0x67c1('0x46')](respondWithResult(_0x3ecea8,null))['catch'](handleError(_0x3ecea8,null));};exports[_0x67c1('0x4b')]=function(_0x722df3,_0x1ce910){return db[_0x67c1('0x2f')]['create'](_0x722df3[_0x67c1('0x4c')],{})[_0x67c1('0x46')](respondWithResult(_0x1ce910,0xc9))[_0x67c1('0x48')](handleError(_0x1ce910,null));};exports[_0x67c1('0x27')]=function(_0x35109a,_0xeb052c){if(_0x35109a[_0x67c1('0x4c')]['id']){delete _0x35109a['body']['id'];}return db['ChatGroup'][_0x67c1('0x4d')]({'where':{'id':_0x35109a[_0x67c1('0x4e')]['id']}})[_0x67c1('0x46')](handleEntityNotFound(_0xeb052c,null))['then'](saveUpdates(_0x35109a[_0x67c1('0x4c')],null))[_0x67c1('0x46')](respondWithResult(_0xeb052c,null))[_0x67c1('0x48')](handleError(_0xeb052c,null));};exports['destroy']=function(_0x480a42,_0x3c5204){return db[_0x67c1('0x2f')][_0x67c1('0x4d')]({'where':{'id':_0x480a42[_0x67c1('0x4e')]['id']}})[_0x67c1('0x46')](handleEntityNotFound(_0x3c5204,null))[_0x67c1('0x46')](removeEntity(_0x3c5204,null))['catch'](handleError(_0x3c5204,null));};exports['describe']=function(_0x56bbf9,_0x3da836){return db[_0x67c1('0x2f')][_0x67c1('0x4f')]()[_0x67c1('0x46')](respondWithResult(_0x3da836,null))[_0x67c1('0x48')](handleError(_0x3da836,null));};exports[_0x67c1('0x50')]=function(_0x1585a7,_0x1b8d7d,_0x82dab1){return db[_0x67c1('0x51')]['count']({'where':{'ChatGroupId':_0x1585a7['params']['id'],'ToId':_0x1585a7[_0x67c1('0x52')]['id'],'read':![]}})[_0x67c1('0x46')](function(_0x477b1d){return{'id':_[_0x67c1('0x53')](_0x1585a7['params']['id']),'count':_0x477b1d};})[_0x67c1('0x46')](respondWithResult(_0x1b8d7d,null))['catch'](handleError(_0x1b8d7d,null));};exports[_0x67c1('0x54')]=function(_0x415352,_0x1cfb08,_0x5278db){return db[_0x67c1('0x2f')][_0x67c1('0x4d')]({'where':{'id':_0x415352['params']['id']}})['then'](handleEntityNotFound(_0x1cfb08,null))[_0x67c1('0x46')](function(_0x263f04){if(_0x263f04){return _0x263f04['addMembers'](_0x415352['body']['ids'],_['omit'](_0x415352[_0x67c1('0x4c')],[_0x67c1('0x55'),'id'])||{});}})[_0x67c1('0x46')](respondWithResult(_0x1cfb08,null))['catch'](handleError(_0x1cfb08,null));};exports['getMembers']=function(_0x20156d,_0x45422c,_0x30fea9){var _0x3e8d95={};var _0x1df802={};var _0x3a4079;var _0x2b91ae;return db[_0x67c1('0x2f')][_0x67c1('0x56')]({'where':{'id':_0x20156d[_0x67c1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x45422c,null))['then'](function(_0x3b31e5){if(_0x3b31e5){_0x3a4079=_0x3b31e5;_0x1df802[_0x67c1('0x34')]=_[_0x67c1('0x35')](db['User']['rawAttributes']);_0x1df802[_0x67c1('0x36')]=_[_0x67c1('0x35')](_0x20156d[_0x67c1('0x36')]);_0x1df802[_0x67c1('0x41')]=_[_0x67c1('0x37')](_0x1df802['model'],_0x1df802[_0x67c1('0x36')]);_0x3e8d95[_0x67c1('0x39')]=_[_0x67c1('0x37')](_0x1df802[_0x67c1('0x34')],qs[_0x67c1('0x38')](_0x20156d['query'][_0x67c1('0x38')]));_0x3e8d95[_0x67c1('0x39')]=_0x3e8d95[_0x67c1('0x39')]['length']?_0x3e8d95[_0x67c1('0x39')]:_0x1df802[_0x67c1('0x34')];_0x3e8d95[_0x67c1('0x3d')]=qs[_0x67c1('0x3e')](_0x20156d['query']['sort']);_0x3e8d95[_0x67c1('0x3f')]=qs[_0x67c1('0x41')](_['pick'](_0x20156d[_0x67c1('0x36')],_0x1df802[_0x67c1('0x41')]));if(_0x20156d[_0x67c1('0x36')][_0x67c1('0x42')]){_0x3e8d95[_0x67c1('0x3f')]=_[_0x67c1('0x43')](_0x3e8d95[_0x67c1('0x3f')],{'$or':_[_0x67c1('0x2e')](_0x3e8d95[_0x67c1('0x39')],function(_0x27bf18){var _0x3b835b={};_0x3b835b[_0x27bf18]={'$like':'%'+_0x20156d['query'][_0x67c1('0x42')]+'%'};return _0x3b835b;})});}_0x3e8d95=_[_0x67c1('0x43')]({},_0x3e8d95,_0x20156d[_0x67c1('0x45')]);return _0x3a4079['getMembers'](_0x3e8d95);}})[_0x67c1('0x46')](function(_0x2f2ff8){if(_0x2f2ff8){_0x2b91ae=_0x2f2ff8['length'];if(!_0x20156d[_0x67c1('0x36')][_0x67c1('0x3b')](_0x67c1('0x3c'))){_0x3e8d95[_0x67c1('0x21')]=qs[_0x67c1('0x21')](_0x20156d['query'][_0x67c1('0x21')]);_0x3e8d95['offset']=qs['offset'](_0x20156d[_0x67c1('0x36')][_0x67c1('0x20')]);}return _0x3a4079['getMembers'](_0x3e8d95);}})[_0x67c1('0x46')](function(_0x5c9412){if(_0x5c9412){return _0x5c9412?{'count':_0x2b91ae,'rows':_0x5c9412}:null;}})['then'](respondWithResult(_0x45422c,null))[_0x67c1('0x48')](handleError(_0x45422c,null));};exports['removeMembers']=function(_0x1f0e38,_0x5a80ef,_0x38d6b3){return db[_0x67c1('0x2f')][_0x67c1('0x4d')]({'where':{'id':_0x1f0e38[_0x67c1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a80ef,null))[_0x67c1('0x46')](function(_0x133ec4){if(_0x133ec4){return _0x133ec4[_0x67c1('0x57')](_0x1f0e38[_0x67c1('0x36')][_0x67c1('0x55')]);}})[_0x67c1('0x46')](respondWithStatusCode(_0x5a80ef,null))['catch'](handleError(_0x5a80ef,null));};exports['addMessage']=function(_0x1568a1,_0x315cb9,_0xb8ab2){if(_0x1568a1[_0x67c1('0x4c')]['id']){delete _0x1568a1[_0x67c1('0x4c')]['id'];}return db[_0x67c1('0x2f')][_0x67c1('0x4d')]({'where':{'id':_0x1568a1[_0x67c1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x315cb9,null))[_0x67c1('0x46')](function(_0x3df7e9){if(_0x3df7e9){_0x1568a1['body'][_0x67c1('0x58')]=_0x3df7e9['id'];return db[_0x67c1('0x51')][_0x67c1('0x4b')](_0x1568a1['body']);}})['then'](respondWithResult(_0x315cb9,null))['catch'](handleError(_0x315cb9,null));};exports[_0x67c1('0x59')]=function(_0x4096f4,_0xc21e2a,_0x3ff54b){var _0x74afe4={};var _0x4a032f={};var _0x49813a;var _0x45ef81;return db[_0x67c1('0x2f')][_0x67c1('0x56')]({'where':{'id':_0x4096f4['params']['id']}})[_0x67c1('0x46')](handleEntityNotFound(_0xc21e2a,null))[_0x67c1('0x46')](function(_0x1f7623){if(_0x1f7623){_0x49813a=_0x1f7623;_0x4a032f['model']=_['keys'](db['ChatInternalMessage'][_0x67c1('0x30')]);_0x4a032f['query']=_['keys'](_0x4096f4[_0x67c1('0x36')]);_0x4a032f[_0x67c1('0x41')]=_[_0x67c1('0x37')](_0x4a032f[_0x67c1('0x34')],_0x4a032f[_0x67c1('0x36')]);_0x74afe4[_0x67c1('0x39')]=_[_0x67c1('0x37')](_0x4a032f[_0x67c1('0x34')],qs[_0x67c1('0x38')](_0x4096f4[_0x67c1('0x36')][_0x67c1('0x38')]));_0x74afe4[_0x67c1('0x39')]=_0x74afe4[_0x67c1('0x39')][_0x67c1('0x3a')]?_0x74afe4[_0x67c1('0x39')]:_0x4a032f[_0x67c1('0x34')];_0x74afe4[_0x67c1('0x3d')]=qs[_0x67c1('0x3e')](_0x4096f4[_0x67c1('0x36')]['sort']);_0x74afe4[_0x67c1('0x3f')]=qs[_0x67c1('0x41')](_[_0x67c1('0x40')](_0x4096f4[_0x67c1('0x36')],_0x4a032f['filters']));if(_0x4096f4['query'][_0x67c1('0x42')]){_0x74afe4[_0x67c1('0x3f')]=_[_0x67c1('0x43')](_0x74afe4[_0x67c1('0x3f')],{'$or':_[_0x67c1('0x2e')](_0x74afe4[_0x67c1('0x39')],function(_0x2418bd){var _0x59a033={};_0x59a033[_0x2418bd]={'$like':'%'+_0x4096f4[_0x67c1('0x36')][_0x67c1('0x42')]+'%'};return _0x59a033;})});}if(_0x4096f4['query'][_0x67c1('0x5a')]){var _0x1d714f=_0x4096f4[_0x67c1('0x36')][_0x67c1('0x5a')][_0x67c1('0x5b')](',');var _0xb94775={};_0xb94775[_0x1d714f[0x0]]={'$gte':moment(_0x1d714f[0x1])[_0x67c1('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x74afe4['where']=_['merge'](_0x74afe4['where'],_0xb94775);}_0x74afe4=_[_0x67c1('0x43')]({},_0x74afe4,_0x4096f4[_0x67c1('0x45')]);return _0x49813a[_0x67c1('0x59')](_0x74afe4);}})[_0x67c1('0x46')](function(_0x3a899e){if(_0x3a899e){_0x45ef81=_0x3a899e[_0x67c1('0x3a')];if(!_0x4096f4[_0x67c1('0x36')][_0x67c1('0x3b')](_0x67c1('0x3c'))){_0x74afe4['limit']=qs[_0x67c1('0x21')](_0x4096f4['query']['limit']);_0x74afe4[_0x67c1('0x20')]=qs[_0x67c1('0x20')](_0x4096f4[_0x67c1('0x36')]['offset']);}return _0x49813a[_0x67c1('0x59')](_0x74afe4);}})[_0x67c1('0x46')](function(_0x1810de){if(_0x1810de){return _0x1810de?{'count':_0x45ef81,'rows':_0x1810de}:null;}})[_0x67c1('0x46')](respondWithResult(_0xc21e2a,null))[_0x67c1('0x48')](handleError(_0xc21e2a,null));};
\ No newline at end of file
+var _0x812e=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','ChatGroup','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','update','describe','getUnread','user','toInteger','addMembers','ids','omit','User','getMembers','nolimit','removeMembers','ChatGroupId','ChatInternalMessage','findOne','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x812e,0x117));var _0xe812=function(_0x5839fa,_0xacd507){_0x5839fa=_0x5839fa-0x0;var _0x5d514e=_0x812e[_0x5839fa];return _0x5d514e;};'use strict';var emlformat=require(_0xe812('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe812('0x1'));var jsonpatch=require(_0xe812('0x2'));var rp=require(_0xe812('0x3'));var moment=require(_0xe812('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe812('0x5'));var util=require('util');var path=require(_0xe812('0x6'));var sox=require(_0xe812('0x7'));var csv=require('to-csv');var ejs=require(_0xe812('0x8'));var fs=require('fs');var fs_extra=require(_0xe812('0x9'));var _=require(_0xe812('0xa'));var squel=require(_0xe812('0xb'));var crypto=require(_0xe812('0xc'));var jsforce=require(_0xe812('0xd'));var deskjs=require(_0xe812('0xe'));var toCsv=require(_0xe812('0xf'));var querystring=require(_0xe812('0x10'));var Papa=require(_0xe812('0x11'));var Redis=require(_0xe812('0x12'));var authService=require(_0xe812('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe812('0x14'));var hardwareService=require(_0xe812('0x15'));var logger=require(_0xe812('0x16'))(_0xe812('0x17'));var utils=require(_0xe812('0x18'));var config=require(_0xe812('0x19'));var licenseUtil=require(_0xe812('0x1a'));var db=require('../../mysqldb')['db'];config[_0xe812('0x1b')]=_[_0xe812('0x1c')](config[_0xe812('0x1b')],{'host':_0xe812('0x1d'),'port':0x18eb});var socket=require(_0xe812('0x1e'))(new Redis(config[_0xe812('0x1b')]));require('./chatGroup.socket')[_0xe812('0x1f')](socket);function respondWithStatusCode(_0x2b0bb6,_0x1f9be0){_0x1f9be0=_0x1f9be0||0xcc;return function(_0x9c4402){if(_0x9c4402){return _0x2b0bb6[_0xe812('0x20')](_0x1f9be0);}return _0x2b0bb6[_0xe812('0x21')](_0x1f9be0)[_0xe812('0x22')]();};}function respondWithResult(_0x3c496e,_0x4ee593){_0x4ee593=_0x4ee593||0xc8;return function(_0x267233){if(_0x267233){return _0x3c496e[_0xe812('0x21')](_0x4ee593)['json'](_0x267233);}};}function respondWithFilteredResult(_0x13b6c6,_0x5ef3dd){return function(_0x1d7e4e){if(_0x1d7e4e){var _0x774e45=typeof _0x5ef3dd[_0xe812('0x23')]===_0xe812('0x24')&&typeof _0x5ef3dd['limit']===_0xe812('0x24');var _0x290d7b=_0x1d7e4e[_0xe812('0x25')];var _0xa8adc8=_0x774e45?0x0:_0x5ef3dd[_0xe812('0x23')];var _0x2427f3=_0x774e45?_0x1d7e4e[_0xe812('0x25')]:_0x5ef3dd['offset']+_0x5ef3dd[_0xe812('0x26')];var _0x3cc7d9;if(_0x2427f3>=_0x290d7b){_0x2427f3=_0x290d7b;_0x3cc7d9=0xc8;}else{_0x3cc7d9=0xce;}_0x13b6c6[_0xe812('0x21')](_0x3cc7d9);return _0x13b6c6[_0xe812('0x27')](_0xe812('0x28'),_0xa8adc8+'-'+_0x2427f3+'/'+_0x290d7b)[_0xe812('0x29')](_0x1d7e4e);}return null;};}function patchUpdates(_0x35e946){return function(_0x1d26a6){try{jsonpatch[_0xe812('0x2a')](_0x1d26a6,_0x35e946,!![]);}catch(_0x553e42){return BPromise[_0xe812('0x2b')](_0x553e42);}return _0x1d26a6[_0xe812('0x2c')]();};}function saveUpdates(_0x35b066,_0x4b4fb1){return function(_0xb76d88){if(_0xb76d88){return _0xb76d88['update'](_0x35b066)[_0xe812('0x2d')](function(_0x1e11b5){return _0x1e11b5;});}return null;};}function removeEntity(_0x580cc3,_0x125fdd){return function(_0x159482){if(_0x159482){return _0x159482[_0xe812('0x2e')]()[_0xe812('0x2d')](function(){_0x580cc3[_0xe812('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44efa7,_0x16bf81){return function(_0x1e0de2){if(!_0x1e0de2){_0x44efa7[_0xe812('0x20')](0x194);}return _0x1e0de2;};}function handleError(_0x5c5ce6,_0x4f65ff){_0x4f65ff=_0x4f65ff||0x1f4;return function(_0x373036){logger[_0xe812('0x2f')](_0x373036[_0xe812('0x30')]);if(_0x373036[_0xe812('0x31')]){delete _0x373036['name'];}_0x5c5ce6[_0xe812('0x21')](_0x4f65ff)[_0xe812('0x32')](_0x373036);};}exports['index']=function(_0xebcad3,_0x478dfc){var _0x240a22={},_0x173721={},_0xc4988c={'count':0x0,'rows':[]};var _0x241bc3=_[_0xe812('0x33')](db[_0xe812('0x34')]['rawAttributes'],function(_0x2d94c4){return{'name':_0x2d94c4[_0xe812('0x35')],'type':_0x2d94c4[_0xe812('0x36')][_0xe812('0x37')]};});_0x173721['model']=_['map'](_0x241bc3,_0xe812('0x31'));_0x173721[_0xe812('0x38')]=_[_0xe812('0x39')](_0xebcad3[_0xe812('0x38')]);_0x173721[_0xe812('0x3a')]=_[_0xe812('0x3b')](_0x173721['model'],_0x173721[_0xe812('0x38')]);_0x240a22[_0xe812('0x3c')]=_[_0xe812('0x3b')](_0x173721['model'],qs[_0xe812('0x3d')](_0xebcad3['query'][_0xe812('0x3d')]));_0x240a22[_0xe812('0x3c')]=_0x240a22['attributes'][_0xe812('0x3e')]?_0x240a22[_0xe812('0x3c')]:_0x173721[_0xe812('0x3f')];if(!_0xebcad3[_0xe812('0x38')][_0xe812('0x40')]('nolimit')){_0x240a22[_0xe812('0x26')]=qs[_0xe812('0x26')](_0xebcad3[_0xe812('0x38')]['limit']);_0x240a22[_0xe812('0x23')]=qs[_0xe812('0x23')](_0xebcad3[_0xe812('0x38')][_0xe812('0x23')]);}_0x240a22['order']=qs[_0xe812('0x41')](_0xebcad3['query'][_0xe812('0x41')]);_0x240a22['where']=qs[_0xe812('0x3a')](_[_0xe812('0x42')](_0xebcad3[_0xe812('0x38')],_0x173721[_0xe812('0x3a')]),_0x241bc3);if(_0xebcad3[_0xe812('0x38')][_0xe812('0x43')]){_0x240a22['where']=_[_0xe812('0x44')](_0x240a22[_0xe812('0x45')],{'$or':_[_0xe812('0x33')](_0x241bc3,function(_0x24860c){if(_0x24860c[_0xe812('0x36')]!==_0xe812('0x46')){var _0x5d20b9={};_0x5d20b9[_0x24860c[_0xe812('0x31')]]={'$like':'%'+_0xebcad3['query'][_0xe812('0x43')]+'%'};return _0x5d20b9;}})});}_0x240a22=_['merge']({},_0x240a22,_0xebcad3['options']);var _0x48155f={'where':_0x240a22[_0xe812('0x45')]};return db[_0xe812('0x34')][_0xe812('0x25')](_0x48155f)[_0xe812('0x2d')](function(_0x53c6d1){_0xc4988c[_0xe812('0x25')]=_0x53c6d1;if(_0xebcad3[_0xe812('0x38')][_0xe812('0x47')]){_0x240a22[_0xe812('0x48')]=[{'all':!![]}];}return db[_0xe812('0x34')][_0xe812('0x49')](_0x240a22);})[_0xe812('0x2d')](function(_0x5b1ebd){_0xc4988c['rows']=_0x5b1ebd;return _0xc4988c;})[_0xe812('0x2d')](respondWithFilteredResult(_0x478dfc,_0x240a22))[_0xe812('0x4a')](handleError(_0x478dfc,null));};exports[_0xe812('0x4b')]=function(_0x89568d,_0x777e3c){var _0x509827={'raw':!![],'where':{'id':_0x89568d[_0xe812('0x4c')]['id']}},_0x1fcba9={};_0x1fcba9[_0xe812('0x3f')]=_[_0xe812('0x39')](db[_0xe812('0x34')]['rawAttributes']);_0x1fcba9['query']=_[_0xe812('0x39')](_0x89568d['query']);_0x1fcba9[_0xe812('0x3a')]=_['intersection'](_0x1fcba9[_0xe812('0x3f')],_0x1fcba9['query']);_0x509827[_0xe812('0x3c')]=_[_0xe812('0x3b')](_0x1fcba9['model'],qs[_0xe812('0x3d')](_0x89568d[_0xe812('0x38')][_0xe812('0x3d')]));_0x509827[_0xe812('0x3c')]=_0x509827[_0xe812('0x3c')]['length']?_0x509827[_0xe812('0x3c')]:_0x1fcba9[_0xe812('0x3f')];if(_0x89568d[_0xe812('0x38')][_0xe812('0x47')]){_0x509827[_0xe812('0x48')]=[{'all':!![]}];}_0x509827=_['merge']({},_0x509827,_0x89568d[_0xe812('0x4d')]);return db[_0xe812('0x34')][_0xe812('0x4e')](_0x509827)[_0xe812('0x2d')](handleEntityNotFound(_0x777e3c,null))[_0xe812('0x2d')](respondWithResult(_0x777e3c,null))['catch'](handleError(_0x777e3c,null));};exports[_0xe812('0x4f')]=function(_0x2b266f,_0x16fe5c){return db[_0xe812('0x34')][_0xe812('0x4f')](_0x2b266f[_0xe812('0x50')],{})[_0xe812('0x2d')](respondWithResult(_0x16fe5c,0xc9))['catch'](handleError(_0x16fe5c,null));};exports[_0xe812('0x51')]=function(_0x1c151b,_0x48eb4d){if(_0x1c151b[_0xe812('0x50')]['id']){delete _0x1c151b[_0xe812('0x50')]['id'];}return db[_0xe812('0x34')][_0xe812('0x4e')]({'where':{'id':_0x1c151b[_0xe812('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48eb4d,null))[_0xe812('0x2d')](saveUpdates(_0x1c151b['body'],null))[_0xe812('0x2d')](respondWithResult(_0x48eb4d,null))[_0xe812('0x4a')](handleError(_0x48eb4d,null));};exports['destroy']=function(_0x3deffd,_0x26052a){return db[_0xe812('0x34')][_0xe812('0x4e')]({'where':{'id':_0x3deffd[_0xe812('0x4c')]['id']}})['then'](handleEntityNotFound(_0x26052a,null))[_0xe812('0x2d')](removeEntity(_0x26052a,null))['catch'](handleError(_0x26052a,null));};exports[_0xe812('0x52')]=function(_0x568791,_0x236187){return db[_0xe812('0x34')][_0xe812('0x52')]()[_0xe812('0x2d')](respondWithResult(_0x236187,null))[_0xe812('0x4a')](handleError(_0x236187,null));};exports[_0xe812('0x53')]=function(_0x1dda33,_0x1c7fce,_0x590b08){return db['ChatInternalMessage'][_0xe812('0x25')]({'where':{'ChatGroupId':_0x1dda33[_0xe812('0x4c')]['id'],'ToId':_0x1dda33[_0xe812('0x54')]['id'],'read':![]}})[_0xe812('0x2d')](function(_0x155b93){return{'id':_[_0xe812('0x55')](_0x1dda33[_0xe812('0x4c')]['id']),'count':_0x155b93};})[_0xe812('0x2d')](respondWithResult(_0x1c7fce,null))[_0xe812('0x4a')](handleError(_0x1c7fce,null));};exports[_0xe812('0x56')]=function(_0x2a1bc6,_0x51c687,_0x46ce96){return db[_0xe812('0x34')][_0xe812('0x4e')]({'where':{'id':_0x2a1bc6['params']['id']}})[_0xe812('0x2d')](handleEntityNotFound(_0x51c687,null))[_0xe812('0x2d')](function(_0x2d194f){if(_0x2d194f){return _0x2d194f[_0xe812('0x56')](_0x2a1bc6[_0xe812('0x50')][_0xe812('0x57')],_[_0xe812('0x58')](_0x2a1bc6['body'],[_0xe812('0x57'),'id'])||{});}})[_0xe812('0x2d')](respondWithResult(_0x51c687,null))[_0xe812('0x4a')](handleError(_0x51c687,null));};exports['getMembers']=function(_0x588e0e,_0x286d80,_0x32c672){var _0x2b4c68={};var _0x32a588={};var _0x1b1de6;var _0x25b584;return db[_0xe812('0x34')]['findOne']({'where':{'id':_0x588e0e[_0xe812('0x4c')]['id']}})[_0xe812('0x2d')](handleEntityNotFound(_0x286d80,null))[_0xe812('0x2d')](function(_0x3420cb){if(_0x3420cb){_0x1b1de6=_0x3420cb;_0x32a588[_0xe812('0x3f')]=_['keys'](db[_0xe812('0x59')]['rawAttributes']);_0x32a588[_0xe812('0x38')]=_[_0xe812('0x39')](_0x588e0e[_0xe812('0x38')]);_0x32a588['filters']=_['intersection'](_0x32a588[_0xe812('0x3f')],_0x32a588[_0xe812('0x38')]);_0x2b4c68[_0xe812('0x3c')]=_[_0xe812('0x3b')](_0x32a588['model'],qs[_0xe812('0x3d')](_0x588e0e[_0xe812('0x38')][_0xe812('0x3d')]));_0x2b4c68[_0xe812('0x3c')]=_0x2b4c68['attributes'][_0xe812('0x3e')]?_0x2b4c68['attributes']:_0x32a588[_0xe812('0x3f')];_0x2b4c68['order']=qs['sort'](_0x588e0e[_0xe812('0x38')]['sort']);_0x2b4c68[_0xe812('0x45')]=qs[_0xe812('0x3a')](_[_0xe812('0x42')](_0x588e0e[_0xe812('0x38')],_0x32a588['filters']));if(_0x588e0e[_0xe812('0x38')][_0xe812('0x43')]){_0x2b4c68[_0xe812('0x45')]=_['merge'](_0x2b4c68[_0xe812('0x45')],{'$or':_[_0xe812('0x33')](_0x2b4c68[_0xe812('0x3c')],function(_0x478a3f){var _0x1716bf={};_0x1716bf[_0x478a3f]={'$like':'%'+_0x588e0e[_0xe812('0x38')][_0xe812('0x43')]+'%'};return _0x1716bf;})});}_0x2b4c68=_[_0xe812('0x44')]({},_0x2b4c68,_0x588e0e[_0xe812('0x4d')]);return _0x1b1de6[_0xe812('0x5a')](_0x2b4c68);}})[_0xe812('0x2d')](function(_0x1df0d0){if(_0x1df0d0){_0x25b584=_0x1df0d0[_0xe812('0x3e')];if(!_0x588e0e[_0xe812('0x38')]['hasOwnProperty'](_0xe812('0x5b'))){_0x2b4c68[_0xe812('0x26')]=qs[_0xe812('0x26')](_0x588e0e[_0xe812('0x38')][_0xe812('0x26')]);_0x2b4c68[_0xe812('0x23')]=qs[_0xe812('0x23')](_0x588e0e[_0xe812('0x38')][_0xe812('0x23')]);}return _0x1b1de6[_0xe812('0x5a')](_0x2b4c68);}})[_0xe812('0x2d')](function(_0x71e7a3){if(_0x71e7a3){return _0x71e7a3?{'count':_0x25b584,'rows':_0x71e7a3}:null;}})['then'](respondWithResult(_0x286d80,null))[_0xe812('0x4a')](handleError(_0x286d80,null));};exports[_0xe812('0x5c')]=function(_0x6a0aba,_0x39dd5b,_0xae2751){return db['ChatGroup']['find']({'where':{'id':_0x6a0aba[_0xe812('0x4c')]['id']}})[_0xe812('0x2d')](handleEntityNotFound(_0x39dd5b,null))[_0xe812('0x2d')](function(_0x35074a){if(_0x35074a){return _0x35074a[_0xe812('0x5c')](_0x6a0aba[_0xe812('0x38')]['ids']);}})[_0xe812('0x2d')](respondWithStatusCode(_0x39dd5b,null))[_0xe812('0x4a')](handleError(_0x39dd5b,null));};exports['addMessage']=function(_0x534234,_0x24c6ea,_0xa3567e){if(_0x534234[_0xe812('0x50')]['id']){delete _0x534234[_0xe812('0x50')]['id'];}return db[_0xe812('0x34')][_0xe812('0x4e')]({'where':{'id':_0x534234[_0xe812('0x4c')]['id']}})['then'](handleEntityNotFound(_0x24c6ea,null))['then'](function(_0x1f1625){if(_0x1f1625){_0x534234[_0xe812('0x50')][_0xe812('0x5d')]=_0x1f1625['id'];return db[_0xe812('0x5e')][_0xe812('0x4f')](_0x534234[_0xe812('0x50')]);}})[_0xe812('0x2d')](respondWithResult(_0x24c6ea,null))['catch'](handleError(_0x24c6ea,null));};exports['getMessages']=function(_0x530d19,_0x4ef0a4,_0x137b55){var _0x1e3e99={};var _0x52cf6b={};var _0x112eb1;var _0x4f4149;return db[_0xe812('0x34')][_0xe812('0x5f')]({'where':{'id':_0x530d19[_0xe812('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ef0a4,null))[_0xe812('0x2d')](function(_0x1a2fcf){if(_0x1a2fcf){_0x112eb1=_0x1a2fcf;_0x52cf6b[_0xe812('0x3f')]=_['keys'](db[_0xe812('0x5e')]['rawAttributes']);_0x52cf6b[_0xe812('0x38')]=_[_0xe812('0x39')](_0x530d19['query']);_0x52cf6b[_0xe812('0x3a')]=_[_0xe812('0x3b')](_0x52cf6b[_0xe812('0x3f')],_0x52cf6b['query']);_0x1e3e99[_0xe812('0x3c')]=_[_0xe812('0x3b')](_0x52cf6b['model'],qs[_0xe812('0x3d')](_0x530d19[_0xe812('0x38')][_0xe812('0x3d')]));_0x1e3e99[_0xe812('0x3c')]=_0x1e3e99['attributes']['length']?_0x1e3e99[_0xe812('0x3c')]:_0x52cf6b[_0xe812('0x3f')];_0x1e3e99[_0xe812('0x60')]=qs[_0xe812('0x41')](_0x530d19['query']['sort']);_0x1e3e99['where']=qs['filters'](_[_0xe812('0x42')](_0x530d19[_0xe812('0x38')],_0x52cf6b[_0xe812('0x3a')]));if(_0x530d19[_0xe812('0x38')]['filter']){_0x1e3e99['where']=_[_0xe812('0x44')](_0x1e3e99[_0xe812('0x45')],{'$or':_['map'](_0x1e3e99[_0xe812('0x3c')],function(_0x99439c){var _0x458c19={};_0x458c19[_0x99439c]={'$like':'%'+_0x530d19[_0xe812('0x38')][_0xe812('0x43')]+'%'};return _0x458c19;})});}if(_0x530d19[_0xe812('0x38')]['$gte']){var _0x3d2d8e=_0x530d19['query'][_0xe812('0x61')][_0xe812('0x62')](',');var _0x44df2e={};_0x44df2e[_0x3d2d8e[0x0]]={'$gte':moment(_0x3d2d8e[0x1])[_0xe812('0x63')](_0xe812('0x64'))};_0x1e3e99['where']=_['merge'](_0x1e3e99[_0xe812('0x45')],_0x44df2e);}_0x1e3e99=_[_0xe812('0x44')]({},_0x1e3e99,_0x530d19[_0xe812('0x4d')]);return _0x112eb1[_0xe812('0x65')](_0x1e3e99);}})['then'](function(_0x294395){if(_0x294395){_0x4f4149=_0x294395[_0xe812('0x3e')];if(!_0x530d19['query'][_0xe812('0x40')](_0xe812('0x5b'))){_0x1e3e99[_0xe812('0x26')]=qs['limit'](_0x530d19[_0xe812('0x38')][_0xe812('0x26')]);_0x1e3e99[_0xe812('0x23')]=qs[_0xe812('0x23')](_0x530d19['query'][_0xe812('0x23')]);}return _0x112eb1[_0xe812('0x65')](_0x1e3e99);}})['then'](function(_0x19969e){if(_0x19969e){return _0x19969e?{'count':_0x4f4149,'rows':_0x19969e}:null;}})[_0xe812('0x2d')](respondWithResult(_0x4ef0a4,null))[_0xe812('0x4a')](handleError(_0x4ef0a4,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index d7886b2..114b4d5 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 _0xb7de=['hook','events','../../mysqldb','ChatGroup','save','update','remove','emit','hasOwnProperty'];(function(_0x4cb272,_0x52c0e9){var _0x57b4aa=function(_0x1efefb){while(--_0x1efefb){_0x4cb272['push'](_0x4cb272['shift']());}};_0x57b4aa(++_0x52c0e9);}(_0xb7de,0xc7));var _0xeb7d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb7de[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xeb7d('0x0'));var ChatGroup=require(_0xeb7d('0x1'))['db'][_0xeb7d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb7d('0x3'),'afterUpdate':_0xeb7d('0x4'),'afterDestroy':_0xeb7d('0x5')};function emitEvent(_0x219063){return function(_0x6b96c8,_0x57a908,_0x16d106){ChatGroupEvents[_0xeb7d('0x6')](_0x219063+':'+_0x6b96c8['id'],_0x6b96c8);ChatGroupEvents[_0xeb7d('0x6')](_0x219063,_0x6b96c8);_0x16d106(null);};}for(var e in events){if(events[_0xeb7d('0x7')](e)){var event=events[e];ChatGroup[_0xeb7d('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x8ff4=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xb3ba57,_0x3c90a8){var _0x5ce9d6=function(_0x4d66a9){while(--_0x4d66a9){_0xb3ba57['push'](_0xb3ba57['shift']());}};_0x5ce9d6(++_0x3c90a8);}(_0x8ff4,0x11f));var _0x48ff=function(_0x53be8d,_0x2cb53f){_0x53be8d=_0x53be8d-0x0;var _0x396d2c=_0x8ff4[_0x53be8d];return _0x396d2c;};'use strict';var EventEmitter=require(_0x48ff('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x48ff('0x1')](0x0);var events={'afterCreate':_0x48ff('0x2'),'afterUpdate':'update','afterDestroy':_0x48ff('0x3')};function emitEvent(_0xc4b32e){return function(_0x2e6166,_0x3fa416,_0x46de8a){ChatGroupEvents[_0x48ff('0x4')](_0xc4b32e+':'+_0x2e6166['id'],_0x2e6166);ChatGroupEvents[_0x48ff('0x4')](_0xc4b32e,_0x2e6166);_0x46de8a(null);};}for(var e in events){if(events[_0x48ff('0x5')](e)){var event=events[e];ChatGroup[_0x48ff('0x6')](e,emitEvent(event));}}module[_0x48ff('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 5ab3fe4..0ee351c 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 _0x6a46=['path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','api','bluebird','request-promise'];(function(_0x38d823,_0x27e64e){var _0x309d97=function(_0x230c68){while(--_0x230c68){_0x38d823['push'](_0x38d823['shift']());}};_0x309d97(++_0x27e64e);}(_0x6a46,0x1ab));var _0x66a4=function(_0x28df53,_0xb65281){_0x28df53=_0x28df53-0x0;var _0x1bc5a7=_0x6a46[_0x28df53];return _0x1bc5a7;};'use strict';var _=require(_0x66a4('0x0'));var util=require(_0x66a4('0x1'));var logger=require('../../config/logger')(_0x66a4('0x2'));var moment=require('moment');var BPromise=require(_0x66a4('0x3'));var rp=require(_0x66a4('0x4'));var fs=require('fs');var path=require(_0x66a4('0x5'));var rimraf=require(_0x66a4('0x6'));var config=require(_0x66a4('0x7'));var attributes=require(_0x66a4('0x8'));module[_0x66a4('0x9')]=function(_0xa4a946,_0xf6df99){return _0xa4a946[_0x66a4('0xa')]('ChatGroup',attributes,{'tableName':_0x66a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5d7=['rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x505473,_0x358249){var _0x1c466d=function(_0x525a9f){while(--_0x525a9f){_0x505473['push'](_0x505473['shift']());}};_0x1c466d(++_0x358249);}(_0xa5d7,0x94));var _0x7a5d=function(_0xba185f,_0x7c5e61){_0xba185f=_0xba185f-0x0;var _0x50c684=_0xa5d7[_0xba185f];return _0x50c684;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var logger=require(_0x7a5d('0x2'))(_0x7a5d('0x3'));var moment=require(_0x7a5d('0x4'));var BPromise=require(_0x7a5d('0x5'));var rp=require(_0x7a5d('0x6'));var fs=require('fs');var path=require(_0x7a5d('0x7'));var rimraf=require(_0x7a5d('0x8'));var config=require(_0x7a5d('0x9'));var attributes=require(_0x7a5d('0xa'));module['exports']=function(_0x7fa601,_0x27022e){return _0x7fa601[_0x7a5d('0xb')](_0x7a5d('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 5c021aa..b820020 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 _0x181d=['../../config/utils','rpc','../../config/environment','http','defaults','redis','localhost','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb'];(function(_0x13f95e,_0x2d0e36){var _0x5bfb57=function(_0x40f78a){while(--_0x40f78a){_0x13f95e['push'](_0x13f95e['shift']());}};_0x5bfb57(++_0x2d0e36);}(_0x181d,0x10f));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd181('0x0'));var BPromise=require('bluebird');var rs=require(_0xd181('0x1'));var fs=require('fs');var Redis=require(_0xd181('0x2'));var db=require(_0xd181('0x3'))['db'];var utils=require(_0xd181('0x4'));var logger=require('../../config/logger')(_0xd181('0x5'));var config=require(_0xd181('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd181('0x7')]({'port':0x232a});config['redis']=_[_0xd181('0x8')](config[_0xd181('0x9')],{'host':_0xd181('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd181('0x9')]));require(_0xd181('0xb'))[_0xd181('0xc')](socket);function respondWithRpcPromise(_0x74ef22,_0x103eee,_0x589470){return new BPromise(function(_0x51d3ce,_0x549dd2){return client['request'](_0x74ef22,_0x589470)[_0xd181('0xd')](function(_0x4cb3f6){logger['info'](_0xd181('0xe'),_0x103eee,_0xd181('0xf'));logger[_0xd181('0x10')](_0xd181('0x11'),_0x103eee,_0xd181('0xf'),JSON[_0xd181('0x12')](_0x4cb3f6));if(_0x4cb3f6[_0xd181('0x13')]){if(_0x4cb3f6[_0xd181('0x13')][_0xd181('0x14')]===0x1f4){logger[_0xd181('0x13')](_0xd181('0xe'),_0x103eee,_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);return _0x549dd2(_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);}logger[_0xd181('0x13')]('ChatGroup,\x20%s,\x20%s',_0x103eee,_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);return _0x51d3ce(_0x4cb3f6[_0xd181('0x13')]['message']);}else{logger[_0xd181('0x16')](_0xd181('0xe'),_0x103eee,_0xd181('0xf'));_0x51d3ce(_0x4cb3f6[_0xd181('0x17')][_0xd181('0x15')]);}})[_0xd181('0x18')](function(_0x483615){logger[_0xd181('0x13')](_0xd181('0xe'),_0x103eee,_0x483615);_0x549dd2(_0x483615);});});}
\ No newline at end of file
+var _0xc15b=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x50eb38,_0x2ee6ba){var _0x5de7bf=function(_0x3558c7){while(--_0x3558c7){_0x50eb38['push'](_0x50eb38['shift']());}};_0x5de7bf(++_0x2ee6ba);}(_0xc15b,0xe4));var _0xbc15=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xc15b[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0xbc15('0x0'));var util=require('util');var moment=require(_0xbc15('0x1'));var BPromise=require(_0xbc15('0x2'));var rs=require(_0xbc15('0x3'));var fs=require('fs');var Redis=require(_0xbc15('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc15('0x5'))(_0xbc15('0x6'));var config=require(_0xbc15('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xbc15('0x8')]=_[_0xbc15('0x9')](config[_0xbc15('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbc15('0xa'))['register'](socket);function respondWithRpcPromise(_0x2189d4,_0x42f0b9,_0x359eb9){return new BPromise(function(_0x551a7b,_0x413eda){return client[_0xbc15('0xb')](_0x2189d4,_0x359eb9)['then'](function(_0xc677d5){logger[_0xbc15('0xc')](_0xbc15('0xd'),_0x42f0b9,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x42f0b9,_0xbc15('0xe'),JSON[_0xbc15('0xf')](_0xc677d5));if(_0xc677d5[_0xbc15('0x10')]){if(_0xc677d5[_0xbc15('0x10')][_0xbc15('0x11')]===0x1f4){logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0xc677d5[_0xbc15('0x10')][_0xbc15('0x12')]);return _0x413eda(_0xc677d5[_0xbc15('0x10')][_0xbc15('0x12')]);}logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0xc677d5[_0xbc15('0x10')]['message']);return _0x551a7b(_0xc677d5[_0xbc15('0x10')]['message']);}else{logger[_0xbc15('0xc')](_0xbc15('0xd'),_0x42f0b9,_0xbc15('0xe'));_0x551a7b(_0xc677d5[_0xbc15('0x13')][_0xbc15('0x12')]);}})[_0xbc15('0x14')](function(_0x7e7826){logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0x7e7826);_0x413eda(_0x7e7826);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index be0e261..54db341 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 _0xb45f=['chatGroup:','./chatGroup.events','update','emit','removeListener','register','length'];(function(_0x1918e5,_0x30391b){var _0x5b194a=function(_0x3529ca){while(--_0x3529ca){_0x1918e5['push'](_0x1918e5['shift']());}};_0x5b194a(++_0x30391b);}(_0xb45f,0x6a));var _0xfb45=function(_0x23ed63,_0x2b031f){_0x23ed63=_0x23ed63-0x0;var _0x33aa6d=_0xb45f[_0x23ed63];return _0x33aa6d;};'use strict';var ChatGroupEvents=require(_0xfb45('0x0'));var events=['save','remove',_0xfb45('0x1')];function createListener(_0x78cef3,_0x3846d1){return function(_0x16242f){_0x3846d1[_0xfb45('0x2')](_0x78cef3,_0x16242f);};}function removeListener(_0x1ad7d5,_0x190adc){return function(){ChatGroupEvents[_0xfb45('0x3')](_0x1ad7d5,_0x190adc);};}exports[_0xfb45('0x4')]=function(_0x33109e){for(var _0x5a4386=0x0,_0x188b56=events[_0xfb45('0x5')];_0x5a4386<_0x188b56;_0x5a4386++){var _0x2c8cb9=events[_0x5a4386];var _0x5ec958=createListener(_0xfb45('0x6')+_0x2c8cb9,_0x33109e);ChatGroupEvents['on'](_0x2c8cb9,_0x5ec958);}};
\ No newline at end of file
+var _0x299b=['./chatGroup.events','remove','update','emit','removeListener','register','chatGroup:'];(function(_0x20a35e,_0x477112){var _0x52bbe7=function(_0x494529){while(--_0x494529){_0x20a35e['push'](_0x20a35e['shift']());}};_0x52bbe7(++_0x477112);}(_0x299b,0x118));var _0xb299=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x299b[_0x13843f];return _0x1063ae;};'use strict';var ChatGroupEvents=require(_0xb299('0x0'));var events=['save',_0xb299('0x1'),_0xb299('0x2')];function createListener(_0x25aaba,_0x500567){return function(_0x3a10ce){_0x500567[_0xb299('0x3')](_0x25aaba,_0x3a10ce);};}function removeListener(_0x1ca9ec,_0x26139d){return function(){ChatGroupEvents[_0xb299('0x4')](_0x1ca9ec,_0x26139d);};}exports[_0xb299('0x5')]=function(_0x5b3f02){for(var _0x37dc00=0x0,_0x3ed409=events['length'];_0x37dc00<_0x3ed409;_0x37dc00++){var _0x1eb304=events[_0x37dc00];var _0x41edbb=createListener(_0xb299('0x6')+_0x1eb304,_0x5b3f02);ChatGroupEvents['on'](_0x1eb304,_0x41edbb);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 8a95bf1..13ad9d6 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 _0x6dfc=['create','/:id/members','addMessage','put','/:id','update','delete','removeMembers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','getUnread','getMembers','/:id/messages','getMessages','post'];(function(_0x5bffa9,_0xc8bc4d){var _0x2c1643=function(_0x47ea52){while(--_0x47ea52){_0x5bffa9['push'](_0x5bffa9['shift']());}};_0x2c1643(++_0xc8bc4d);}(_0x6dfc,0x1d9));var _0xc6df=function(_0x496b41,_0x2678de){_0x496b41=_0x496b41-0x0;var _0x4e0c51=_0x6dfc[_0x496b41];return _0x4e0c51;};'use strict';var multer=require('multer');var util=require(_0xc6df('0x0'));var path=require(_0xc6df('0x1'));var timeout=require(_0xc6df('0x2'));var express=require(_0xc6df('0x3'));var router=express['Router']();var fs_extra=require(_0xc6df('0x4'));var auth=require(_0xc6df('0x5'));var interaction=require(_0xc6df('0x6'));var config=require(_0xc6df('0x7'));var controller=require(_0xc6df('0x8'));router[_0xc6df('0x9')]('/',auth[_0xc6df('0xa')](),controller[_0xc6df('0xb')]);router[_0xc6df('0x9')](_0xc6df('0xc'),auth[_0xc6df('0xa')](),controller[_0xc6df('0xd')]);router[_0xc6df('0x9')]('/:id',auth[_0xc6df('0xa')](),controller[_0xc6df('0xe')]);router[_0xc6df('0x9')]('/:id/unread',auth[_0xc6df('0xa')](),controller[_0xc6df('0xf')]);router[_0xc6df('0x9')]('/:id/members',auth[_0xc6df('0xa')](),controller[_0xc6df('0x10')]);router['get'](_0xc6df('0x11'),auth[_0xc6df('0xa')](),controller[_0xc6df('0x12')]);router[_0xc6df('0x13')]('/',auth['isAuthenticated'](),controller[_0xc6df('0x14')]);router['post'](_0xc6df('0x15'),auth[_0xc6df('0xa')](),controller['addMembers']);router[_0xc6df('0x13')](_0xc6df('0x11'),auth[_0xc6df('0xa')](),controller[_0xc6df('0x16')]);router[_0xc6df('0x17')](_0xc6df('0x18'),auth[_0xc6df('0xa')](),controller[_0xc6df('0x19')]);router[_0xc6df('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xc6df('0x1a')](_0xc6df('0x15'),auth[_0xc6df('0xa')](),controller[_0xc6df('0x1b')]);module[_0xc6df('0x1c')]=router;
\ No newline at end of file
+var _0xe0d8=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','put','delete','destroy','removeMembers','multer'];(function(_0x223a3e,_0x2da798){var _0x582005=function(_0x4adba8){while(--_0x4adba8){_0x223a3e['push'](_0x223a3e['shift']());}};_0x582005(++_0x2da798);}(_0xe0d8,0x185));var _0x8e0d=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0xe0d8[_0x3d4ef1];return _0x409423;};'use strict';var multer=require(_0x8e0d('0x0'));var util=require(_0x8e0d('0x1'));var path=require(_0x8e0d('0x2'));var timeout=require(_0x8e0d('0x3'));var express=require(_0x8e0d('0x4'));var router=express['Router']();var fs_extra=require(_0x8e0d('0x5'));var auth=require(_0x8e0d('0x6'));var interaction=require(_0x8e0d('0x7'));var config=require('../../config/environment');var controller=require(_0x8e0d('0x8'));router[_0x8e0d('0x9')]('/',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0xb')]);router[_0x8e0d('0x9')]('/describe',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0xc')]);router[_0x8e0d('0x9')](_0x8e0d('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8e0d('0xe'),auth[_0x8e0d('0xa')](),controller[_0x8e0d('0xf')]);router[_0x8e0d('0x9')](_0x8e0d('0x10'),auth['isAuthenticated'](),controller[_0x8e0d('0x11')]);router['get'](_0x8e0d('0x12'),auth[_0x8e0d('0xa')](),controller['getMessages']);router[_0x8e0d('0x13')]('/',auth['isAuthenticated'](),controller[_0x8e0d('0x14')]);router['post']('/:id/members',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x15')]);router[_0x8e0d('0x13')](_0x8e0d('0x12'),auth['isAuthenticated'](),controller['addMessage']);router[_0x8e0d('0x16')](_0x8e0d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8e0d('0x17')](_0x8e0d('0xd'),auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x18')]);router[_0x8e0d('0x17')](_0x8e0d('0x10'),auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index e3496f6..118ad12 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 _0x98e5=['long','DATE','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING'];(function(_0xaa442d,_0x3c65bf){var _0x191c19=function(_0x573216){while(--_0x573216){_0xaa442d['push'](_0xaa442d['shift']());}};_0x191c19(++_0x3c65bf);}(_0x98e5,0x8a));var _0x598e=function(_0x47b402,_0x1e84c2){_0x47b402=_0x47b402-0x0;var _0x2f4f6c=_0x98e5[_0x47b402];return _0x2f4f6c;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x598e('0x0')]},'ratingType':{'type':Sequelize[_0x598e('0x1')]('star',_0x598e('0x2')),'defaultValue':_0x598e('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x598e('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x598e('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x598e('0x5')]},'note':{'type':Sequelize[_0x598e('0x5')]},'browserName':{'type':Sequelize[_0x598e('0x5')]},'browserVersion':{'type':Sequelize[_0x598e('0x5')]},'osName':{'type':Sequelize[_0x598e('0x5')]},'osVersion':{'type':Sequelize[_0x598e('0x5')]},'deviceModel':{'type':Sequelize[_0x598e('0x5')]},'deviceVendor':{'type':Sequelize[_0x598e('0x5')]},'deviceType':{'type':Sequelize[_0x598e('0x5')]},'referer':{'type':Sequelize[_0x598e('0x4')]},'customerIp':{'type':Sequelize[_0x598e('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x598e('0x6'))},'read1stAt':{'type':Sequelize[_0x598e('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x598e('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x598e('0x5')]},'customerPort':{'type':Sequelize[_0x598e('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x598e('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x598e('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x38c9=['long','out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x3d0719,_0x53156d){var _0x1eedfd=function(_0xc07d52){while(--_0xc07d52){_0x3d0719['push'](_0x3d0719['shift']());}};_0x1eedfd(++_0x53156d);}(_0x38c9,0x199));var _0x938c=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x38c9[_0x2f4c1c];return _0x25e0f2;};'use strict';var Sequelize=require(_0x938c('0x0'));module[_0x938c('0x1')]={'closed':{'type':Sequelize[_0x938c('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x938c('0x3')](_0x938c('0x4'),_0x938c('0x5')),'defaultValue':_0x938c('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x938c('0x6')]},'mailTranscript':{'type':Sequelize[_0x938c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x938c('0x8')]},'disposition':{'type':Sequelize[_0x938c('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x938c('0x7')]},'note':{'type':Sequelize[_0x938c('0x7')]},'browserName':{'type':Sequelize[_0x938c('0x7')]},'browserVersion':{'type':Sequelize[_0x938c('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x938c('0x7')]},'deviceVendor':{'type':Sequelize[_0x938c('0x7')]},'deviceType':{'type':Sequelize[_0x938c('0x7')]},'referer':{'type':Sequelize[_0x938c('0x6')]},'customerIp':{'type':Sequelize[_0x938c('0x7')]},'formData':{'type':Sequelize[_0x938c('0x6')](_0x938c('0x9'))},'read1stAt':{'type':Sequelize[_0x938c('0x8')]},'lastMsgAt':{'type':Sequelize[_0x938c('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x938c('0x3')]('in',_0x938c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x938c('0x7')]},'customerPort':{'type':Sequelize[_0x938c('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x938c('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x938c('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 1276523..d1efeb8 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(_0x24ed0d,_0x1f60b0){var _0x489e1b=function(_0x5735ac){while(--_0x5735ac){_0x24ed0d['push'](_0x24ed0d['shift']());}};_0x489e1b(++_0x1f60b0);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'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 _0xbaf0=['../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','isNull','vidaooNote','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','mimetype','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','findAll','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','firstName','lastName','Attachment','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x10c988,_0x1a5956){var _0x4a4dcd=function(_0x4d96da){while(--_0x4d96da){_0x10c988['push'](_0x10c988['shift']());}};_0x4a4dcd(++_0x1a5956);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var pdf=require(_0x0baf('0x16'));var hardwareService=require(_0x0baf('0x17'));var logger=require(_0x0baf('0x18'))(_0x0baf('0x19'));var utils=require(_0x0baf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0baf('0x1b'))['db'];config[_0x0baf('0x1c')]=_[_0x0baf('0x1d')](config[_0x0baf('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0x1e'))(new Redis(config['redis']));require(_0x0baf('0x1f'))[_0x0baf('0x20')](socket);var jayson=require(_0x0baf('0x21'));var client=jayson[_0x0baf('0x22')][_0x0baf('0x23')]({'port':0x232b});var client9004=jayson[_0x0baf('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd79d,_0x2312c7,_0x38395b,_0x283408){return new BPromise(function(_0x3d83a3,_0x2cf7da){var _0x288a98=_0x283408||client;return _0x288a98['request'](_0x4cd79d,_0x38395b)[_0x0baf('0x24')](function(_0xfbecec){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x2312c7,_0x0baf('0x27'));logger[_0x0baf('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2312c7,'request\x20sent',JSON[_0x0baf('0x29')](_0xfbecec));if(_0xfbecec[_0x0baf('0x2a')]){if(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2b')]===0x1f4){logger[_0x0baf('0x2a')](_0x0baf('0x26'),_0x2312c7,_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);return _0x2cf7da(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);}logger['error'](_0x0baf('0x26'),_0x2312c7,_0xfbecec['error'][_0x0baf('0x2c')]);return _0x3d83a3(_0xfbecec['error']['message']);}else{logger[_0x0baf('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,'request\x20sent');_0x3d83a3(_0xfbecec[_0x0baf('0x2d')][_0x0baf('0x2c')]);}})[_0x0baf('0x2e')](function(_0x19d9fd){logger[_0x0baf('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,_0x19d9fd);_0x2cf7da(_0x19d9fd);});});}function respondWithStatusCode(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2f')](_0x4681c5);}return _0x448617[_0x0baf('0x30')](_0x4681c5)[_0x0baf('0x31')]();};}function respondWithResult(_0x453525,_0x549fd0){_0x549fd0=_0x549fd0||0xc8;return function(_0x1590b4){if(_0x1590b4){return _0x453525[_0x0baf('0x30')](_0x549fd0)[_0x0baf('0x32')](_0x1590b4);}};}function respondWithFilteredResult(_0x265915,_0x55c715){return function(_0x29dbdf){if(_0x29dbdf){var _0x34a58a=typeof _0x55c715['offset']===_0x0baf('0x33')&&typeof _0x55c715[_0x0baf('0x34')]===_0x0baf('0x33');var _0xb4dbb1=_0x29dbdf[_0x0baf('0x35')];var _0x366924=_0x34a58a?0x0:_0x55c715[_0x0baf('0x36')];var _0x57476f=_0x34a58a?_0x29dbdf[_0x0baf('0x35')]:_0x55c715[_0x0baf('0x36')]+_0x55c715[_0x0baf('0x34')];var _0x3ed995;if(_0x57476f>=_0xb4dbb1){_0x57476f=_0xb4dbb1;_0x3ed995=0xc8;}else{_0x3ed995=0xce;}_0x265915[_0x0baf('0x30')](_0x3ed995);return _0x265915[_0x0baf('0x37')](_0x0baf('0x38'),_0x366924+'-'+_0x57476f+'/'+_0xb4dbb1)[_0x0baf('0x32')](_0x29dbdf);}return null;};}function patchUpdates(_0x59431b){return function(_0x3ded64){try{jsonpatch[_0x0baf('0x39')](_0x3ded64,_0x59431b,!![]);}catch(_0x165d14){return BPromise[_0x0baf('0x3a')](_0x165d14);}return _0x3ded64[_0x0baf('0x3b')]();};}function saveUpdates(_0x57a6bb,_0x2fd426){return function(_0x53ae1d){if(_0x53ae1d){return _0x53ae1d[_0x0baf('0x3c')](_0x57a6bb)[_0x0baf('0x24')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x3d65f2,_0x5300a5){return function(_0x1a2b03){if(_0x1a2b03){return _0x1a2b03[_0x0baf('0x3d')]()['then'](function(){_0x3d65f2[_0x0baf('0x30')](0xcc)[_0x0baf('0x31')]();});}};}function handleEntityNotFound(_0x62a2ed,_0xbaa9a7){return function(_0x1f60bd){if(!_0x1f60bd){_0x62a2ed[_0x0baf('0x2f')](0x194);}return _0x1f60bd;};}function handleError(_0xe03d82,_0x675461){_0x675461=_0x675461||0x1f4;return function(_0x4aa6ed){logger[_0x0baf('0x2a')](_0x4aa6ed[_0x0baf('0x3e')]);if(_0x4aa6ed['name']){delete _0x4aa6ed[_0x0baf('0x3f')];}_0xe03d82['status'](_0x675461)['send'](_0x4aa6ed);};}function getMustacheRender(_0x11bc49,_0x81af83){return Mustache['render'](_0x11bc49,_['merge'](_0x81af83[_0x0baf('0x40')],{'contact':_0x81af83[_0x0baf('0x41')],'message':_0x81af83[_0x0baf('0x2c')],'agent':_0x81af83[_0x0baf('0x42')],'interaction':_0x81af83[_0x0baf('0x43')],'account':_0x81af83[_0x0baf('0x44')]}))||'';}function getInteractionUsers(_0x290464,_0x37c038){return new BPromise(function(_0x631f74,_0x36c6d2){try{if(_0x37c038[_0x290464['id']]){_0x290464[_0x0baf('0x45')]=_[_0x0baf('0x46')](_0x37c038[_0x290464['id']],function(_0x354cb1){return{'id':_0x354cb1['id'],'fullname':_0x354cb1[_0x0baf('0x47')]};});}}catch(_0x53d6b7){_0x36c6d2(_0x53d6b7);}_0x631f74(_0x290464);});}function getInteractionTags(_0x3573ce,_0x1435d5){return new BPromise(function(_0x4f1de9,_0x38006a){try{if(_0x3573ce[_0x0baf('0x48')]){_0x3573ce[_0x0baf('0x49')]=[];_0x3573ce[_0x0baf('0x48')][_0x0baf('0x4a')](',')[_0x0baf('0x4b')](function(_0x57b581){_0x3573ce[_0x0baf('0x49')][_0x0baf('0x4c')](_0x1435d5[_0x57b581]);});}delete _0x3573ce['TagIds'];}catch(_0x35d442){_0x38006a(_0x35d442);}_0x4f1de9(_0x3573ce);});}function updateChatInteraction(_0x412e6f,_0x45c6aa,_0x57903e){return new BPromise(function(_0x504031,_0x193fd3){return getInteractionUsers(_0x412e6f,_0x57903e)[_0x0baf('0x24')](function(_0x301412){return getInteractionTags(_0x301412,_0x45c6aa);})[_0x0baf('0x24')](function(_0x2b6d54){_0x504031(_0x2b6d54);})[_0x0baf('0x2e')](function(_0x33da34){_0x193fd3(_0x33da34);});});}exports[_0x0baf('0x4d')]=function(_0xce1bf0,_0x355033){var _0x56270e={},_0x2a2a7c={},_0x2bc755={'count':0x0,'rows':[]};var _0x1daf1d=_[_0x0baf('0x46')](db[_0x0baf('0x4e')]['rawAttributes'],function(_0x1e7364){return{'name':_0x1e7364[_0x0baf('0x4f')],'type':_0x1e7364[_0x0baf('0x50')][_0x0baf('0x51')]};});_0x2a2a7c[_0x0baf('0x52')]=_['map'](_0x1daf1d,_0x0baf('0x3f'));_0x2a2a7c[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0xce1bf0[_0x0baf('0x53')]);_0x2a2a7c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],_0x2a2a7c['query']);_0x56270e[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],qs['fields'](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]));_0x56270e[_0x0baf('0x57')]=_0x56270e[_0x0baf('0x57')][_0x0baf('0x59')]?_0x56270e[_0x0baf('0x57')]:_0x2a2a7c[_0x0baf('0x52')];if(!_0xce1bf0['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x56270e[_0x0baf('0x34')]=qs[_0x0baf('0x34')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x34')]);_0x56270e[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x56270e[_0x0baf('0x5c')]=qs['sort'](_0xce1bf0['query'][_0x0baf('0x5d')]);_0x56270e[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0xce1bf0[_0x0baf('0x53')],_0x2a2a7c[_0x0baf('0x55')]),_0x1daf1d);var _0x3403d5=[];var _0x4b492c=squel[_0x0baf('0x60')]()[_0x0baf('0x61')]('id')[_0x0baf('0x61')](_0x0baf('0x3f'))[_0x0baf('0x61')](_0x0baf('0x62'))['from'](_0x0baf('0x63'));var _0x5f123c=squel[_0x0baf('0x60')]()['field'](_0x0baf('0x64'))['field'](_0x0baf('0x65'))['field'](_0x0baf('0x66'))[_0x0baf('0x67')](_0x0baf('0x68'),'ui')[_0x0baf('0x69')](_0x0baf('0x6a'),'u','u.id\x20=\x20ui.UserId');var _0x21f179=squel[_0x0baf('0x60')]()[_0x0baf('0x67')](_0x0baf('0x6b'),'i')[_0x0baf('0x69')](_0x0baf('0x6c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0baf('0x69')](_0x0baf('0x6a'),'o',_0x0baf('0x6d'))[_0x0baf('0x69')](_0x0baf('0x6e'),'a',_0x0baf('0x6f'))[_0x0baf('0x69')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x0baf('0x69')](_0x0baf('0x70'),'it',_0x0baf('0x71'))[_0x0baf('0x69')](_0x0baf('0x63'),'t',_0x0baf('0x72'));var _0xaa4293=squel[_0x0baf('0x73')]();var _0x3d9a32=[];var _0x585969=squel[_0x0baf('0x73')]();var _0x268be8;if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]){_0x268be8=as[_0x0baf('0x75')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]);var _0x51d75f=_0x268be8[_0x0baf('0x76')];for(var _0x27f580=0x0;_0x27f580<_0x268be8[_0x0baf('0x77')][_0x0baf('0x59')];_0x27f580++){var _0x1c7d88=_0x268be8[_0x0baf('0x77')][_0x27f580];var _0x14e6d0='i';var _0x12543e=_['find'](_0x1daf1d,[_0x0baf('0x3f'),_0x1c7d88['field']]);if(!_0x12543e){switch(_0x1c7d88[_0x0baf('0x61')]){case'unreadMessages':if(_0x1c7d88['value']==0x1){_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x79'));}else{_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x7a'));}break;case _0x0baf('0x7b'):if(_0x1c7d88[_0x0baf('0x7c')]==='$substring'){if(_0x1c7d88['value'][_0x0baf('0x4a')]('\x20')[_0x0baf('0x59')]>0x1){_0xaa4293[_0x51d75f](_0x0baf('0x7d'),qs[_0x0baf('0x7e')](_0x1c7d88[_0x0baf('0x7f')]),null);}else{var _0x588b88='%'+_0x1c7d88[_0x0baf('0x7f')]+'%';_0xaa4293[_0x51d75f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x588b88,_0x588b88,_0x588b88);}}else{_0x12543e=_['find'](_0x1daf1d,['name',_0x0baf('0x80')]);_0x1c7d88['field']='ContactId';_0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);}break;case _0x0baf('0x84'):var _0x1a0a67=_0x1c7d88[_0x0baf('0x7f')][_0x0baf('0x4a')](',')[_0x0baf('0x46')](function(_0x1273f4){return Number(_0x1273f4);});_0x1a0a67['forEach'](function(_0x42e8ad){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x42e8ad+',%');});_0x3d9a32=_[_0x0baf('0x86')](_0x3d9a32,_0x1a0a67);break;case'User':if(_0x1c7d88[_0x0baf('0x7c')]===_0x0baf('0x87')){_0xaa4293[_0x51d75f](_0x0baf('0x88'),'%'+_0x1c7d88[_0x0baf('0x7f')]+'%',null);}else{_0x12543e=_[_0x0baf('0x89')](_0x1daf1d,[_0x0baf('0x3f'),_0x0baf('0x8a')]);_0x1c7d88['field']='UserId';_0xf45ec3=as['buildExpression'](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}break;case'body':_0xf45ec3=as['buildExpression']('me',null,_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3['value'][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);break;}}else{var _0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}}}else{var _0xfcc697=_(_0xce1bf0['query'])['keys']()['map'](function(_0x493784){return _['some'](_0x1daf1d,[_0x0baf('0x3f'),_0x493784])?_0x493784:undefined;})[_0x0baf('0x8b')]()[_0x0baf('0x7f')]();if(!_[_0x0baf('0x8c')](_0xfcc697)){_0xfcc697['forEach'](function(_0x1be7f2){if(_0x1be7f2===_0x0baf('0x8d')){_0x21f179['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x0baf('0x8e')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]));}else if(_0x1be7f2===_0x0baf('0x8f')){var _0x442e5f=JSON[_0x0baf('0x90')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x91')];var _0x399f40=JSON['parse'](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x92')];_0x21f179['where'](_0x0baf('0x93'),_0x442e5f,_0x399f40);}else{if(_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]==='null'){_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x94'));}else{_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x95'),_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]);}}});}if(_0xce1bf0['query']['read']){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x96')]==0x1){_0x21f179['having'](_0x0baf('0x97'));}else{_0x21f179[_0x0baf('0x78')](_0x0baf('0x98'));}}if(_0xce1bf0['query'][_0x0baf('0x99')]){_0x3d9a32=_[_0x0baf('0x9a')](_0xce1bf0[_0x0baf('0x53')]['tag'])?_0xce1bf0[_0x0baf('0x53')]['tag']:new Array(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x99')]);_0x3d9a32[_0x0baf('0x4b')](function(_0x2f009f){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x2f009f+',%');});}if(_0xce1bf0['query'][_0x0baf('0x9b')]){var _0x57f33c=_0xce1bf0['query'][_0x0baf('0x9b')][_0x0baf('0x9c')]('\x5c','\x5c\x5c')[_0x0baf('0x9c')](/'/g,'\x27\x27');if(qs[_0x0baf('0x9d')](_0x57f33c)){_0xaa4293['or'](_0x0baf('0x9e'),_0x57f33c+'%');}else{_0xaa4293['or'](_0x0baf('0x9f'),qs[_0x0baf('0x7e')](_0x57f33c))['or'](_0x0baf('0xa0'),_0x57f33c+'%');}}}_0x21f179[_0x0baf('0x5e')](_0xaa4293);_0x21f179[_0x0baf('0xa1')](_0x0baf('0xa2'));var _0x2c2f09={'type':db['Sequelize']['QueryTypes'][_0x0baf('0xa3')],'raw':!![]};var _0x322a09=_0x21f179[_0x0baf('0xa4')]();_0x322a09['field']('i.id');_0x322a09[_0x0baf('0x61')](_0x0baf('0xa5'),_0x0baf('0xa6'));if(_0x56270e[_0x0baf('0x5c')]){_0x56270e[_0x0baf('0x5c')][_0x0baf('0x4b')](function(_0x191d35){var _0xa2d315=_0x191d35[0x0]===_0x0baf('0xa7')?_0x191d35[0x0]:'i.'+_0x191d35[0x0];_0x21f179['order'](_0xa2d315,_0x191d35[0x1]===_0x0baf('0xa8')?![]:!![]);});}if(!_[_0x0baf('0x8c')](_0x3d9a32)){_0x21f179[_0x0baf('0x78')](_0x585969);_0x322a09[_0x0baf('0x5e')]('t.id\x20IN\x20?',_0x3d9a32);}BPromise['resolve']()['then'](function(){if(!_0x268be8){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return;_0x322a09['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x21f179[_0x0baf('0x5e')](_0x0baf('0xa9'));return;}if(_0xce1bf0['user'][_0x0baf('0xaa')]!==_0x0baf('0x42'))return;return _0xce1bf0[_0x0baf('0xab')][_0x0baf('0xac')]({'attributes':['id'],'raw':!![]})[_0x0baf('0x24')](function(_0x25081e){if(_[_0x0baf('0x8c')](_0x25081e)){_0x322a09[_0x0baf('0x5e')](_0x0baf('0xad'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xad'));}else{_0x322a09[_0x0baf('0x5e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0baf('0x46')](_0x25081e,'id'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xae'),_[_0x0baf('0x46')](_0x25081e,'id'));}});})[_0x0baf('0x24')](function(){if(_0xce1bf0[_0x0baf('0xab')]['role']===_0x0baf('0x42')&&!_0x268be8&&!_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return[];return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x322a09['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x30eac8){_0x2bc755[_0x0baf('0x35')]=_0x30eac8[_0x0baf('0x59')];if(_0x2bc755[_0x0baf('0x35')]===0x0)return[];return db['sequelize']['query'](_0x4b492c[_0x0baf('0xb0')](),_0x2c2f09)['then'](function(_0x477cd5){_0x3403d5=_['keyBy'](_0x477cd5,'id');_0x2c2f09=_[_0x0baf('0xb1')](_0x2c2f09,{'model':db[_0x0baf('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]){_0x56270e['attributes'][_0x0baf('0x4b')](function(_0x106ffa){_0x21f179[_0x0baf('0x61')]('i.'+_0x106ffa);});}else{_0x21f179['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x21f179['field'](_0x0baf('0xb2'),_0x0baf('0xb3'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xb4'),'Account.mandatoryDisposition');_0x21f179[_0x0baf('0x61')](_0x0baf('0xb5'),_0x0baf('0xa7'));_0x21f179['field'](_0x0baf('0xb6'));_0x21f179[_0x0baf('0x61')]('c.firstName',_0x0baf('0xb7'));_0x21f179['field'](_0x0baf('0xb8'),_0x0baf('0xb9'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xba'),'Contact.email');_0x21f179['field'](_0x0baf('0xbb'),'Contact.phone');_0x21f179[_0x0baf('0x61')](_0x0baf('0xbc'),_0x0baf('0xbd'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xbe'),'Contact.fax');_0x21f179[_0x0baf('0x61')]('o.fullname',_0x0baf('0xbf'));_0x21f179['field'](_0x0baf('0xc0'),'Owner.internal');_0x21f179[_0x0baf('0x61')](_0x0baf('0xc1'),_0x0baf('0x48'));}if(_0x56270e['limit'])_0x21f179['limit'](_0x56270e[_0x0baf('0x34')]);if(_0x56270e[_0x0baf('0x36')])_0x21f179[_0x0baf('0x36')](_0x56270e[_0x0baf('0x36')]);return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x21f179['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x5ee37f){if(_0x5ee37f[_0x0baf('0x59')]>0x0)_0x5f123c['where'](_0x0baf('0xc2'),_[_0x0baf('0x46')](_0x5ee37f,'id'));return db[_0x0baf('0xaf')]['query'](_0x5f123c[_0x0baf('0xb0')](),_0x2c2f09)[_0x0baf('0x24')](function(_0x4879b4){var _0x544498=_[_0x0baf('0xc3')](_0x4879b4,_0x0baf('0xc4'));var _0x20dd04=[];_0x5ee37f[_0x0baf('0x4b')](function(_0x4823a3){_0x20dd04['push'](updateChatInteraction(_0x4823a3,_0x3403d5,_0x544498));});return BPromise[_0x0baf('0xc5')](_0x20dd04);});});})[_0x0baf('0x24')](function(_0x116d52){_0x2bc755[_0x0baf('0xc6')]=_0x116d52;return _0x2bc755;})[_0x0baf('0x24')](respondWithFilteredResult(_0x355033,_0x56270e))[_0x0baf('0x2e')](handleError(_0x355033,null));};exports[_0x0baf('0xc7')]=function(_0xe0b67c,_0x205de6){var _0x2369f0={'raw':![],'where':{'id':_0xe0b67c[_0x0baf('0xc8')]['id']}},_0x58f95c={};_0x58f95c['model']=_[_0x0baf('0x54')](db[_0x0baf('0x4e')][_0x0baf('0xc9')]);_0x58f95c[_0x0baf('0x53')]=_['keys'](_0xe0b67c[_0x0baf('0x53')]);_0x58f95c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],_0x58f95c[_0x0baf('0x53')]);_0x2369f0[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0xe0b67c['query'][_0x0baf('0x58')]));_0x2369f0[_0x0baf('0x57')]=_0x2369f0['attributes'][_0x0baf('0x59')]?_0x2369f0[_0x0baf('0x57')]:_0x58f95c[_0x0baf('0x52')];if(_0xe0b67c[_0x0baf('0x53')][_0x0baf('0xca')]){_0x2369f0[_0x0baf('0xcb')]=[{'all':!![]}];}_0x2369f0=_[_0x0baf('0xb1')]({},_0x2369f0,_0xe0b67c[_0x0baf('0xcc')]);return db[_0x0baf('0x4e')]['find'](_0x2369f0)[_0x0baf('0x24')](handleEntityNotFound(_0x205de6,null))[_0x0baf('0x24')](respondWithResult(_0x205de6,null))[_0x0baf('0x2e')](handleError(_0x205de6,null));};exports[_0x0baf('0xcd')]=function(_0x4328d5,_0x270d69){return db['ChatInteraction'][_0x0baf('0xcd')](_0x4328d5[_0x0baf('0x40')],{})[_0x0baf('0x24')](respondWithResult(_0x270d69,0xc9))['catch'](handleError(_0x270d69,null));};exports['update']=function(_0x5adbd9,_0x1adb84){if(_0x5adbd9[_0x0baf('0x40')]['id']){delete _0x5adbd9['body']['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x5adbd9[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1adb84,null))[_0x0baf('0x24')](saveUpdates(_0x5adbd9[_0x0baf('0x40')],null))['then'](respondWithResult(_0x1adb84,null))[_0x0baf('0x2e')](handleError(_0x1adb84,null));};exports[_0x0baf('0x3d')]=function(_0x25d25e,_0x4494de){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x25d25e[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4494de,null))[_0x0baf('0x24')](removeEntity(_0x4494de,null))[_0x0baf('0x2e')](handleError(_0x4494de,null));};exports[_0x0baf('0xce')]=function(_0x2e1629,_0x275cc4){return db[_0x0baf('0x4e')][_0x0baf('0xce')]()[_0x0baf('0x24')](respondWithResult(_0x275cc4,null))[_0x0baf('0x2e')](handleError(_0x275cc4,null));};exports[_0x0baf('0xcf')]=function(_0x308b3f,_0xae8bc2){var _0x1390cd=_0x308b3f[_0x0baf('0xc8')]['id'];var _0x59dd6c;var _0x57b64b;var _0x1cd215;return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x1390cd}})[_0x0baf('0x24')](function(_0x52e98a){_0x59dd6c=_0x52e98a;return db[_0x0baf('0xd1')][_0x0baf('0xd0')]({'where':{'id':_0x52e98a[_0x0baf('0x8d')]},'attributes':['id',_0x0baf('0xd2'),_0x0baf('0xd3'),_0x0baf('0xd4'),'vidaooNote',_0x0baf('0xd5')],'raw':!![]});})[_0x0baf('0x24')](function(_0x347c39){if(_0x347c39&&_0x347c39['vidaooApiKey']&&_0x347c39[_0x0baf('0xd3')]){_0x57b64b=_0x347c39;var _0x106c6e={'interaction':{'id':_0x1390cd},'agent':{'id':_0x308b3f[_0x0baf('0xab')]['id'],'name':_0x308b3f['user']['name'],'fullname':_0x308b3f['user'][_0x0baf('0x47')],'email':_0x308b3f['user'][_0x0baf('0xd6')]},'contact':_0x308b3f[_0x0baf('0x40')]['contact'],'account':_0x308b3f[_0x0baf('0x40')]['account']};var _0x5737b0={'rejectUnauthorized':![],'method':_0x0baf('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x347c39[_0x0baf('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x308b3f['user']['email']],'buttons':null,'topic':_0x57b64b['vidaooTopic'],'note':_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd9')])?null:getMustacheRender(_0x57b64b[_0x0baf('0xd9')],_0x106c6e),'metadata':null},'redirect':_0x0baf('0xda'),'json':!![]};try{if(!_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd5')])){var _0x20582a=getMustacheRender(_0x57b64b['vidaooMetadata'],_0x106c6e);var _0x36cd08=JSON[_0x0baf('0x90')](_0x20582a);_0x5737b0[_0x0baf('0x40')]['metadata']=_0x36cd08;}}catch(_0x24672f){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5737b0);}else{throw new db[(_0x0baf('0xdb'))]['ValidationError'](_0x0baf('0xdd'));}})[_0x0baf('0x24')](function(_0x57846e){_0x1cd215=_0x57846e;if(_0x1cd215['id']){var _0xd4ed40={'body':_0x1cd215[_0x0baf('0xde')],'ChatWebsiteId':_0x57b64b['id'],'ChatInteractionId':_0x59dd6c['id'],'direction':_0x0baf('0xdf'),'UserId':_0x308b3f[_0x0baf('0xab')]['id']};return db['ChatMessage'][_0x0baf('0xcd')](_0xd4ed40,{});}else{throw new db[(_0x0baf('0xdb'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x0baf('0x24')](function(){return _0x59dd6c[_0x0baf('0xe0')]({'vidaooSessionId':_0x1cd215['id']});})[_0x0baf('0x24')](respondWithResult(_0xae8bc2,null))[_0x0baf('0x2e')](handleError(_0xae8bc2,null));};exports['customUpdate']=function(_0x5571d4,_0x16579f){if(_0x5571d4[_0x0baf('0x40')]['id']){delete _0x5571d4[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x5571d4['params']['id']},'include':[{'model':db[_0x0baf('0xe1')],'as':_0x0baf('0x7b')}]})['then'](handleEntityNotFound(_0x16579f,null))[_0x0baf('0x24')](saveUpdates(_0x5571d4[_0x0baf('0x40')],null))['then'](respondWithResult(_0x16579f,null))[_0x0baf('0x2e')](handleError(_0x16579f,null));};exports[_0x0baf('0xe2')]=function(_0x19457c,_0x1f0b00,_0x2484d4){if(_0x19457c[_0x0baf('0x40')]['id']){delete _0x19457c[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x19457c[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](function(_0x226edd){if(!_0x226edd){logger[_0x0baf('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0baf('0xe2'),0x194,_0x0baf('0xe3'));_0x1f0b00['sendStatus'](0x194);}else{if(_0x226edd[_0x0baf('0x8a')]){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))](_0x0baf('0xe4'));}}return _0x226edd;})['then'](function(_0x3ca1a6){if(_0x3ca1a6){return _0x3ca1a6[_0x0baf('0x3c')]({'closed':_0x19457c[_0x0baf('0x40')][_0x0baf('0xe5')],'disposition':_0x19457c[_0x0baf('0x40')]['disposition']})[_0x0baf('0x24')](function(_0xc5ec1a){return _0xc5ec1a;});}})[_0x0baf('0x24')](function(_0x5d33b4){return respondWithRpcPromise(_0x0baf('0xe6'),_0x0baf('0xe2'),_0x19457c[_0x0baf('0x40')],client9004);})[_0x0baf('0x24')](respondWithResult(_0x1f0b00,null))[_0x0baf('0x2e')](handleError(_0x1f0b00,null));};exports['attachmentUpload']=function(_0x553084,_0x19898e,_0x315ada){_0x553084[_0x0baf('0x40')]['name']=_0x553084[_0x0baf('0xe7')][_0x0baf('0xe8')];_0x553084[_0x0baf('0x40')][_0x0baf('0xe9')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xea')];_0x553084[_0x0baf('0x40')][_0x0baf('0x50')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xeb')];return db['Attachment'][_0x0baf('0xcd')](_0x553084[_0x0baf('0x40')])[_0x0baf('0x24')](respondWithResult(_0x19898e,0xc9))[_0x0baf('0x2e')](handleError(_0x19898e,null));};exports['attachmentDownload']=function(_0x413d0d,_0x3d7667,_0x386928){return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0xc8')]['id']},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null))[_0x0baf('0x24')](function(_0x1e4bf1){if(_0x1e4bf1){if(_0x1e4bf1['closed']){return _0x3d7667[_0x0baf('0x30')](0x193)[_0x0baf('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0x53')][_0x0baf('0xec')]},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null));}})[_0x0baf('0x24')](function(_0xb22125){if(_0xb22125){var _0x37c83a=_0xb22125['ChatOfflineMessageId']!==null;var _0x5deb7b=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0xef'));if(_0x37c83a){_0x5deb7b=path['join'](_0x5deb7b,_0x0baf('0xf0'));}var _0x3a6bf8=path['join'](_0x5deb7b,_0xb22125[_0x0baf('0xe9')]);return _0x3d7667[_0x0baf('0xf1')](_0x3a6bf8);}})['catch'](handleError(_0x3d7667,null));};exports[_0x0baf('0xf2')]=function(_0x9d6974,_0x939365){var _0x4d6ac4=null;var _0x1d86c9=null;var _0x95fe84=null;var _0x2a7138=null;if(_0x9d6974[_0x0baf('0x40')]['id']){delete _0x9d6974[_0x0baf('0x40')]['id'];}if(_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]){_0x2a7138=path['join'](config[_0x0baf('0xee')],'server/files/chat/upload/',util[_0x0baf('0xf4')](_0x0baf('0xf5'),Date['now']()));_0x9d6974['body'][_0x0baf('0xf6')]=_0x2a7138;}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x9d6974['params']['id']},'include':[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'include':[{'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9')}]}]})[_0x0baf('0x24')](handleEntityNotFound(_0x939365,null))[_0x0baf('0x24')](saveUpdates(_0x9d6974[_0x0baf('0x40')],null))[_0x0baf('0x24')](function(_0x5f3691){if(_0x5f3691){_0x4d6ac4=_0x5f3691;return db['ChatWebsite'][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x8d')]}});}})['then'](function(_0x210047){if(_0x210047){_0x95fe84=_0x210047;return db[_0x0baf('0xe1')][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x80')]}});}})[_0x0baf('0x24')](function(_0x8806f9){if(_0x8806f9){_0x1d86c9=_0x8806f9;if(_0x2a7138){var _0x1cb69a=null;for(var _0x4bc31f=0x1;_0x4bc31f<_0x4d6ac4[_0x0baf('0xf8')]['length'];++_0x4bc31f){_0x1cb69a=_0x4d6ac4[_0x0baf('0xf8')][_0x4bc31f];var _0x32abf2=_0x1cb69a['UserId']?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');var _0x4759d5=_0x9d6974[_0x0baf('0x40')][_0x0baf('0xfd')]||util['format']('%s%d','Visitor',_0x1cb69a[_0x0baf('0x80')]);switch(_0x95fe84['agentIdentifier']){case _0x0baf('0xfe'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format']('%s%d',_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');break;case _0x0baf('0xff'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x100')]||_0x1cb69a[_0x0baf('0xf9')][_0x0baf('0x47')]:_0x0baf('0xfc');break;case _0x0baf('0x101'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x47')]:_0x0baf('0xfc');break;default:_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a['UserId']):_0x0baf('0xfc');}var _0xe93008=util[_0x0baf('0xf4')](_0x0baf('0x102'),moment(_0x1cb69a['createdAt'])['format'](_0x0baf('0x103')),_0x1cb69a[_0x0baf('0x104')]==='in'?_0x4759d5:_0x32abf2,_0x1cb69a['body']);if(!_0x1cb69a[_0x0baf('0x105')]){fs[_0x0baf('0x106')](_0x2a7138,_0xe93008);}}return db[_0x0baf('0x107')][_0x0baf('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x0baf('0x108')],'as':'Smtp','raw':!![]}]});}}})[_0x0baf('0x24')](function(_0x1fe362){if(_0x1fe362&&_0x1fe362[_0x0baf('0x109')]&&_0x9d6974[_0x0baf('0x40')]){var _0x51287e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe362[_0x0baf('0x109')]['service']){_0x51287e[_0x0baf('0x10a')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10a')];}else{_0x51287e['host']=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10b')];_0x51287e[_0x0baf('0x10c')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10c')];_0x51287e[_0x0baf('0x10d')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10d')];}if(_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10e')]){_0x51287e[_0x0baf('0x10f')]={'user':_0x1fe362[_0x0baf('0x109')]['user'],'pass':_0x1fe362['Smtp'][_0x0baf('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51287e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1fe362[_0x0baf('0x3f')],_0x1fe362[_0x0baf('0xd6')]||_0x1fe362['Smtp']['user']),'to':_0x9d6974['body']['mailTranscript'],'subject':_0x0baf('0x111'),'text':util['format'](_0x0baf('0x112'),_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]),'attachments':[{'path':_0x2a7138}]}})[_0x0baf('0x24')](function(){return _0x4d6ac4;})[_0x0baf('0x2e')](function(_0x292469){console[_0x0baf('0x2a')](_0x292469);});}else{return _0x4d6ac4;}})[_0x0baf('0x24')](respondWithStatusCode(_0x939365,0xc8))['catch'](handleError(_0x939365,null));};exports['addMessage']=function(_0x2d7ec3,_0x2a4d79,_0x5ebcad){return db[_0x0baf('0xf7')]['find']({'where':{'id':_0x2d7ec3[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x2a4d79,null))['then'](function(_0x4621ba){if(_0x4621ba){return _0x4621ba[_0x0baf('0x113')](_0x2d7ec3[_0x0baf('0x40')][_0x0baf('0x114')],_[_0x0baf('0x115')](_0x2d7ec3[_0x0baf('0x40')],[_0x0baf('0x114'),'id'])||{});}})[_0x0baf('0x24')](respondWithResult(_0x2a4d79,null))[_0x0baf('0x2e')](handleError(_0x2a4d79,null));};exports[_0x0baf('0x116')]=function(_0x425869,_0x4059e1,_0x2c94ff){var _0x738da0={'raw':![],'where':{}};var _0x268a1c={};var _0x34cb32={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x425869[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4059e1,null))[_0x0baf('0x24')](function(_0x39526b){if(_0x39526b){_0x268a1c['model']=_[_0x0baf('0x54')](db['ChatMessage'][_0x0baf('0xc9')]);_0x268a1c['query']=_[_0x0baf('0x54')](_0x425869['query']);_0x268a1c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],_0x268a1c[_0x0baf('0x53')]);_0x738da0['attributes']=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x425869[_0x0baf('0x53')]['fields']));_0x738da0['attributes']=_0x738da0[_0x0baf('0x57')][_0x0baf('0x59')]?_0x738da0[_0x0baf('0x57')]:_0x268a1c[_0x0baf('0x52')];if(!_0x425869['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x738da0[_0x0baf('0x34')]=qs['limit'](_0x425869['query'][_0x0baf('0x34')]);_0x738da0['offset']=qs[_0x0baf('0x36')](_0x425869['query'][_0x0baf('0x36')]);}_0x738da0[_0x0baf('0x5c')]=qs[_0x0baf('0x5d')](_0x425869['query'][_0x0baf('0x5d')]);_0x738da0[_0x0baf('0x5e')]=qs['filters'](_['pick'](_0x425869[_0x0baf('0x53')],_0x268a1c['filters']));_0x738da0[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x39526b['id'];if(_0x425869['query']['filter']){_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],{'$or':_[_0x0baf('0x46')](_0x738da0['attributes'],function(_0x309220){var _0x376eb3={};_0x376eb3[_0x309220]={'$like':'%'+_0x425869['query'][_0x0baf('0x9b')]+'%'};return _0x376eb3;})});}if(_0x425869[_0x0baf('0x53')][_0x0baf('0x91')]){var _0x2ef76b=_0x425869[_0x0baf('0x53')]['$gte'][_0x0baf('0x4a')](',');var _0x4ca9ea={};_0x4ca9ea[_0x2ef76b[0x0]]={'$gte':moment(_0x2ef76b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],_0x4ca9ea);}_0x738da0=_[_0x0baf('0xb1')]({},_0x738da0,_0x425869[_0x0baf('0xcc')]);return db['ChatMessage'][_0x0baf('0x35')]({'where':_0x738da0[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x3d6ece){_0x34cb32[_0x0baf('0x35')]=_0x3d6ece;if(_0x425869[_0x0baf('0x53')][_0x0baf('0xca')]){_0x738da0[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')][_0x0baf('0x117')](_0x738da0);})['then'](function(_0x19727f){_0x34cb32[_0x0baf('0xc6')]=_0x19727f;return _0x34cb32;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x4059e1,_0x738da0))[_0x0baf('0x2e')](handleError(_0x4059e1,null));};exports[_0x0baf('0x118')]=function(_0x57b26e,_0x3a0a2f,_0x5b676d){var _0x298155={'where':{}},_0xff9b69={},_0x5398c6={'count':0x0,'rows':[]};return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x57b26e[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x3a0a2f,null))['then'](function(_0x2edcf9){if(_0x2edcf9){_0xff9b69[_0x0baf('0x52')]=_[_0x0baf('0x54')](db[_0x0baf('0xf7')][_0x0baf('0xc9')]);_0xff9b69[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0x57b26e[_0x0baf('0x53')]);_0xff9b69[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],_0xff9b69[_0x0baf('0x53')]);_0x298155[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x58')]));_0x298155['attributes']=_0x298155[_0x0baf('0x57')][_0x0baf('0x59')]?_0x298155[_0x0baf('0x57')]:_0xff9b69[_0x0baf('0x52')];if(!_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x298155['limit']=qs[_0x0baf('0x34')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x34')]);_0x298155[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x298155['order']=qs[_0x0baf('0x5d')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5d')]);_0x298155[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0x57b26e['query'],_0xff9b69[_0x0baf('0x55')]));_0x298155[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x2edcf9['id'];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]){_0x298155['where']=_['merge'](_0x298155[_0x0baf('0x5e')],{'$or':_[_0x0baf('0x46')](_0x298155[_0x0baf('0x57')],function(_0x2d43ac){var _0x34126b={};_0x34126b[_0x2d43ac]={'$like':'%'+_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]+'%'};return _0x34126b;})});}_0x298155[_0x0baf('0x5e')][_0x0baf('0x105')]=![];if(_0x57b26e[_0x0baf('0x53')]['id']){_0x298155[_0x0baf('0x5e')]['id']={'$gt':_0x57b26e[_0x0baf('0x53')]['id']};}_0x298155=_[_0x0baf('0xb1')]({},_0x298155,_0x57b26e[_0x0baf('0xcc')]);return db[_0x0baf('0xf7')][_0x0baf('0x35')]({'where':_0x298155[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x18d219){_0x5398c6[_0x0baf('0x35')]=_0x18d219;_0x298155[_0x0baf('0xcb')]=[];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x119')]){_0x298155[_0x0baf('0xcb')][_0x0baf('0x4c')]({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id','fullname',_0x0baf('0x100')]});}if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0xca')]){_0x298155[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')]['findAll'](_0x298155);})[_0x0baf('0x24')](function(_0x344fef){_0x5398c6[_0x0baf('0xc6')]=_0x344fef;return _0x5398c6;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x3a0a2f,_0x298155))[_0x0baf('0x2e')](handleError(_0x3a0a2f,null));};exports[_0x0baf('0x11a')]=function(_0x3358f5,_0x237a20,_0x26dd4c){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x3358f5[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x237a20,null))[_0x0baf('0x24')](function(_0x2867b7){if(_0x2867b7){return _0x2867b7[_0x0baf('0x11b')](_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')],_['omit'](_0x3358f5[_0x0baf('0x40')],['ids','id'])||{})['spread'](function(){return db[_0x0baf('0x84')][_0x0baf('0x117')]({'attributes':['id',_0x0baf('0x3f'),'color'],'where':{'id':_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')]}});})[_0x0baf('0x24')](function(_0x24bc8f){socket[_0x0baf('0x11c')](_0x0baf('0x11d'),{'id':Number(_0x3358f5['params']['id']),'tags':_0x24bc8f||[]});return{'id':Number(_0x3358f5[_0x0baf('0xc8')]['id']),'tags':_0x24bc8f||[]};});}})[_0x0baf('0x24')](respondWithResult(_0x237a20,null))[_0x0baf('0x2e')](handleError(_0x237a20,null));};exports[_0x0baf('0x11e')]=function(_0x262063,_0x216897,_0x4c2bae){return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x262063[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x216897,null))['then'](function(_0x56da3e){if(_0x56da3e){return _0x56da3e[_0x0baf('0x11e')](_0x262063[_0x0baf('0x53')][_0x0baf('0x114')]);}})['then'](respondWithStatusCode(_0x216897,null))[_0x0baf('0x2e')](handleError(_0x216897,null));};exports[_0x0baf('0xf1')]=function(_0x51d2aa,_0x26d73d){var _0x20cc18=moment()[_0x0baf('0x11f')]()[_0x0baf('0xb0')]();var _0x3fa8eb=path[_0x0baf('0xed')](config[_0x0baf('0xee')],'server','files',_0x0baf('0x120'));var _0x1bd67f=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x122'),_0x0baf('0x123'));var _0x4316c5=path[_0x0baf('0xed')](_0x3fa8eb,_0x20cc18);var _0x1d5b73=util['format']('transcript-%d-%s.zip',_0x51d2aa[_0x0baf('0xc8')]['id'],_0x20cc18);var _0x2a84f8=path[_0x0baf('0xed')](_0x3fa8eb,_0x1d5b73);var _0x552504=[];_0x552504['push']({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id',_0x0baf('0x47')],'raw':!![]});_0x552504[_0x0baf('0x4c')]({'model':db['CmContact'],'as':_0x0baf('0x7b'),'attributes':['id',_0x0baf('0x124'),_0x0baf('0x125')],'raw':!![]});if(_0x51d2aa[_0x0baf('0x53')][_0x0baf('0x123')]){_0x552504[_0x0baf('0x4c')]({'model':db[_0x0baf('0x126')],'as':_0x0baf('0x126'),'raw':!![]});}var _0x5bbd33=[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'attributes':['id',_0x0baf('0x40'),_0x0baf('0x8f'),_0x0baf('0x104'),_0x0baf('0x105'),'read'],'include':_0x552504}];_0x5bbd33[_0x0baf('0x4c')]({'model':db[_0x0baf('0xd1')],'as':'Account','attributes':['id','name']});_0x5bbd33[_0x0baf('0x4c')]({'model':db['User'],'as':_0x0baf('0x127'),'attributes':['id',_0x0baf('0x47')]});return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x51d2aa['params']['id']},'include':_0x5bbd33})[_0x0baf('0x24')](handleEntityNotFound(_0x26d73d,null))[_0x0baf('0x24')](function(_0x32c2a8){if(_0x32c2a8){var _0x58fea2=_0x32c2a8[_0x0baf('0x128')]({'plain':!![]});fs[_0x0baf('0x129')](_0x4316c5);var _0x5f5d45={'channel':_0x0baf('0x12a'),'account':_0x58fea2['Account'][_0x0baf('0x3f')],'agent':_0x58fea2[_0x0baf('0x127')]?_0x58fea2[_0x0baf('0x127')][_0x0baf('0x47')]:'N.A.','createdAt':moment(_0x58fea2[_0x0baf('0x8f')])[_0x0baf('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0baf('0xb0')](),'closedAt':_0x58fea2[_0x0baf('0xe5')]?moment(_0x58fea2['closedAt'])[_0x0baf('0xf4')](_0x0baf('0x12b'))['toString']():'','disposition':_0x58fea2[_0x0baf('0x12c')],'chatInfo':{'browser':_0x58fea2[_0x0baf('0x12d')],'os':_0x58fea2[_0x0baf('0x12e')],'referer':_0x58fea2[_0x0baf('0x12f')],'customerIp':_0x58fea2[_0x0baf('0x130')],'customerPort':_0x58fea2[_0x0baf('0x131')]?_0x58fea2['customerPort']:_0x0baf('0x132')},'messages':_(_0x58fea2[_0x0baf('0xf8')])[_0x0baf('0x133')]()[_0x0baf('0x9b')]({'secret':![]})[_0x0baf('0x46')](function(_0x1ca912){if(_0x1ca912[_0x0baf('0x126')]){var _0x70e2e=path[_0x0baf('0xed')](_0x1bd67f,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')]);if(fs[_0x0baf('0x134')](_0x70e2e)){fs[_0x0baf('0x135')](_0x70e2e)[_0x0baf('0x136')](fs[_0x0baf('0x137')](path[_0x0baf('0xed')](_0x4316c5,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')])));}}return{'date':moment(_0x1ca912[_0x0baf('0x8f')])[_0x0baf('0xf4')](_0x0baf('0x12b'))[_0x0baf('0xb0')](),'sender':_0x1ca912['direction']===_0x0baf('0xdf')?_0x1ca912[_0x0baf('0xf9')]?_0x1ca912['User']['fullname']:'System':_0x1ca912[_0x0baf('0x7b')]['firstName']+(_0x1ca912['Contact']['lastName']?'\x20'+_0x1ca912[_0x0baf('0x7b')][_0x0baf('0x125')]:''),'body':_0x1ca912[_0x0baf('0x126')]?_0x1ca912['Attachment'][_0x0baf('0xe9')]:_0x1ca912['body'],'direction':_0x1ca912['direction']===_0x0baf('0xdf')?'A':'C','secret':_0x1ca912[_0x0baf('0x105')],'read':_0x1ca912[_0x0baf('0x96')],'attachment':_0x1ca912['Attachment']};})['value']()};return ejs[_0x0baf('0x138')](path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x139'),_0x0baf('0x13a')),{'interaction':_0x5f5d45})['then'](function(_0x4c1f01){var _0x217cd8=path[_0x0baf('0xed')](_0x4316c5,'transcript-'+_0x58fea2['id']+'-'+_0x20cc18+_0x0baf('0x13b'));var _0x223d32={'path':_0x217cd8,'channel':_0x0baf('0x12a'),'interactionId':_0x58fea2['id']};return pdf[_0x0baf('0x13c')](_0x4c1f01,_0x223d32);})['then'](function(){return new BPromise(function(_0xcca408,_0x557ec9){zipdir(_0x4316c5,{'saveTo':_0x2a84f8},function(_0x479231,_0x320409){if(_0x479231)return _0x557ec9(_0x479231);return _0xcca408(_0x320409);});})['then'](function(){return new BPromise(function(_0x4a0f32,_0xc6fc4d){rimraf(_0x4316c5,function(_0x46b904){if(_0x46b904)_0xc6fc4d(_0x46b904);return _0x4a0f32();});});})['then'](function(){return _0x26d73d[_0x0baf('0xf1')](_0x2a84f8,_0x1d5b73,function(_0x2dea20){if(_0x2dea20){console[_0x0baf('0x13d')](_0x0baf('0x13e'),_0x2dea20);}else{fs[_0x0baf('0x13f')](_0x2a84f8);}});});});}else{return _0x26d73d[_0x0baf('0x2f')](0xc8);}})['catch'](handleError(_0x26d73d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 8305c13..28d6f88 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 _0x0d7f=['exports','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x5841c1,_0x575a6f){var _0x41ad9c=function(_0x28b5fe){while(--_0x28b5fe){_0x5841c1['push'](_0x5841c1['shift']());}};_0x41ad9c(++_0x575a6f);}(_0x0d7f,0x78));var _0xf0d7=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x0d7f[_0x17b6e3];return _0x3906f3;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xf0d7('0x0'))['db'][_0xf0d7('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xf0d7('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0d7('0x3'),'afterUpdate':_0xf0d7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1cca63){return function(_0x22f4e9,_0x176add,_0x27d8f0){_0x22f4e9[_0xf0d7('0x5')]({'attributes':['id'],'raw':!![]})[_0xf0d7('0x6')](function(_0x259131){_0x22f4e9['setDataValue'](_0xf0d7('0x7'),_0x259131[_0xf0d7('0x8')](function(_0x120d91){return{'id':_0x120d91['id']};}));return ChatMessage[_0xf0d7('0x9')]({'where':{'ChatInteractionId':_0x22f4e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf0d7('0x6')](function(_0x5f3602){_0x22f4e9[_0xf0d7('0xa')](_0xf0d7('0xb'),_0x5f3602['length']);ChatInteractionEvents[_0xf0d7('0xc')](_0x1cca63+':'+_0x22f4e9['id'],_0x22f4e9);ChatInteractionEvents['emit'](_0x1cca63,_0x22f4e9);_0x27d8f0(null);})[_0xf0d7('0xd')](_0x27d8f0(null));};}for(var e in events){if(events[_0xf0d7('0xe')](e)){var event=events[e];ChatInteraction[_0xf0d7('0xf')](e,emitEvent(event));}}module[_0xf0d7('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x4ecc=['map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users'];(function(_0x408753,_0x5176e1){var _0x1ba6f1=function(_0x2ed00d){while(--_0x2ed00d){_0x408753['push'](_0x408753['shift']());}};_0x1ba6f1(++_0x5176e1);}(_0x4ecc,0x177));var _0xc4ec=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x4ecc[_0xca1f0e];return _0x35e4ef;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xc4ec('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xc4ec('0x0'))['db'][_0xc4ec('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc4ec('0x2')](0x0);var events={'afterCreate':_0xc4ec('0x3'),'afterUpdate':_0xc4ec('0x4'),'afterDestroy':_0xc4ec('0x5')};function emitEvent(_0x448c21){return function(_0x4624a4,_0x86ef0d,_0x147f2c){_0x4624a4[_0xc4ec('0x6')]({'attributes':['id'],'raw':!![]})[_0xc4ec('0x7')](function(_0x29e24f){_0x4624a4['setDataValue'](_0xc4ec('0x8'),_0x29e24f[_0xc4ec('0x9')](function(_0x129175){return{'id':_0x129175['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4624a4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3fc874){_0x4624a4['setDataValue'](_0xc4ec('0xa'),_0x3fc874['length']);ChatInteractionEvents[_0xc4ec('0xb')](_0x448c21+':'+_0x4624a4['id'],_0x4624a4);ChatInteractionEvents['emit'](_0x448c21,_0x4624a4);_0x147f2c(null);})[_0xc4ec('0xc')](_0x147f2c(null));};}for(var e in events){if(events[_0xc4ec('0xd')](e)){var event=events[e];ChatInteraction[_0xc4ec('0xe')](e,emitEvent(event));}}module[_0xc4ec('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index eb78894..601220b 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 _0x16c4=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','format'];(function(_0x543e6b,_0x218c9a){var _0xffb501=function(_0x8e7b6b){while(--_0x8e7b6b){_0x543e6b['push'](_0x543e6b['shift']());}};_0xffb501(++_0x218c9a);}(_0x16c4,0x120));var _0x416c=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x16c4[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0x416c('0x0'));var util=require(_0x416c('0x1'));var logger=require('../../config/logger')(_0x416c('0x2'));var moment=require('moment');var BPromise=require(_0x416c('0x3'));var rp=require(_0x416c('0x4'));var fs=require('fs');var path=require(_0x416c('0x5'));var rimraf=require(_0x416c('0x6'));var config=require(_0x416c('0x7'));var attributes=require(_0x416c('0x8'));module[_0x416c('0x9')]=function(_0xa69c0d,_0x1d5e9d){return _0xa69c0d[_0x416c('0xa')](_0x416c('0xb'),attributes,{'tableName':_0x416c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x431bf9,_0xfb133,_0x459bb4){if(_0x431bf9[_0x416c('0xd')]('closed')){_0x431bf9[_0x416c('0xe')]=moment()[_0x416c('0xf')](_0x416c('0x10'));}_0x459bb4(null,_0x431bf9);}},'charset':_0x416c('0x11'),'collate':_0x416c('0x12')});};
\ No newline at end of file
+var _0xc23c=['request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0xc23c,0x187));var _0xcc23=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xc23c[_0x2a9f4];return _0x3c39e0;};'use strict';var _=require(_0xcc23('0x0'));var util=require(_0xcc23('0x1'));var logger=require('../../config/logger')(_0xcc23('0x2'));var moment=require(_0xcc23('0x3'));var BPromise=require(_0xcc23('0x4'));var rp=require(_0xcc23('0x5'));var fs=require('fs');var path=require(_0xcc23('0x6'));var rimraf=require('rimraf');var config=require(_0xcc23('0x7'));var attributes=require(_0xcc23('0x8'));module[_0xcc23('0x9')]=function(_0x5a6a89,_0x2a3791){return _0x5a6a89[_0xcc23('0xa')]('ChatInteraction',attributes,{'tableName':_0xcc23('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x298aed,_0x115710,_0x54d54e){if(_0x298aed[_0xcc23('0xc')](_0xcc23('0xd'))){_0x298aed[_0xcc23('0xe')]=moment()[_0xcc23('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x54d54e(null,_0x298aed);}},'charset':_0xcc23('0x10'),'collate':_0xcc23('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index abae7c3..0be062f 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 _0x7cc5=['error','code','message','ChatInteraction,\x20%s,\x20%s','result','UpdateChatInteraction','ChatInteraction','body','options','attributes','limit','then','AddTagsToChatInteraction','where','addTags','omit','ids','AddTags','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1aa21c,_0xe7dedd){var _0x45edb8=function(_0xa003be){while(--_0xa003be){_0x1aa21c['push'](_0x1aa21c['shift']());}};_0x45edb8(++_0xe7dedd);}(_0x7cc5,0x153));var _0x57cc=function(_0x197005,_0x1d8b1b){_0x197005=_0x197005-0x0;var _0x5501e1=_0x7cc5[_0x197005];return _0x5501e1;};'use strict';var _=require(_0x57cc('0x0'));var util=require(_0x57cc('0x1'));var moment=require(_0x57cc('0x2'));var BPromise=require('bluebird');var rs=require(_0x57cc('0x3'));var fs=require('fs');var Redis=require(_0x57cc('0x4'));var db=require(_0x57cc('0x5'))['db'];var utils=require(_0x57cc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x57cc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x57cc('0x8')][_0x57cc('0x9')]({'port':0x232a});config[_0x57cc('0xa')]=_[_0x57cc('0xb')](config[_0x57cc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x57cc('0xc'))(new Redis(config[_0x57cc('0xa')]));require(_0x57cc('0xd'))[_0x57cc('0xe')](socket);function respondWithRpcPromise(_0x1a7063,_0x5704d2,_0x45b7c5){return new BPromise(function(_0x47d340,_0x32b349){return client[_0x57cc('0xf')](_0x1a7063,_0x45b7c5)['then'](function(_0x3b214c){logger[_0x57cc('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x5704d2,'request\x20sent');logger[_0x57cc('0x11')](_0x57cc('0x12'),_0x5704d2,_0x57cc('0x13'),JSON[_0x57cc('0x14')](_0x3b214c));if(_0x3b214c[_0x57cc('0x15')]){if(_0x3b214c['error'][_0x57cc('0x16')]===0x1f4){logger[_0x57cc('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x5704d2,_0x3b214c['error']['message']);return _0x32b349(_0x3b214c[_0x57cc('0x15')][_0x57cc('0x17')]);}logger[_0x57cc('0x15')](_0x57cc('0x18'),_0x5704d2,_0x3b214c['error'][_0x57cc('0x17')]);return _0x47d340(_0x3b214c[_0x57cc('0x15')]['message']);}else{logger[_0x57cc('0x10')](_0x57cc('0x18'),_0x5704d2,_0x57cc('0x13'));_0x47d340(_0x3b214c[_0x57cc('0x19')]['message']);}})['catch'](function(_0x2c29db){logger[_0x57cc('0x15')](_0x57cc('0x18'),_0x5704d2,_0x2c29db);_0x32b349(_0x2c29db);});});}exports[_0x57cc('0x1a')]=function(_0x4dceb9){var _0x5e8c5b=this;return new Promise(function(_0x3b3c94,_0x201242){return db[_0x57cc('0x1b')]['update'](_0x4dceb9[_0x57cc('0x1c')],{'raw':_0x4dceb9[_0x57cc('0x1d')]?_0x4dceb9[_0x57cc('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dceb9[_0x57cc('0x1d')]?_0x4dceb9[_0x57cc('0x1d')]['where']||null:null,'attributes':_0x4dceb9[_0x57cc('0x1d')]?_0x4dceb9['options'][_0x57cc('0x1e')]||null:null,'limit':_0x4dceb9[_0x57cc('0x1d')]?_0x4dceb9[_0x57cc('0x1d')][_0x57cc('0x1f')]||null:null})[_0x57cc('0x20')](function(_0x1bc7fa){logger[_0x57cc('0x10')](_0x57cc('0x1a'),_0x4dceb9);logger[_0x57cc('0x11')](_0x57cc('0x1a'),_0x4dceb9,JSON[_0x57cc('0x14')](_0x1bc7fa));_0x3b3c94(_0x1bc7fa);})['catch'](function(_0x479be5){logger[_0x57cc('0x15')](_0x57cc('0x1a'),_0x479be5[_0x57cc('0x17')],_0x4dceb9);_0x201242(_0x5e8c5b[_0x57cc('0x15')](0x1f4,_0x479be5['message']));});});};exports[_0x57cc('0x21')]=function(_0x18a8a4){return new Promise(function(_0x2b2b37,_0x1fc45b){return db['ChatInteraction']['find']({'where':_0x18a8a4['options']?_0x18a8a4[_0x57cc('0x1d')][_0x57cc('0x22')]||null:null})[_0x57cc('0x20')](function(_0x39efaf){if(_0x39efaf){return _0x39efaf[_0x57cc('0x23')](_0x18a8a4[_0x57cc('0x1c')]['ids'],_[_0x57cc('0x24')](_0x18a8a4[_0x57cc('0x1c')],[_0x57cc('0x25'),'id'])||{});}})['spread'](function(_0x3356c9){logger['info'](_0x57cc('0x26'),_0x18a8a4);logger[_0x57cc('0x11')](_0x57cc('0x26'),_0x18a8a4,JSON['stringify'](_0x3356c9));_0x2b2b37(_0x3356c9);})[_0x57cc('0x27')](function(_0x336b86){logger[_0x57cc('0x15')]('AddTags',_0x336b86[_0x57cc('0x17')],_0x18a8a4);_0x1fc45b(_this['error'](0x1f4,_0x336b86[_0x57cc('0x17')]));});});};
\ No newline at end of file
+var _0x620f=['spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ChatInteraction','update','body','options','raw','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','omit'];(function(_0xf13d0d,_0x3df04c){var _0x4e55f2=function(_0xe546eb){while(--_0xe546eb){_0xf13d0d['push'](_0xf13d0d['shift']());}};_0x4e55f2(++_0x3df04c);}(_0x620f,0x1af));var _0xf620=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x620f[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf620('0x0'));var moment=require(_0xf620('0x1'));var BPromise=require(_0xf620('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf620('0x3'));var db=require(_0xf620('0x4'))['db'];var utils=require(_0xf620('0x5'));var logger=require(_0xf620('0x6'))(_0xf620('0x7'));var config=require(_0xf620('0x8'));var jayson=require(_0xf620('0x9'));var client=jayson['client'][_0xf620('0xa')]({'port':0x232a});config[_0xf620('0xb')]=_[_0xf620('0xc')](config[_0xf620('0xb')],{'host':_0xf620('0xd'),'port':0x18eb});var socket=require(_0xf620('0xe'))(new Redis(config[_0xf620('0xb')]));require(_0xf620('0xf'))['register'](socket);function respondWithRpcPromise(_0x5ed84c,_0x1e7b1e,_0x2d059d){return new BPromise(function(_0x8bd8f3,_0x1d627f){return client['request'](_0x5ed84c,_0x2d059d)[_0xf620('0x10')](function(_0x4a462d){logger['info'](_0xf620('0x11'),_0x1e7b1e,_0xf620('0x12'));logger[_0xf620('0x13')](_0xf620('0x14'),_0x1e7b1e,'request\x20sent',JSON[_0xf620('0x15')](_0x4a462d));if(_0x4a462d[_0xf620('0x16')]){if(_0x4a462d[_0xf620('0x16')]['code']===0x1f4){logger[_0xf620('0x16')](_0xf620('0x11'),_0x1e7b1e,_0x4a462d['error'][_0xf620('0x17')]);return _0x1d627f(_0x4a462d[_0xf620('0x16')]['message']);}logger[_0xf620('0x16')](_0xf620('0x11'),_0x1e7b1e,_0x4a462d[_0xf620('0x16')][_0xf620('0x17')]);return _0x8bd8f3(_0x4a462d['error'][_0xf620('0x17')]);}else{logger[_0xf620('0x18')](_0xf620('0x11'),_0x1e7b1e,_0xf620('0x12'));_0x8bd8f3(_0x4a462d[_0xf620('0x19')][_0xf620('0x17')]);}})['catch'](function(_0x1e63b8){logger[_0xf620('0x16')](_0xf620('0x11'),_0x1e7b1e,_0x1e63b8);_0x1d627f(_0x1e63b8);});});}exports['UpdateChatInteraction']=function(_0x1d9be0){var _0x15d6d2=this;return new Promise(function(_0xd20a4c,_0x14a1ed){return db[_0xf620('0x1a')][_0xf620('0x1b')](_0x1d9be0[_0xf620('0x1c')],{'raw':_0x1d9be0['options']?_0x1d9be0[_0xf620('0x1d')][_0xf620('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d9be0[_0xf620('0x1d')]?_0x1d9be0[_0xf620('0x1d')]['where']||null:null,'attributes':_0x1d9be0[_0xf620('0x1d')]?_0x1d9be0['options'][_0xf620('0x1f')]||null:null,'limit':_0x1d9be0['options']?_0x1d9be0['options'][_0xf620('0x20')]||null:null})[_0xf620('0x10')](function(_0x539650){logger[_0xf620('0x18')]('UpdateChatInteraction',_0x1d9be0);logger[_0xf620('0x13')](_0xf620('0x21'),_0x1d9be0,JSON['stringify'](_0x539650));_0xd20a4c(_0x539650);})[_0xf620('0x22')](function(_0x154b82){logger[_0xf620('0x16')]('UpdateChatInteraction',_0x154b82[_0xf620('0x17')],_0x1d9be0);_0x14a1ed(_0x15d6d2[_0xf620('0x16')](0x1f4,_0x154b82['message']));});});};exports[_0xf620('0x23')]=function(_0x11b6bf){return new Promise(function(_0x12ffe4,_0x594806){return db[_0xf620('0x1a')]['find']({'where':_0x11b6bf[_0xf620('0x1d')]?_0x11b6bf['options']['where']||null:null})[_0xf620('0x10')](function(_0xc7bb29){if(_0xc7bb29){return _0xc7bb29['addTags'](_0x11b6bf[_0xf620('0x1c')]['ids'],_[_0xf620('0x24')](_0x11b6bf[_0xf620('0x1c')],['ids','id'])||{});}})[_0xf620('0x25')](function(_0x4e5def){logger[_0xf620('0x18')](_0xf620('0x26'),_0x11b6bf);logger[_0xf620('0x13')](_0xf620('0x26'),_0x11b6bf,JSON[_0xf620('0x15')](_0x4e5def));_0x12ffe4(_0x4e5def);})[_0xf620('0x22')](function(_0x589793){logger[_0xf620('0x16')]('AddTags',_0x589793[_0xf620('0x17')],_0x11b6bf);_0x594806(_this[_0xf620('0x16')](0x1f4,_0x589793['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index ca203e8..8044e52 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 _0xe444=['./chatInteraction.events','save','emit','removeListener','register','length','chatInteraction:'];(function(_0x5473aa,_0x494457){var _0x1c2368=function(_0x251c07){while(--_0x251c07){_0x5473aa['push'](_0x5473aa['shift']());}};_0x1c2368(++_0x494457);}(_0xe444,0xe0));var _0x4e44=function(_0x3a343f,_0x135325){_0x3a343f=_0x3a343f-0x0;var _0x36c538=_0xe444[_0x3a343f];return _0x36c538;};'use strict';var ChatInteractionEvents=require(_0x4e44('0x0'));var events=[_0x4e44('0x1'),'remove','update'];function createListener(_0x234992,_0x31b323){return function(_0x33fde8){_0x31b323[_0x4e44('0x2')](_0x234992,_0x33fde8);};}function removeListener(_0x5aa738,_0x4c8454){return function(){ChatInteractionEvents[_0x4e44('0x3')](_0x5aa738,_0x4c8454);};}exports[_0x4e44('0x4')]=function(_0x31b783){for(var _0x59c7d1=0x0,_0x276d09=events[_0x4e44('0x5')];_0x59c7d1<_0x276d09;_0x59c7d1++){var _0x1af927=events[_0x59c7d1];var _0x5c021f=createListener(_0x4e44('0x6')+_0x1af927,_0x31b783);ChatInteractionEvents['on'](_0x1af927,_0x5c021f);}};
\ No newline at end of file
+var _0x8734=['removeListener','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x2e11d3,_0x26a29a){var _0x3f7f7f=function(_0x3c43f1){while(--_0x3c43f1){_0x2e11d3['push'](_0x2e11d3['shift']());}};_0x3f7f7f(++_0x26a29a);}(_0x8734,0x134));var _0x4873=function(_0x3dfea6,_0x5cd685){_0x3dfea6=_0x3dfea6-0x0;var _0x567aca=_0x8734[_0x3dfea6];return _0x567aca;};'use strict';var ChatInteractionEvents=require(_0x4873('0x0'));var events=['save',_0x4873('0x1'),_0x4873('0x2')];function createListener(_0x270283,_0x354735){return function(_0x4eb8ad){_0x354735[_0x4873('0x3')](_0x270283,_0x4eb8ad);};}function removeListener(_0x5bcb32,_0x1ae455){return function(){ChatInteractionEvents[_0x4873('0x4')](_0x5bcb32,_0x1ae455);};}exports['register']=function(_0xb44024){for(var _0x4b5d88=0x0,_0x5ea436=events['length'];_0x4b5d88<_0x5ea436;_0x4b5d88++){var _0x22ed5c=events[_0x4b5d88];var _0x54fdb5=createListener(_0x4873('0x5')+_0x22ed5c,_0xb44024);ChatInteractionEvents['on'](_0x22ed5c,_0x54fdb5);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 1c8b503..d548562 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 _0x4ba5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','abandon','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5524b8,_0x2dc714){var _0x3c73ec=function(_0x5e1002){while(--_0x5e1002){_0x5524b8['push'](_0x5524b8['shift']());}};_0x3c73ec(++_0x2dc714);}(_0x4ba5,0x93));var _0x54ba=function(_0x334608,_0x34ac07){_0x334608=_0x334608-0x0;var _0x334d34=_0x4ba5[_0x334608];return _0x334d34;};'use strict';var multer=require(_0x54ba('0x0'));var util=require(_0x54ba('0x1'));var path=require(_0x54ba('0x2'));var timeout=require(_0x54ba('0x3'));var express=require(_0x54ba('0x4'));var router=express[_0x54ba('0x5')]();var fs_extra=require(_0x54ba('0x6'));var auth=require(_0x54ba('0x7'));var interaction=require(_0x54ba('0x8'));var config=require(_0x54ba('0x9'));var controller=require(_0x54ba('0xa'));router[_0x54ba('0xb')]('/',auth[_0x54ba('0xc')](),controller[_0x54ba('0xd')]);router[_0x54ba('0xb')](_0x54ba('0xe'),auth[_0x54ba('0xc')](),controller[_0x54ba('0xf')]);router['get'](_0x54ba('0x10'),auth[_0x54ba('0x11')](),controller['show']);router['get'](_0x54ba('0x12'),auth[_0x54ba('0x11')](),controller[_0x54ba('0x13')]);router[_0x54ba('0xb')](_0x54ba('0x14'),auth[_0x54ba('0xc')](),controller[_0x54ba('0x15')]);router[_0x54ba('0xb')](_0x54ba('0x16'),auth[_0x54ba('0x11')](),controller[_0x54ba('0x17')]);router['get'](_0x54ba('0x18'),auth[_0x54ba('0xc')](),controller['download']);router[_0x54ba('0x19')]('/',auth[_0x54ba('0xc')](),controller[_0x54ba('0x1a')]);router[_0x54ba('0x19')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x54ba('0x1b')]);var upload=multer({'storage':multer[_0x54ba('0x1c')]({'destination':function(_0x3d4f48,_0x5e3f77,_0x2d266a){_0x2d266a(null,path['join'](config[_0x54ba('0x1d')],_0x54ba('0x1e')));},'filename':function(_0xf64e6f,_0x275ceb,_0xad6db4){_0xad6db4(null,util[_0x54ba('0x1f')]('%s-%s',Date[_0x54ba('0x20')](),_0x275ceb['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x54ba('0x19')]('/:id/attachment_upload',upload[_0x54ba('0x21')](_0x54ba('0x22')),controller[_0x54ba('0x23')]);router['post']('/:id/messages',auth[_0x54ba('0x11')](),controller[_0x54ba('0x24')]);router[_0x54ba('0x19')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x54ba('0x25')](_0x54ba('0x26'),_0x54ba('0x27')),controller[_0x54ba('0x28')]);router[_0x54ba('0x29')]('/:id',auth[_0x54ba('0xc')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x54ba('0x2a')]);router['put'](_0x54ba('0x2b'),controller[_0x54ba('0x2c')]);router['put']('/:id/abandon',auth[_0x54ba('0x11')](),controller[_0x54ba('0x2d')]);router[_0x54ba('0x29')]('/:id/close',controller['close']);router[_0x54ba('0x2e')](_0x54ba('0x10'),auth[_0x54ba('0xc')](),interaction[_0x54ba('0x25')](_0x54ba('0x26'),_0x54ba('0x2f')),controller[_0x54ba('0x30')]);router[_0x54ba('0x2e')]('/:id/tags',auth[_0x54ba('0xc')](),controller[_0x54ba('0x31')]);module[_0x54ba('0x32')]=router;
\ No newline at end of file
+var _0xf06a=['/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','attachmentUpload','addMessage','tracked','chat','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages'];(function(_0x4f95f8,_0xb73784){var _0x123b8e=function(_0x89ad8f){while(--_0x89ad8f){_0x4f95f8['push'](_0x4f95f8['shift']());}};_0x123b8e(++_0xb73784);}(_0xf06a,0x158));var _0xaf06=function(_0x1b1d3b,_0x5ead4c){_0x1b1d3b=_0x1b1d3b-0x0;var _0x1535bc=_0xf06a[_0x1b1d3b];return _0x1535bc;};'use strict';var multer=require(_0xaf06('0x0'));var util=require('util');var path=require(_0xaf06('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf06('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaf06('0x3'));var interaction=require(_0xaf06('0x4'));var config=require(_0xaf06('0x5'));var controller=require(_0xaf06('0x6'));router[_0xaf06('0x7')]('/',auth[_0xaf06('0x8')](),controller['index']);router['get'](_0xaf06('0x9'),auth[_0xaf06('0x8')](),controller[_0xaf06('0xa')]);router[_0xaf06('0x7')](_0xaf06('0xb'),auth[_0xaf06('0xc')](),controller[_0xaf06('0xd')]);router[_0xaf06('0x7')](_0xaf06('0xe'),auth['isChatInteractionAuthorized'](),controller[_0xaf06('0xf')]);router[_0xaf06('0x7')](_0xaf06('0x10'),auth[_0xaf06('0x8')](),controller[_0xaf06('0x11')]);router[_0xaf06('0x7')](_0xaf06('0x12'),auth[_0xaf06('0xc')](),controller[_0xaf06('0x13')]);router[_0xaf06('0x7')](_0xaf06('0x14'),auth[_0xaf06('0x8')](),controller[_0xaf06('0x15')]);router['post']('/',auth[_0xaf06('0x8')](),controller[_0xaf06('0x16')]);router[_0xaf06('0x17')](_0xaf06('0x18'),auth[_0xaf06('0x8')](),controller[_0xaf06('0x19')]);var upload=multer({'storage':multer[_0xaf06('0x1a')]({'destination':function(_0x3a02e1,_0x58de4c,_0x114eed){_0x114eed(null,path[_0xaf06('0x1b')](config[_0xaf06('0x1c')],_0xaf06('0x1d')));},'filename':function(_0x52012b,_0x155b39,_0x1e2b4d){_0x1e2b4d(null,util['format'](_0xaf06('0x1e'),Date[_0xaf06('0x1f')](),_0x155b39[_0xaf06('0x20')][_0xaf06('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xaf06('0x17')](_0xaf06('0x22'),upload['single']('file'),controller[_0xaf06('0x23')]);router[_0xaf06('0x17')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xaf06('0x24')]);router['post']('/:id/tags',auth[_0xaf06('0x8')](),interaction[_0xaf06('0x25')](_0xaf06('0x26'),'chatinteraction:addtags'),controller['addTags']);router[_0xaf06('0x27')](_0xaf06('0xb'),auth['isAuthenticated'](),interaction[_0xaf06('0x25')]('chat',_0xaf06('0x28')),controller[_0xaf06('0x29')]);router[_0xaf06('0x27')]('/:id/custom_update',controller[_0xaf06('0x2a')]);router[_0xaf06('0x27')](_0xaf06('0x2b'),auth[_0xaf06('0xc')](),controller[_0xaf06('0x2c')]);router[_0xaf06('0x27')](_0xaf06('0x2d'),controller['close']);router[_0xaf06('0x2e')](_0xaf06('0xb'),auth[_0xaf06('0x8')](),interaction[_0xaf06('0x25')](_0xaf06('0x26'),_0xaf06('0x2f')),controller[_0xaf06('0x30')]);router['delete'](_0xaf06('0x31'),auth['isAuthenticated'](),controller[_0xaf06('0x32')]);module[_0xaf06('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index c81aaf9..a612c52 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 _0xfd0f=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2c2b07,_0x59d4bf){var _0xe8a768=function(_0x52990e){while(--_0x52990e){_0x2c2b07['push'](_0x2c2b07['shift']());}};_0xe8a768(++_0x59d4bf);}(_0xfd0f,0x1cf));var _0xffd0=function(_0x1b5526,_0x502c33){_0x1b5526=_0x1b5526-0x0;var _0xed0d8e=_0xfd0f[_0x1b5526];return _0xed0d8e;};'use strict';var Sequelize=require(_0xffd0('0x0'));module[_0xffd0('0x1')]={'body':{'type':Sequelize[_0xffd0('0x2')](_0xffd0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd0('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xffd0('0x5')]}};
\ No newline at end of file
+var _0xd2a3=['exports','medium','BOOLEAN','INTEGER'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0xd2a3,0xd4));var _0x3d2a=function(_0x55e0c3,_0x456cf4){_0x55e0c3=_0x55e0c3-0x0;var _0x3ee5d8=_0xd2a3[_0x55e0c3];return _0x3ee5d8;};'use strict';var Sequelize=require('sequelize');module[_0x3d2a('0x0')]={'body':{'type':Sequelize['TEXT'](_0x3d2a('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3d2a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3d2a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 8bee25f..8fc6c73 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 _0xb517=['order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','length','find','catch','create','body','update','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','user','role','internal','online','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb517,0x99));var _0x7b51=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb517[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0x7b51('0x0'));var rimraf=require(_0x7b51('0x1'));var zipdir=require(_0x7b51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b51('0x3'));var moment=require(_0x7b51('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b51('0x5'));var path=require('path');var sox=require(_0x7b51('0x6'));var csv=require(_0x7b51('0x7'));var ejs=require(_0x7b51('0x8'));var fs=require('fs');var fs_extra=require(_0x7b51('0x9'));var _=require('lodash');var squel=require(_0x7b51('0xa'));var crypto=require(_0x7b51('0xb'));var jsforce=require(_0x7b51('0xc'));var deskjs=require(_0x7b51('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b51('0xe'));var Redis=require('ioredis');var authService=require(_0x7b51('0xf'));var qs=require(_0x7b51('0x10'));var as=require(_0x7b51('0x11'));var hardwareService=require(_0x7b51('0x12'));var logger=require(_0x7b51('0x13'))(_0x7b51('0x14'));var utils=require(_0x7b51('0x15'));var config=require(_0x7b51('0x16'));var licenseUtil=require(_0x7b51('0x17'));var db=require(_0x7b51('0x18'))['db'];config['redis']=_[_0x7b51('0x19')](config[_0x7b51('0x1a')],{'host':_0x7b51('0x1b'),'port':0x18eb});var socket=require(_0x7b51('0x1c'))(new Redis(config[_0x7b51('0x1a')]));require(_0x7b51('0x1d'))[_0x7b51('0x1e')](socket);function respondWithStatusCode(_0x533a37,_0x45c708){_0x45c708=_0x45c708||0xcc;return function(_0x26a401){if(_0x26a401){return _0x533a37[_0x7b51('0x1f')](_0x45c708);}return _0x533a37['status'](_0x45c708)[_0x7b51('0x20')]();};}function respondWithResult(_0x25fcef,_0x14d178){_0x14d178=_0x14d178||0xc8;return function(_0xde0b8){if(_0xde0b8){return _0x25fcef[_0x7b51('0x21')](_0x14d178)[_0x7b51('0x22')](_0xde0b8);}};}function respondWithFilteredResult(_0x9707c9,_0xedb6f2){return function(_0x567454){if(_0x567454){var _0x46d951=typeof _0xedb6f2[_0x7b51('0x23')]===_0x7b51('0x24')&&typeof _0xedb6f2[_0x7b51('0x25')]==='undefined';var _0x54de10=_0x567454[_0x7b51('0x26')];var _0x2fd59f=_0x46d951?0x0:_0xedb6f2[_0x7b51('0x23')];var _0xedc237=_0x46d951?_0x567454[_0x7b51('0x26')]:_0xedb6f2[_0x7b51('0x23')]+_0xedb6f2['limit'];var _0x2bdd85;if(_0xedc237>=_0x54de10){_0xedc237=_0x54de10;_0x2bdd85=0xc8;}else{_0x2bdd85=0xce;}_0x9707c9['status'](_0x2bdd85);return _0x9707c9[_0x7b51('0x27')](_0x7b51('0x28'),_0x2fd59f+'-'+_0xedc237+'/'+_0x54de10)[_0x7b51('0x22')](_0x567454);}return null;};}function patchUpdates(_0xaa470d){return function(_0x1b251b){try{jsonpatch[_0x7b51('0x29')](_0x1b251b,_0xaa470d,!![]);}catch(_0x548232){return BPromise[_0x7b51('0x2a')](_0x548232);}return _0x1b251b[_0x7b51('0x2b')]();};}function saveUpdates(_0x5cc8b4,_0x37a75f){return function(_0x1bb777){if(_0x1bb777){return _0x1bb777['update'](_0x5cc8b4)[_0x7b51('0x2c')](function(_0x4f21fa){return _0x4f21fa;});}return null;};}function removeEntity(_0x5d14e1,_0x150cbf){return function(_0x2c0b0e){if(_0x2c0b0e){return _0x2c0b0e[_0x7b51('0x2d')]()[_0x7b51('0x2c')](function(){_0x5d14e1[_0x7b51('0x21')](0xcc)[_0x7b51('0x20')]();});}};}function handleEntityNotFound(_0x1bbc32,_0x4a7eba){return function(_0x1e12bb){if(!_0x1e12bb){_0x1bbc32[_0x7b51('0x1f')](0x194);}return _0x1e12bb;};}function handleError(_0x28d17e,_0x572a81){_0x572a81=_0x572a81||0x1f4;return function(_0x56f432){logger['error'](_0x56f432[_0x7b51('0x2e')]);if(_0x56f432[_0x7b51('0x2f')]){delete _0x56f432[_0x7b51('0x2f')];}_0x28d17e[_0x7b51('0x21')](_0x572a81)[_0x7b51('0x30')](_0x56f432);};}exports['index']=function(_0x264859,_0x3c5850){var _0x45677b={},_0x69431f={},_0x1fbd17={'count':0x0,'rows':[]};var _0x356849=_[_0x7b51('0x31')](db[_0x7b51('0x32')][_0x7b51('0x33')],function(_0xfa0c46){return{'name':_0xfa0c46[_0x7b51('0x34')],'type':_0xfa0c46[_0x7b51('0x35')][_0x7b51('0x36')]};});_0x69431f[_0x7b51('0x37')]=_['map'](_0x356849,_0x7b51('0x2f'));_0x69431f[_0x7b51('0x38')]=_['keys'](_0x264859[_0x7b51('0x38')]);_0x69431f[_0x7b51('0x39')]=_[_0x7b51('0x3a')](_0x69431f['model'],_0x69431f['query']);_0x45677b['attributes']=_[_0x7b51('0x3a')](_0x69431f[_0x7b51('0x37')],qs[_0x7b51('0x3b')](_0x264859[_0x7b51('0x38')]['fields']));_0x45677b[_0x7b51('0x3c')]=_0x45677b['attributes']['length']?_0x45677b[_0x7b51('0x3c')]:_0x69431f[_0x7b51('0x37')];if(!_0x264859[_0x7b51('0x38')][_0x7b51('0x3d')](_0x7b51('0x3e'))){_0x45677b[_0x7b51('0x25')]=qs[_0x7b51('0x25')](_0x264859['query'][_0x7b51('0x25')]);_0x45677b[_0x7b51('0x23')]=qs[_0x7b51('0x23')](_0x264859[_0x7b51('0x38')]['offset']);}_0x45677b[_0x7b51('0x3f')]=qs[_0x7b51('0x40')](_0x264859[_0x7b51('0x38')][_0x7b51('0x40')]);_0x45677b[_0x7b51('0x41')]=qs['filters'](_['pick'](_0x264859['query'],_0x69431f[_0x7b51('0x39')]),_0x356849);if(_0x264859['query'][_0x7b51('0x42')]){_0x45677b['where']=_[_0x7b51('0x43')](_0x45677b[_0x7b51('0x41')],{'$or':_[_0x7b51('0x31')](_0x356849,function(_0x234af0){if(_0x234af0[_0x7b51('0x35')]!==_0x7b51('0x44')){var _0x311b56={};_0x311b56[_0x234af0[_0x7b51('0x2f')]]={'$like':'%'+_0x264859[_0x7b51('0x38')][_0x7b51('0x42')]+'%'};return _0x311b56;}})});}_0x45677b=_[_0x7b51('0x43')]({},_0x45677b,_0x264859[_0x7b51('0x45')]);var _0x3ee5ce={'where':_0x45677b[_0x7b51('0x41')]};return db[_0x7b51('0x32')][_0x7b51('0x26')](_0x3ee5ce)[_0x7b51('0x2c')](function(_0x1ba0e8){_0x1fbd17[_0x7b51('0x26')]=_0x1ba0e8;if(_0x264859[_0x7b51('0x38')][_0x7b51('0x46')]){_0x45677b['include']=[{'all':!![]}];}return db[_0x7b51('0x32')][_0x7b51('0x47')](_0x45677b);})[_0x7b51('0x2c')](function(_0x10ac6b){_0x1fbd17['rows']=_0x10ac6b;return _0x1fbd17;})['then'](respondWithFilteredResult(_0x3c5850,_0x45677b))['catch'](handleError(_0x3c5850,null));};exports[_0x7b51('0x48')]=function(_0x583230,_0x2e1c48){var _0x30a4ef={'raw':!![],'where':{'id':_0x583230[_0x7b51('0x49')]['id']}},_0x3e7ed5={};_0x3e7ed5[_0x7b51('0x37')]=_[_0x7b51('0x4a')](db['ChatInternalMessage']['rawAttributes']);_0x3e7ed5[_0x7b51('0x38')]=_[_0x7b51('0x4a')](_0x583230[_0x7b51('0x38')]);_0x3e7ed5['filters']=_[_0x7b51('0x3a')](_0x3e7ed5[_0x7b51('0x37')],_0x3e7ed5[_0x7b51('0x38')]);_0x30a4ef[_0x7b51('0x3c')]=_[_0x7b51('0x3a')](_0x3e7ed5[_0x7b51('0x37')],qs[_0x7b51('0x3b')](_0x583230[_0x7b51('0x38')][_0x7b51('0x3b')]));_0x30a4ef[_0x7b51('0x3c')]=_0x30a4ef[_0x7b51('0x3c')][_0x7b51('0x4b')]?_0x30a4ef[_0x7b51('0x3c')]:_0x3e7ed5['model'];if(_0x583230['query']['includeAll']){_0x30a4ef['include']=[{'all':!![]}];}_0x30a4ef=_[_0x7b51('0x43')]({},_0x30a4ef,_0x583230[_0x7b51('0x45')]);return db['ChatInternalMessage'][_0x7b51('0x4c')](_0x30a4ef)['then'](handleEntityNotFound(_0x2e1c48,null))[_0x7b51('0x2c')](respondWithResult(_0x2e1c48,null))[_0x7b51('0x4d')](handleError(_0x2e1c48,null));};exports[_0x7b51('0x4e')]=function(_0x61c223,_0x12449a){return db[_0x7b51('0x32')][_0x7b51('0x4e')](_0x61c223[_0x7b51('0x4f')],{})['then'](respondWithResult(_0x12449a,0xc9))[_0x7b51('0x4d')](handleError(_0x12449a,null));};exports[_0x7b51('0x50')]=function(_0x44f1d4,_0x497895){if(_0x44f1d4['body']['id']){delete _0x44f1d4[_0x7b51('0x4f')]['id'];}return db[_0x7b51('0x32')][_0x7b51('0x4c')]({'where':{'id':_0x44f1d4['params']['id']}})[_0x7b51('0x2c')](handleEntityNotFound(_0x497895,null))[_0x7b51('0x2c')](saveUpdates(_0x44f1d4[_0x7b51('0x4f')],null))['then'](respondWithResult(_0x497895,null))['catch'](handleError(_0x497895,null));};exports[_0x7b51('0x2d')]=function(_0x30fe0c,_0x97645f){return db[_0x7b51('0x32')]['find']({'where':{'id':_0x30fe0c[_0x7b51('0x49')]['id']}})[_0x7b51('0x2c')](handleEntityNotFound(_0x97645f,null))[_0x7b51('0x2c')](removeEntity(_0x97645f,null))[_0x7b51('0x4d')](handleError(_0x97645f,null));};exports[_0x7b51('0x51')]=function(_0x337d5c,_0x25a50a){return db['ChatInternalMessage']['describe']()[_0x7b51('0x2c')](respondWithResult(_0x25a50a,null))[_0x7b51('0x4d')](handleError(_0x25a50a,null));};function wrapUser(_0x5d0dad){return function(_0x40c37d){var _0x59011f=_0x5d0dad[_0x7b51('0x52')]({'plain':!![]});_0x59011f[_0x7b51('0x53')]=[];if(_0x40c37d){_0x59011f[_0x7b51('0x54')]=_0x40c37d[_0x7b51('0x55')];_0x59011f['lastMessage']=_0x40c37d;}else{_0x59011f['lastMessageAt']=moment(0x0)[_0x7b51('0x56')](_0x7b51('0x57'));_0x59011f[_0x7b51('0x58')]={};}return _0x59011f;};}exports['getUsers']=function(_0x4a0d4b,_0x430617,_0xf189dd){var _0x380036=[];return db[_0x7b51('0x59')][_0x7b51('0x47')]({'where':{'role':[_0x7b51('0x5a'),_0x7b51('0x5b'),_0x7b51('0x5c')]},'attributes':['id','fullname',_0x7b51('0x2f'),_0x7b51('0x5d'),'userpic',_0x7b51('0x5e'),_0x7b51('0x5f'),'lastLoginAt',_0x7b51('0x60'),'showWebBar'],'order':qs[_0x7b51('0x40')]('-online'),'include':[{'model':db[_0x7b51('0x61')],'as':_0x7b51('0x62'),'attributes':['id',_0x7b51('0x2f'),_0x7b51('0x35')],'through':{'attributes':[]}}]})['then'](function(_0x4c1e6a){if(_0x4c1e6a){var _0x2a31ea=_0x4a0d4b[_0x7b51('0x5c')][_0x7b51('0x52')]({'plain':!![]});if(!_0x2a31ea)throw new Error(_0x7b51('0x63'));if(_0x2a31ea[_0x7b51('0x5d')]===_0x7b51('0x5c')){return db['UserProfileSection'][_0x7b51('0x4c')]({'where':{'name':'Agents','userProfileId':_0x2a31ea[_0x7b51('0x64')]},'raw':!![]})[_0x7b51('0x2c')](function(_0x6ffe65){if(_0x6ffe65){if(_0x6ffe65[_0x7b51('0x65')]===0x0){return db[_0x7b51('0x66')][_0x7b51('0x47')]({'where':{'sectionId':_0x6ffe65['id']},'raw':!![]})[_0x7b51('0x2c')](function(_0x5b31fe){var _0x36298d=[];if(_['isEmpty'](_0x5b31fe)){_0x36298d=_[_0x7b51('0x42')](_0x4c1e6a,function(_0x1b3235){if(_0x1b3235[_0x7b51('0x5d')]!=='agent'){return _0x1b3235;}});return _0x36298d;}else{for(var _0x56f2ec=0x0;_0x56f2ec<_0x4c1e6a['length'];_0x56f2ec++){var _0x10e128=_0x4c1e6a[_0x56f2ec];if(_0x10e128[_0x7b51('0x5d')]==='agent'){var _0x396c0e=_['find'](_0x5b31fe,function(_0x500c58){return _0x500c58['resourceId']===_0x10e128['id'];});if(_0x396c0e)_0x36298d['push'](_0x10e128);}else{_0x36298d[_0x7b51('0x67')](_0x10e128);}}return _0x36298d;}});}else{return _0x4c1e6a;}}else{var _0x2c00b8=_[_0x7b51('0x42')](_0x4c1e6a,function(_0x1e1527){if(_0x1e1527[_0x7b51('0x5d')]!==_0x7b51('0x5a')){return _0x1e1527;}});return _0x2c00b8;}});}else{return _0x4c1e6a;}}})[_0x7b51('0x2c')](function(_0x368dbf){var _0x4a28eb=[];if(_0x368dbf){_0x380036=_0x368dbf;for(var _0x45444d=0x0;_0x45444d<_0x368dbf[_0x7b51('0x4b')];_0x45444d+=0x1){_0x380036[_0x45444d][_0x7b51('0x53')]=[];_0x4a28eb[_0x7b51('0x67')](db['ChatInternalMessage'][_0x7b51('0x4c')]({'where':{'FromId':[_0x4a0d4b[_0x7b51('0x5c')]['id'],_0x368dbf[_0x45444d]['id']],'ToId':[_0x4a0d4b[_0x7b51('0x5c')]['id'],_0x368dbf[_0x45444d]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x7b51('0x68'),_0x7b51('0x69'),'read','body'],'order':qs[_0x7b51('0x40')](_0x7b51('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7b51('0x2c')](wrapUser(_0x368dbf[_0x45444d])));}return BPromise[_0x7b51('0x6b')](_0x4a28eb);}return[];})[_0x7b51('0x2c')](function(_0x19b562){return{'rows':_0x19b562,'count':_0x19b562['length']};})['then'](respondWithResult(_0x430617,null))[_0x7b51('0x4d')](handleError(_0x430617,null));};
\ No newline at end of file
+var _0x5ed7=['save','update','then','destroy','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','user','internal','online','allowmessenger','showWebBar','sort','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId','push','messages','ToId','read','all','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0x5ed7,0x11c));var _0x75ed=function(_0x11abab,_0x1ad3dd){_0x11abab=_0x11abab-0x0;var _0x1e2b7c=_0x5ed7[_0x11abab];return _0x1e2b7c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x75ed('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75ed('0x1'));var moment=require('moment');var BPromise=require(_0x75ed('0x2'));var Mustache=require(_0x75ed('0x3'));var util=require(_0x75ed('0x4'));var path=require(_0x75ed('0x5'));var sox=require(_0x75ed('0x6'));var csv=require(_0x75ed('0x7'));var ejs=require(_0x75ed('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75ed('0x9'));var squel=require('squel');var crypto=require(_0x75ed('0xa'));var jsforce=require(_0x75ed('0xb'));var deskjs=require(_0x75ed('0xc'));var toCsv=require(_0x75ed('0x7'));var querystring=require('querystring');var Papa=require(_0x75ed('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x75ed('0xe'));var as=require(_0x75ed('0xf'));var hardwareService=require(_0x75ed('0x10'));var logger=require('../../config/logger')(_0x75ed('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x75ed('0x12'));var db=require(_0x75ed('0x13'))['db'];config[_0x75ed('0x14')]=_[_0x75ed('0x15')](config[_0x75ed('0x14')],{'host':_0x75ed('0x16'),'port':0x18eb});var socket=require(_0x75ed('0x17'))(new Redis(config['redis']));require(_0x75ed('0x18'))[_0x75ed('0x19')](socket);function respondWithStatusCode(_0x8715e2,_0x3fc968){_0x3fc968=_0x3fc968||0xcc;return function(_0x11a465){if(_0x11a465){return _0x8715e2[_0x75ed('0x1a')](_0x3fc968);}return _0x8715e2[_0x75ed('0x1b')](_0x3fc968)[_0x75ed('0x1c')]();};}function respondWithResult(_0x28caa4,_0x1f4fa1){_0x1f4fa1=_0x1f4fa1||0xc8;return function(_0x422a8a){if(_0x422a8a){return _0x28caa4[_0x75ed('0x1b')](_0x1f4fa1)[_0x75ed('0x1d')](_0x422a8a);}};}function respondWithFilteredResult(_0x32567b,_0x34cb14){return function(_0x9a258c){if(_0x9a258c){var _0xc7ee9f=typeof _0x34cb14[_0x75ed('0x1e')]===_0x75ed('0x1f')&&typeof _0x34cb14[_0x75ed('0x20')]===_0x75ed('0x1f');var _0xb977a3=_0x9a258c[_0x75ed('0x21')];var _0x28a4a2=_0xc7ee9f?0x0:_0x34cb14['offset'];var _0x9a89f3=_0xc7ee9f?_0x9a258c[_0x75ed('0x21')]:_0x34cb14['offset']+_0x34cb14[_0x75ed('0x20')];var _0x1bd8c4;if(_0x9a89f3>=_0xb977a3){_0x9a89f3=_0xb977a3;_0x1bd8c4=0xc8;}else{_0x1bd8c4=0xce;}_0x32567b[_0x75ed('0x1b')](_0x1bd8c4);return _0x32567b['set'](_0x75ed('0x22'),_0x28a4a2+'-'+_0x9a89f3+'/'+_0xb977a3)[_0x75ed('0x1d')](_0x9a258c);}return null;};}function patchUpdates(_0x2d17cd){return function(_0x5bfa16){try{jsonpatch[_0x75ed('0x23')](_0x5bfa16,_0x2d17cd,!![]);}catch(_0x51f886){return BPromise[_0x75ed('0x24')](_0x51f886);}return _0x5bfa16[_0x75ed('0x25')]();};}function saveUpdates(_0x5781ac,_0x23eb8a){return function(_0x359e31){if(_0x359e31){return _0x359e31[_0x75ed('0x26')](_0x5781ac)[_0x75ed('0x27')](function(_0x5a70f8){return _0x5a70f8;});}return null;};}function removeEntity(_0x8cd377,_0x42c93b){return function(_0x477530){if(_0x477530){return _0x477530[_0x75ed('0x28')]()['then'](function(){_0x8cd377['status'](0xcc)[_0x75ed('0x1c')]();});}};}function handleEntityNotFound(_0xffc1d7,_0x26edd5){return function(_0x5efdd1){if(!_0x5efdd1){_0xffc1d7[_0x75ed('0x1a')](0x194);}return _0x5efdd1;};}function handleError(_0x440dea,_0x17785c){_0x17785c=_0x17785c||0x1f4;return function(_0x12cc8d){logger[_0x75ed('0x29')](_0x12cc8d[_0x75ed('0x2a')]);if(_0x12cc8d['name']){delete _0x12cc8d[_0x75ed('0x2b')];}_0x440dea[_0x75ed('0x1b')](_0x17785c)[_0x75ed('0x2c')](_0x12cc8d);};}exports['index']=function(_0x4dc113,_0x18ce30){var _0x331ad3={},_0x581769={},_0x49bab0={'count':0x0,'rows':[]};var _0x259676=_['map'](db[_0x75ed('0x2d')][_0x75ed('0x2e')],function(_0x2a4607){return{'name':_0x2a4607[_0x75ed('0x2f')],'type':_0x2a4607['type'][_0x75ed('0x30')]};});_0x581769['model']=_['map'](_0x259676,_0x75ed('0x2b'));_0x581769[_0x75ed('0x31')]=_[_0x75ed('0x32')](_0x4dc113['query']);_0x581769[_0x75ed('0x33')]=_['intersection'](_0x581769['model'],_0x581769[_0x75ed('0x31')]);_0x331ad3[_0x75ed('0x34')]=_[_0x75ed('0x35')](_0x581769[_0x75ed('0x36')],qs[_0x75ed('0x37')](_0x4dc113[_0x75ed('0x31')]['fields']));_0x331ad3['attributes']=_0x331ad3[_0x75ed('0x34')][_0x75ed('0x38')]?_0x331ad3[_0x75ed('0x34')]:_0x581769[_0x75ed('0x36')];if(!_0x4dc113[_0x75ed('0x31')][_0x75ed('0x39')](_0x75ed('0x3a'))){_0x331ad3[_0x75ed('0x20')]=qs[_0x75ed('0x20')](_0x4dc113['query']['limit']);_0x331ad3['offset']=qs['offset'](_0x4dc113[_0x75ed('0x31')][_0x75ed('0x1e')]);}_0x331ad3[_0x75ed('0x3b')]=qs['sort'](_0x4dc113[_0x75ed('0x31')]['sort']);_0x331ad3[_0x75ed('0x3c')]=qs[_0x75ed('0x33')](_[_0x75ed('0x3d')](_0x4dc113['query'],_0x581769['filters']),_0x259676);if(_0x4dc113['query'][_0x75ed('0x3e')]){_0x331ad3[_0x75ed('0x3c')]=_['merge'](_0x331ad3['where'],{'$or':_[_0x75ed('0x3f')](_0x259676,function(_0x4da6bc){if(_0x4da6bc[_0x75ed('0x40')]!==_0x75ed('0x41')){var _0xce8334={};_0xce8334[_0x4da6bc['name']]={'$like':'%'+_0x4dc113['query'][_0x75ed('0x3e')]+'%'};return _0xce8334;}})});}_0x331ad3=_[_0x75ed('0x42')]({},_0x331ad3,_0x4dc113[_0x75ed('0x43')]);var _0x48cdc7={'where':_0x331ad3[_0x75ed('0x3c')]};return db[_0x75ed('0x2d')][_0x75ed('0x21')](_0x48cdc7)['then'](function(_0x2f7477){_0x49bab0[_0x75ed('0x21')]=_0x2f7477;if(_0x4dc113[_0x75ed('0x31')][_0x75ed('0x44')]){_0x331ad3[_0x75ed('0x45')]=[{'all':!![]}];}return db[_0x75ed('0x2d')][_0x75ed('0x46')](_0x331ad3);})[_0x75ed('0x27')](function(_0x3ed486){_0x49bab0[_0x75ed('0x47')]=_0x3ed486;return _0x49bab0;})[_0x75ed('0x27')](respondWithFilteredResult(_0x18ce30,_0x331ad3))[_0x75ed('0x48')](handleError(_0x18ce30,null));};exports[_0x75ed('0x49')]=function(_0x2a8d7e,_0x5e567d){var _0x5a687e={'raw':!![],'where':{'id':_0x2a8d7e['params']['id']}},_0x44ae7a={};_0x44ae7a[_0x75ed('0x36')]=_[_0x75ed('0x32')](db[_0x75ed('0x2d')][_0x75ed('0x2e')]);_0x44ae7a[_0x75ed('0x31')]=_['keys'](_0x2a8d7e[_0x75ed('0x31')]);_0x44ae7a[_0x75ed('0x33')]=_[_0x75ed('0x35')](_0x44ae7a[_0x75ed('0x36')],_0x44ae7a['query']);_0x5a687e['attributes']=_['intersection'](_0x44ae7a[_0x75ed('0x36')],qs[_0x75ed('0x37')](_0x2a8d7e['query'][_0x75ed('0x37')]));_0x5a687e[_0x75ed('0x34')]=_0x5a687e['attributes'][_0x75ed('0x38')]?_0x5a687e['attributes']:_0x44ae7a['model'];if(_0x2a8d7e[_0x75ed('0x31')]['includeAll']){_0x5a687e[_0x75ed('0x45')]=[{'all':!![]}];}_0x5a687e=_[_0x75ed('0x42')]({},_0x5a687e,_0x2a8d7e['options']);return db[_0x75ed('0x2d')][_0x75ed('0x4a')](_0x5a687e)[_0x75ed('0x27')](handleEntityNotFound(_0x5e567d,null))[_0x75ed('0x27')](respondWithResult(_0x5e567d,null))[_0x75ed('0x48')](handleError(_0x5e567d,null));};exports[_0x75ed('0x4b')]=function(_0xad8e9f,_0x46f1e7){return db[_0x75ed('0x2d')][_0x75ed('0x4b')](_0xad8e9f[_0x75ed('0x4c')],{})['then'](respondWithResult(_0x46f1e7,0xc9))[_0x75ed('0x48')](handleError(_0x46f1e7,null));};exports['update']=function(_0x40a8d1,_0x5c8f9d){if(_0x40a8d1[_0x75ed('0x4c')]['id']){delete _0x40a8d1[_0x75ed('0x4c')]['id'];}return db[_0x75ed('0x2d')][_0x75ed('0x4a')]({'where':{'id':_0x40a8d1[_0x75ed('0x4d')]['id']}})[_0x75ed('0x27')](handleEntityNotFound(_0x5c8f9d,null))['then'](saveUpdates(_0x40a8d1[_0x75ed('0x4c')],null))[_0x75ed('0x27')](respondWithResult(_0x5c8f9d,null))['catch'](handleError(_0x5c8f9d,null));};exports[_0x75ed('0x28')]=function(_0x2bb938,_0x30ce06){return db[_0x75ed('0x2d')][_0x75ed('0x4a')]({'where':{'id':_0x2bb938[_0x75ed('0x4d')]['id']}})['then'](handleEntityNotFound(_0x30ce06,null))['then'](removeEntity(_0x30ce06,null))[_0x75ed('0x48')](handleError(_0x30ce06,null));};exports[_0x75ed('0x4e')]=function(_0x382fa4,_0x3a0dbe){return db[_0x75ed('0x2d')][_0x75ed('0x4e')]()[_0x75ed('0x27')](respondWithResult(_0x3a0dbe,null))[_0x75ed('0x48')](handleError(_0x3a0dbe,null));};function wrapUser(_0xf4f425){return function(_0x27e564){var _0x33174d=_0xf4f425[_0x75ed('0x4f')]({'plain':!![]});_0x33174d['messages']=[];if(_0x27e564){_0x33174d['lastMessageAt']=_0x27e564[_0x75ed('0x50')];_0x33174d[_0x75ed('0x51')]=_0x27e564;}else{_0x33174d[_0x75ed('0x52')]=moment(0x0)[_0x75ed('0x53')](_0x75ed('0x54'));_0x33174d[_0x75ed('0x51')]={};}return _0x33174d;};}exports[_0x75ed('0x55')]=function(_0x5906ca,_0x307b02,_0xbc8294){var _0x3e8040=[];return db['User'][_0x75ed('0x46')]({'where':{'role':[_0x75ed('0x56'),'admin',_0x75ed('0x57')]},'attributes':['id','fullname',_0x75ed('0x2b'),'role','userpic',_0x75ed('0x58'),_0x75ed('0x59'),'lastLoginAt',_0x75ed('0x5a'),_0x75ed('0x5b')],'order':qs[_0x75ed('0x5c')]('-online'),'include':[{'model':db[_0x75ed('0x5d')],'as':_0x75ed('0x5e'),'attributes':['id',_0x75ed('0x2b'),_0x75ed('0x40')],'through':{'attributes':[]}}]})[_0x75ed('0x27')](function(_0x4c80f8){if(_0x4c80f8){var _0x3c757b=_0x5906ca[_0x75ed('0x57')][_0x75ed('0x4f')]({'plain':!![]});if(!_0x3c757b)throw new Error(_0x75ed('0x5f'));if(_0x3c757b[_0x75ed('0x60')]===_0x75ed('0x57')){return db[_0x75ed('0x61')][_0x75ed('0x4a')]({'where':{'name':_0x75ed('0x62'),'userProfileId':_0x3c757b['userProfileId']},'raw':!![]})[_0x75ed('0x27')](function(_0x2e3107){if(_0x2e3107){if(_0x2e3107[_0x75ed('0x63')]===0x0){return db['UserProfileResource'][_0x75ed('0x46')]({'where':{'sectionId':_0x2e3107['id']},'raw':!![]})[_0x75ed('0x27')](function(_0x54fa6f){var _0xf08da=[];if(_[_0x75ed('0x64')](_0x54fa6f)){_0xf08da=_[_0x75ed('0x3e')](_0x4c80f8,function(_0x5b2c7a){if(_0x5b2c7a['role']!=='agent'){return _0x5b2c7a;}});return _0xf08da;}else{for(var _0x5d7331=0x0;_0x5d7331<_0x4c80f8[_0x75ed('0x38')];_0x5d7331++){var _0x5ca16d=_0x4c80f8[_0x5d7331];if(_0x5ca16d['role']===_0x75ed('0x56')){var _0x3901cc=_['find'](_0x54fa6f,function(_0x178511){return _0x178511[_0x75ed('0x65')]===_0x5ca16d['id'];});if(_0x3901cc)_0xf08da[_0x75ed('0x66')](_0x5ca16d);}else{_0xf08da[_0x75ed('0x66')](_0x5ca16d);}}return _0xf08da;}});}else{return _0x4c80f8;}}else{var _0x103958=_[_0x75ed('0x3e')](_0x4c80f8,function(_0x406725){if(_0x406725['role']!==_0x75ed('0x56')){return _0x406725;}});return _0x103958;}});}else{return _0x4c80f8;}}})[_0x75ed('0x27')](function(_0x35b4f3){var _0x39da36=[];if(_0x35b4f3){_0x3e8040=_0x35b4f3;for(var _0x534fcf=0x0;_0x534fcf<_0x35b4f3[_0x75ed('0x38')];_0x534fcf+=0x1){_0x3e8040[_0x534fcf][_0x75ed('0x67')]=[];_0x39da36[_0x75ed('0x66')](db[_0x75ed('0x2d')]['find']({'where':{'FromId':[_0x5906ca[_0x75ed('0x57')]['id'],_0x35b4f3[_0x534fcf]['id']],'ToId':[_0x5906ca[_0x75ed('0x57')]['id'],_0x35b4f3[_0x534fcf]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x75ed('0x68'),_0x75ed('0x69'),_0x75ed('0x4c')],'order':qs[_0x75ed('0x5c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x75ed('0x27')](wrapUser(_0x35b4f3[_0x534fcf])));}return BPromise[_0x75ed('0x6a')](_0x39da36);}return[];})['then'](function(_0x2418cd){return{'rows':_0x2418cd,'count':_0x2418cd['length']};})['then'](respondWithResult(_0x307b02,null))['catch'](handleError(_0x307b02,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index c62e0b4..8b9a0df 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 _0xf9f8=['hook','exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x185d5a,_0x51280b){var _0x1f04e6=function(_0x371bfd){while(--_0x371bfd){_0x185d5a['push'](_0x185d5a['shift']());}};_0x1f04e6(++_0x51280b);}(_0xf9f8,0x98));var _0x8f9f=function(_0x3b182c,_0x3905c5){_0x3b182c=_0x3b182c-0x0;var _0x13c9e0=_0xf9f8[_0x3b182c];return _0x13c9e0;};'use strict';var EventEmitter=require(_0x8f9f('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x8f9f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8f9f('0x2')](0x0);var events={'afterCreate':_0x8f9f('0x3'),'afterUpdate':_0x8f9f('0x4'),'afterDestroy':_0x8f9f('0x5')};function emitEvent(_0x27f113){return function(_0x5f52c1,_0x1a2a20,_0x293b92){ChatInternalMessageEvents[_0x8f9f('0x6')](_0x27f113+':'+_0x5f52c1['id'],_0x5f52c1);ChatInternalMessageEvents[_0x8f9f('0x6')](_0x27f113,_0x5f52c1);_0x293b92(null);};}for(var e in events){if(events[_0x8f9f('0x7')](e)){var event=events[e];ChatInternalMessage[_0x8f9f('0x8')](e,emitEvent(event));}}module[_0x8f9f('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb1fa=['save','hook','ChatInternalMessage'];(function(_0x3003fc,_0x5ac5de){var _0x22cb43=function(_0x478661){while(--_0x478661){_0x3003fc['push'](_0x3003fc['shift']());}};_0x22cb43(++_0x5ac5de);}(_0xb1fa,0x9e));var _0xab1f=function(_0x2d51ed,_0x40cc5f){_0x2d51ed=_0x2d51ed-0x0;var _0x368cea=_0xb1fa[_0x2d51ed];return _0x368cea;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xab1f('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xab1f('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4fa20a){return function(_0x554576,_0x50e03f,_0x2f3821){ChatInternalMessageEvents['emit'](_0x4fa20a+':'+_0x554576['id'],_0x554576);ChatInternalMessageEvents['emit'](_0x4fa20a,_0x554576);_0x2f3821(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xab1f('0x2')](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 b9910b2..350bfdb 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 _0x7daa=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x648151,_0xd23b19){var _0x5bde8d=function(_0x4a0489){while(--_0x4a0489){_0x648151['push'](_0x648151['shift']());}};_0x5bde8d(++_0xd23b19);}(_0x7daa,0x15d));var _0xa7da=function(_0x268cfd,_0x401b42){_0x268cfd=_0x268cfd-0x0;var _0x2b94c8=_0x7daa[_0x268cfd];return _0x2b94c8;};'use strict';var _=require('lodash');var util=require(_0xa7da('0x0'));var logger=require(_0xa7da('0x1'))(_0xa7da('0x2'));var moment=require(_0xa7da('0x3'));var BPromise=require(_0xa7da('0x4'));var rp=require(_0xa7da('0x5'));var fs=require('fs');var path=require(_0xa7da('0x6'));var rimraf=require(_0xa7da('0x7'));var config=require(_0xa7da('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xa7da('0x9')]=function(_0x4a84a3,_0x470bd1){return _0x4a84a3[_0xa7da('0xa')](_0xa7da('0xb'),attributes,{'tableName':_0xa7da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa7da('0xd'),'collate':_0xa7da('0xe')});};
\ No newline at end of file
+var _0x9797=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x38acab,_0x5db216){var _0x560db8=function(_0x4e3d19){while(--_0x4e3d19){_0x38acab['push'](_0x38acab['shift']());}};_0x560db8(++_0x5db216);}(_0x9797,0xdc));var _0x7979=function(_0x583e98,_0x5534f5){_0x583e98=_0x583e98-0x0;var _0x84cc30=_0x9797[_0x583e98];return _0x84cc30;};'use strict';var _=require(_0x7979('0x0'));var util=require(_0x7979('0x1'));var logger=require('../../config/logger')(_0x7979('0x2'));var moment=require(_0x7979('0x3'));var BPromise=require(_0x7979('0x4'));var rp=require(_0x7979('0x5'));var fs=require('fs');var path=require(_0x7979('0x6'));var rimraf=require(_0x7979('0x7'));var config=require(_0x7979('0x8'));var attributes=require(_0x7979('0x9'));module[_0x7979('0xa')]=function(_0x50c3bd,_0x41351f){return _0x50c3bd[_0x7979('0xb')](_0x7979('0xc'),attributes,{'tableName':_0x7979('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7979('0xe'),'collate':_0x7979('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 25227af..46eac2d 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 _0xa979=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x2d83a5,_0x39b775){var _0x34c64b=function(_0x18d49d){while(--_0x18d49d){_0x2d83a5['push'](_0x2d83a5['shift']());}};_0x34c64b(++_0x39b775);}(_0xa979,0x17a));var _0x9a97=function(_0x32fe22,_0x5287d6){_0x32fe22=_0x32fe22-0x0;var _0x319ba7=_0xa979[_0x32fe22];return _0x319ba7;};'use strict';var _=require(_0x9a97('0x0'));var util=require(_0x9a97('0x1'));var moment=require(_0x9a97('0x2'));var BPromise=require(_0x9a97('0x3'));var rs=require(_0x9a97('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a97('0x5'))['db'];var utils=require(_0x9a97('0x6'));var logger=require(_0x9a97('0x7'))(_0x9a97('0x8'));var config=require(_0x9a97('0x9'));var jayson=require(_0x9a97('0xa'));var client=jayson[_0x9a97('0xb')][_0x9a97('0xc')]({'port':0x232a});config[_0x9a97('0xd')]=_['defaults'](config[_0x9a97('0xd')],{'host':_0x9a97('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9a97('0xf'))[_0x9a97('0x10')](socket);function respondWithRpcPromise(_0x5de727,_0x4f28a6,_0x5c710f){return new BPromise(function(_0x1f9cfd,_0x4805e7){return client[_0x9a97('0x11')](_0x5de727,_0x5c710f)[_0x9a97('0x12')](function(_0x9cc22a){logger[_0x9a97('0x13')](_0x9a97('0x14'),_0x4f28a6,_0x9a97('0x15'));logger['debug'](_0x9a97('0x16'),_0x4f28a6,_0x9a97('0x15'),JSON[_0x9a97('0x17')](_0x9cc22a));if(_0x9cc22a['error']){if(_0x9cc22a[_0x9a97('0x18')]['code']===0x1f4){logger[_0x9a97('0x18')](_0x9a97('0x14'),_0x4f28a6,_0x9cc22a[_0x9a97('0x18')][_0x9a97('0x19')]);return _0x4805e7(_0x9cc22a[_0x9a97('0x18')][_0x9a97('0x19')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4f28a6,_0x9cc22a['error'][_0x9a97('0x19')]);return _0x1f9cfd(_0x9cc22a[_0x9a97('0x18')][_0x9a97('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x4f28a6,_0x9a97('0x15'));_0x1f9cfd(_0x9cc22a[_0x9a97('0x1a')][_0x9a97('0x19')]);}})['catch'](function(_0x2cd3ba){logger[_0x9a97('0x18')](_0x9a97('0x14'),_0x4f28a6,_0x2cd3ba);_0x4805e7(_0x2cd3ba);});});}
\ No newline at end of file
+var _0x4390=['error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1b63f1,_0x2fd7e0){var _0x189093=function(_0x8ec513){while(--_0x8ec513){_0x1b63f1['push'](_0x1b63f1['shift']());}};_0x189093(++_0x2fd7e0);}(_0x4390,0x64));var _0x0439=function(_0x3c8df6,_0x3067a3){_0x3c8df6=_0x3c8df6-0x0;var _0xa73cd6=_0x4390[_0x3c8df6];return _0xa73cd6;};'use strict';var _=require('lodash');var util=require(_0x0439('0x0'));var moment=require(_0x0439('0x1'));var BPromise=require(_0x0439('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0439('0x3'))['db'];var utils=require(_0x0439('0x4'));var logger=require(_0x0439('0x5'))(_0x0439('0x6'));var config=require(_0x0439('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0439('0x8')]['http']({'port':0x232a});config[_0x0439('0x9')]=_[_0x0439('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0439('0xb'))(new Redis(config[_0x0439('0x9')]));require(_0x0439('0xc'))['register'](socket);function respondWithRpcPromise(_0x56a29f,_0x202236,_0x344108){return new BPromise(function(_0x3a0262,_0x15f886){return client[_0x0439('0xd')](_0x56a29f,_0x344108)[_0x0439('0xe')](function(_0xc26b84){logger[_0x0439('0xf')](_0x0439('0x10'),_0x202236,'request\x20sent');logger['debug'](_0x0439('0x11'),_0x202236,_0x0439('0x12'),JSON[_0x0439('0x13')](_0xc26b84));if(_0xc26b84[_0x0439('0x14')]){if(_0xc26b84[_0x0439('0x14')]['code']===0x1f4){logger[_0x0439('0x14')](_0x0439('0x10'),_0x202236,_0xc26b84[_0x0439('0x14')]['message']);return _0x15f886(_0xc26b84[_0x0439('0x14')][_0x0439('0x15')]);}logger[_0x0439('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x202236,_0xc26b84[_0x0439('0x14')]['message']);return _0x3a0262(_0xc26b84[_0x0439('0x14')]['message']);}else{logger[_0x0439('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x202236,_0x0439('0x12'));_0x3a0262(_0xc26b84[_0x0439('0x16')][_0x0439('0x15')]);}})[_0x0439('0x17')](function(_0x40d337){logger[_0x0439('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x202236,_0x40d337);_0x15f886(_0x40d337);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 307a674..4bf5004 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 _0xedea=['emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x423e4b,_0x1bb75b){var _0x626fd4=function(_0x1e731e){while(--_0x1e731e){_0x423e4b['push'](_0x423e4b['shift']());}};_0x626fd4(++_0x1bb75b);}(_0xedea,0xcc));var _0xaede=function(_0x2f67d2,_0x3b21ba){_0x2f67d2=_0x2f67d2-0x0;var _0x3f0f07=_0xedea[_0x2f67d2];return _0x3f0f07;};'use strict';var ChatInternalMessageEvents=require(_0xaede('0x0'));var events=[_0xaede('0x1'),_0xaede('0x2'),_0xaede('0x3')];function createListener(_0x5b3fa3,_0x4a4cb8){return function(_0x4626a3){_0x4a4cb8[_0xaede('0x4')](_0x5b3fa3,_0x4626a3);};}function removeListener(_0x8286a,_0x2b9a79){return function(){ChatInternalMessageEvents['removeListener'](_0x8286a,_0x2b9a79);};}exports[_0xaede('0x5')]=function(_0x2af0b1){for(var _0x4ac4c0=0x0,_0x273b9=events[_0xaede('0x6')];_0x4ac4c0<_0x273b9;_0x4ac4c0++){var _0x2d0e52=events[_0x4ac4c0];var _0x144951=createListener(_0xaede('0x7')+_0x2d0e52,_0x2af0b1);ChatInternalMessageEvents['on'](_0x2d0e52,_0x144951);}};
\ No newline at end of file
+var _0xec3b=['./chatInternalMessage.events','save','update','removeListener'];(function(_0x3a4574,_0x585526){var _0x13352a=function(_0x398863){while(--_0x398863){_0x3a4574['push'](_0x3a4574['shift']());}};_0x13352a(++_0x585526);}(_0xec3b,0x1f0));var _0xbec3=function(_0x4902e8,_0x1ca53e){_0x4902e8=_0x4902e8-0x0;var _0x4c31fe=_0xec3b[_0x4902e8];return _0x4c31fe;};'use strict';var ChatInternalMessageEvents=require(_0xbec3('0x0'));var events=[_0xbec3('0x1'),'remove',_0xbec3('0x2')];function createListener(_0x4499bb,_0x5758b2){return function(_0x4e3037){_0x5758b2['emit'](_0x4499bb,_0x4e3037);};}function removeListener(_0x285e99,_0x24c42f){return function(){ChatInternalMessageEvents[_0xbec3('0x3')](_0x285e99,_0x24c42f);};}exports['register']=function(_0x5d4141){for(var _0x1c8be2=0x0,_0x34dfa4=events['length'];_0x1c8be2<_0x34dfa4;_0x1c8be2++){var _0xd2d6ff=events[_0x1c8be2];var _0x19229d=createListener('chatInternalMessage:'+_0xd2d6ff,_0x5d4141);ChatInternalMessageEvents['on'](_0xd2d6ff,_0x19229d);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4972e60..cafe564 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 _0x871b=['get','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x1b8b84,_0x51ec50){var _0x4959dd=function(_0x3d1c3d){while(--_0x3d1c3d){_0x1b8b84['push'](_0x1b8b84['shift']());}};_0x4959dd(++_0x51ec50);}(_0x871b,0xe7));var _0xb871=function(_0x573548,_0x152c83){_0x573548=_0x573548-0x0;var _0x432394=_0x871b[_0x573548];return _0x432394;};'use strict';var multer=require(_0xb871('0x0'));var util=require(_0xb871('0x1'));var path=require(_0xb871('0x2'));var timeout=require(_0xb871('0x3'));var express=require('express');var router=express[_0xb871('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb871('0x5'));var interaction=require(_0xb871('0x6'));var config=require(_0xb871('0x7'));var controller=require(_0xb871('0x8'));router[_0xb871('0x9')]('/',auth['isAuthenticated'](),controller[_0xb871('0xa')]);router[_0xb871('0x9')]('/describe',auth[_0xb871('0xb')](),controller['describe']);router['get']('/users',auth['isAuthenticated'](),controller['getUsers']);router[_0xb871('0x9')]('/:id',auth[_0xb871('0xb')](),controller[_0xb871('0xc')]);router[_0xb871('0xd')]('/',auth[_0xb871('0xb')](),controller[_0xb871('0xe')]);router['put'](_0xb871('0xf'),controller[_0xb871('0x10')]);router[_0xb871('0x11')](_0xb871('0xf'),auth[_0xb871('0xb')](),controller[_0xb871('0x12')]);module[_0xb871('0x13')]=router;
\ No newline at end of file
+var _0x0422=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x2df0f0,_0x121f5d){var _0x863c9f=function(_0x245745){while(--_0x245745){_0x2df0f0['push'](_0x2df0f0['shift']());}};_0x863c9f(++_0x121f5d);}(_0x0422,0x1b3));var _0x2042=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x0422[_0x40a825];return _0x273a54;};'use strict';var multer=require(_0x2042('0x0'));var util=require(_0x2042('0x1'));var path=require(_0x2042('0x2'));var timeout=require(_0x2042('0x3'));var express=require(_0x2042('0x4'));var router=express[_0x2042('0x5')]();var fs_extra=require(_0x2042('0x6'));var auth=require(_0x2042('0x7'));var interaction=require(_0x2042('0x8'));var config=require('../../config/environment');var controller=require(_0x2042('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2042('0xa')](_0x2042('0xb'),auth[_0x2042('0xc')](),controller[_0x2042('0xd')]);router['get']('/users',auth[_0x2042('0xc')](),controller['getUsers']);router[_0x2042('0xa')](_0x2042('0xe'),auth[_0x2042('0xc')](),controller[_0x2042('0xf')]);router[_0x2042('0x10')]('/',auth[_0x2042('0xc')](),controller[_0x2042('0x11')]);router[_0x2042('0x12')]('/:id',controller[_0x2042('0x13')]);router[_0x2042('0x14')](_0x2042('0xe'),auth[_0x2042('0xc')](),controller['destroy']);module[_0x2042('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 349a9d3..1eb5f78 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 _0x7df3=['out','DATE','STRING','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x7df3,0x1cc));var _0x37df=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7df3[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'body':{'type':Sequelize['TEXT'](_0x37df('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x37df('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x37df('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x37df('0x5')]},'providerName':{'type':Sequelize[_0x37df('0x6')]},'providerResponse':{'type':Sequelize[_0x37df('0x7')]}};
\ No newline at end of file
+var _0x9158=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x9158,0x16e));var _0x8915=function(_0x396680,_0x5ac1e5){_0x396680=_0x396680-0x0;var _0x112aae=_0x9158[_0x396680];return _0x112aae;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'body':{'type':Sequelize[_0x8915('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8915('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8915('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8915('0x5')]},'providerName':{'type':Sequelize[_0x8915('0x6')]},'providerResponse':{'type':Sequelize[_0x8915('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 58c2e68..392e701 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 _0xf5fc=['redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','status','end','offset','limit','count','json','apply','reject','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','isNil','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','User','rejectmessage','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5fc,0x169));var _0xcf5f=function(_0x39db49,_0x5a1bfd){_0x39db49=_0x39db49-0x0;var _0x345c13=_0xf5fc[_0x39db49];return _0x345c13;};'use strict';var emlformat=require(_0xcf5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf5f('0x1'));var jsonpatch=require(_0xcf5f('0x2'));var rp=require('request-promise');var moment=require(_0xcf5f('0x3'));var BPromise=require(_0xcf5f('0x4'));var Mustache=require(_0xcf5f('0x5'));var util=require(_0xcf5f('0x6'));var path=require(_0xcf5f('0x7'));var sox=require(_0xcf5f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf5f('0x9'));var _=require(_0xcf5f('0xa'));var squel=require(_0xcf5f('0xb'));var crypto=require('crypto');var jsforce=require(_0xcf5f('0xc'));var deskjs=require(_0xcf5f('0xd'));var toCsv=require(_0xcf5f('0xe'));var querystring=require(_0xcf5f('0xf'));var Papa=require(_0xcf5f('0x10'));var Redis=require(_0xcf5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf5f('0x12'))(_0xcf5f('0x13'));var utils=require(_0xcf5f('0x14'));var config=require(_0xcf5f('0x15'));var licenseUtil=require(_0xcf5f('0x16'));var db=require('../../mysqldb')['db'];config[_0xcf5f('0x17')]=_['defaults'](config[_0xcf5f('0x17')],{'host':_0xcf5f('0x18'),'port':0x18eb});var socket=require(_0xcf5f('0x19'))(new Redis(config[_0xcf5f('0x17')]));require('./chatMessage.socket')[_0xcf5f('0x1a')](socket);var jayson=require(_0xcf5f('0x1b'));var client=jayson[_0xcf5f('0x1c')][_0xcf5f('0x1d')]({'port':0x232c});var client9002=jayson[_0xcf5f('0x1c')][_0xcf5f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1b25d7,_0x3b4dfc,_0x43cd6a,_0x49509e){return new BPromise(function(_0xfd5812,_0x3c5736){var _0x146427=_0x49509e||client;return _0x146427['request'](_0x1b25d7,_0x43cd6a)[_0xcf5f('0x1e')](function(_0x595bd4){logger[_0xcf5f('0x1f')](_0xcf5f('0x20'),_0x3b4dfc,'request\x20sent');logger[_0xcf5f('0x21')](_0xcf5f('0x22'),_0x3b4dfc,'request\x20sent',JSON['stringify'](_0x595bd4));if(_0x595bd4[_0xcf5f('0x23')]){if(_0x595bd4['error'][_0xcf5f('0x24')]===0x1f4){logger[_0xcf5f('0x23')](_0xcf5f('0x20'),_0x3b4dfc,_0x595bd4[_0xcf5f('0x23')]['message']);return _0x3c5736(_0x595bd4[_0xcf5f('0x23')][_0xcf5f('0x25')]);}logger[_0xcf5f('0x23')](_0xcf5f('0x20'),_0x3b4dfc,_0x595bd4['error'][_0xcf5f('0x25')]);return _0xfd5812(_0x595bd4[_0xcf5f('0x23')][_0xcf5f('0x25')]);}else{logger['info'](_0xcf5f('0x20'),_0x3b4dfc,_0xcf5f('0x26'));_0xfd5812(_0x595bd4['result'][_0xcf5f('0x25')]);}})[_0xcf5f('0x27')](function(_0x58cfe2){logger[_0xcf5f('0x23')](_0xcf5f('0x20'),_0x3b4dfc,_0x58cfe2);_0x3c5736(_0x58cfe2);});});}function respondWithStatusCode(_0x4f86c9,_0x32087c){_0x32087c=_0x32087c||0xcc;return function(_0x375ffb){if(_0x375ffb){return _0x4f86c9['sendStatus'](_0x32087c);}return _0x4f86c9[_0xcf5f('0x28')](_0x32087c)[_0xcf5f('0x29')]();};}function respondWithResult(_0x3bb086,_0x224d95){_0x224d95=_0x224d95||0xc8;return function(_0x36c8bf){if(_0x36c8bf){return _0x3bb086['status'](_0x224d95)['json'](_0x36c8bf);}};}function respondWithFilteredResult(_0x542f47,_0x4571ea){return function(_0x1f8eef){if(_0x1f8eef){var _0x2e887a=typeof _0x4571ea[_0xcf5f('0x2a')]==='undefined'&&typeof _0x4571ea[_0xcf5f('0x2b')]==='undefined';var _0x184b94=_0x1f8eef[_0xcf5f('0x2c')];var _0x30e207=_0x2e887a?0x0:_0x4571ea['offset'];var _0x46b43a=_0x2e887a?_0x1f8eef[_0xcf5f('0x2c')]:_0x4571ea['offset']+_0x4571ea[_0xcf5f('0x2b')];var _0x5c86ec;if(_0x46b43a>=_0x184b94){_0x46b43a=_0x184b94;_0x5c86ec=0xc8;}else{_0x5c86ec=0xce;}_0x542f47[_0xcf5f('0x28')](_0x5c86ec);return _0x542f47['set']('Content-Range',_0x30e207+'-'+_0x46b43a+'/'+_0x184b94)[_0xcf5f('0x2d')](_0x1f8eef);}return null;};}function patchUpdates(_0x3afca1){return function(_0x4b469b){try{jsonpatch[_0xcf5f('0x2e')](_0x4b469b,_0x3afca1,!![]);}catch(_0x1848a9){return BPromise[_0xcf5f('0x2f')](_0x1848a9);}return _0x4b469b[_0xcf5f('0x30')]();};}function saveUpdates(_0x1d6646,_0x2172ab){return function(_0x5108b3){if(_0x5108b3){return _0x5108b3[_0xcf5f('0x31')](_0x1d6646)[_0xcf5f('0x1e')](function(_0x3e5533){return _0x3e5533;});}return null;};}function removeEntity(_0x5e2934,_0x3901ce){return function(_0x4ecab3){if(_0x4ecab3){return _0x4ecab3[_0xcf5f('0x32')]()[_0xcf5f('0x1e')](function(){_0x5e2934[_0xcf5f('0x28')](0xcc)[_0xcf5f('0x29')]();});}};}function handleEntityNotFound(_0x987bd2,_0x8611f4){return function(_0x3bfe94){if(!_0x3bfe94){_0x987bd2['sendStatus'](0x194);}return _0x3bfe94;};}function handleError(_0x353909,_0x475c75){_0x475c75=_0x475c75||0x1f4;return function(_0x4182e1){logger[_0xcf5f('0x23')](_0x4182e1[_0xcf5f('0x33')]);if(_0x4182e1[_0xcf5f('0x34')]){delete _0x4182e1['name'];}_0x353909['status'](_0x475c75)['send'](_0x4182e1);};}exports[_0xcf5f('0x35')]=function(_0x2a94ab,_0x25778f){var _0xe28a25={},_0xcfb354={},_0x47f3f6={'count':0x0,'rows':[]};var _0x3685b0=_[_0xcf5f('0x36')](db[_0xcf5f('0x37')][_0xcf5f('0x38')],function(_0x227cde){return{'name':_0x227cde['fieldName'],'type':_0x227cde['type'][_0xcf5f('0x39')]};});_0xcfb354[_0xcf5f('0x3a')]=_[_0xcf5f('0x36')](_0x3685b0,'name');_0xcfb354[_0xcf5f('0x3b')]=_[_0xcf5f('0x3c')](_0x2a94ab['query']);_0xcfb354[_0xcf5f('0x3d')]=_[_0xcf5f('0x3e')](_0xcfb354['model'],_0xcfb354['query']);_0xe28a25['attributes']=_[_0xcf5f('0x3e')](_0xcfb354[_0xcf5f('0x3a')],qs[_0xcf5f('0x3f')](_0x2a94ab['query'][_0xcf5f('0x3f')]));_0xe28a25['attributes']=_0xe28a25[_0xcf5f('0x40')][_0xcf5f('0x41')]?_0xe28a25['attributes']:_0xcfb354['model'];if(!_0x2a94ab[_0xcf5f('0x3b')][_0xcf5f('0x42')](_0xcf5f('0x43'))){_0xe28a25['limit']=qs[_0xcf5f('0x2b')](_0x2a94ab['query'][_0xcf5f('0x2b')]);_0xe28a25[_0xcf5f('0x2a')]=qs[_0xcf5f('0x2a')](_0x2a94ab['query'][_0xcf5f('0x2a')]);}_0xe28a25[_0xcf5f('0x44')]=qs[_0xcf5f('0x45')](_0x2a94ab[_0xcf5f('0x3b')][_0xcf5f('0x45')]);_0xe28a25[_0xcf5f('0x46')]=qs[_0xcf5f('0x3d')](_['pick'](_0x2a94ab[_0xcf5f('0x3b')],_0xcfb354[_0xcf5f('0x3d')]),_0x3685b0);if(_0x2a94ab['query'][_0xcf5f('0x47')]){_0xe28a25[_0xcf5f('0x46')]=_[_0xcf5f('0x48')](_0xe28a25['where'],{'$or':_[_0xcf5f('0x36')](_0x3685b0,function(_0x18c5ba){if(_0x18c5ba['type']!==_0xcf5f('0x49')){var _0x4923a9={};_0x4923a9[_0x18c5ba['name']]={'$like':'%'+_0x2a94ab[_0xcf5f('0x3b')]['filter']+'%'};return _0x4923a9;}})});}_0xe28a25=_[_0xcf5f('0x48')]({},_0xe28a25,_0x2a94ab[_0xcf5f('0x4a')]);var _0xab2c84={'where':_0xe28a25[_0xcf5f('0x46')]};return db[_0xcf5f('0x37')]['count'](_0xab2c84)['then'](function(_0x57d538){_0x47f3f6[_0xcf5f('0x2c')]=_0x57d538;if(_0x2a94ab['query'][_0xcf5f('0x4b')]){_0xe28a25[_0xcf5f('0x4c')]=[{'all':!![]}];}return db[_0xcf5f('0x37')][_0xcf5f('0x4d')](_0xe28a25);})[_0xcf5f('0x1e')](function(_0x1f270e){_0x47f3f6[_0xcf5f('0x4e')]=_0x1f270e;return _0x47f3f6;})[_0xcf5f('0x1e')](respondWithFilteredResult(_0x25778f,_0xe28a25))[_0xcf5f('0x27')](handleError(_0x25778f,null));};exports[_0xcf5f('0x4f')]=function(_0x314e87,_0x583bde){var _0x1e2457={'raw':!![],'where':{'id':_0x314e87[_0xcf5f('0x50')]['id']}},_0x418ac1={};_0x418ac1[_0xcf5f('0x3a')]=_['keys'](db[_0xcf5f('0x37')]['rawAttributes']);_0x418ac1[_0xcf5f('0x3b')]=_[_0xcf5f('0x3c')](_0x314e87[_0xcf5f('0x3b')]);_0x418ac1[_0xcf5f('0x3d')]=_[_0xcf5f('0x3e')](_0x418ac1[_0xcf5f('0x3a')],_0x418ac1[_0xcf5f('0x3b')]);_0x1e2457[_0xcf5f('0x40')]=_[_0xcf5f('0x3e')](_0x418ac1[_0xcf5f('0x3a')],qs[_0xcf5f('0x3f')](_0x314e87['query'][_0xcf5f('0x3f')]));_0x1e2457['attributes']=_0x1e2457['attributes'][_0xcf5f('0x41')]?_0x1e2457[_0xcf5f('0x40')]:_0x418ac1[_0xcf5f('0x3a')];if(_0x314e87[_0xcf5f('0x3b')][_0xcf5f('0x4b')]){_0x1e2457[_0xcf5f('0x4c')]=[{'all':!![]}];}_0x1e2457=_[_0xcf5f('0x48')]({},_0x1e2457,_0x314e87[_0xcf5f('0x4a')]);return db[_0xcf5f('0x37')][_0xcf5f('0x51')](_0x1e2457)['then'](handleEntityNotFound(_0x583bde,null))[_0xcf5f('0x1e')](respondWithResult(_0x583bde,null))['catch'](handleError(_0x583bde,null));};exports[_0xcf5f('0x52')]=function(_0x64b870,_0x3a6600){return db[_0xcf5f('0x37')][_0xcf5f('0x52')](_0x64b870['body'],{})[_0xcf5f('0x1e')](respondWithResult(_0x3a6600,0xc9))[_0xcf5f('0x27')](handleError(_0x3a6600,null));};exports[_0xcf5f('0x31')]=function(_0x564148,_0x22c733){if(_0x564148['body']['id']){delete _0x564148[_0xcf5f('0x53')]['id'];}return db[_0xcf5f('0x37')][_0xcf5f('0x51')]({'where':{'id':_0x564148['params']['id']}})['then'](handleEntityNotFound(_0x22c733,null))[_0xcf5f('0x1e')](saveUpdates(_0x564148[_0xcf5f('0x53')],null))[_0xcf5f('0x1e')](respondWithResult(_0x22c733,null))[_0xcf5f('0x27')](handleError(_0x22c733,null));};exports[_0xcf5f('0x32')]=function(_0x4234b5,_0xa8c24b){return db[_0xcf5f('0x37')][_0xcf5f('0x51')]({'where':{'id':_0x4234b5['params']['id']}})[_0xcf5f('0x1e')](handleEntityNotFound(_0xa8c24b,null))[_0xcf5f('0x1e')](removeEntity(_0xa8c24b,null))[_0xcf5f('0x27')](handleError(_0xa8c24b,null));};exports[_0xcf5f('0x54')]=function(_0x2e7254,_0x7a6fb9){return db[_0xcf5f('0x37')][_0xcf5f('0x54')]()[_0xcf5f('0x1e')](respondWithResult(_0x7a6fb9,null))[_0xcf5f('0x27')](handleError(_0x7a6fb9,null));};var interaction_log=require(_0xcf5f('0x12'))(_0xcf5f('0x55'));exports['accept']=function(_0x57bb78,_0x92c38b,_0x40f5e4){var _0x28fec6={'agent':{},'channel':_0xcf5f('0x56')};if(_0x57bb78[_0xcf5f('0x53')]['id']){delete _0x57bb78[_0xcf5f('0x53')]['id'];}_0x57bb78[_0xcf5f('0x53')][_0xcf5f('0x57')]=!![];_0x57bb78[_0xcf5f('0x53')][_0xcf5f('0x58')]=moment()[_0xcf5f('0x59')](_0xcf5f('0x5a'));_0x57bb78[_0xcf5f('0x53')][_0xcf5f('0x5b')]=_0x57bb78[_0xcf5f('0x53')][_0xcf5f('0x5b')]||_0x57bb78[_0xcf5f('0x5c')]['id'];_0x28fec6['agent']['id']=_0x57bb78[_0xcf5f('0x53')][_0xcf5f('0x5b')];return db['ChatMessage'][_0xcf5f('0x51')]({'where':{'id':_0x57bb78[_0xcf5f('0x50')]['id'],'UserId':null}})[_0xcf5f('0x1e')](handleEntityNotFound(_0x92c38b,null))[_0xcf5f('0x1e')](saveUpdates(_0x57bb78['body'],null))['then'](function(_0x277f27){if(_0x277f27){_0x28fec6[_0xcf5f('0x25')]=_0x277f27['get']({'plain':!![]});return db[_0xcf5f('0x5d')][_0xcf5f('0x51')]({'where':{'id':_0x277f27['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x92c38b,null))[_0xcf5f('0x1e')](function(_0x3eb03a){if(_0x3eb03a){return _0x3eb03a[_0xcf5f('0x31')]({'UserId':_0x57bb78[_0xcf5f('0x53')][_0xcf5f('0x5b')],'read1stAt':_[_0xcf5f('0x5e')](_0x3eb03a['read1stAt'])?moment()[_0xcf5f('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcf5f('0x1e')](function(_0xd9dcf){if(_0xd9dcf){_0x28fec6['interaction']=_0xd9dcf[_0xcf5f('0x5f')]({'plain':!![]});interaction_log['info'](_0xcf5f('0x60'),_0x57bb78['user']['id'],_0x57bb78['user'][_0xcf5f('0x34')],_0x57bb78[_0xcf5f('0x5c')]['role'],_0x28fec6[_0xcf5f('0x61')]['id'],_0x57bb78[_0xcf5f('0x53')]?JSON[_0xcf5f('0x62')](_0x57bb78[_0xcf5f('0x53')]):_0xcf5f('0x63'));return respondWithRpcPromise(_0xcf5f('0x64'),_0xcf5f('0x65'),_0x28fec6);}return null;})[_0xcf5f('0x1e')](function(_0xd17435){var _0x2cbeac='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd17435[_0xcf5f('0x25')]['ContactId'];return db['sequelize'][_0xcf5f('0x3b')](_0x2cbeac,{'type':db['Sequelize']['QueryTypes'][_0xcf5f('0x66')],'raw':!![]})[_0xcf5f('0x1e')](function(_0x2ff7a9){return _0x2ff7a9;});})[_0xcf5f('0x1e')](function(_0x34455b){if(_0x34455b){_0x28fec6['message'][_0xcf5f('0x67')]=_0x34455b[0x0];if(!_0x57bb78[_0xcf5f('0x53')][_0xcf5f('0x5b')])return;return db['User']['find']({'where':{'id':_0x57bb78[_0xcf5f('0x53')][_0xcf5f('0x5b')],'role':_0xcf5f('0x68')},'attributes':['id',_0xcf5f('0x34'),_0xcf5f('0x69'),_0xcf5f('0x6a'),_0xcf5f('0x6b')],'raw':!![]});}return null;})[_0xcf5f('0x1e')](function(_0x414d9b){if(!_0x414d9b)return null;_0x28fec6[_0xcf5f('0x25')][_0xcf5f('0x68')]=_0x414d9b;return _0x28fec6;})[_0xcf5f('0x1e')](function(_0x3cb954){if(_0x3cb954){if(_0x57bb78['body'][_0xcf5f('0x6c')]){_0x28fec6[_0xcf5f('0x25')][_0xcf5f('0x6d')]=util[_0xcf5f('0x59')](_0xcf5f('0x6e'),_0x57bb78[_0xcf5f('0x5c')][_0xcf5f('0x34')]);_0x28fec6['message'][_0xcf5f('0x6f')]=_0x28fec6[_0xcf5f('0x6f')];_0x28fec6['message']['motionChannel']=_0x28fec6['channel'];_0x28fec6[_0xcf5f('0x25')][_0xcf5f('0x70')]=_0xcf5f('0x71');return respondWithRpcPromise(_0xcf5f('0x72'),_0xcf5f('0x72'),{'event':_0xcf5f('0x73'),'message':_[_0xcf5f('0x48')](_0x28fec6['message'],JSON[_0xcf5f('0x74')](_0x28fec6[_0xcf5f('0x61')][_0xcf5f('0x75')]))},client9002)[_0xcf5f('0x1e')](function(){return _0x28fec6;});}return _0x28fec6;}return null;})[_0xcf5f('0x1e')](respondWithResult(_0x92c38b,null))['catch'](handleError(_0x92c38b,null));};var interaction_log=require(_0xcf5f('0x12'))(_0xcf5f('0x55'));exports['reject']=function(_0x26dcff,_0x80b17b,_0x358b89){var _0x2d7f32={'agent':{},'channel':_0xcf5f('0x56')};if(_0x26dcff[_0xcf5f('0x53')]['id']){delete _0x26dcff['body']['id'];}_0x26dcff[_0xcf5f('0x53')][_0xcf5f('0x5b')]=_0x26dcff[_0xcf5f('0x53')]['UserId']||_0x26dcff[_0xcf5f('0x5c')]['id'];_0x2d7f32[_0xcf5f('0x68')]['id']=_0x26dcff['body']['UserId'];return db[_0xcf5f('0x37')][_0xcf5f('0x51')]({'where':{'id':_0x26dcff[_0xcf5f('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x80b17b,null))[_0xcf5f('0x1e')](function(_0x20df72){if(_0x20df72){_0x2d7f32['message']=_0x20df72[_0xcf5f('0x5f')]({'plain':!![]});return db['ChatInteraction'][_0xcf5f('0x51')]({'where':{'id':_0x20df72[_0xcf5f('0x76')]}});}return null;})[_0xcf5f('0x1e')](handleEntityNotFound(_0x80b17b,null))[_0xcf5f('0x1e')](function(_0x566968){if(_0x566968){_0x2d7f32[_0xcf5f('0x61')]=_0x566968[_0xcf5f('0x5f')]({'plain':!![]});interaction_log[_0xcf5f('0x1f')](_0xcf5f('0x77'),_0x26dcff[_0xcf5f('0x5c')]['id'],_0x26dcff[_0xcf5f('0x5c')][_0xcf5f('0x34')],_0x26dcff[_0xcf5f('0x5c')][_0xcf5f('0x78')],_0x2d7f32['interaction']['id'],_0x26dcff[_0xcf5f('0x53')]?JSON[_0xcf5f('0x62')](_0x26dcff['body']):_0xcf5f('0x63'));return respondWithRpcPromise('RejectMessage',_0xcf5f('0x79'),_0x2d7f32);}return null;})[_0xcf5f('0x1e')](function(_0x579c68){var _0x511bb7=_0xcf5f('0x7a')+_0x579c68[_0xcf5f('0x25')][_0xcf5f('0x7b')];return db[_0xcf5f('0x7c')]['query'](_0x511bb7,{'type':db[_0xcf5f('0x7d')]['QueryTypes'][_0xcf5f('0x66')],'raw':!![]})['then'](function(_0x210415){return _0x210415;});})[_0xcf5f('0x1e')](function(_0x2b320f){if(_0x2b320f){_0x2d7f32[_0xcf5f('0x25')][_0xcf5f('0x67')]=_0x2b320f[0x0];if(!_0x26dcff[_0xcf5f('0x53')]['UserId'])return;return db[_0xcf5f('0x7e')][_0xcf5f('0x51')]({'where':{'id':_0x26dcff[_0xcf5f('0x53')][_0xcf5f('0x5b')],'role':_0xcf5f('0x68')},'attributes':['id','name',_0xcf5f('0x69'),'email',_0xcf5f('0x6b')],'raw':!![]});}return null;})[_0xcf5f('0x1e')](function(_0xb8e3f7){if(!_0xb8e3f7)return null;_0x2d7f32[_0xcf5f('0x25')][_0xcf5f('0x68')]=_0xb8e3f7;return _0x2d7f32;})[_0xcf5f('0x1e')](function(_0x517541){if(_0x517541){_0x517541[_0xcf5f('0x25')][_0xcf5f('0x6d')]=util[_0xcf5f('0x59')](_0xcf5f('0x6e'),_0x26dcff['user'][_0xcf5f('0x34')]);_0x517541[_0xcf5f('0x25')][_0xcf5f('0x6f')]=_0x2d7f32[_0xcf5f('0x6f')];_0x517541[_0xcf5f('0x25')]['motionChannel']=_0x2d7f32['channel'];_0x517541[_0xcf5f('0x25')][_0xcf5f('0x70')]=_0xcf5f('0x2f');respondWithRpcPromise(_0xcf5f('0x72'),_0xcf5f('0x72'),{'event':_0xcf5f('0x7f'),'message':_['merge'](_0x2d7f32[_0xcf5f('0x25')],JSON['parse'](_0x2d7f32[_0xcf5f('0x61')][_0xcf5f('0x75')]))},client9002);return _0x2d7f32;}return null;})[_0xcf5f('0x1e')](respondWithResult(_0x80b17b,null))['catch'](handleError(_0x80b17b,null));};
\ No newline at end of file
+var _0x8c56=['bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','name','send','ChatMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','update','accept','chat','read','format','UserId','agent','get','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','parse','formData','chat-interactions','ChatInteraction','RejectMessage','EventManager','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8c56,0x7b));var _0x68c5=function(_0x39d90f,_0xee44f){_0x39d90f=_0x39d90f-0x0;var _0x4d5c2c=_0x8c56[_0x39d90f];return _0x4d5c2c;};'use strict';var emlformat=require(_0x68c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68c5('0x1'));var jsonpatch=require(_0x68c5('0x2'));var rp=require(_0x68c5('0x3'));var moment=require(_0x68c5('0x4'));var BPromise=require(_0x68c5('0x5'));var Mustache=require('mustache');var util=require(_0x68c5('0x6'));var path=require(_0x68c5('0x7'));var sox=require('sox');var csv=require(_0x68c5('0x8'));var ejs=require(_0x68c5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68c5('0xa'));var squel=require(_0x68c5('0xb'));var crypto=require(_0x68c5('0xc'));var jsforce=require(_0x68c5('0xd'));var deskjs=require(_0x68c5('0xe'));var toCsv=require(_0x68c5('0x8'));var querystring=require(_0x68c5('0xf'));var Papa=require(_0x68c5('0x10'));var Redis=require('ioredis');var authService=require(_0x68c5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x68c5('0x12'))(_0x68c5('0x13'));var utils=require(_0x68c5('0x14'));var config=require(_0x68c5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x68c5('0x16'))['db'];config[_0x68c5('0x17')]=_[_0x68c5('0x18')](config[_0x68c5('0x17')],{'host':_0x68c5('0x19'),'port':0x18eb});var socket=require(_0x68c5('0x1a'))(new Redis(config[_0x68c5('0x17')]));require(_0x68c5('0x1b'))[_0x68c5('0x1c')](socket);var jayson=require(_0x68c5('0x1d'));var client=jayson[_0x68c5('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x68c5('0x1e')][_0x68c5('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1327e9,_0x1d168d,_0x414007,_0x1ed71a){return new BPromise(function(_0x5ec727,_0x494fc1){var _0x56f96a=_0x1ed71a||client;return _0x56f96a[_0x68c5('0x20')](_0x1327e9,_0x414007)[_0x68c5('0x21')](function(_0x498812){logger[_0x68c5('0x22')]('ChatMessage,\x20%s,\x20%s',_0x1d168d,_0x68c5('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1d168d,'request\x20sent',JSON[_0x68c5('0x24')](_0x498812));if(_0x498812[_0x68c5('0x25')]){if(_0x498812[_0x68c5('0x25')][_0x68c5('0x26')]===0x1f4){logger[_0x68c5('0x25')]('ChatMessage,\x20%s,\x20%s',_0x1d168d,_0x498812[_0x68c5('0x25')][_0x68c5('0x27')]);return _0x494fc1(_0x498812[_0x68c5('0x25')][_0x68c5('0x27')]);}logger[_0x68c5('0x25')]('ChatMessage,\x20%s,\x20%s',_0x1d168d,_0x498812[_0x68c5('0x25')][_0x68c5('0x27')]);return _0x5ec727(_0x498812['error'][_0x68c5('0x27')]);}else{logger[_0x68c5('0x22')](_0x68c5('0x28'),_0x1d168d,_0x68c5('0x23'));_0x5ec727(_0x498812['result'][_0x68c5('0x27')]);}})[_0x68c5('0x29')](function(_0x4153e4){logger[_0x68c5('0x25')](_0x68c5('0x28'),_0x1d168d,_0x4153e4);_0x494fc1(_0x4153e4);});});}function respondWithStatusCode(_0x132771,_0x282000){_0x282000=_0x282000||0xcc;return function(_0x55d832){if(_0x55d832){return _0x132771[_0x68c5('0x2a')](_0x282000);}return _0x132771['status'](_0x282000)[_0x68c5('0x2b')]();};}function respondWithResult(_0x218776,_0x2f6c54){_0x2f6c54=_0x2f6c54||0xc8;return function(_0x42bc6b){if(_0x42bc6b){return _0x218776[_0x68c5('0x2c')](_0x2f6c54)[_0x68c5('0x2d')](_0x42bc6b);}};}function respondWithFilteredResult(_0x359a23,_0x20229d){return function(_0x8d243e){if(_0x8d243e){var _0x1f155c=typeof _0x20229d[_0x68c5('0x2e')]===_0x68c5('0x2f')&&typeof _0x20229d[_0x68c5('0x30')]==='undefined';var _0x2ee639=_0x8d243e[_0x68c5('0x31')];var _0x251b26=_0x1f155c?0x0:_0x20229d[_0x68c5('0x2e')];var _0x58e770=_0x1f155c?_0x8d243e['count']:_0x20229d['offset']+_0x20229d[_0x68c5('0x30')];var _0x57ef7f;if(_0x58e770>=_0x2ee639){_0x58e770=_0x2ee639;_0x57ef7f=0xc8;}else{_0x57ef7f=0xce;}_0x359a23[_0x68c5('0x2c')](_0x57ef7f);return _0x359a23[_0x68c5('0x32')](_0x68c5('0x33'),_0x251b26+'-'+_0x58e770+'/'+_0x2ee639)[_0x68c5('0x2d')](_0x8d243e);}return null;};}function patchUpdates(_0x2b5675){return function(_0x519dcd){try{jsonpatch[_0x68c5('0x34')](_0x519dcd,_0x2b5675,!![]);}catch(_0x5b3f19){return BPromise[_0x68c5('0x35')](_0x5b3f19);}return _0x519dcd[_0x68c5('0x36')]();};}function saveUpdates(_0x4b9804,_0x331d0d){return function(_0x2012cb){if(_0x2012cb){return _0x2012cb['update'](_0x4b9804)[_0x68c5('0x21')](function(_0x462019){return _0x462019;});}return null;};}function removeEntity(_0x1022f5,_0x3f2e89){return function(_0x18aaad){if(_0x18aaad){return _0x18aaad[_0x68c5('0x37')]()[_0x68c5('0x21')](function(){_0x1022f5[_0x68c5('0x2c')](0xcc)[_0x68c5('0x2b')]();});}};}function handleEntityNotFound(_0x4362a8,_0x11fe46){return function(_0x449f91){if(!_0x449f91){_0x4362a8[_0x68c5('0x2a')](0x194);}return _0x449f91;};}function handleError(_0x3da050,_0xc0037b){_0xc0037b=_0xc0037b||0x1f4;return function(_0x3fb261){logger[_0x68c5('0x25')](_0x3fb261['stack']);if(_0x3fb261['name']){delete _0x3fb261[_0x68c5('0x38')];}_0x3da050[_0x68c5('0x2c')](_0xc0037b)[_0x68c5('0x39')](_0x3fb261);};}exports['index']=function(_0x285ee8,_0x20e90e){var _0x57dcb7={},_0xb29df7={},_0x261cb8={'count':0x0,'rows':[]};var _0x13f4ba=_['map'](db[_0x68c5('0x3a')][_0x68c5('0x3b')],function(_0x2f3680){return{'name':_0x2f3680['fieldName'],'type':_0x2f3680[_0x68c5('0x3c')][_0x68c5('0x3d')]};});_0xb29df7[_0x68c5('0x3e')]=_[_0x68c5('0x3f')](_0x13f4ba,_0x68c5('0x38'));_0xb29df7[_0x68c5('0x40')]=_[_0x68c5('0x41')](_0x285ee8[_0x68c5('0x40')]);_0xb29df7[_0x68c5('0x42')]=_[_0x68c5('0x43')](_0xb29df7[_0x68c5('0x3e')],_0xb29df7['query']);_0x57dcb7[_0x68c5('0x44')]=_[_0x68c5('0x43')](_0xb29df7[_0x68c5('0x3e')],qs['fields'](_0x285ee8[_0x68c5('0x40')][_0x68c5('0x45')]));_0x57dcb7[_0x68c5('0x44')]=_0x57dcb7['attributes']['length']?_0x57dcb7[_0x68c5('0x44')]:_0xb29df7[_0x68c5('0x3e')];if(!_0x285ee8[_0x68c5('0x40')][_0x68c5('0x46')](_0x68c5('0x47'))){_0x57dcb7[_0x68c5('0x30')]=qs['limit'](_0x285ee8[_0x68c5('0x40')][_0x68c5('0x30')]);_0x57dcb7[_0x68c5('0x2e')]=qs[_0x68c5('0x2e')](_0x285ee8['query'][_0x68c5('0x2e')]);}_0x57dcb7[_0x68c5('0x48')]=qs[_0x68c5('0x49')](_0x285ee8[_0x68c5('0x40')][_0x68c5('0x49')]);_0x57dcb7['where']=qs['filters'](_['pick'](_0x285ee8[_0x68c5('0x40')],_0xb29df7['filters']),_0x13f4ba);if(_0x285ee8['query']['filter']){_0x57dcb7['where']=_[_0x68c5('0x4a')](_0x57dcb7['where'],{'$or':_[_0x68c5('0x3f')](_0x13f4ba,function(_0x5d418b){if(_0x5d418b[_0x68c5('0x3c')]!==_0x68c5('0x4b')){var _0x38c899={};_0x38c899[_0x5d418b[_0x68c5('0x38')]]={'$like':'%'+_0x285ee8[_0x68c5('0x40')]['filter']+'%'};return _0x38c899;}})});}_0x57dcb7=_[_0x68c5('0x4a')]({},_0x57dcb7,_0x285ee8[_0x68c5('0x4c')]);var _0x2354da={'where':_0x57dcb7['where']};return db['ChatMessage'][_0x68c5('0x31')](_0x2354da)['then'](function(_0x1351c5){_0x261cb8[_0x68c5('0x31')]=_0x1351c5;if(_0x285ee8[_0x68c5('0x40')]['includeAll']){_0x57dcb7[_0x68c5('0x4d')]=[{'all':!![]}];}return db[_0x68c5('0x3a')][_0x68c5('0x4e')](_0x57dcb7);})['then'](function(_0x2da353){_0x261cb8[_0x68c5('0x4f')]=_0x2da353;return _0x261cb8;})[_0x68c5('0x21')](respondWithFilteredResult(_0x20e90e,_0x57dcb7))['catch'](handleError(_0x20e90e,null));};exports[_0x68c5('0x50')]=function(_0x33f6d8,_0x522a2e){var _0xc827e7={'raw':!![],'where':{'id':_0x33f6d8[_0x68c5('0x51')]['id']}},_0x45e64d={};_0x45e64d[_0x68c5('0x3e')]=_[_0x68c5('0x41')](db[_0x68c5('0x3a')][_0x68c5('0x3b')]);_0x45e64d[_0x68c5('0x40')]=_[_0x68c5('0x41')](_0x33f6d8['query']);_0x45e64d['filters']=_[_0x68c5('0x43')](_0x45e64d['model'],_0x45e64d['query']);_0xc827e7[_0x68c5('0x44')]=_[_0x68c5('0x43')](_0x45e64d[_0x68c5('0x3e')],qs['fields'](_0x33f6d8[_0x68c5('0x40')][_0x68c5('0x45')]));_0xc827e7[_0x68c5('0x44')]=_0xc827e7[_0x68c5('0x44')]['length']?_0xc827e7[_0x68c5('0x44')]:_0x45e64d['model'];if(_0x33f6d8[_0x68c5('0x40')][_0x68c5('0x52')]){_0xc827e7[_0x68c5('0x4d')]=[{'all':!![]}];}_0xc827e7=_[_0x68c5('0x4a')]({},_0xc827e7,_0x33f6d8['options']);return db[_0x68c5('0x3a')][_0x68c5('0x53')](_0xc827e7)[_0x68c5('0x21')](handleEntityNotFound(_0x522a2e,null))[_0x68c5('0x21')](respondWithResult(_0x522a2e,null))[_0x68c5('0x29')](handleError(_0x522a2e,null));};exports[_0x68c5('0x54')]=function(_0x79212b,_0x4a962d){return db['ChatMessage']['create'](_0x79212b[_0x68c5('0x55')],{})[_0x68c5('0x21')](respondWithResult(_0x4a962d,0xc9))[_0x68c5('0x29')](handleError(_0x4a962d,null));};exports[_0x68c5('0x56')]=function(_0x5dd14a,_0x4e953a){if(_0x5dd14a['body']['id']){delete _0x5dd14a['body']['id'];}return db[_0x68c5('0x3a')][_0x68c5('0x53')]({'where':{'id':_0x5dd14a[_0x68c5('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e953a,null))[_0x68c5('0x21')](saveUpdates(_0x5dd14a[_0x68c5('0x55')],null))[_0x68c5('0x21')](respondWithResult(_0x4e953a,null))[_0x68c5('0x29')](handleError(_0x4e953a,null));};exports[_0x68c5('0x37')]=function(_0x122ad3,_0x5805e4){return db[_0x68c5('0x3a')][_0x68c5('0x53')]({'where':{'id':_0x122ad3[_0x68c5('0x51')]['id']}})['then'](handleEntityNotFound(_0x5805e4,null))[_0x68c5('0x21')](removeEntity(_0x5805e4,null))[_0x68c5('0x29')](handleError(_0x5805e4,null));};exports['describe']=function(_0x4a21f5,_0x3aa43d){return db[_0x68c5('0x3a')]['describe']()[_0x68c5('0x21')](respondWithResult(_0x3aa43d,null))[_0x68c5('0x29')](handleError(_0x3aa43d,null));};var interaction_log=require(_0x68c5('0x12'))('chat-interactions');exports[_0x68c5('0x57')]=function(_0x1bd9f,_0x3c4284,_0x471320){var _0x423cac={'agent':{},'channel':_0x68c5('0x58')};if(_0x1bd9f[_0x68c5('0x55')]['id']){delete _0x1bd9f['body']['id'];}_0x1bd9f[_0x68c5('0x55')][_0x68c5('0x59')]=!![];_0x1bd9f[_0x68c5('0x55')]['readAt']=moment()[_0x68c5('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1bd9f[_0x68c5('0x55')]['UserId']=_0x1bd9f[_0x68c5('0x55')][_0x68c5('0x5b')]||_0x1bd9f['user']['id'];_0x423cac[_0x68c5('0x5c')]['id']=_0x1bd9f['body'][_0x68c5('0x5b')];return db[_0x68c5('0x3a')][_0x68c5('0x53')]({'where':{'id':_0x1bd9f[_0x68c5('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c4284,null))[_0x68c5('0x21')](saveUpdates(_0x1bd9f[_0x68c5('0x55')],null))[_0x68c5('0x21')](function(_0xb61f2b){if(_0xb61f2b){_0x423cac['message']=_0xb61f2b[_0x68c5('0x5d')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0xb61f2b[_0x68c5('0x5e')]}});}return null;})[_0x68c5('0x21')](handleEntityNotFound(_0x3c4284,null))['then'](function(_0x3beed7){if(_0x3beed7){return _0x3beed7[_0x68c5('0x56')]({'UserId':_0x1bd9f[_0x68c5('0x55')][_0x68c5('0x5b')],'read1stAt':_[_0x68c5('0x5f')](_0x3beed7[_0x68c5('0x60')])?moment()['format'](_0x68c5('0x61')):undefined});}return null;})[_0x68c5('0x21')](function(_0x286190){if(_0x286190){_0x423cac['interaction']=_0x286190[_0x68c5('0x5d')]({'plain':!![]});interaction_log[_0x68c5('0x22')](_0x68c5('0x62'),_0x1bd9f[_0x68c5('0x63')]['id'],_0x1bd9f[_0x68c5('0x63')][_0x68c5('0x38')],_0x1bd9f[_0x68c5('0x63')][_0x68c5('0x64')],_0x423cac[_0x68c5('0x65')]['id'],_0x1bd9f['body']?JSON[_0x68c5('0x24')](_0x1bd9f[_0x68c5('0x55')]):_0x68c5('0x66'));return respondWithRpcPromise(_0x68c5('0x67'),_0x68c5('0x68'),_0x423cac);}return null;})[_0x68c5('0x21')](function(_0x6bd594){var _0x529148=_0x68c5('0x69')+_0x6bd594[_0x68c5('0x27')][_0x68c5('0x6a')];return db[_0x68c5('0x6b')][_0x68c5('0x40')](_0x529148,{'type':db[_0x68c5('0x6c')][_0x68c5('0x6d')][_0x68c5('0x6e')],'raw':!![]})[_0x68c5('0x21')](function(_0x33a06c){return _0x33a06c;});})[_0x68c5('0x21')](function(_0x4bd448){if(_0x4bd448){_0x423cac[_0x68c5('0x27')][_0x68c5('0x6f')]=_0x4bd448[0x0];if(!_0x1bd9f[_0x68c5('0x55')][_0x68c5('0x5b')])return;return db[_0x68c5('0x70')][_0x68c5('0x53')]({'where':{'id':_0x1bd9f['body'][_0x68c5('0x5b')],'role':_0x68c5('0x5c')},'attributes':['id',_0x68c5('0x38'),_0x68c5('0x71'),_0x68c5('0x72'),_0x68c5('0x73')],'raw':!![]});}return null;})[_0x68c5('0x21')](function(_0x569bf8){if(!_0x569bf8)return null;_0x423cac[_0x68c5('0x27')]['agent']=_0x569bf8;return _0x423cac;})[_0x68c5('0x21')](function(_0xa2fa22){if(_0xa2fa22){if(_0x1bd9f[_0x68c5('0x55')]['manual']){_0x423cac[_0x68c5('0x27')][_0x68c5('0x74')]=util[_0x68c5('0x5a')](_0x68c5('0x75'),_0x1bd9f[_0x68c5('0x63')][_0x68c5('0x38')]);_0x423cac[_0x68c5('0x27')][_0x68c5('0x76')]=_0x423cac[_0x68c5('0x76')];_0x423cac[_0x68c5('0x27')][_0x68c5('0x77')]=_0x423cac[_0x68c5('0x76')];_0x423cac['message'][_0x68c5('0x78')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0x68c5('0x4a')](_0x423cac[_0x68c5('0x27')],JSON[_0x68c5('0x79')](_0x423cac[_0x68c5('0x65')][_0x68c5('0x7a')]))},client9002)[_0x68c5('0x21')](function(){return _0x423cac;});}return _0x423cac;}return null;})[_0x68c5('0x21')](respondWithResult(_0x3c4284,null))[_0x68c5('0x29')](handleError(_0x3c4284,null));};var interaction_log=require(_0x68c5('0x12'))(_0x68c5('0x7b'));exports[_0x68c5('0x35')]=function(_0xb6a0f9,_0x350841,_0x17aee8){var _0x35c4a8={'agent':{},'channel':_0x68c5('0x58')};if(_0xb6a0f9['body']['id']){delete _0xb6a0f9[_0x68c5('0x55')]['id'];}_0xb6a0f9[_0x68c5('0x55')][_0x68c5('0x5b')]=_0xb6a0f9['body'][_0x68c5('0x5b')]||_0xb6a0f9['user']['id'];_0x35c4a8[_0x68c5('0x5c')]['id']=_0xb6a0f9[_0x68c5('0x55')][_0x68c5('0x5b')];return db['ChatMessage']['find']({'where':{'id':_0xb6a0f9[_0x68c5('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x350841,null))['then'](function(_0x15d98c){if(_0x15d98c){_0x35c4a8[_0x68c5('0x27')]=_0x15d98c[_0x68c5('0x5d')]({'plain':!![]});return db[_0x68c5('0x7c')][_0x68c5('0x53')]({'where':{'id':_0x15d98c[_0x68c5('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x350841,null))['then'](function(_0xd1dc66){if(_0xd1dc66){_0x35c4a8['interaction']=_0xd1dc66[_0x68c5('0x5d')]({'plain':!![]});interaction_log[_0x68c5('0x22')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xb6a0f9[_0x68c5('0x63')]['id'],_0xb6a0f9[_0x68c5('0x63')]['name'],_0xb6a0f9[_0x68c5('0x63')][_0x68c5('0x64')],_0x35c4a8[_0x68c5('0x65')]['id'],_0xb6a0f9[_0x68c5('0x55')]?JSON[_0x68c5('0x24')](_0xb6a0f9[_0x68c5('0x55')]):'null');return respondWithRpcPromise(_0x68c5('0x7d'),'rejectMessage',_0x35c4a8);}return null;})[_0x68c5('0x21')](function(_0x1cf959){var _0x2a832d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1cf959['message'][_0x68c5('0x6a')];return db[_0x68c5('0x6b')][_0x68c5('0x40')](_0x2a832d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x68c5('0x21')](function(_0x48e00a){return _0x48e00a;});})[_0x68c5('0x21')](function(_0x41baba){if(_0x41baba){_0x35c4a8[_0x68c5('0x27')][_0x68c5('0x6f')]=_0x41baba[0x0];if(!_0xb6a0f9[_0x68c5('0x55')][_0x68c5('0x5b')])return;return db[_0x68c5('0x70')]['find']({'where':{'id':_0xb6a0f9[_0x68c5('0x55')][_0x68c5('0x5b')],'role':'agent'},'attributes':['id',_0x68c5('0x38'),_0x68c5('0x71'),'email',_0x68c5('0x73')],'raw':!![]});}return null;})[_0x68c5('0x21')](function(_0x1d5772){if(!_0x1d5772)return null;_0x35c4a8[_0x68c5('0x27')]['agent']=_0x1d5772;return _0x35c4a8;})['then'](function(_0xf61fba){if(_0xf61fba){_0xf61fba['message']['interface']=util[_0x68c5('0x5a')](_0x68c5('0x75'),_0xb6a0f9[_0x68c5('0x63')][_0x68c5('0x38')]);_0xf61fba[_0x68c5('0x27')]['channel']=_0x35c4a8[_0x68c5('0x76')];_0xf61fba[_0x68c5('0x27')][_0x68c5('0x77')]=_0x35c4a8[_0x68c5('0x76')];_0xf61fba['message'][_0x68c5('0x78')]='reject';respondWithRpcPromise(_0x68c5('0x7e'),_0x68c5('0x7e'),{'event':_0x68c5('0x7f'),'message':_[_0x68c5('0x4a')](_0x35c4a8[_0x68c5('0x27')],JSON['parse'](_0x35c4a8[_0x68c5('0x65')][_0x68c5('0x7a')]))},client9002);return _0x35c4a8;}return null;})[_0x68c5('0x21')](respondWithResult(_0x350841,null))['catch'](handleError(_0x350841,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 1fa1344..a577bc1 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 _0x0bc8=['events','../../mysqldb','ChatMessage','setMaxListeners','save','emit','hook','exports'];(function(_0x2ea087,_0x17f324){var _0x23ebac=function(_0x5575d8){while(--_0x5575d8){_0x2ea087['push'](_0x2ea087['shift']());}};_0x23ebac(++_0x17f324);}(_0x0bc8,0x178));var _0x80bc=function(_0x359f09,_0x6f7568){_0x359f09=_0x359f09-0x0;var _0x49f719=_0x0bc8[_0x359f09];return _0x49f719;};'use strict';var EventEmitter=require(_0x80bc('0x0'));var ChatMessage=require(_0x80bc('0x1'))['db'][_0x80bc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x80bc('0x3')](0x0);var events={'afterCreate':_0x80bc('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x97f2c8){return function(_0x1b9b14,_0x5bc350,_0xa54026){ChatMessageEvents[_0x80bc('0x5')](_0x97f2c8+':'+_0x1b9b14['id'],_0x1b9b14);ChatMessageEvents[_0x80bc('0x5')](_0x97f2c8,_0x1b9b14);_0xa54026(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x80bc('0x6')](e,emitEvent(event));}}module[_0x80bc('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xf9eb=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5c588f,_0x425a0d){var _0x19125e=function(_0x325792){while(--_0x325792){_0x5c588f['push'](_0x5c588f['shift']());}};_0x19125e(++_0x425a0d);}(_0xf9eb,0x1a2));var _0xbf9e=function(_0x376e18,_0x4273c6){_0x376e18=_0x376e18-0x0;var _0x247ca1=_0xf9eb[_0x376e18];return _0x247ca1;};'use strict';var EventEmitter=require(_0xbf9e('0x0'));var ChatMessage=require(_0xbf9e('0x1'))['db'][_0xbf9e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbf9e('0x3')](0x0);var events={'afterCreate':_0xbf9e('0x4'),'afterUpdate':_0xbf9e('0x5'),'afterDestroy':_0xbf9e('0x6')};function emitEvent(_0x4c8680){return function(_0x111f7e,_0x5ba57c,_0x566fcf){ChatMessageEvents[_0xbf9e('0x7')](_0x4c8680+':'+_0x111f7e['id'],_0x111f7e);ChatMessageEvents[_0xbf9e('0x7')](_0x4c8680,_0x111f7e);_0x566fcf(null);};}for(var e in events){if(events[_0xbf9e('0x8')](e)){var event=events[e];ChatMessage[_0xbf9e('0x9')](e,emitEvent(event));}}module[_0xbf9e('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 06536f3..e64e902 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 _0x9ce8=['request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4b24c3,_0x1192d1){var _0x95d352=function(_0x3c05fb){while(--_0x3c05fb){_0x4b24c3['push'](_0x4b24c3['shift']());}};_0x95d352(++_0x1192d1);}(_0x9ce8,0x163));var _0x89ce=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x9ce8[_0x47e549];return _0x251374;};'use strict';var _=require(_0x89ce('0x0'));var util=require('util');var logger=require(_0x89ce('0x1'))(_0x89ce('0x2'));var moment=require(_0x89ce('0x3'));var BPromise=require(_0x89ce('0x4'));var rp=require(_0x89ce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x89ce('0x6'));var config=require(_0x89ce('0x7'));var attributes=require(_0x89ce('0x8'));module[_0x89ce('0x9')]=function(_0x3c67c4,_0x24e85b){return _0x3c67c4['define'](_0x89ce('0xa'),attributes,{'tableName':_0x89ce('0xb'),'paranoid':![],'indexes':[{'name':_0x89ce('0xc'),'fields':['body'],'type':_0x89ce('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a04c9,_0x56051e,_0x442042){var _0x2aacc8=_0x3c67c4[_0x89ce('0xe')];var _0x546dbb=_0x2a04c9[_0x89ce('0xf')]({'plain':!![]});if(_0x546dbb[_0x89ce('0x10')][_0x89ce('0x11')]()==='in'||_0x546dbb['direction'][_0x89ce('0x11')]()===_0x89ce('0x12')&&!_0x546dbb[_0x89ce('0x13')]&&!_[_0x89ce('0x14')](_0x546dbb[_0x89ce('0x15')])){_0x2aacc8[_0x89ce('0x16')][_0x89ce('0x17')]({'where':{'id':_0x546dbb[_0x89ce('0x18')]}})[_0x89ce('0x19')](function(_0x3420fd){if(_0x3420fd){_0x3420fd[_0x89ce('0x1a')]({'lastMsgAt':_0x546dbb[_0x89ce('0x1b')],'lastMsgDirection':_0x546dbb['direction'][_0x89ce('0x11')]()});}})['catch'](function(_0x1b8c30){console[_0x89ce('0x1c')](_0x1b8c30);});}_0x442042();}},'charset':_0x89ce('0x1d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x640e=['../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x34802f,_0x161127){var _0x18e109=function(_0x209311){while(--_0x209311){_0x34802f['push'](_0x34802f['shift']());}};_0x18e109(++_0x161127);}(_0x640e,0xde));var _0xe640=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x640e[_0x209fcd];return _0x501d5e;};'use strict';var _=require(_0xe640('0x0'));var util=require(_0xe640('0x1'));var logger=require(_0xe640('0x2'))(_0xe640('0x3'));var moment=require(_0xe640('0x4'));var BPromise=require(_0xe640('0x5'));var rp=require(_0xe640('0x6'));var fs=require('fs');var path=require(_0xe640('0x7'));var rimraf=require(_0xe640('0x8'));var config=require(_0xe640('0x9'));var attributes=require(_0xe640('0xa'));module[_0xe640('0xb')]=function(_0x3cb4c2,_0x2412f3){return _0x3cb4c2[_0xe640('0xc')](_0xe640('0xd'),attributes,{'tableName':_0xe640('0xe'),'paranoid':![],'indexes':[{'name':_0xe640('0xf'),'fields':[_0xe640('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b0f3f,_0x28d3a5,_0x596884){var _0x4c26b6=_0x3cb4c2[_0xe640('0x11')];var _0x50df97=_0x3b0f3f[_0xe640('0x12')]({'plain':!![]});if(_0x50df97[_0xe640('0x13')]['toLowerCase']()==='in'||_0x50df97[_0xe640('0x13')][_0xe640('0x14')]()===_0xe640('0x15')&&!_0x50df97[_0xe640('0x16')]&&!_[_0xe640('0x17')](_0x50df97[_0xe640('0x18')])){_0x4c26b6[_0xe640('0x19')]['findOne']({'where':{'id':_0x50df97[_0xe640('0x1a')]}})[_0xe640('0x1b')](function(_0x5b0e16){if(_0x5b0e16){_0x5b0e16[_0xe640('0x1c')]({'lastMsgAt':_0x50df97[_0xe640('0x1d')],'lastMsgDirection':_0x50df97[_0xe640('0x13')][_0xe640('0x14')]()});}})[_0xe640('0x1e')](function(_0x43e209){console[_0xe640('0x1f')](_0x43e209);});}_0x596884();}},'charset':_0xe640('0x20'),'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 50b0571..ab7924e 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 _0x38ad=['./chatMessage.socket','register','request','then','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x38ad,0x1d2));var _0xd38a=function(_0x41c943,_0x540db4){_0x41c943=_0x41c943-0x0;var _0x13eb93=_0x38ad[_0x41c943];return _0x13eb93;};'use strict';var _=require(_0xd38a('0x0'));var util=require(_0xd38a('0x1'));var moment=require('moment');var BPromise=require(_0xd38a('0x2'));var rs=require(_0xd38a('0x3'));var fs=require('fs');var Redis=require(_0xd38a('0x4'));var db=require(_0xd38a('0x5'))['db'];var utils=require(_0xd38a('0x6'));var logger=require(_0xd38a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd38a('0x8'));var client=jayson[_0xd38a('0x9')][_0xd38a('0xa')]({'port':0x232a});config[_0xd38a('0xb')]=_['defaults'](config[_0xd38a('0xb')],{'host':_0xd38a('0xc'),'port':0x18eb});var socket=require(_0xd38a('0xd'))(new Redis(config['redis']));require(_0xd38a('0xe'))[_0xd38a('0xf')](socket);function respondWithRpcPromise(_0x45729a,_0x57c136,_0x1825d8){return new BPromise(function(_0x1714ef,_0xe4f833){return client[_0xd38a('0x10')](_0x45729a,_0x1825d8)[_0xd38a('0x11')](function(_0x1e9692){logger[_0xd38a('0x12')]('ChatMessage,\x20%s,\x20%s',_0x57c136,_0xd38a('0x13'));logger[_0xd38a('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57c136,_0xd38a('0x13'),JSON['stringify'](_0x1e9692));if(_0x1e9692[_0xd38a('0x15')]){if(_0x1e9692[_0xd38a('0x15')][_0xd38a('0x16')]===0x1f4){logger['error'](_0xd38a('0x17'),_0x57c136,_0x1e9692['error'][_0xd38a('0x18')]);return _0xe4f833(_0x1e9692[_0xd38a('0x15')]['message']);}logger['error'](_0xd38a('0x17'),_0x57c136,_0x1e9692[_0xd38a('0x15')][_0xd38a('0x18')]);return _0x1714ef(_0x1e9692['error']['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x57c136,_0xd38a('0x13'));_0x1714ef(_0x1e9692['result'][_0xd38a('0x18')]);}})[_0xd38a('0x19')](function(_0x58b627){logger[_0xd38a('0x15')](_0xd38a('0x17'),_0x57c136,_0x58b627);_0xe4f833(_0x58b627);});});}exports[_0xd38a('0x1a')]=function(_0x2ee3a6){var _0x5d9ba6=this;return new Promise(function(_0x27d9c8,_0x11e7c0){return db[_0xd38a('0x1b')][_0xd38a('0x1c')](_0x2ee3a6[_0xd38a('0x1d')],{'raw':_0x2ee3a6[_0xd38a('0x1e')]?_0x2ee3a6[_0xd38a('0x1e')][_0xd38a('0x1f')]===undefined?!![]:![]:!![]})[_0xd38a('0x11')](function(_0x4cf53f){logger['info'](_0xd38a('0x1a'),_0x2ee3a6);logger['debug'](_0xd38a('0x1a'),_0x2ee3a6,JSON['stringify'](_0x4cf53f));_0x27d9c8(_0x4cf53f);})[_0xd38a('0x19')](function(_0x1b3298){logger[_0xd38a('0x15')](_0xd38a('0x1a'),_0x1b3298[_0xd38a('0x18')],_0x2ee3a6);_0x11e7c0(_0x5d9ba6['error'](0x1f4,_0x1b3298[_0xd38a('0x18')]));});});};
\ No newline at end of file
+var _0xdcb8=['register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xdcb8,0x13b));var _0x8dcb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdcb8[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x8dcb('0x0'));var moment=require(_0x8dcb('0x1'));var BPromise=require('bluebird');var rs=require(_0x8dcb('0x2'));var fs=require('fs');var Redis=require(_0x8dcb('0x3'));var db=require(_0x8dcb('0x4'))['db'];var utils=require(_0x8dcb('0x5'));var logger=require(_0x8dcb('0x6'))(_0x8dcb('0x7'));var config=require('../../config/environment');var jayson=require(_0x8dcb('0x8'));var client=jayson[_0x8dcb('0x9')][_0x8dcb('0xa')]({'port':0x232a});config[_0x8dcb('0xb')]=_[_0x8dcb('0xc')](config[_0x8dcb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dcb('0xd'))(new Redis(config['redis']));require(_0x8dcb('0xe'))[_0x8dcb('0xf')](socket);function respondWithRpcPromise(_0x4e0494,_0x25916d,_0x49d06d){return new BPromise(function(_0x480639,_0x30b4e2){return client[_0x8dcb('0x10')](_0x4e0494,_0x49d06d)['then'](function(_0x23bfaa){logger[_0x8dcb('0x11')](_0x8dcb('0x12'),_0x25916d,_0x8dcb('0x13'));logger['debug'](_0x8dcb('0x14'),_0x25916d,_0x8dcb('0x13'),JSON['stringify'](_0x23bfaa));if(_0x23bfaa[_0x8dcb('0x15')]){if(_0x23bfaa['error'][_0x8dcb('0x16')]===0x1f4){logger[_0x8dcb('0x15')]('ChatMessage,\x20%s,\x20%s',_0x25916d,_0x23bfaa[_0x8dcb('0x15')][_0x8dcb('0x17')]);return _0x30b4e2(_0x23bfaa[_0x8dcb('0x15')]['message']);}logger[_0x8dcb('0x15')](_0x8dcb('0x12'),_0x25916d,_0x23bfaa[_0x8dcb('0x15')]['message']);return _0x480639(_0x23bfaa['error'][_0x8dcb('0x17')]);}else{logger[_0x8dcb('0x11')](_0x8dcb('0x12'),_0x25916d,'request\x20sent');_0x480639(_0x23bfaa[_0x8dcb('0x18')][_0x8dcb('0x17')]);}})[_0x8dcb('0x19')](function(_0x45f918){logger[_0x8dcb('0x15')](_0x8dcb('0x12'),_0x25916d,_0x45f918);_0x30b4e2(_0x45f918);});});}exports[_0x8dcb('0x1a')]=function(_0x109bca){var _0x103bf0=this;return new Promise(function(_0x1837c6,_0x34df68){return db[_0x8dcb('0x1b')][_0x8dcb('0x1c')](_0x109bca[_0x8dcb('0x1d')],{'raw':_0x109bca[_0x8dcb('0x1e')]?_0x109bca[_0x8dcb('0x1e')][_0x8dcb('0x1f')]===undefined?!![]:![]:!![]})[_0x8dcb('0x20')](function(_0x4925de){logger[_0x8dcb('0x11')](_0x8dcb('0x1a'),_0x109bca);logger['debug'](_0x8dcb('0x1a'),_0x109bca,JSON['stringify'](_0x4925de));_0x1837c6(_0x4925de);})[_0x8dcb('0x19')](function(_0x432028){logger[_0x8dcb('0x15')](_0x8dcb('0x1a'),_0x432028[_0x8dcb('0x17')],_0x109bca);_0x34df68(_0x103bf0[_0x8dcb('0x15')](0x1f4,_0x432028[_0x8dcb('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index d1ecd55..6a8658d 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 _0x7d55=['emit','removeListener','register','length','./chatMessage.events','save','remove','update'];(function(_0x9a6ed7,_0x174916){var _0x13d571=function(_0x3d9902){while(--_0x3d9902){_0x9a6ed7['push'](_0x9a6ed7['shift']());}};_0x13d571(++_0x174916);}(_0x7d55,0x1bc));var _0x57d5=function(_0x4a5439,_0x228af){_0x4a5439=_0x4a5439-0x0;var _0x2f5150=_0x7d55[_0x4a5439];return _0x2f5150;};'use strict';var ChatMessageEvents=require(_0x57d5('0x0'));var events=[_0x57d5('0x1'),_0x57d5('0x2'),_0x57d5('0x3')];function createListener(_0x517d62,_0x541e22){return function(_0x3ce441){_0x541e22[_0x57d5('0x4')](_0x517d62,_0x3ce441);};}function removeListener(_0x2b6dc5,_0x48b5aa){return function(){ChatMessageEvents[_0x57d5('0x5')](_0x2b6dc5,_0x48b5aa);};}exports[_0x57d5('0x6')]=function(_0x15c349){for(var _0x30fcfe=0x0,_0x4393ed=events[_0x57d5('0x7')];_0x30fcfe<_0x4393ed;_0x30fcfe++){var _0x599ec5=events[_0x30fcfe];var _0x50bc50=createListener('chatMessage:'+_0x599ec5,_0x15c349);ChatMessageEvents['on'](_0x599ec5,_0x50bc50);}};
\ No newline at end of file
+var _0x818f=['update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x1974a6,_0xdb12ff){var _0x8f6b8c=function(_0x4655d1){while(--_0x4655d1){_0x1974a6['push'](_0x1974a6['shift']());}};_0x8f6b8c(++_0xdb12ff);}(_0x818f,0x1da));var _0xf818=function(_0x8cc1ce,_0x120de3){_0x8cc1ce=_0x8cc1ce-0x0;var _0x293189=_0x818f[_0x8cc1ce];return _0x293189;};'use strict';var ChatMessageEvents=require(_0xf818('0x0'));var events=[_0xf818('0x1'),_0xf818('0x2'),_0xf818('0x3')];function createListener(_0x121db7,_0x39b430){return function(_0x58f142){_0x39b430[_0xf818('0x4')](_0x121db7,_0x58f142);};}function removeListener(_0xd6c86,_0x2c1bb0){return function(){ChatMessageEvents[_0xf818('0x5')](_0xd6c86,_0x2c1bb0);};}exports[_0xf818('0x6')]=function(_0x41310f){for(var _0x27119b=0x0,_0x42a23e=events[_0xf818('0x7')];_0x27119b<_0x42a23e;_0x27119b++){var _0x55540d=events[_0x27119b];var _0x1dbfc8=createListener(_0xf818('0x8')+_0x55540d,_0x41310f);ChatMessageEvents['on'](_0x55540d,_0x1dbfc8);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 4e06e7f..d153cf9 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 _0x4f23=['show','post','tracked','chat','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x23dcb3,_0x37f439){var _0x15e3e1=function(_0x5d3a85){while(--_0x5d3a85){_0x23dcb3['push'](_0x23dcb3['shift']());}};_0x15e3e1(++_0x37f439);}(_0x4f23,0x83));var _0x34f2=function(_0x5879dd,_0x31f7f4){_0x5879dd=_0x5879dd-0x0;var _0x271b41=_0x4f23[_0x5879dd];return _0x271b41;};'use strict';var multer=require('multer');var util=require(_0x34f2('0x0'));var path=require('path');var timeout=require(_0x34f2('0x1'));var express=require(_0x34f2('0x2'));var router=express[_0x34f2('0x3')]();var fs_extra=require(_0x34f2('0x4'));var auth=require(_0x34f2('0x5'));var interaction=require(_0x34f2('0x6'));var config=require(_0x34f2('0x7'));var controller=require(_0x34f2('0x8'));router[_0x34f2('0x9')]('/',auth[_0x34f2('0xa')](),controller[_0x34f2('0xb')]);router['get'](_0x34f2('0xc'),auth['isAuthenticated'](),controller[_0x34f2('0xd')]);router[_0x34f2('0x9')]('/:id',auth[_0x34f2('0xa')](),controller[_0x34f2('0xe')]);router[_0x34f2('0xf')]('/',auth['isAuthenticated'](),interaction[_0x34f2('0x10')](_0x34f2('0x11'),'chatmessage:create'),controller[_0x34f2('0x12')]);router[_0x34f2('0x13')](_0x34f2('0x14'),controller[_0x34f2('0x15')]);router['put'](_0x34f2('0x16'),auth['isAuthenticated'](),controller[_0x34f2('0x17')]);router[_0x34f2('0x13')](_0x34f2('0x18'),auth['isAuthenticated'](),controller[_0x34f2('0x19')]);router[_0x34f2('0x1a')](_0x34f2('0x14'),auth[_0x34f2('0xa')](),controller[_0x34f2('0x1b')]);module[_0x34f2('0x1c')]=router;
\ No newline at end of file
+var _0xa1d6=['chat','chatmessage:create','create','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','tracked'];(function(_0x56f561,_0x7f75f4){var _0x15ed6f=function(_0xc13416){while(--_0xc13416){_0x56f561['push'](_0x56f561['shift']());}};_0x15ed6f(++_0x7f75f4);}(_0xa1d6,0x10f));var _0x6a1d=function(_0x35ce0e,_0x13f34e){_0x35ce0e=_0x35ce0e-0x0;var _0x17d179=_0xa1d6[_0x35ce0e];return _0x17d179;};'use strict';var multer=require(_0x6a1d('0x0'));var util=require(_0x6a1d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6a1d('0x2'));var router=express[_0x6a1d('0x3')]();var fs_extra=require(_0x6a1d('0x4'));var auth=require(_0x6a1d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6a1d('0x6'));var controller=require('./chatMessage.controller');router[_0x6a1d('0x7')]('/',auth[_0x6a1d('0x8')](),controller['index']);router['get'](_0x6a1d('0x9'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0xa')]);router[_0x6a1d('0x7')](_0x6a1d('0xb'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0xc')]);router[_0x6a1d('0xd')]('/',auth[_0x6a1d('0x8')](),interaction[_0x6a1d('0xe')](_0x6a1d('0xf'),_0x6a1d('0x10')),controller[_0x6a1d('0x11')]);router['put'](_0x6a1d('0xb'),controller['update']);router['put'](_0x6a1d('0x12'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0x13')]);router[_0x6a1d('0x14')](_0x6a1d('0x15'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0x16')]);router[_0x6a1d('0x17')](_0x6a1d('0xb'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0x18')]);module[_0x6a1d('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index a12f17a..92640e3 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 _0xd1a0=['sequelize','TEXT','medium'];(function(_0xf4b05a,_0x301123){var _0x29812f=function(_0x535463){while(--_0x535463){_0xf4b05a['push'](_0xf4b05a['shift']());}};_0x29812f(++_0x301123);}(_0xd1a0,0x132));var _0x0d1a=function(_0xc94ca0,_0x363c2a){_0xc94ca0=_0xc94ca0-0x0;var _0x1871b8=_0xd1a0[_0xc94ca0];return _0x1871b8;};'use strict';var Sequelize=require(_0x0d1a('0x0'));module['exports']={'body':{'type':Sequelize[_0x0d1a('0x1')](_0x0d1a('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x47c8=['exports','TEXT','medium','sequelize'];(function(_0x369cae,_0x45a057){var _0xc7a297=function(_0x1e81bf){while(--_0x1e81bf){_0x369cae['push'](_0x369cae['shift']());}};_0xc7a297(++_0x45a057);}(_0x47c8,0xcf));var _0x847c=function(_0x2f1351,_0xb5203){_0x2f1351=_0x2f1351-0x0;var _0xe88511=_0x47c8[_0x2f1351];return _0xe88511;};'use strict';var Sequelize=require(_0x847c('0x0'));module[_0x847c('0x1')]={'body':{'type':Sequelize[_0x847c('0x2')](_0x847c('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 632d606..7b43f5a 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7a54,0x106));var _0x47a5=function(_0x1b3f8b,_0x218dc6){_0x1b3f8b=_0x1b3f8b-0x0;var _0x413fb0=_0x7a54[_0x1b3f8b];return _0x413fb0;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _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(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0x11d73e,_0x3f4882){_0x11d73e=_0x11d73e-0x0;var _0xfd3d73=_0x7a54[_0x11d73e];return _0xfd3d73;};'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 631331c..b9c4474 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 _0x7484=['chat_offline_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x23bed6,_0x45f84f){var _0x1f9d5b=function(_0x96df66){while(--_0x96df66){_0x23bed6['push'](_0x23bed6['shift']());}};_0x1f9d5b(++_0x45f84f);}(_0x7484,0x71));var _0x4748=function(_0x16fedc,_0x254475){_0x16fedc=_0x16fedc-0x0;var _0xff9a07=_0x7484[_0x16fedc];return _0xff9a07;};'use strict';var _=require(_0x4748('0x0'));var util=require(_0x4748('0x1'));var logger=require(_0x4748('0x2'))(_0x4748('0x3'));var moment=require(_0x4748('0x4'));var BPromise=require(_0x4748('0x5'));var rp=require(_0x4748('0x6'));var fs=require('fs');var path=require(_0x4748('0x7'));var rimraf=require(_0x4748('0x8'));var config=require(_0x4748('0x9'));var attributes=require(_0x4748('0xa'));module[_0x4748('0xb')]=function(_0x260c5c,_0x209a1b){return _0x260c5c['define'](_0x4748('0xc'),attributes,{'tableName':_0x4748('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x74f1=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x74f1,0x14a));var _0x174f=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x74f1[_0x1ee0a1];return _0x1d2d5b;};'use strict';var _=require('lodash');var util=require(_0x174f('0x0'));var logger=require(_0x174f('0x1'))(_0x174f('0x2'));var moment=require(_0x174f('0x3'));var BPromise=require('bluebird');var rp=require(_0x174f('0x4'));var fs=require('fs');var path=require(_0x174f('0x5'));var rimraf=require(_0x174f('0x6'));var config=require(_0x174f('0x7'));var attributes=require(_0x174f('0x8'));module[_0x174f('0x9')]=function(_0xc8fdce,_0x1a4cff){return _0xc8fdce[_0x174f('0xa')]('ChatOfflineMessage',attributes,{'tableName':_0x174f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x174f('0xc'),'collate':_0x174f('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 3bb70b6..64f2b9d 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 _0xd139=['catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x114626,_0xa10843){var _0x109aef=function(_0x14c4fe){while(--_0x14c4fe){_0x114626['push'](_0x114626['shift']());}};_0x109aef(++_0xa10843);}(_0xd139,0x1ef));var _0x9d13=function(_0xca70d,_0x11827e){_0xca70d=_0xca70d-0x0;var _0x1a17f1=_0xd139[_0xca70d];return _0x1a17f1;};'use strict';var _=require(_0x9d13('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x1'));var fs=require('fs');var Redis=require(_0x9d13('0x2'));var db=require(_0x9d13('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d13('0x4'))(_0x9d13('0x5'));var config=require('../../config/environment');var jayson=require(_0x9d13('0x6'));var client=jayson[_0x9d13('0x7')][_0x9d13('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d7993,_0x4d47e0,_0x75b3d2){return new BPromise(function(_0x5f3551,_0x1eafba){return client['request'](_0x1d7993,_0x75b3d2)[_0x9d13('0x9')](function(_0xdce21d){logger[_0x9d13('0xa')](_0x9d13('0xb'),_0x4d47e0,_0x9d13('0xc'));logger[_0x9d13('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4d47e0,_0x9d13('0xc'),JSON['stringify'](_0xdce21d));if(_0xdce21d[_0x9d13('0xe')]){if(_0xdce21d['error'][_0x9d13('0xf')]===0x1f4){logger[_0x9d13('0xe')](_0x9d13('0xb'),_0x4d47e0,_0xdce21d['error'][_0x9d13('0x10')]);return _0x1eafba(_0xdce21d[_0x9d13('0xe')][_0x9d13('0x10')]);}logger[_0x9d13('0xe')](_0x9d13('0xb'),_0x4d47e0,_0xdce21d[_0x9d13('0xe')][_0x9d13('0x10')]);return _0x5f3551(_0xdce21d[_0x9d13('0xe')][_0x9d13('0x10')]);}else{logger[_0x9d13('0xa')](_0x9d13('0xb'),_0x4d47e0,_0x9d13('0xc'));_0x5f3551(_0xdce21d[_0x9d13('0x11')][_0x9d13('0x10')]);}})[_0x9d13('0x12')](function(_0x3cbfc9){logger[_0x9d13('0xe')](_0x9d13('0xb'),_0x4d47e0,_0x3cbfc9);_0x1eafba(_0x3cbfc9);});});}
\ No newline at end of file
+var _0x9ea2=['then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ea2,0x147));var _0x29ea=function(_0x383ea8,_0x5d5797){_0x383ea8=_0x383ea8-0x0;var _0x3736b8=_0x9ea2[_0x383ea8];return _0x3736b8;};'use strict';var _=require(_0x29ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29ea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29ea('0x2'));var db=require(_0x29ea('0x3'))['db'];var utils=require(_0x29ea('0x4'));var logger=require(_0x29ea('0x5'))(_0x29ea('0x6'));var config=require(_0x29ea('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19f3b7,_0x50e60f,_0x36dbd7){return new BPromise(function(_0x25b1aa,_0x724c09){return client[_0x29ea('0x8')](_0x19f3b7,_0x36dbd7)[_0x29ea('0x9')](function(_0x96d254){logger[_0x29ea('0xa')](_0x29ea('0xb'),_0x50e60f,'request\x20sent');logger[_0x29ea('0xc')](_0x29ea('0xd'),_0x50e60f,_0x29ea('0xe'),JSON[_0x29ea('0xf')](_0x96d254));if(_0x96d254['error']){if(_0x96d254['error'][_0x29ea('0x10')]===0x1f4){logger[_0x29ea('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x50e60f,_0x96d254[_0x29ea('0x11')][_0x29ea('0x12')]);return _0x724c09(_0x96d254[_0x29ea('0x11')]['message']);}logger[_0x29ea('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x50e60f,_0x96d254[_0x29ea('0x11')][_0x29ea('0x12')]);return _0x25b1aa(_0x96d254[_0x29ea('0x11')][_0x29ea('0x12')]);}else{logger[_0x29ea('0xa')](_0x29ea('0xb'),_0x50e60f,_0x29ea('0xe'));_0x25b1aa(_0x96d254[_0x29ea('0x13')][_0x29ea('0x12')]);}})[_0x29ea('0x14')](function(_0x303ceb){logger[_0x29ea('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x50e60f,_0x303ceb);_0x724c09(_0x303ceb);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d9778b2..72ef751 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 _0x4ee6=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0xe49a87,_0x405df8){var _0x54a107=function(_0x4cd5cb){while(--_0x4cd5cb){_0xe49a87['push'](_0xe49a87['shift']());}};_0x54a107(++_0x405df8);}(_0x4ee6,0x1c2));var _0x64ee=function(_0xa4a87d,_0x3b8229){_0xa4a87d=_0xa4a87d-0x0;var _0xc064ed=_0x4ee6[_0xa4a87d];return _0xc064ed;};'use strict';var multer=require('multer');var util=require(_0x64ee('0x0'));var path=require(_0x64ee('0x1'));var timeout=require(_0x64ee('0x2'));var express=require(_0x64ee('0x3'));var router=express[_0x64ee('0x4')]();var fs_extra=require(_0x64ee('0x5'));var auth=require(_0x64ee('0x6'));var interaction=require(_0x64ee('0x7'));var config=require(_0x64ee('0x8'));var controller=require(_0x64ee('0x9'));router[_0x64ee('0xa')]('/',auth['isAuthenticated'](),controller[_0x64ee('0xb')]);router[_0x64ee('0xa')](_0x64ee('0xc'),auth[_0x64ee('0xd')](),controller[_0x64ee('0xe')]);router[_0x64ee('0xa')](_0x64ee('0xf'),auth[_0x64ee('0xd')](),controller[_0x64ee('0x10')]);router[_0x64ee('0x11')]('/',auth[_0x64ee('0xd')](),controller[_0x64ee('0x12')]);router[_0x64ee('0x13')](_0x64ee('0xf'),auth[_0x64ee('0xd')](),controller[_0x64ee('0x14')]);router[_0x64ee('0x15')](_0x64ee('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x64ee('0x16')]=router;
\ No newline at end of file
+var _0x1591=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','destroy','exports','path','express','fs-extra','../../components/interaction/service'];(function(_0x16061c,_0xc37b21){var _0x190355=function(_0x3fe799){while(--_0x3fe799){_0x16061c['push'](_0x16061c['shift']());}};_0x190355(++_0xc37b21);}(_0x1591,0x84));var _0x1159=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x1591[_0x5311e8];return _0x582ad8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1159('0x0'));var timeout=require('connect-timeout');var express=require(_0x1159('0x1'));var router=express['Router']();var fs_extra=require(_0x1159('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x1159('0x3'));var config=require(_0x1159('0x4'));var controller=require(_0x1159('0x5'));router[_0x1159('0x6')]('/',auth[_0x1159('0x7')](),controller['index']);router[_0x1159('0x6')](_0x1159('0x8'),auth[_0x1159('0x7')](),controller[_0x1159('0x9')]);router['get'](_0x1159('0xa'),auth[_0x1159('0x7')](),controller[_0x1159('0xb')]);router[_0x1159('0xc')]('/',auth[_0x1159('0x7')](),controller[_0x1159('0xd')]);router['put'](_0x1159('0xa'),auth['isAuthenticated'](),controller[_0x1159('0xe')]);router['delete'](_0x1159('0xa'),auth[_0x1159('0x7')](),controller[_0x1159('0xf')]);module[_0x1159('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 53e5b4b..65f53bf 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 _0x9619=['mouseOver','timeout','STRING','exports','ENUM'];(function(_0x192772,_0x100b16){var _0x2b50bd=function(_0x3cbf90){while(--_0x3cbf90){_0x192772['push'](_0x192772['shift']());}};_0x2b50bd(++_0x100b16);}(_0x9619,0x175));var _0x9961=function(_0x83a927,_0x2737b9){_0x83a927=_0x83a927-0x0;var _0x54825c=_0x9619[_0x83a927];return _0x54825c;};'use strict';var Sequelize=require('sequelize');module[_0x9961('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9961('0x1')](_0x9961('0x2'),_0x9961('0x3')),'defaultValue':_0x9961('0x2')},'selector':{'type':Sequelize[_0x9961('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x086f=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x941f4b,_0x2881e4){var _0x5b4e5b=function(_0x1ab59e){while(--_0x1ab59e){_0x941f4b['push'](_0x941f4b['shift']());}};_0x5b4e5b(++_0x2881e4);}(_0x086f,0xd3));var _0xf086=function(_0x521884,_0x29a522){_0x521884=_0x521884-0x0;var _0x35d60b=_0x086f[_0x521884];return _0x35d60b;};'use strict';var Sequelize=require(_0xf086('0x0'));module[_0xf086('0x1')]={'name':{'type':Sequelize[_0xf086('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf086('0x3')](_0xf086('0x4'),_0xf086('0x5')),'defaultValue':_0xf086('0x4')},'selector':{'type':Sequelize[_0xf086('0x2')]},'timeout':{'type':Sequelize[_0xf086('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d8bd8d5..bbad025 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 _0x8958=['json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','show','params','model','keys','query','filters','intersection','fields','attributes','includeAll','include','options','find','catch','create','body','ChatProactiveAction','destroy','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x129cfc,_0x406219){var _0x1fddd5=function(_0x15c845){while(--_0x15c845){_0x129cfc['push'](_0x129cfc['shift']());}};_0x1fddd5(++_0x406219);}(_0x8958,0x93));var _0x8895=function(_0x1dddc0,_0xb87b48){_0x1dddc0=_0x1dddc0-0x0;var _0x38c199=_0x8958[_0x1dddc0];return _0x38c199;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={'raw':!![],'where':{'id':_0x5c03ea[_0x8895('0x29')]['id']}},_0x37ac3a={};_0x37ac3a[_0x8895('0x2a')]=_[_0x8895('0x2b')](db['ChatProactiveAction']['rawAttributes']);_0x37ac3a[_0x8895('0x2c')]=_[_0x8895('0x2b')](_0x5c03ea[_0x8895('0x2c')]);_0x37ac3a[_0x8895('0x2d')]=_[_0x8895('0x2e')](_0x37ac3a['model'],_0x37ac3a[_0x8895('0x2c')]);_0x6e449d['attributes']=_[_0x8895('0x2e')](_0x37ac3a['model'],qs[_0x8895('0x2f')](_0x5c03ea[_0x8895('0x2c')][_0x8895('0x2f')]));_0x6e449d[_0x8895('0x30')]=_0x6e449d[_0x8895('0x30')]['length']?_0x6e449d[_0x8895('0x30')]:_0x37ac3a[_0x8895('0x2a')];if(_0x5c03ea[_0x8895('0x2c')][_0x8895('0x31')]){_0x6e449d[_0x8895('0x32')]=[{'all':!![]}];}_0x6e449d=_['merge']({},_0x6e449d,_0x5c03ea[_0x8895('0x33')]);return db['ChatProactiveAction'][_0x8895('0x34')](_0x6e449d)['then'](handleEntityNotFound(_0x4d567a,null))[_0x8895('0x24')](respondWithResult(_0x4d567a,null))[_0x8895('0x35')](handleError(_0x4d567a,null));};exports[_0x8895('0x36')]=function(_0x418e53,_0xd08bf3){return db['ChatProactiveAction'][_0x8895('0x36')](_0x418e53['body'],{})[_0x8895('0x24')](respondWithResult(_0xd08bf3,0xc9))[_0x8895('0x35')](handleError(_0xd08bf3,null));};exports[_0x8895('0x23')]=function(_0x9297ea,_0x25fa39){if(_0x9297ea[_0x8895('0x37')]['id']){delete _0x9297ea['body']['id'];}return db[_0x8895('0x38')][_0x8895('0x34')]({'where':{'id':_0x9297ea['params']['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x25fa39,null))['then'](saveUpdates(_0x9297ea[_0x8895('0x37')],null))[_0x8895('0x24')](respondWithResult(_0x25fa39,null))['catch'](handleError(_0x25fa39,null));};exports[_0x8895('0x39')]=function(_0x418250,_0x5b7204){return db['ChatProactiveAction'][_0x8895('0x34')]({'where':{'id':_0x418250[_0x8895('0x29')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x5b7204,null))[_0x8895('0x24')](removeEntity(_0x5b7204,null))[_0x8895('0x35')](handleError(_0x5b7204,null));};
\ No newline at end of file
+var _0x97d5=['catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','filters','attributes','includeAll','include','merge','options','find'];(function(_0x527382,_0x15ba60){var _0x157add=function(_0x452261){while(--_0x452261){_0x527382['push'](_0x527382['shift']());}};_0x157add(++_0x15ba60);}(_0x97d5,0x199));var _0x597d=function(_0x484630,_0x24ca02){_0x484630=_0x484630-0x0;var _0x2e187e=_0x97d5[_0x484630];return _0x2e187e;};'use strict';var emlformat=require(_0x597d('0x0'));var rimraf=require(_0x597d('0x1'));var zipdir=require(_0x597d('0x2'));var jsonpatch=require(_0x597d('0x3'));var rp=require(_0x597d('0x4'));var moment=require(_0x597d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x597d('0x6'));var util=require(_0x597d('0x7'));var path=require(_0x597d('0x8'));var sox=require('sox');var csv=require(_0x597d('0x9'));var ejs=require(_0x597d('0xa'));var fs=require('fs');var fs_extra=require(_0x597d('0xb'));var _=require(_0x597d('0xc'));var squel=require(_0x597d('0xd'));var crypto=require(_0x597d('0xe'));var jsforce=require(_0x597d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x597d('0x9'));var querystring=require(_0x597d('0x10'));var Papa=require('papaparse');var Redis=require(_0x597d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x597d('0x12'));var as=require(_0x597d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x597d('0x14'));var utils=require(_0x597d('0x15'));var config=require(_0x597d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x597d('0x17'))['db'];function respondWithStatusCode(_0x2f464a,_0x355fbd){_0x355fbd=_0x355fbd||0xcc;return function(_0x1664e5){if(_0x1664e5){return _0x2f464a[_0x597d('0x18')](_0x355fbd);}return _0x2f464a[_0x597d('0x19')](_0x355fbd)[_0x597d('0x1a')]();};}function respondWithResult(_0x465ebc,_0x810dce){_0x810dce=_0x810dce||0xc8;return function(_0x11147c){if(_0x11147c){return _0x465ebc[_0x597d('0x19')](_0x810dce)[_0x597d('0x1b')](_0x11147c);}};}function respondWithFilteredResult(_0x290db2,_0x394d1d){return function(_0x4ca1b1){if(_0x4ca1b1){var _0x17b021=typeof _0x394d1d['offset']===_0x597d('0x1c')&&typeof _0x394d1d[_0x597d('0x1d')]==='undefined';var _0x38844b=_0x4ca1b1['count'];var _0x68a5c6=_0x17b021?0x0:_0x394d1d[_0x597d('0x1e')];var _0x525f28=_0x17b021?_0x4ca1b1['count']:_0x394d1d['offset']+_0x394d1d[_0x597d('0x1d')];var _0x32717e;if(_0x525f28>=_0x38844b){_0x525f28=_0x38844b;_0x32717e=0xc8;}else{_0x32717e=0xce;}_0x290db2[_0x597d('0x19')](_0x32717e);return _0x290db2[_0x597d('0x1f')](_0x597d('0x20'),_0x68a5c6+'-'+_0x525f28+'/'+_0x38844b)[_0x597d('0x1b')](_0x4ca1b1);}return null;};}function patchUpdates(_0x4173c9){return function(_0x1f8966){try{jsonpatch[_0x597d('0x21')](_0x1f8966,_0x4173c9,!![]);}catch(_0x349d8a){return BPromise['reject'](_0x349d8a);}return _0x1f8966[_0x597d('0x22')]();};}function saveUpdates(_0x330794,_0x639ac){return function(_0x2d4e7b){if(_0x2d4e7b){return _0x2d4e7b[_0x597d('0x23')](_0x330794)[_0x597d('0x24')](function(_0x529af4){return _0x529af4;});}return null;};}function removeEntity(_0xc6ca7,_0xa0a6da){return function(_0x104476){if(_0x104476){return _0x104476[_0x597d('0x25')]()[_0x597d('0x24')](function(){_0xc6ca7['status'](0xcc)[_0x597d('0x1a')]();});}};}function handleEntityNotFound(_0x8e3c80,_0x1379a2){return function(_0x5a551f){if(!_0x5a551f){_0x8e3c80[_0x597d('0x18')](0x194);}return _0x5a551f;};}function handleError(_0x1713d1,_0x30d783){_0x30d783=_0x30d783||0x1f4;return function(_0x6f424f){logger[_0x597d('0x26')](_0x6f424f[_0x597d('0x27')]);if(_0x6f424f[_0x597d('0x28')]){delete _0x6f424f[_0x597d('0x28')];}_0x1713d1[_0x597d('0x19')](_0x30d783)[_0x597d('0x29')](_0x6f424f);};}exports[_0x597d('0x2a')]=function(_0x249e81,_0x25ffc6){var _0x2fcb0d={'raw':!![],'where':{'id':_0x249e81[_0x597d('0x2b')]['id']}},_0x106b92={};_0x106b92[_0x597d('0x2c')]=_['keys'](db[_0x597d('0x2d')][_0x597d('0x2e')]);_0x106b92['query']=_['keys'](_0x249e81[_0x597d('0x2f')]);_0x106b92[_0x597d('0x30')]=_['intersection'](_0x106b92[_0x597d('0x2c')],_0x106b92[_0x597d('0x2f')]);_0x2fcb0d[_0x597d('0x31')]=_['intersection'](_0x106b92[_0x597d('0x2c')],qs['fields'](_0x249e81[_0x597d('0x2f')]['fields']));_0x2fcb0d['attributes']=_0x2fcb0d['attributes']['length']?_0x2fcb0d['attributes']:_0x106b92[_0x597d('0x2c')];if(_0x249e81[_0x597d('0x2f')][_0x597d('0x32')]){_0x2fcb0d[_0x597d('0x33')]=[{'all':!![]}];}_0x2fcb0d=_[_0x597d('0x34')]({},_0x2fcb0d,_0x249e81[_0x597d('0x35')]);return db[_0x597d('0x2d')][_0x597d('0x36')](_0x2fcb0d)['then'](handleEntityNotFound(_0x25ffc6,null))[_0x597d('0x24')](respondWithResult(_0x25ffc6,null))[_0x597d('0x37')](handleError(_0x25ffc6,null));};exports[_0x597d('0x38')]=function(_0x2d56a1,_0x581541){return db[_0x597d('0x2d')][_0x597d('0x38')](_0x2d56a1[_0x597d('0x39')],{})[_0x597d('0x24')](respondWithResult(_0x581541,0xc9))[_0x597d('0x37')](handleError(_0x581541,null));};exports[_0x597d('0x23')]=function(_0x3807ca,_0x1cf849){if(_0x3807ca[_0x597d('0x39')]['id']){delete _0x3807ca[_0x597d('0x39')]['id'];}return db[_0x597d('0x2d')][_0x597d('0x36')]({'where':{'id':_0x3807ca[_0x597d('0x2b')]['id']}})[_0x597d('0x24')](handleEntityNotFound(_0x1cf849,null))[_0x597d('0x24')](saveUpdates(_0x3807ca[_0x597d('0x39')],null))[_0x597d('0x24')](respondWithResult(_0x1cf849,null))[_0x597d('0x37')](handleError(_0x1cf849,null));};exports[_0x597d('0x25')]=function(_0x13d8ba,_0x5b46cc){return db['ChatProactiveAction'][_0x597d('0x36')]({'where':{'id':_0x13d8ba['params']['id']}})[_0x597d('0x24')](handleEntityNotFound(_0x5b46cc,null))[_0x597d('0x24')](removeEntity(_0x5b46cc,null))['catch'](handleError(_0x5b46cc,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0625de7..6922b7d 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 _0x1312=['path','../../config/environment','./chatProactiveAction.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1312,0x16d));var _0x2131=function(_0x99c2dd,_0x1d32eb){_0x99c2dd=_0x99c2dd-0x0;var _0x173349=_0x1312[_0x99c2dd];return _0x173349;};'use strict';var _=require(_0x2131('0x0'));var util=require(_0x2131('0x1'));var logger=require(_0x2131('0x2'))(_0x2131('0x3'));var moment=require(_0x2131('0x4'));var BPromise=require(_0x2131('0x5'));var rp=require(_0x2131('0x6'));var fs=require('fs');var path=require(_0x2131('0x7'));var rimraf=require('rimraf');var config=require(_0x2131('0x8'));var attributes=require(_0x2131('0x9'));module[_0x2131('0xa')]=function(_0x44a2ee,_0x4c412b){return _0x44a2ee[_0x2131('0xb')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1216=['exports','define','ChatProactiveAction','lodash','api','moment','bluebird','path','../../config/environment'];(function(_0x89f002,_0x576460){var _0x3e6340=function(_0x1117f4){while(--_0x1117f4){_0x89f002['push'](_0x89f002['shift']());}};_0x3e6340(++_0x576460);}(_0x1216,0x1c5));var _0x6121=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0x1216[_0x243cca];return _0xf94771;};'use strict';var _=require(_0x6121('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6121('0x1'));var moment=require(_0x6121('0x2'));var BPromise=require(_0x6121('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6121('0x4'));var rimraf=require('rimraf');var config=require(_0x6121('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0x6121('0x6')]=function(_0x48f5ab,_0x18c7bf){return _0x48f5ab[_0x6121('0x7')](_0x6121('0x8'),attributes,{'tableName':'chat_proactive_actions','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 ecf0f59..7e582ea 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 _0xfe11=['jayson/promise','client','request','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x583ae6,_0x13a7da){var _0x56c9b6=function(_0x2e12fc){while(--_0x2e12fc){_0x583ae6['push'](_0x583ae6['shift']());}};_0x56c9b6(++_0x13a7da);}(_0xfe11,0x103));var _0x1fe1=function(_0xc4966b,_0x6cd5e0){_0xc4966b=_0xc4966b-0x0;var _0x1802bb=_0xfe11[_0xc4966b];return _0x1802bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1fe1('0x0'));var BPromise=require(_0x1fe1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fe1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fe1('0x3'));var logger=require(_0x1fe1('0x4'))(_0x1fe1('0x5'));var config=require(_0x1fe1('0x6'));var jayson=require(_0x1fe1('0x7'));var client=jayson[_0x1fe1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd00b24,_0x204aa7,_0x15aa12){return new BPromise(function(_0x102eb5,_0x4c76ff){return client[_0x1fe1('0x9')](_0xd00b24,_0x15aa12)['then'](function(_0x688254){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x204aa7,_0x1fe1('0xa'));logger['debug'](_0x1fe1('0xb'),_0x204aa7,_0x1fe1('0xa'),JSON[_0x1fe1('0xc')](_0x688254));if(_0x688254[_0x1fe1('0xd')]){if(_0x688254['error'][_0x1fe1('0xe')]===0x1f4){logger[_0x1fe1('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x204aa7,_0x688254[_0x1fe1('0xd')]['message']);return _0x4c76ff(_0x688254[_0x1fe1('0xd')][_0x1fe1('0xf')]);}logger['error'](_0x1fe1('0x10'),_0x204aa7,_0x688254[_0x1fe1('0xd')]['message']);return _0x102eb5(_0x688254[_0x1fe1('0xd')][_0x1fe1('0xf')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x204aa7,_0x1fe1('0xa'));_0x102eb5(_0x688254[_0x1fe1('0x11')]['message']);}})[_0x1fe1('0x12')](function(_0x559755){logger[_0x1fe1('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x204aa7,_0x559755);_0x4c76ff(_0x559755);});});}
\ No newline at end of file
+var _0x3b42=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x43f631,_0x519107){var _0x241582=function(_0x3f3616){while(--_0x3f3616){_0x43f631['push'](_0x43f631['shift']());}};_0x241582(++_0x519107);}(_0x3b42,0x1a1));var _0x23b4=function(_0x1c2d05,_0x1b5545){_0x1c2d05=_0x1c2d05-0x0;var _0xcc38af=_0x3b42[_0x1c2d05];return _0xcc38af;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x23b4('0x0'));var BPromise=require(_0x23b4('0x1'));var rs=require(_0x23b4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23b4('0x3'))['db'];var utils=require(_0x23b4('0x4'));var logger=require(_0x23b4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x23b4('0x6'));var client=jayson[_0x23b4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15bf82,_0x4fe583,_0x466075){return new BPromise(function(_0xa6a581,_0x381530){return client['request'](_0x15bf82,_0x466075)[_0x23b4('0x8')](function(_0x1451dd){logger[_0x23b4('0x9')](_0x23b4('0xa'),_0x4fe583,_0x23b4('0xb'));logger[_0x23b4('0xc')](_0x23b4('0xd'),_0x4fe583,'request\x20sent',JSON[_0x23b4('0xe')](_0x1451dd));if(_0x1451dd[_0x23b4('0xf')]){if(_0x1451dd[_0x23b4('0xf')][_0x23b4('0x10')]===0x1f4){logger[_0x23b4('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x4fe583,_0x1451dd['error'][_0x23b4('0x11')]);return _0x381530(_0x1451dd[_0x23b4('0xf')]['message']);}logger[_0x23b4('0xf')](_0x23b4('0xa'),_0x4fe583,_0x1451dd[_0x23b4('0xf')][_0x23b4('0x11')]);return _0xa6a581(_0x1451dd['error']['message']);}else{logger[_0x23b4('0x9')](_0x23b4('0xa'),_0x4fe583,_0x23b4('0xb'));_0xa6a581(_0x1451dd[_0x23b4('0x12')][_0x23b4('0x11')]);}})[_0x23b4('0x13')](function(_0x5ea951){logger[_0x23b4('0xf')](_0x23b4('0xa'),_0x4fe583,_0x5ea951);_0x381530(_0x5ea951);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index e626cd5..be2f198 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 _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x32924e,_0x1c46bf){_0x32924e=_0x32924e-0x0;var _0xc7804a=_0x8d0e[_0x32924e];return _0xc7804a;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x4b8aa8,_0x44d6b8){var _0x1467fe=function(_0x440908){while(--_0x440908){_0x4b8aa8['push'](_0x4b8aa8['shift']());}};_0x1467fe(++_0x44d6b8);}(_0xeda8,0x104));var _0x8eda=function(_0x26631e,_0x52ea53){_0x26631e=_0x26631e-0x0;var _0x19dafd=_0xeda8[_0x26631e];return _0x19dafd;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('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 0809dbf..fd55b5e 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc60a=['STRING','INTEGER','rrmemory','beepall','exports','name'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xc60a,0x17e));var _0xac60=function(_0x2c3d62,_0x533913){_0x2c3d62=_0x2c3d62-0x0;var _0x2bf4c1=_0xc60a[_0x2c3d62];return _0x2bf4c1;};'use strict';var Sequelize=require('sequelize');module[_0xac60('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xac60('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac60('0x2')]},'timeout':{'type':Sequelize[_0xac60('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xac60('0x4'),_0xac60('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0xb767=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xb767,0x1bf));var _0x7b76=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb767[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7b76('0x0'));module[_0x7b76('0x1')]={'name':{'type':Sequelize[_0x7b76('0x2')],'unique':_0x7b76('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7b76('0x2')]},'timeout':{'type':Sequelize[_0x7b76('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7b76('0x5')](_0x7b76('0x6'),_0x7b76('0x7'),_0x7b76('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 955afa7..dbf581c 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 _0x17f1=['json','reject','update','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','show','params','includeAll','include','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserChatQueue','rawAttributes','order','ChatQueueId','options','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','findAll','Agents','online','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x3d4c8b,_0x3e6ad6){var _0x1d1bc3=function(_0x155297){while(--_0x155297){_0x3d4c8b['push'](_0x3d4c8b['shift']());}};_0x1d1bc3(++_0x3e6ad6);}(_0x17f1,0x19d));var _0x117f=function(_0x4a92f9,_0x32b570){_0x4a92f9=_0x4a92f9-0x0;var _0x3c6448=_0x17f1[_0x4a92f9];return _0x3c6448;};'use strict';var emlformat=require(_0x117f('0x0'));var rimraf=require(_0x117f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x117f('0x2'));var moment=require(_0x117f('0x3'));var BPromise=require(_0x117f('0x4'));var Mustache=require(_0x117f('0x5'));var util=require(_0x117f('0x6'));var path=require('path');var sox=require(_0x117f('0x7'));var csv=require(_0x117f('0x8'));var ejs=require(_0x117f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x117f('0xa'));var squel=require(_0x117f('0xb'));var crypto=require(_0x117f('0xc'));var jsforce=require(_0x117f('0xd'));var deskjs=require(_0x117f('0xe'));var toCsv=require(_0x117f('0x8'));var querystring=require(_0x117f('0xf'));var Papa=require(_0x117f('0x10'));var Redis=require(_0x117f('0x11'));var authService=require(_0x117f('0x12'));var qs=require(_0x117f('0x13'));var as=require(_0x117f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x117f('0x15'))(_0x117f('0x16'));var utils=require(_0x117f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x117f('0x18'));var db=require(_0x117f('0x19'))['db'];config[_0x117f('0x1a')]=_[_0x117f('0x1b')](config[_0x117f('0x1a')],{'host':_0x117f('0x1c'),'port':0x18eb});var socket=require(_0x117f('0x1d'))(new Redis(config[_0x117f('0x1a')]));require(_0x117f('0x1e'))[_0x117f('0x1f')](socket);var jayson=require(_0x117f('0x20'));var client=jayson[_0x117f('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2734bd,_0x593c32,_0x319c83,_0x58099e){return new BPromise(function(_0xc538f5,_0x5cbb15){var _0x340097=_0x58099e||client;return _0x340097[_0x117f('0x22')](_0x2734bd,_0x319c83)[_0x117f('0x23')](function(_0x29c886){logger[_0x117f('0x24')](_0x117f('0x25'),_0x593c32,_0x117f('0x26'));logger[_0x117f('0x27')](_0x117f('0x28'),_0x593c32,_0x117f('0x26'),JSON[_0x117f('0x29')](_0x29c886));if(_0x29c886[_0x117f('0x2a')]){if(_0x29c886['error'][_0x117f('0x2b')]===0x1f4){logger[_0x117f('0x2a')](_0x117f('0x25'),_0x593c32,_0x29c886[_0x117f('0x2a')]['message']);return _0x5cbb15(_0x29c886[_0x117f('0x2a')][_0x117f('0x2c')]);}logger[_0x117f('0x2a')](_0x117f('0x25'),_0x593c32,_0x29c886[_0x117f('0x2a')][_0x117f('0x2c')]);return _0xc538f5(_0x29c886['error'][_0x117f('0x2c')]);}else{logger[_0x117f('0x24')](_0x117f('0x25'),_0x593c32,_0x117f('0x26'));_0xc538f5(_0x29c886[_0x117f('0x2d')][_0x117f('0x2c')]);}})['catch'](function(_0x3ed598){logger[_0x117f('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x593c32,_0x3ed598);_0x5cbb15(_0x3ed598);});});}function respondWithStatusCode(_0x4a11cd,_0x4e2fb5){_0x4e2fb5=_0x4e2fb5||0xcc;return function(_0x553166){if(_0x553166){return _0x4a11cd[_0x117f('0x2e')](_0x4e2fb5);}return _0x4a11cd[_0x117f('0x2f')](_0x4e2fb5)[_0x117f('0x30')]();};}function respondWithResult(_0x4ca19d,_0x2b5005){_0x2b5005=_0x2b5005||0xc8;return function(_0x52a7a8){if(_0x52a7a8){return _0x4ca19d[_0x117f('0x2f')](_0x2b5005)['json'](_0x52a7a8);}};}function respondWithFilteredResult(_0x3506fd,_0x4f4510){return function(_0x390587){if(_0x390587){var _0xcd3d15=typeof _0x4f4510[_0x117f('0x31')]===_0x117f('0x32')&&typeof _0x4f4510[_0x117f('0x33')]===_0x117f('0x32');var _0x5aaac6=_0x390587['count'];var _0x2ed25d=_0xcd3d15?0x0:_0x4f4510[_0x117f('0x31')];var _0x1f40b7=_0xcd3d15?_0x390587[_0x117f('0x34')]:_0x4f4510['offset']+_0x4f4510[_0x117f('0x33')];var _0x5382ee;if(_0x1f40b7>=_0x5aaac6){_0x1f40b7=_0x5aaac6;_0x5382ee=0xc8;}else{_0x5382ee=0xce;}_0x3506fd[_0x117f('0x2f')](_0x5382ee);return _0x3506fd[_0x117f('0x35')](_0x117f('0x36'),_0x2ed25d+'-'+_0x1f40b7+'/'+_0x5aaac6)[_0x117f('0x37')](_0x390587);}return null;};}function patchUpdates(_0xc84ff8){return function(_0x15beba){try{jsonpatch['apply'](_0x15beba,_0xc84ff8,!![]);}catch(_0x12b7c8){return BPromise[_0x117f('0x38')](_0x12b7c8);}return _0x15beba['save']();};}function saveUpdates(_0x293d1b,_0x8b7098){return function(_0x40751e){if(_0x40751e){return _0x40751e[_0x117f('0x39')](_0x293d1b)[_0x117f('0x23')](function(_0x380eee){return _0x380eee;});}return null;};}function removeEntity(_0x20328a,_0x266c9b){return function(_0x5d605f){if(_0x5d605f){return _0x5d605f['destroy']()[_0x117f('0x23')](function(){var _0x19427c=_0x5d605f['get']({'plain':!![]});var _0x2bd910=_0x117f('0x3a');return db[_0x117f('0x3b')]['destroy']({'where':{'type':_0x2bd910,'resourceId':_0x19427c['id']}})['then'](function(){return _0x5d605f;});})[_0x117f('0x23')](function(){_0x20328a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f9ae1,_0x4cb399){return function(_0x3a6238){if(!_0x3a6238){_0x4f9ae1[_0x117f('0x2e')](0x194);}return _0x3a6238;};}function handleError(_0x1e793f,_0x2b104b){_0x2b104b=_0x2b104b||0x1f4;return function(_0x2bf468){logger[_0x117f('0x2a')](_0x2bf468[_0x117f('0x3c')]);if(_0x2bf468[_0x117f('0x3d')]){delete _0x2bf468[_0x117f('0x3d')];}_0x1e793f[_0x117f('0x2f')](_0x2b104b)[_0x117f('0x3e')](_0x2bf468);};}exports[_0x117f('0x3f')]=function(_0x4ff5af,_0x514cad){var _0x2026c4={},_0x406242={},_0x30cf71={'count':0x0,'rows':[]};var _0x56968a=_[_0x117f('0x40')](db[_0x117f('0x41')]['rawAttributes'],function(_0x54f5d2){return{'name':_0x54f5d2['fieldName'],'type':_0x54f5d2[_0x117f('0x42')][_0x117f('0x43')]};});_0x406242[_0x117f('0x44')]=_[_0x117f('0x40')](_0x56968a,'name');_0x406242[_0x117f('0x45')]=_[_0x117f('0x46')](_0x4ff5af['query']);_0x406242['filters']=_[_0x117f('0x47')](_0x406242[_0x117f('0x44')],_0x406242[_0x117f('0x45')]);_0x2026c4['attributes']=_[_0x117f('0x47')](_0x406242['model'],qs[_0x117f('0x48')](_0x4ff5af[_0x117f('0x45')][_0x117f('0x48')]));_0x2026c4[_0x117f('0x49')]=_0x2026c4[_0x117f('0x49')][_0x117f('0x4a')]?_0x2026c4['attributes']:_0x406242['model'];if(!_0x4ff5af[_0x117f('0x45')][_0x117f('0x4b')](_0x117f('0x4c'))){_0x2026c4[_0x117f('0x33')]=qs[_0x117f('0x33')](_0x4ff5af[_0x117f('0x45')][_0x117f('0x33')]);_0x2026c4['offset']=qs[_0x117f('0x31')](_0x4ff5af[_0x117f('0x45')]['offset']);}_0x2026c4['order']=qs[_0x117f('0x4d')](_0x4ff5af[_0x117f('0x45')][_0x117f('0x4d')]);_0x2026c4['where']=qs[_0x117f('0x4e')](_[_0x117f('0x4f')](_0x4ff5af[_0x117f('0x45')],_0x406242[_0x117f('0x4e')]),_0x56968a);if(_0x4ff5af[_0x117f('0x45')]['filter']){_0x2026c4[_0x117f('0x50')]=_[_0x117f('0x51')](_0x2026c4['where'],{'$or':_[_0x117f('0x40')](_0x56968a,function(_0x32d16e){if(_0x32d16e[_0x117f('0x42')]!==_0x117f('0x52')){var _0x325736={};_0x325736[_0x32d16e['name']]={'$like':'%'+_0x4ff5af[_0x117f('0x45')][_0x117f('0x53')]+'%'};return _0x325736;}})});}_0x2026c4=_[_0x117f('0x51')]({},_0x2026c4,_0x4ff5af['options']);var _0x330efe={'where':_0x2026c4[_0x117f('0x50')]};return db[_0x117f('0x41')][_0x117f('0x34')](_0x330efe)[_0x117f('0x23')](function(_0x3f7493){_0x30cf71[_0x117f('0x34')]=_0x3f7493;if(_0x4ff5af[_0x117f('0x45')]['includeAll']){_0x2026c4['include']=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x2026c4);})[_0x117f('0x23')](function(_0x209aab){_0x30cf71['rows']=_0x209aab;return _0x30cf71;})[_0x117f('0x23')](respondWithFilteredResult(_0x514cad,_0x2026c4))['catch'](handleError(_0x514cad,null));};exports[_0x117f('0x54')]=function(_0x13dda9,_0x54e38f){var _0xe5334e={'raw':!![],'where':{'id':_0x13dda9[_0x117f('0x55')]['id']}},_0x2e2f60={};_0x2e2f60['model']=_[_0x117f('0x46')](db[_0x117f('0x41')]['rawAttributes']);_0x2e2f60[_0x117f('0x45')]=_[_0x117f('0x46')](_0x13dda9['query']);_0x2e2f60['filters']=_[_0x117f('0x47')](_0x2e2f60[_0x117f('0x44')],_0x2e2f60['query']);_0xe5334e[_0x117f('0x49')]=_['intersection'](_0x2e2f60[_0x117f('0x44')],qs['fields'](_0x13dda9[_0x117f('0x45')][_0x117f('0x48')]));_0xe5334e[_0x117f('0x49')]=_0xe5334e[_0x117f('0x49')]['length']?_0xe5334e[_0x117f('0x49')]:_0x2e2f60['model'];if(_0x13dda9[_0x117f('0x45')][_0x117f('0x56')]){_0xe5334e[_0x117f('0x57')]=[{'all':!![]}];}_0xe5334e=_[_0x117f('0x51')]({},_0xe5334e,_0x13dda9['options']);return db[_0x117f('0x41')]['find'](_0xe5334e)[_0x117f('0x23')](handleEntityNotFound(_0x54e38f,null))[_0x117f('0x23')](respondWithResult(_0x54e38f,null))[_0x117f('0x58')](handleError(_0x54e38f,null));};exports[_0x117f('0x59')]=function(_0x549a1e,_0x4fef2b){return db[_0x117f('0x41')][_0x117f('0x59')](_0x549a1e['body'],{})[_0x117f('0x23')](function(_0xf6f268){var _0x109809=_0x549a1e[_0x117f('0x5a')][_0x117f('0x5b')]({'plain':!![]});if(!_0x109809)throw new Error(_0x117f('0x5c'));if(_0x109809['role']===_0x117f('0x5a')){var _0x11d246=_0xf6f268[_0x117f('0x5b')]({'plain':!![]});var _0x225db0=_0x117f('0x3a');return db[_0x117f('0x5d')][_0x117f('0x5e')]({'where':{'name':_0x225db0,'userProfileId':_0x109809['userProfileId']},'raw':!![]})['then'](function(_0x56da6d){if(_0x56da6d&&_0x56da6d['autoAssociation']===0x0){return db[_0x117f('0x3b')][_0x117f('0x59')]({'name':_0x11d246['name'],'resourceId':_0x11d246['id'],'type':_0x56da6d[_0x117f('0x3d')],'sectionId':_0x56da6d['id']},{})[_0x117f('0x23')](function(){return _0xf6f268;});}else{return _0xf6f268;}})[_0x117f('0x58')](function(_0x2378d5){logger[_0x117f('0x2a')](_0x117f('0x5f'),_0x2378d5);throw _0x2378d5;});}return _0xf6f268;})['then'](respondWithResult(_0x4fef2b,0xc9))[_0x117f('0x58')](handleError(_0x4fef2b,null));};exports[_0x117f('0x39')]=function(_0x2017ed,_0x3917bc){if(_0x2017ed[_0x117f('0x60')]['id']){delete _0x2017ed[_0x117f('0x60')]['id'];}return db[_0x117f('0x41')][_0x117f('0x5e')]({'where':{'id':_0x2017ed['params']['id']}})['then'](handleEntityNotFound(_0x3917bc,null))[_0x117f('0x23')](saveUpdates(_0x2017ed['body'],null))[_0x117f('0x23')](respondWithResult(_0x3917bc,null))[_0x117f('0x58')](handleError(_0x3917bc,null));};exports[_0x117f('0x61')]=function(_0x2c21c1,_0xfec564){return db[_0x117f('0x41')][_0x117f('0x5e')]({'where':{'id':_0x2c21c1[_0x117f('0x55')]['id']}})[_0x117f('0x23')](handleEntityNotFound(_0xfec564,null))['then'](removeEntity(_0xfec564,null))[_0x117f('0x58')](handleError(_0xfec564,null));};exports[_0x117f('0x62')]=function(_0xe83a54,_0xb32ab6){return db['ChatQueue'][_0x117f('0x62')]()[_0x117f('0x23')](respondWithResult(_0xb32ab6,null))[_0x117f('0x58')](handleError(_0xb32ab6,null));};exports[_0x117f('0x63')]=function(_0x359fd0,_0x2e9895,_0x1b86f6){var _0x13c8a9={'raw':!![],'where':{}},_0x6dc3ca={},_0x57c663;return db[_0x117f('0x41')][_0x117f('0x64')]({'where':{'id':_0x359fd0[_0x117f('0x55')]['id']}})[_0x117f('0x23')](handleEntityNotFound(_0x2e9895,null))[_0x117f('0x23')](function(_0x1bcf0c){if(_0x1bcf0c){_0x57c663=_0x1bcf0c[_0x117f('0x5b')]({'plain':!![]});_0x6dc3ca['model']=_['keys'](db[_0x117f('0x65')][_0x117f('0x66')]);_0x6dc3ca['query']=_[_0x117f('0x46')](_0x359fd0[_0x117f('0x45')]);_0x6dc3ca[_0x117f('0x4e')]=_[_0x117f('0x47')](_0x6dc3ca[_0x117f('0x44')],_0x6dc3ca[_0x117f('0x45')]);_0x13c8a9[_0x117f('0x49')]=_['intersection'](_0x6dc3ca[_0x117f('0x44')],qs[_0x117f('0x48')](_0x359fd0[_0x117f('0x45')][_0x117f('0x48')]));_0x13c8a9[_0x117f('0x49')]=_0x13c8a9['attributes']['length']?_0x13c8a9['attributes']:_0x6dc3ca[_0x117f('0x44')];if(!_0x359fd0[_0x117f('0x45')][_0x117f('0x4b')](_0x117f('0x4c'))){_0x13c8a9[_0x117f('0x33')]=qs['limit'](_0x359fd0[_0x117f('0x45')][_0x117f('0x33')]);_0x13c8a9[_0x117f('0x31')]=qs[_0x117f('0x31')](_0x359fd0[_0x117f('0x45')][_0x117f('0x31')]);}_0x13c8a9[_0x117f('0x67')]=qs[_0x117f('0x4d')](_0x359fd0[_0x117f('0x45')][_0x117f('0x4d')]);_0x13c8a9['where']=qs[_0x117f('0x4e')](_[_0x117f('0x4f')](_0x359fd0[_0x117f('0x45')],_0x6dc3ca[_0x117f('0x4e')]));_0x13c8a9[_0x117f('0x50')][_0x117f('0x68')]=_0x1bcf0c['id'];if(_0x359fd0[_0x117f('0x45')][_0x117f('0x53')]){_0x13c8a9[_0x117f('0x50')]=_[_0x117f('0x51')](_0x13c8a9['where'],{'$or':_[_0x117f('0x40')](_0x13c8a9[_0x117f('0x49')],function(_0x3d0cbf){var _0x3e96d7={};_0x3e96d7[_0x3d0cbf]={'$like':'%'+_0x359fd0['query'][_0x117f('0x53')]+'%'};return _0x3e96d7;})});}_0x13c8a9=_[_0x117f('0x51')]({},_0x13c8a9,_0x359fd0[_0x117f('0x69')]);return db['UserChatQueue']['findAll'](_0x13c8a9);}})[_0x117f('0x23')](function(_0x194e05){if(_0x194e05){return db[_0x117f('0x6a')][_0x117f('0x6b')]({'where':{'id':_[_0x117f('0x40')](_0x194e05,_0x117f('0x6c')),'role':_0x117f('0x6d')},'attributes':['id','name',_0x117f('0x6e'),_0x117f('0x6f'),_0x117f('0x70')]});}})[_0x117f('0x23')](function(_0x3d45df){if(_0x3d45df){return{'count':_0x3d45df[_0x117f('0x34')],'rows':_[_0x117f('0x40')](_0x3d45df[_0x117f('0x71')],function(_0x4eae74){return{'membername':_0x4eae74['name'],'UserId':_0x4eae74['id'],'queue_name':_0x57c663[_0x117f('0x3d')],'ChatQueueId':_0x57c663['id'],'interface':util[_0x117f('0x72')](_0x117f('0x73'),_0x117f('0x74'),_0x4eae74[_0x117f('0x3d')]),'penalty':0x0,'paused':_0x4eae74[_0x117f('0x6e')],'createdAt':_0x4eae74['createdAt'],'updatedAt':_0x4eae74[_0x117f('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x117f('0x23')](respondWithFilteredResult(_0x2e9895,_0x13c8a9))[_0x117f('0x58')](handleError(_0x2e9895,null));};exports[_0x117f('0x75')]=function(_0x1a19a6,_0xa27a4f,_0x20ebd0){var _0x4584ae={};var _0x5ac082={};var _0x5a2fa9;var _0x29f1d8;return db[_0x117f('0x41')]['findOne']({'where':{'id':_0x1a19a6[_0x117f('0x55')]['id']}})[_0x117f('0x23')](handleEntityNotFound(_0xa27a4f,null))['then'](function(_0x5e73ca){if(_0x5e73ca){_0x5a2fa9=_0x5e73ca;_0x5ac082[_0x117f('0x44')]=_['keys'](db[_0x117f('0x76')][_0x117f('0x66')]);_0x5ac082[_0x117f('0x45')]=_[_0x117f('0x46')](_0x1a19a6['query']);_0x5ac082[_0x117f('0x4e')]=_['intersection'](_0x5ac082['model'],_0x5ac082[_0x117f('0x45')]);_0x4584ae[_0x117f('0x49')]=_[_0x117f('0x47')](_0x5ac082[_0x117f('0x44')],qs[_0x117f('0x48')](_0x1a19a6['query']['fields']));_0x4584ae[_0x117f('0x49')]=_0x4584ae[_0x117f('0x49')][_0x117f('0x4a')]?_0x4584ae[_0x117f('0x49')]:_0x5ac082[_0x117f('0x44')];_0x4584ae[_0x117f('0x67')]=qs[_0x117f('0x4d')](_0x1a19a6[_0x117f('0x45')][_0x117f('0x4d')]);_0x4584ae[_0x117f('0x50')]=qs['filters'](_['pick'](_0x1a19a6['query'],_0x5ac082['filters']));if(_0x1a19a6[_0x117f('0x45')]['filter']){_0x4584ae[_0x117f('0x50')]=_[_0x117f('0x51')](_0x4584ae[_0x117f('0x50')],{'$or':_[_0x117f('0x40')](_0x4584ae[_0x117f('0x49')],function(_0x1568ad){var _0x359751={};_0x359751[_0x1568ad]={'$like':'%'+_0x1a19a6['query'][_0x117f('0x53')]+'%'};return _0x359751;})});}_0x4584ae=_[_0x117f('0x51')]({},_0x4584ae,_0x1a19a6[_0x117f('0x69')]);return _0x5a2fa9['getTeams'](_0x4584ae);}})[_0x117f('0x23')](function(_0x38d955){if(_0x38d955){_0x29f1d8=_0x38d955[_0x117f('0x4a')];if(!_0x1a19a6['query'][_0x117f('0x4b')](_0x117f('0x4c'))){_0x4584ae['limit']=qs[_0x117f('0x33')](_0x1a19a6[_0x117f('0x45')][_0x117f('0x33')]);_0x4584ae[_0x117f('0x31')]=qs[_0x117f('0x31')](_0x1a19a6[_0x117f('0x45')]['offset']);}return _0x5a2fa9[_0x117f('0x75')](_0x4584ae);}})[_0x117f('0x23')](function(_0x2ce91b){if(_0x2ce91b){return _0x2ce91b?{'count':_0x29f1d8,'rows':_0x2ce91b}:null;}})['then'](respondWithResult(_0xa27a4f,null))[_0x117f('0x58')](handleError(_0xa27a4f,null));};exports[_0x117f('0x77')]=function(_0x2ae6d3,_0x5e019a,_0x463d20){var _0x215e26=_0x2ae6d3[_0x117f('0x60')]['ids'];return db[_0x117f('0x76')][_0x117f('0x78')]({'where':{'id':_0x215e26},'attributes':['id'],'include':[{'model':db[_0x117f('0x6a')],'as':_0x117f('0x79'),'attributes':['id','name',_0x117f('0x7a'),'voicePause','interface'],'raw':!![]}]})[_0x117f('0x23')](function(_0x3cf8e0){if(_0x3cf8e0){var _0x2f3177=_['flatMap'](_0x3cf8e0,function(_0x1d2cf1){var _0x12279b=_0x1d2cf1[_0x117f('0x5b')]({'plain':!![]});return _0x12279b[_0x117f('0x79')];});return db[_0x117f('0x41')]['find']({'where':{'id':_0x2ae6d3[_0x117f('0x55')]['id']}})[_0x117f('0x23')](function(_0x1092b1){return db[_0x117f('0x7b')][_0x117f('0x7c')](function(_0x8b8709){return _0x1092b1[_0x117f('0x77')](_0x215e26,{'transaction':_0x8b8709})[_0x117f('0x23')](function(){return BPromise[_0x117f('0x7d')](_0x2f3177,function(_0xde679e){return db[_0x117f('0x65')]['findOrCreate']({'where':{'UserId':_0xde679e['id'],'ChatQueueId':_0x2ae6d3['params']['id']},'transaction':_0x8b8709});});})[_0x117f('0x23')](function(){_0x2f3177[_0x117f('0x7e')](function(_0x2a915e){socket[_0x117f('0x7f')](_0x117f('0x80'),{'UserId':_0x2a915e['id'],'ChatQueueId':_0x1092b1['id']});});});});});}})['then'](respondWithStatusCode(_0x5e019a,null))['catch'](handleError(_0x5e019a,null));};exports[_0x117f('0x81')]=function(_0x17d18d,_0x3d4efd,_0xa06151){return db['Team'][_0x117f('0x78')]({'where':{'id':_0x17d18d[_0x117f('0x45')][_0x117f('0x82')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x117f('0x79'),'attributes':['id'],'raw':!![]}]})[_0x117f('0x23')](handleEntityNotFound(_0x3d4efd,null))['then'](function(_0x5a8ae3){var _0x3dfe2f=_['map'](_0x5a8ae3,'id');var _0x15e0a0=[];var _0x4e951d=[];var _0x1e494a=squel[_0x117f('0x83')]();_0x1e494a[_0x117f('0x84')](_0x117f('0x85'))[_0x117f('0x86')](_0x117f('0x87'),'tq')[_0x117f('0x88')](_0x117f('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x117f('0x50')]('ChatQueueId\x20=\x20?',_0x17d18d['params']['id']);for(var _0x527e77=0x0;_0x527e77<_0x5a8ae3[_0x117f('0x4a')];_0x527e77+=0x1){let _0x372b29=_0x5a8ae3[_0x527e77];for(var _0x432482=0x0;_0x432482<_0x372b29[_0x117f('0x79')][_0x117f('0x4a')];_0x432482+=0x1){let _0x5e9a6f=_0x372b29[_0x117f('0x79')][_0x432482];var _0x24acdb=_0x1e494a['clone']();_0x24acdb[_0x117f('0x50')](_0x117f('0x8a'),_0x5e9a6f['id']);_0x4e951d[_0x117f('0x8b')](db['sequelize'][_0x117f('0x45')](_0x24acdb[_0x117f('0x8c')](),{'type':db[_0x117f('0x7b')]['QueryTypes'][_0x117f('0x8d')]})['then'](function(_0x8b4320){if(_0x8b4320[_0x117f('0x4a')]===0x1){return _0x5e9a6f['id'];}else{var _0x277b36=_[_0x117f('0x8e')](_['map'](_0x8b4320,_0x117f('0x8f')),function(_0x909208){return _[_0x117f('0x90')](_0x3dfe2f,_0x909208);});if(_0x277b36){return _0x5e9a6f['id'];}}}));}}return BPromise['all'](_0x4e951d)[_0x117f('0x23')](function(_0x2b1fcf){_0x15e0a0=_(_0x15e0a0)[_0x117f('0x91')](_0x2b1fcf)[_0x117f('0x92')]()[_0x117f('0x93')]();return db[_0x117f('0x41')][_0x117f('0x5e')]({'where':{'id':_0x17d18d[_0x117f('0x55')]['id']}})[_0x117f('0x23')](function(_0x18d8f0){return db[_0x117f('0x7b')][_0x117f('0x7c')](function(_0x5a7c60){return _0x18d8f0['removeTeams'](_0x17d18d[_0x117f('0x45')]['ids'],{'transaction':_0x5a7c60})[_0x117f('0x23')](function(){if(!_[_0x117f('0x94')](_0x15e0a0)){return _0x18d8f0[_0x117f('0x95')](_0x15e0a0,{'transaction':_0x5a7c60});}})['then'](function(){_0x15e0a0[_0x117f('0x7e')](function(_0x5fdbcb){socket[_0x117f('0x7f')](_0x117f('0x96'),{'UserId':_0x5fdbcb,'ChatQueueId':_0x18d8f0['id']});});});});});});})[_0x117f('0x23')](respondWithStatusCode(_0x3d4efd,null))[_0x117f('0x58')](handleError(_0x3d4efd,null));};exports[_0x117f('0x97')]=function(_0x3a4150,_0x18e11b,_0x284157){return db[_0x117f('0x41')][_0x117f('0x5e')]({'where':{'id':_0x3a4150[_0x117f('0x55')]['id']}})[_0x117f('0x23')](handleEntityNotFound(_0x18e11b,null))[_0x117f('0x23')](function(_0x33cac6){if(_0x33cac6){return _0x33cac6[_0x117f('0x97')](_0x3a4150['body'][_0x117f('0x82')],_[_0x117f('0x98')](_0x3a4150[_0x117f('0x60')],[_0x117f('0x82'),'id'])||{})[_0x117f('0x99')](function(_0x2948c9){for(var _0x56a19b=0x0;_0x56a19b<_0x3a4150[_0x117f('0x60')][_0x117f('0x82')]['length'];_0x56a19b+=0x1){socket['emit'](_0x117f('0x80'),{'UserId':Number(_0x3a4150[_0x117f('0x60')]['ids'][_0x56a19b]),'ChatQueueId':Number(_0x3a4150['params']['id'])});}return _0x2948c9;});}})[_0x117f('0x23')](respondWithResult(_0x18e11b,null))[_0x117f('0x58')](handleError(_0x18e11b,null));};exports['removeAgents']=function(_0x2217c5,_0x27de13,_0x16ad55){return db['ChatQueue'][_0x117f('0x5e')]({'where':{'id':_0x2217c5[_0x117f('0x55')]['id']}})[_0x117f('0x23')](handleEntityNotFound(_0x27de13,null))[_0x117f('0x23')](function(_0x47c8ed){if(_0x47c8ed){return _0x47c8ed[_0x117f('0x95')](_0x2217c5[_0x117f('0x45')][_0x117f('0x82')])[_0x117f('0x23')](function(){if(_[_0x117f('0x9a')](_0x2217c5[_0x117f('0x45')][_0x117f('0x82')])){for(var _0x5affe1=0x0;_0x5affe1<_0x2217c5[_0x117f('0x45')][_0x117f('0x82')]['length'];_0x5affe1+=0x1){socket[_0x117f('0x7f')](_0x117f('0x96'),{'UserId':Number(_0x2217c5['query'][_0x117f('0x82')][_0x5affe1]),'ChatQueueId':Number(_0x2217c5[_0x117f('0x55')]['id'])});}}else{socket['emit'](_0x117f('0x96'),{'UserId':Number(_0x2217c5[_0x117f('0x45')][_0x117f('0x82')]),'ChatQueueId':Number(_0x2217c5['params']['id'])});}});}})[_0x117f('0x23')](respondWithStatusCode(_0x27de13,null))['catch'](handleError(_0x27de13,null));};exports['getAgents']=function(_0x354162,_0x2afef0,_0x4cd5ac){var _0x4d63e3={};var _0x464714={};var _0x278a53;var _0x547c5a;return db[_0x117f('0x41')][_0x117f('0x64')]({'where':{'id':_0x354162['params']['id']}})[_0x117f('0x23')](handleEntityNotFound(_0x2afef0,null))[_0x117f('0x23')](function(_0x339dd8){if(_0x339dd8){_0x278a53=_0x339dd8;_0x464714['model']=_[_0x117f('0x46')](db['User']['rawAttributes']);_0x464714[_0x117f('0x45')]=_[_0x117f('0x46')](_0x354162[_0x117f('0x45')]);_0x464714[_0x117f('0x4e')]=_[_0x117f('0x47')](_0x464714[_0x117f('0x44')],_0x464714[_0x117f('0x45')]);_0x4d63e3['attributes']=_[_0x117f('0x47')](_0x464714[_0x117f('0x44')],qs[_0x117f('0x48')](_0x354162['query']['fields']));_0x4d63e3[_0x117f('0x49')]=_0x4d63e3[_0x117f('0x49')][_0x117f('0x4a')]?_0x4d63e3[_0x117f('0x49')]:_0x464714[_0x117f('0x44')];_0x4d63e3['order']=qs[_0x117f('0x4d')](_0x354162[_0x117f('0x45')][_0x117f('0x4d')]);_0x4d63e3['where']=qs[_0x117f('0x4e')](_[_0x117f('0x4f')](_0x354162['query'],_0x464714[_0x117f('0x4e')]));if(_0x354162[_0x117f('0x45')][_0x117f('0x53')]){_0x4d63e3[_0x117f('0x50')]=_[_0x117f('0x51')](_0x4d63e3[_0x117f('0x50')],{'$or':_['map'](_0x4d63e3[_0x117f('0x49')],function(_0x442e35){var _0xb67838={};_0xb67838[_0x442e35]={'$like':'%'+_0x354162[_0x117f('0x45')][_0x117f('0x53')]+'%'};return _0xb67838;})});}_0x4d63e3=_[_0x117f('0x51')]({},_0x4d63e3,_0x354162[_0x117f('0x69')]);return _0x278a53[_0x117f('0x9b')](_0x4d63e3);}})[_0x117f('0x23')](function(_0x228e96){if(_0x228e96){_0x547c5a=_0x228e96[_0x117f('0x4a')];if(!_0x354162[_0x117f('0x45')][_0x117f('0x4b')](_0x117f('0x4c'))){_0x4d63e3[_0x117f('0x33')]=qs[_0x117f('0x33')](_0x354162[_0x117f('0x45')][_0x117f('0x33')]);_0x4d63e3['offset']=qs[_0x117f('0x31')](_0x354162[_0x117f('0x45')][_0x117f('0x31')]);}return _0x278a53[_0x117f('0x9b')](_0x4d63e3);}})[_0x117f('0x23')](function(_0x311970){if(_0x311970){return _0x311970?{'count':_0x547c5a,'rows':_0x311970}:null;}})[_0x117f('0x23')](respondWithResult(_0x2afef0,null))[_0x117f('0x58')](handleError(_0x2afef0,null));};
\ No newline at end of file
+var _0x4adb=['end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','ChatQueue','rows','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','pick','findAll','User','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','ids','Agents','voicePause','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','sequelize','isEmpty','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status'];(function(_0x124298,_0x542004){var _0x35ac24=function(_0x49afe8){while(--_0x49afe8){_0x124298['push'](_0x124298['shift']());}};_0x35ac24(++_0x542004);}(_0x4adb,0x105));var _0xb4ad=function(_0x4f44b1,_0x3598cc){_0x4f44b1=_0x4f44b1-0x0;var _0x38ba9e=_0x4adb[_0x4f44b1];return _0x38ba9e;};'use strict';var emlformat=require(_0xb4ad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4ad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4ad('0x2'));var moment=require(_0xb4ad('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb4ad('0x4'));var util=require(_0xb4ad('0x5'));var path=require('path');var sox=require(_0xb4ad('0x6'));var csv=require('to-csv');var ejs=require(_0xb4ad('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4ad('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb4ad('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xb4ad('0xa'));var querystring=require(_0xb4ad('0xb'));var Papa=require('papaparse');var Redis=require(_0xb4ad('0xc'));var authService=require(_0xb4ad('0xd'));var qs=require(_0xb4ad('0xe'));var as=require(_0xb4ad('0xf'));var hardwareService=require(_0xb4ad('0x10'));var logger=require(_0xb4ad('0x11'))(_0xb4ad('0x12'));var utils=require(_0xb4ad('0x13'));var config=require(_0xb4ad('0x14'));var licenseUtil=require(_0xb4ad('0x15'));var db=require(_0xb4ad('0x16'))['db'];config[_0xb4ad('0x17')]=_[_0xb4ad('0x18')](config[_0xb4ad('0x17')],{'host':_0xb4ad('0x19'),'port':0x18eb});var socket=require(_0xb4ad('0x1a'))(new Redis(config[_0xb4ad('0x17')]));require(_0xb4ad('0x1b'))[_0xb4ad('0x1c')](socket);var jayson=require(_0xb4ad('0x1d'));var client=jayson[_0xb4ad('0x1e')][_0xb4ad('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2400f,_0x3f89f7,_0x1ae24e,_0x278451){return new BPromise(function(_0x2f7824,_0x31f6d3){var _0x2a22a0=_0x278451||client;return _0x2a22a0[_0xb4ad('0x20')](_0x2400f,_0x1ae24e)[_0xb4ad('0x21')](function(_0x1de2cb){logger[_0xb4ad('0x22')](_0xb4ad('0x23'),_0x3f89f7,_0xb4ad('0x24'));logger['debug'](_0xb4ad('0x25'),_0x3f89f7,'request\x20sent',JSON['stringify'](_0x1de2cb));if(_0x1de2cb['error']){if(_0x1de2cb[_0xb4ad('0x26')][_0xb4ad('0x27')]===0x1f4){logger[_0xb4ad('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3f89f7,_0x1de2cb['error'][_0xb4ad('0x28')]);return _0x31f6d3(_0x1de2cb[_0xb4ad('0x26')]['message']);}logger[_0xb4ad('0x26')](_0xb4ad('0x23'),_0x3f89f7,_0x1de2cb[_0xb4ad('0x26')][_0xb4ad('0x28')]);return _0x2f7824(_0x1de2cb['error'][_0xb4ad('0x28')]);}else{logger['info'](_0xb4ad('0x23'),_0x3f89f7,'request\x20sent');_0x2f7824(_0x1de2cb[_0xb4ad('0x29')][_0xb4ad('0x28')]);}})[_0xb4ad('0x2a')](function(_0x515815){logger[_0xb4ad('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3f89f7,_0x515815);_0x31f6d3(_0x515815);});});}function respondWithStatusCode(_0x3fec40,_0x4204b3){_0x4204b3=_0x4204b3||0xcc;return function(_0x359c18){if(_0x359c18){return _0x3fec40[_0xb4ad('0x2b')](_0x4204b3);}return _0x3fec40[_0xb4ad('0x2c')](_0x4204b3)[_0xb4ad('0x2d')]();};}function respondWithResult(_0x4ec5cc,_0x28b5d7){_0x28b5d7=_0x28b5d7||0xc8;return function(_0x757a03){if(_0x757a03){return _0x4ec5cc['status'](_0x28b5d7)[_0xb4ad('0x2e')](_0x757a03);}};}function respondWithFilteredResult(_0xde5ea3,_0x2684fe){return function(_0x4c94d2){if(_0x4c94d2){var _0x280931=typeof _0x2684fe['offset']===_0xb4ad('0x2f')&&typeof _0x2684fe['limit']==='undefined';var _0x235be6=_0x4c94d2['count'];var _0x319a4d=_0x280931?0x0:_0x2684fe['offset'];var _0x457538=_0x280931?_0x4c94d2[_0xb4ad('0x30')]:_0x2684fe[_0xb4ad('0x31')]+_0x2684fe[_0xb4ad('0x32')];var _0x587fc4;if(_0x457538>=_0x235be6){_0x457538=_0x235be6;_0x587fc4=0xc8;}else{_0x587fc4=0xce;}_0xde5ea3[_0xb4ad('0x2c')](_0x587fc4);return _0xde5ea3[_0xb4ad('0x33')](_0xb4ad('0x34'),_0x319a4d+'-'+_0x457538+'/'+_0x235be6)['json'](_0x4c94d2);}return null;};}function patchUpdates(_0x3b6a8c){return function(_0x296880){try{jsonpatch['apply'](_0x296880,_0x3b6a8c,!![]);}catch(_0x56db03){return BPromise[_0xb4ad('0x35')](_0x56db03);}return _0x296880[_0xb4ad('0x36')]();};}function saveUpdates(_0x67ebfd,_0x5c2142){return function(_0x132e6c){if(_0x132e6c){return _0x132e6c[_0xb4ad('0x37')](_0x67ebfd)[_0xb4ad('0x21')](function(_0x35a6af){return _0x35a6af;});}return null;};}function removeEntity(_0x57c7c8,_0x288514){return function(_0x4cbaf8){if(_0x4cbaf8){return _0x4cbaf8[_0xb4ad('0x38')]()['then'](function(){var _0x111ec6=_0x4cbaf8['get']({'plain':!![]});var _0x1d8ff4=_0xb4ad('0x39');return db[_0xb4ad('0x3a')]['destroy']({'where':{'type':_0x1d8ff4,'resourceId':_0x111ec6['id']}})[_0xb4ad('0x21')](function(){return _0x4cbaf8;});})[_0xb4ad('0x21')](function(){_0x57c7c8[_0xb4ad('0x2c')](0xcc)[_0xb4ad('0x2d')]();});}};}function handleEntityNotFound(_0x102b7a,_0xf061bc){return function(_0x3a5d88){if(!_0x3a5d88){_0x102b7a[_0xb4ad('0x2b')](0x194);}return _0x3a5d88;};}function handleError(_0x33b6e9,_0x41a94d){_0x41a94d=_0x41a94d||0x1f4;return function(_0x149103){logger[_0xb4ad('0x26')](_0x149103[_0xb4ad('0x3b')]);if(_0x149103[_0xb4ad('0x3c')]){delete _0x149103[_0xb4ad('0x3c')];}_0x33b6e9[_0xb4ad('0x2c')](_0x41a94d)[_0xb4ad('0x3d')](_0x149103);};}exports[_0xb4ad('0x3e')]=function(_0x8bad9d,_0x5cb5dd){var _0x192b28={},_0x539c8b={},_0x1501ed={'count':0x0,'rows':[]};var _0xb17a47=_['map'](db['ChatQueue']['rawAttributes'],function(_0x51fc96){return{'name':_0x51fc96[_0xb4ad('0x3f')],'type':_0x51fc96[_0xb4ad('0x40')][_0xb4ad('0x41')]};});_0x539c8b['model']=_[_0xb4ad('0x42')](_0xb17a47,_0xb4ad('0x3c'));_0x539c8b[_0xb4ad('0x43')]=_[_0xb4ad('0x44')](_0x8bad9d[_0xb4ad('0x43')]);_0x539c8b['filters']=_[_0xb4ad('0x45')](_0x539c8b['model'],_0x539c8b['query']);_0x192b28['attributes']=_[_0xb4ad('0x45')](_0x539c8b[_0xb4ad('0x46')],qs[_0xb4ad('0x47')](_0x8bad9d[_0xb4ad('0x43')]['fields']));_0x192b28[_0xb4ad('0x48')]=_0x192b28[_0xb4ad('0x48')][_0xb4ad('0x49')]?_0x192b28[_0xb4ad('0x48')]:_0x539c8b[_0xb4ad('0x46')];if(!_0x8bad9d[_0xb4ad('0x43')]['hasOwnProperty'](_0xb4ad('0x4a'))){_0x192b28[_0xb4ad('0x32')]=qs[_0xb4ad('0x32')](_0x8bad9d[_0xb4ad('0x43')][_0xb4ad('0x32')]);_0x192b28[_0xb4ad('0x31')]=qs['offset'](_0x8bad9d['query']['offset']);}_0x192b28['order']=qs['sort'](_0x8bad9d[_0xb4ad('0x43')][_0xb4ad('0x4b')]);_0x192b28[_0xb4ad('0x4c')]=qs[_0xb4ad('0x4d')](_['pick'](_0x8bad9d['query'],_0x539c8b[_0xb4ad('0x4d')]),_0xb17a47);if(_0x8bad9d[_0xb4ad('0x43')]['filter']){_0x192b28[_0xb4ad('0x4c')]=_[_0xb4ad('0x4e')](_0x192b28[_0xb4ad('0x4c')],{'$or':_[_0xb4ad('0x42')](_0xb17a47,function(_0x18d90e){if(_0x18d90e[_0xb4ad('0x40')]!==_0xb4ad('0x4f')){var _0x57df88={};_0x57df88[_0x18d90e[_0xb4ad('0x3c')]]={'$like':'%'+_0x8bad9d[_0xb4ad('0x43')][_0xb4ad('0x50')]+'%'};return _0x57df88;}})});}_0x192b28=_[_0xb4ad('0x4e')]({},_0x192b28,_0x8bad9d[_0xb4ad('0x51')]);var _0x4e7ac2={'where':_0x192b28[_0xb4ad('0x4c')]};return db['ChatQueue']['count'](_0x4e7ac2)['then'](function(_0x4519e9){_0x1501ed[_0xb4ad('0x30')]=_0x4519e9;if(_0x8bad9d[_0xb4ad('0x43')][_0xb4ad('0x52')]){_0x192b28[_0xb4ad('0x53')]=[{'all':!![]}];}return db[_0xb4ad('0x54')]['findAll'](_0x192b28);})[_0xb4ad('0x21')](function(_0x3ee04d){_0x1501ed[_0xb4ad('0x55')]=_0x3ee04d;return _0x1501ed;})['then'](respondWithFilteredResult(_0x5cb5dd,_0x192b28))['catch'](handleError(_0x5cb5dd,null));};exports[_0xb4ad('0x56')]=function(_0x569489,_0x58765b){var _0x37cef5={'raw':!![],'where':{'id':_0x569489[_0xb4ad('0x57')]['id']}},_0x33e338={};_0x33e338[_0xb4ad('0x46')]=_[_0xb4ad('0x44')](db[_0xb4ad('0x54')][_0xb4ad('0x58')]);_0x33e338[_0xb4ad('0x43')]=_['keys'](_0x569489[_0xb4ad('0x43')]);_0x33e338[_0xb4ad('0x4d')]=_['intersection'](_0x33e338[_0xb4ad('0x46')],_0x33e338[_0xb4ad('0x43')]);_0x37cef5[_0xb4ad('0x48')]=_[_0xb4ad('0x45')](_0x33e338[_0xb4ad('0x46')],qs[_0xb4ad('0x47')](_0x569489[_0xb4ad('0x43')][_0xb4ad('0x47')]));_0x37cef5[_0xb4ad('0x48')]=_0x37cef5['attributes'][_0xb4ad('0x49')]?_0x37cef5[_0xb4ad('0x48')]:_0x33e338['model'];if(_0x569489[_0xb4ad('0x43')][_0xb4ad('0x52')]){_0x37cef5[_0xb4ad('0x53')]=[{'all':!![]}];}_0x37cef5=_[_0xb4ad('0x4e')]({},_0x37cef5,_0x569489[_0xb4ad('0x51')]);return db[_0xb4ad('0x54')]['find'](_0x37cef5)[_0xb4ad('0x21')](handleEntityNotFound(_0x58765b,null))[_0xb4ad('0x21')](respondWithResult(_0x58765b,null))[_0xb4ad('0x2a')](handleError(_0x58765b,null));};exports[_0xb4ad('0x59')]=function(_0x283b88,_0x320ab4){return db['ChatQueue'][_0xb4ad('0x59')](_0x283b88[_0xb4ad('0x5a')],{})['then'](function(_0x468686){var _0x4e97d3=_0x283b88[_0xb4ad('0x5b')][_0xb4ad('0x5c')]({'plain':!![]});if(!_0x4e97d3)throw new Error(_0xb4ad('0x5d'));if(_0x4e97d3[_0xb4ad('0x5e')]===_0xb4ad('0x5b')){var _0x5c9d64=_0x468686[_0xb4ad('0x5c')]({'plain':!![]});var _0x5bb9dc=_0xb4ad('0x39');return db[_0xb4ad('0x5f')][_0xb4ad('0x60')]({'where':{'name':_0x5bb9dc,'userProfileId':_0x4e97d3[_0xb4ad('0x61')]},'raw':!![]})[_0xb4ad('0x21')](function(_0x3f2603){if(_0x3f2603&&_0x3f2603[_0xb4ad('0x62')]===0x0){return db[_0xb4ad('0x3a')][_0xb4ad('0x59')]({'name':_0x5c9d64[_0xb4ad('0x3c')],'resourceId':_0x5c9d64['id'],'type':_0x3f2603[_0xb4ad('0x3c')],'sectionId':_0x3f2603['id']},{})[_0xb4ad('0x21')](function(){return _0x468686;});}else{return _0x468686;}})['catch'](function(_0x3f3111){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f3111);throw _0x3f3111;});}return _0x468686;})[_0xb4ad('0x21')](respondWithResult(_0x320ab4,0xc9))[_0xb4ad('0x2a')](handleError(_0x320ab4,null));};exports[_0xb4ad('0x37')]=function(_0x50b3d9,_0x7a3be7){if(_0x50b3d9[_0xb4ad('0x5a')]['id']){delete _0x50b3d9['body']['id'];}return db[_0xb4ad('0x54')][_0xb4ad('0x60')]({'where':{'id':_0x50b3d9[_0xb4ad('0x57')]['id']}})[_0xb4ad('0x21')](handleEntityNotFound(_0x7a3be7,null))['then'](saveUpdates(_0x50b3d9[_0xb4ad('0x5a')],null))[_0xb4ad('0x21')](respondWithResult(_0x7a3be7,null))[_0xb4ad('0x2a')](handleError(_0x7a3be7,null));};exports['destroy']=function(_0x9fac7d,_0x5f2726){return db['ChatQueue'][_0xb4ad('0x60')]({'where':{'id':_0x9fac7d['params']['id']}})[_0xb4ad('0x21')](handleEntityNotFound(_0x5f2726,null))['then'](removeEntity(_0x5f2726,null))[_0xb4ad('0x2a')](handleError(_0x5f2726,null));};exports[_0xb4ad('0x63')]=function(_0x2862e6,_0x3b3d71){return db[_0xb4ad('0x54')][_0xb4ad('0x63')]()[_0xb4ad('0x21')](respondWithResult(_0x3b3d71,null))[_0xb4ad('0x2a')](handleError(_0x3b3d71,null));};exports[_0xb4ad('0x64')]=function(_0x3bbbd5,_0x51b7da,_0x46fdab){var _0x28544f={'raw':!![],'where':{}},_0x54a7e7={},_0x29cd8d;return db[_0xb4ad('0x54')][_0xb4ad('0x65')]({'where':{'id':_0x3bbbd5['params']['id']}})[_0xb4ad('0x21')](handleEntityNotFound(_0x51b7da,null))[_0xb4ad('0x21')](function(_0x33cd37){if(_0x33cd37){_0x29cd8d=_0x33cd37[_0xb4ad('0x5c')]({'plain':!![]});_0x54a7e7[_0xb4ad('0x46')]=_[_0xb4ad('0x44')](db[_0xb4ad('0x66')]['rawAttributes']);_0x54a7e7[_0xb4ad('0x43')]=_[_0xb4ad('0x44')](_0x3bbbd5['query']);_0x54a7e7['filters']=_[_0xb4ad('0x45')](_0x54a7e7['model'],_0x54a7e7[_0xb4ad('0x43')]);_0x28544f[_0xb4ad('0x48')]=_['intersection'](_0x54a7e7[_0xb4ad('0x46')],qs[_0xb4ad('0x47')](_0x3bbbd5[_0xb4ad('0x43')][_0xb4ad('0x47')]));_0x28544f[_0xb4ad('0x48')]=_0x28544f['attributes']['length']?_0x28544f[_0xb4ad('0x48')]:_0x54a7e7[_0xb4ad('0x46')];if(!_0x3bbbd5['query'][_0xb4ad('0x67')](_0xb4ad('0x4a'))){_0x28544f[_0xb4ad('0x32')]=qs[_0xb4ad('0x32')](_0x3bbbd5[_0xb4ad('0x43')][_0xb4ad('0x32')]);_0x28544f[_0xb4ad('0x31')]=qs['offset'](_0x3bbbd5['query']['offset']);}_0x28544f[_0xb4ad('0x68')]=qs['sort'](_0x3bbbd5['query']['sort']);_0x28544f['where']=qs['filters'](_[_0xb4ad('0x69')](_0x3bbbd5[_0xb4ad('0x43')],_0x54a7e7[_0xb4ad('0x4d')]));_0x28544f[_0xb4ad('0x4c')]['ChatQueueId']=_0x33cd37['id'];if(_0x3bbbd5[_0xb4ad('0x43')][_0xb4ad('0x50')]){_0x28544f[_0xb4ad('0x4c')]=_[_0xb4ad('0x4e')](_0x28544f[_0xb4ad('0x4c')],{'$or':_[_0xb4ad('0x42')](_0x28544f['attributes'],function(_0x4cc63d){var _0x2954c2={};_0x2954c2[_0x4cc63d]={'$like':'%'+_0x3bbbd5[_0xb4ad('0x43')][_0xb4ad('0x50')]+'%'};return _0x2954c2;})});}_0x28544f=_[_0xb4ad('0x4e')]({},_0x28544f,_0x3bbbd5[_0xb4ad('0x51')]);return db[_0xb4ad('0x66')][_0xb4ad('0x6a')](_0x28544f);}})[_0xb4ad('0x21')](function(_0x4f2e56){if(_0x4f2e56){return db[_0xb4ad('0x6b')]['findAndCountAll']({'where':{'id':_[_0xb4ad('0x42')](_0x4f2e56,'UserId'),'role':_0xb4ad('0x6c')},'attributes':['id',_0xb4ad('0x3c'),'chatPause',_0xb4ad('0x6d'),_0xb4ad('0x6e')]});}})[_0xb4ad('0x21')](function(_0x5bc72c){if(_0x5bc72c){return{'count':_0x5bc72c['count'],'rows':_[_0xb4ad('0x42')](_0x5bc72c[_0xb4ad('0x55')],function(_0x13359b){return{'membername':_0x13359b['name'],'UserId':_0x13359b['id'],'queue_name':_0x29cd8d[_0xb4ad('0x3c')],'ChatQueueId':_0x29cd8d['id'],'interface':util[_0xb4ad('0x6f')](_0xb4ad('0x70'),_0xb4ad('0x71'),_0x13359b['name']),'penalty':0x0,'paused':_0x13359b[_0xb4ad('0x72')],'createdAt':_0x13359b[_0xb4ad('0x6e')],'updatedAt':_0x13359b[_0xb4ad('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb4ad('0x21')](respondWithFilteredResult(_0x51b7da,_0x28544f))[_0xb4ad('0x2a')](handleError(_0x51b7da,null));};exports[_0xb4ad('0x73')]=function(_0x281537,_0x189910,_0x43271f){var _0x464207={};var _0x315714={};var _0x1ff24c;var _0x32c412;return db[_0xb4ad('0x54')]['findOne']({'where':{'id':_0x281537[_0xb4ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x189910,null))[_0xb4ad('0x21')](function(_0x69559a){if(_0x69559a){_0x1ff24c=_0x69559a;_0x315714[_0xb4ad('0x46')]=_[_0xb4ad('0x44')](db[_0xb4ad('0x74')][_0xb4ad('0x58')]);_0x315714[_0xb4ad('0x43')]=_[_0xb4ad('0x44')](_0x281537[_0xb4ad('0x43')]);_0x315714[_0xb4ad('0x4d')]=_[_0xb4ad('0x45')](_0x315714['model'],_0x315714[_0xb4ad('0x43')]);_0x464207['attributes']=_[_0xb4ad('0x45')](_0x315714[_0xb4ad('0x46')],qs[_0xb4ad('0x47')](_0x281537[_0xb4ad('0x43')][_0xb4ad('0x47')]));_0x464207[_0xb4ad('0x48')]=_0x464207[_0xb4ad('0x48')][_0xb4ad('0x49')]?_0x464207[_0xb4ad('0x48')]:_0x315714[_0xb4ad('0x46')];_0x464207[_0xb4ad('0x68')]=qs[_0xb4ad('0x4b')](_0x281537[_0xb4ad('0x43')]['sort']);_0x464207[_0xb4ad('0x4c')]=qs[_0xb4ad('0x4d')](_[_0xb4ad('0x69')](_0x281537[_0xb4ad('0x43')],_0x315714[_0xb4ad('0x4d')]));if(_0x281537[_0xb4ad('0x43')][_0xb4ad('0x50')]){_0x464207[_0xb4ad('0x4c')]=_[_0xb4ad('0x4e')](_0x464207[_0xb4ad('0x4c')],{'$or':_[_0xb4ad('0x42')](_0x464207[_0xb4ad('0x48')],function(_0x4049e5){var _0x2c9d33={};_0x2c9d33[_0x4049e5]={'$like':'%'+_0x281537[_0xb4ad('0x43')][_0xb4ad('0x50')]+'%'};return _0x2c9d33;})});}_0x464207=_[_0xb4ad('0x4e')]({},_0x464207,_0x281537[_0xb4ad('0x51')]);return _0x1ff24c[_0xb4ad('0x73')](_0x464207);}})[_0xb4ad('0x21')](function(_0x47ae6a){if(_0x47ae6a){_0x32c412=_0x47ae6a[_0xb4ad('0x49')];if(!_0x281537[_0xb4ad('0x43')][_0xb4ad('0x67')](_0xb4ad('0x4a'))){_0x464207[_0xb4ad('0x32')]=qs[_0xb4ad('0x32')](_0x281537[_0xb4ad('0x43')][_0xb4ad('0x32')]);_0x464207['offset']=qs['offset'](_0x281537[_0xb4ad('0x43')][_0xb4ad('0x31')]);}return _0x1ff24c[_0xb4ad('0x73')](_0x464207);}})['then'](function(_0x14ed3d){if(_0x14ed3d){return _0x14ed3d?{'count':_0x32c412,'rows':_0x14ed3d}:null;}})[_0xb4ad('0x21')](respondWithResult(_0x189910,null))['catch'](handleError(_0x189910,null));};exports[_0xb4ad('0x75')]=function(_0x2303b7,_0x4e0e07,_0x5baca3){var _0x1bb472=_0x2303b7[_0xb4ad('0x5a')][_0xb4ad('0x76')];return db[_0xb4ad('0x74')]['findAll']({'where':{'id':_0x1bb472},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb4ad('0x77'),'attributes':['id',_0xb4ad('0x3c'),'online',_0xb4ad('0x78'),'interface'],'raw':!![]}]})[_0xb4ad('0x21')](function(_0x5147a7){if(_0x5147a7){var _0xf4ef09=_['flatMap'](_0x5147a7,function(_0x1407b8){var _0x3202e4=_0x1407b8['get']({'plain':!![]});return _0x3202e4['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x2303b7[_0xb4ad('0x57')]['id']}})['then'](function(_0x302d79){return db['sequelize'][_0xb4ad('0x79')](function(_0x1c1603){return _0x302d79[_0xb4ad('0x75')](_0x1bb472,{'transaction':_0x1c1603})[_0xb4ad('0x21')](function(){return BPromise[_0xb4ad('0x7a')](_0xf4ef09,function(_0x31264a){return db[_0xb4ad('0x66')][_0xb4ad('0x7b')]({'where':{'UserId':_0x31264a['id'],'ChatQueueId':_0x2303b7[_0xb4ad('0x57')]['id']},'transaction':_0x1c1603});});})[_0xb4ad('0x21')](function(){_0xf4ef09[_0xb4ad('0x7c')](function(_0xc52cb8){socket['emit'](_0xb4ad('0x7d'),{'UserId':_0xc52cb8['id'],'ChatQueueId':_0x302d79['id']});});});});});}})[_0xb4ad('0x21')](respondWithStatusCode(_0x4e0e07,null))[_0xb4ad('0x2a')](handleError(_0x4e0e07,null));};exports[_0xb4ad('0x7e')]=function(_0x40b8b0,_0x44cbaa,_0x1ba239){return db[_0xb4ad('0x74')][_0xb4ad('0x6a')]({'where':{'id':_0x40b8b0[_0xb4ad('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb4ad('0x6b')],'as':_0xb4ad('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x44cbaa,null))[_0xb4ad('0x21')](function(_0x20f493){var _0x26230a=_['map'](_0x20f493,'id');var _0x48ac9b=[];var _0x30ef30=[];var _0x21fd29=squel[_0xb4ad('0x7f')]();_0x21fd29[_0xb4ad('0x80')](_0xb4ad('0x81'))[_0xb4ad('0x82')]('team_has_chat_queues','tq')[_0xb4ad('0x83')](_0xb4ad('0x84'),'ut',_0xb4ad('0x85'))[_0xb4ad('0x4c')](_0xb4ad('0x86'),_0x40b8b0[_0xb4ad('0x57')]['id']);for(var _0x5051de=0x0;_0x5051de<_0x20f493[_0xb4ad('0x49')];_0x5051de+=0x1){let _0x4a7783=_0x20f493[_0x5051de];for(var _0x37c351=0x0;_0x37c351<_0x4a7783[_0xb4ad('0x77')][_0xb4ad('0x49')];_0x37c351+=0x1){let _0x3e0acd=_0x4a7783['Agents'][_0x37c351];var _0x3fbbff=_0x21fd29['clone']();_0x3fbbff[_0xb4ad('0x4c')]('ut.UserId\x20=\x20?',_0x3e0acd['id']);_0x30ef30[_0xb4ad('0x87')](db['sequelize'][_0xb4ad('0x43')](_0x3fbbff[_0xb4ad('0x88')](),{'type':db['sequelize'][_0xb4ad('0x89')][_0xb4ad('0x8a')]})['then'](function(_0x1aeb2a){if(_0x1aeb2a[_0xb4ad('0x49')]===0x1){return _0x3e0acd['id'];}else{var _0x93cc98=_[_0xb4ad('0x8b')](_[_0xb4ad('0x42')](_0x1aeb2a,_0xb4ad('0x8c')),function(_0x27daa4){return _['includes'](_0x26230a,_0x27daa4);});if(_0x93cc98){return _0x3e0acd['id'];}}}));}}return BPromise[_0xb4ad('0x8d')](_0x30ef30)[_0xb4ad('0x21')](function(_0x18106a){_0x48ac9b=_(_0x48ac9b)[_0xb4ad('0x8e')](_0x18106a)['compact']()[_0xb4ad('0x8f')]();return db[_0xb4ad('0x54')]['find']({'where':{'id':_0x40b8b0[_0xb4ad('0x57')]['id']}})[_0xb4ad('0x21')](function(_0x4caeb3){return db[_0xb4ad('0x90')][_0xb4ad('0x79')](function(_0x2fcf95){return _0x4caeb3['removeTeams'](_0x40b8b0[_0xb4ad('0x43')][_0xb4ad('0x76')],{'transaction':_0x2fcf95})[_0xb4ad('0x21')](function(){if(!_[_0xb4ad('0x91')](_0x48ac9b)){return _0x4caeb3['removeAgents'](_0x48ac9b,{'transaction':_0x2fcf95});}})[_0xb4ad('0x21')](function(){_0x48ac9b['forEach'](function(_0x5d7d71){socket[_0xb4ad('0x92')](_0xb4ad('0x93'),{'UserId':_0x5d7d71,'ChatQueueId':_0x4caeb3['id']});});});});});});})[_0xb4ad('0x21')](respondWithStatusCode(_0x44cbaa,null))[_0xb4ad('0x2a')](handleError(_0x44cbaa,null));};exports[_0xb4ad('0x94')]=function(_0x49d7a8,_0x1ad58c,_0x52a709){return db[_0xb4ad('0x54')][_0xb4ad('0x60')]({'where':{'id':_0x49d7a8[_0xb4ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x1ad58c,null))[_0xb4ad('0x21')](function(_0x18c381){if(_0x18c381){return _0x18c381['addAgents'](_0x49d7a8[_0xb4ad('0x5a')]['ids'],_[_0xb4ad('0x95')](_0x49d7a8[_0xb4ad('0x5a')],['ids','id'])||{})[_0xb4ad('0x96')](function(_0x12e8a3){for(var _0x4388d3=0x0;_0x4388d3<_0x49d7a8[_0xb4ad('0x5a')][_0xb4ad('0x76')][_0xb4ad('0x49')];_0x4388d3+=0x1){socket['emit'](_0xb4ad('0x7d'),{'UserId':Number(_0x49d7a8[_0xb4ad('0x5a')][_0xb4ad('0x76')][_0x4388d3]),'ChatQueueId':Number(_0x49d7a8[_0xb4ad('0x57')]['id'])});}return _0x12e8a3;});}})[_0xb4ad('0x21')](respondWithResult(_0x1ad58c,null))[_0xb4ad('0x2a')](handleError(_0x1ad58c,null));};exports[_0xb4ad('0x97')]=function(_0xa02048,_0x13c694,_0x367329){return db[_0xb4ad('0x54')][_0xb4ad('0x60')]({'where':{'id':_0xa02048[_0xb4ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x13c694,null))[_0xb4ad('0x21')](function(_0x300186){if(_0x300186){return _0x300186[_0xb4ad('0x97')](_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')])[_0xb4ad('0x21')](function(){if(_['isArray'](_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')])){for(var _0x490dcf=0x0;_0x490dcf<_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')][_0xb4ad('0x49')];_0x490dcf+=0x1){socket[_0xb4ad('0x92')](_0xb4ad('0x93'),{'UserId':Number(_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')][_0x490dcf]),'ChatQueueId':Number(_0xa02048['params']['id'])});}}else{socket[_0xb4ad('0x92')](_0xb4ad('0x93'),{'UserId':Number(_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')]),'ChatQueueId':Number(_0xa02048['params']['id'])});}});}})['then'](respondWithStatusCode(_0x13c694,null))['catch'](handleError(_0x13c694,null));};exports[_0xb4ad('0x98')]=function(_0xc1598c,_0x596d2c,_0x206f53){var _0x56ac1e={};var _0x14605a={};var _0x22dea7;var _0xd3a446;return db[_0xb4ad('0x54')]['findOne']({'where':{'id':_0xc1598c[_0xb4ad('0x57')]['id']}})[_0xb4ad('0x21')](handleEntityNotFound(_0x596d2c,null))[_0xb4ad('0x21')](function(_0x4fa312){if(_0x4fa312){_0x22dea7=_0x4fa312;_0x14605a[_0xb4ad('0x46')]=_[_0xb4ad('0x44')](db[_0xb4ad('0x6b')][_0xb4ad('0x58')]);_0x14605a['query']=_[_0xb4ad('0x44')](_0xc1598c[_0xb4ad('0x43')]);_0x14605a[_0xb4ad('0x4d')]=_['intersection'](_0x14605a[_0xb4ad('0x46')],_0x14605a[_0xb4ad('0x43')]);_0x56ac1e[_0xb4ad('0x48')]=_[_0xb4ad('0x45')](_0x14605a[_0xb4ad('0x46')],qs['fields'](_0xc1598c[_0xb4ad('0x43')][_0xb4ad('0x47')]));_0x56ac1e[_0xb4ad('0x48')]=_0x56ac1e[_0xb4ad('0x48')][_0xb4ad('0x49')]?_0x56ac1e[_0xb4ad('0x48')]:_0x14605a['model'];_0x56ac1e[_0xb4ad('0x68')]=qs['sort'](_0xc1598c[_0xb4ad('0x43')][_0xb4ad('0x4b')]);_0x56ac1e[_0xb4ad('0x4c')]=qs[_0xb4ad('0x4d')](_['pick'](_0xc1598c[_0xb4ad('0x43')],_0x14605a['filters']));if(_0xc1598c['query'][_0xb4ad('0x50')]){_0x56ac1e[_0xb4ad('0x4c')]=_[_0xb4ad('0x4e')](_0x56ac1e[_0xb4ad('0x4c')],{'$or':_['map'](_0x56ac1e[_0xb4ad('0x48')],function(_0x2c6472){var _0x36b259={};_0x36b259[_0x2c6472]={'$like':'%'+_0xc1598c[_0xb4ad('0x43')][_0xb4ad('0x50')]+'%'};return _0x36b259;})});}_0x56ac1e=_[_0xb4ad('0x4e')]({},_0x56ac1e,_0xc1598c[_0xb4ad('0x51')]);return _0x22dea7['getAgents'](_0x56ac1e);}})[_0xb4ad('0x21')](function(_0x6b113f){if(_0x6b113f){_0xd3a446=_0x6b113f[_0xb4ad('0x49')];if(!_0xc1598c['query'][_0xb4ad('0x67')](_0xb4ad('0x4a'))){_0x56ac1e[_0xb4ad('0x32')]=qs[_0xb4ad('0x32')](_0xc1598c['query'][_0xb4ad('0x32')]);_0x56ac1e[_0xb4ad('0x31')]=qs[_0xb4ad('0x31')](_0xc1598c[_0xb4ad('0x43')][_0xb4ad('0x31')]);}return _0x22dea7['getAgents'](_0x56ac1e);}})[_0xb4ad('0x21')](function(_0x211068){if(_0x211068){return _0x211068?{'count':_0xd3a446,'rows':_0x211068}:null;}})[_0xb4ad('0x21')](respondWithResult(_0x596d2c,null))[_0xb4ad('0x2a')](handleError(_0x596d2c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 69d0a6a..c66dfb8 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 _0xeb79=['ChatQueue','save','remove','emit','hook'];(function(_0x4f6464,_0x19ce0b){var _0x2970c0=function(_0x30b705){while(--_0x30b705){_0x4f6464['push'](_0x4f6464['shift']());}};_0x2970c0(++_0x19ce0b);}(_0xeb79,0x87));var _0x9eb7=function(_0x3c0a09,_0x3db8d7){_0x3c0a09=_0x3c0a09-0x0;var _0x463015=_0xeb79[_0x3c0a09];return _0x463015;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x9eb7('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9eb7('0x1'),'afterUpdate':'update','afterDestroy':_0x9eb7('0x2')};function emitEvent(_0x47e1e5){return function(_0x3ee5c6,_0x2987e1,_0x385233){ChatQueueEvents[_0x9eb7('0x3')](_0x47e1e5+':'+_0x3ee5c6['id'],_0x3ee5c6);ChatQueueEvents['emit'](_0x47e1e5,_0x3ee5c6);_0x385233(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x9eb7('0x4')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x4e8e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0x5bd4ce,_0x40f4f2){var _0x1bd0f1=function(_0x399c73){while(--_0x399c73){_0x5bd4ce['push'](_0x5bd4ce['shift']());}};_0x1bd0f1(++_0x40f4f2);}(_0x4e8e,0x95));var _0xe4e8=function(_0x255c9a,_0x50c1db){_0x255c9a=_0x255c9a-0x0;var _0x57491d=_0x4e8e[_0x255c9a];return _0x57491d;};'use strict';var EventEmitter=require(_0xe4e8('0x0'));var ChatQueue=require(_0xe4e8('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4e8('0x2'),'afterUpdate':_0xe4e8('0x3'),'afterDestroy':_0xe4e8('0x4')};function emitEvent(_0xb45e41){return function(_0x53cfb5,_0x46c61f,_0x209be6){ChatQueueEvents[_0xe4e8('0x5')](_0xb45e41+':'+_0x53cfb5['id'],_0x53cfb5);ChatQueueEvents['emit'](_0xb45e41,_0x53cfb5);_0x209be6(null);};}for(var e in events){if(events[_0xe4e8('0x6')](e)){var event=events[e];ChatQueue[_0xe4e8('0x7')](e,emitEvent(event));}}module[_0xe4e8('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index aceb077..2dca84a 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 _0x553c=['chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1dbf7c,_0x14cf12){var _0x132e52=function(_0x57e292){while(--_0x57e292){_0x1dbf7c['push'](_0x1dbf7c['shift']());}};_0x132e52(++_0x14cf12);}(_0x553c,0x121));var _0xc553=function(_0x4f65a9,_0x296b49){_0x4f65a9=_0x4f65a9-0x0;var _0x5bb921=_0x553c[_0x4f65a9];return _0x5bb921;};'use strict';var _=require(_0xc553('0x0'));var util=require(_0xc553('0x1'));var logger=require(_0xc553('0x2'))(_0xc553('0x3'));var moment=require(_0xc553('0x4'));var BPromise=require('bluebird');var rp=require(_0xc553('0x5'));var fs=require('fs');var path=require(_0xc553('0x6'));var rimraf=require(_0xc553('0x7'));var config=require(_0xc553('0x8'));var attributes=require('./chatQueue.attributes');module[_0xc553('0x9')]=function(_0x2ef105,_0x269284){return _0x2ef105[_0xc553('0xa')]('ChatQueue',attributes,{'tableName':_0xc553('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdf3=['ChatQueue','chat_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0xef4fc0,_0x33cc41){var _0x57dade=function(_0xe75b3e){while(--_0xe75b3e){_0xef4fc0['push'](_0xef4fc0['shift']());}};_0x57dade(++_0x33cc41);}(_0xfdf3,0x176));var _0x3fdf=function(_0x77e70,_0xd75f49){_0x77e70=_0x77e70-0x0;var _0x38f7aa=_0xfdf3[_0x77e70];return _0x38f7aa;};'use strict';var _=require(_0x3fdf('0x0'));var util=require(_0x3fdf('0x1'));var logger=require('../../config/logger')(_0x3fdf('0x2'));var moment=require(_0x3fdf('0x3'));var BPromise=require(_0x3fdf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fdf('0x5'));var rimraf=require(_0x3fdf('0x6'));var config=require(_0x3fdf('0x7'));var attributes=require(_0x3fdf('0x8'));module[_0x3fdf('0x9')]=function(_0xd23d22,_0x30c2a8){return _0xd23d22['define'](_0x3fdf('0xa'),attributes,{'tableName':_0x3fdf('0xb'),'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 4176f55..5895393 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 _0x0e3b=['redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','ChatQueue','options','raw','where','attributes','include','map','model','GetChatQueue','stringify','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x17c3df,_0x57fb6c){var _0x4fea8d=function(_0x27aa4d){while(--_0x27aa4d){_0x17c3df['push'](_0x17c3df['shift']());}};_0x4fea8d(++_0x57fb6c);}(_0x0e3b,0x125));var _0xb0e3=function(_0x11f9ac,_0xcb2915){_0x11f9ac=_0x11f9ac-0x0;var _0x269817=_0x0e3b[_0x11f9ac];return _0x269817;};'use strict';var _=require(_0xb0e3('0x0'));var util=require(_0xb0e3('0x1'));var moment=require(_0xb0e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0e3('0x3'));var fs=require('fs');var Redis=require(_0xb0e3('0x4'));var db=require(_0xb0e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0e3('0x6'))(_0xb0e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xb0e3('0x8'));var client=jayson[_0xb0e3('0x9')][_0xb0e3('0xa')]({'port':0x232a});config[_0xb0e3('0xb')]=_['defaults'](config[_0xb0e3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb0e3('0xc'))(new Redis(config[_0xb0e3('0xb')]));require(_0xb0e3('0xd'))[_0xb0e3('0xe')](socket);function respondWithRpcPromise(_0x53b526,_0x4b90aa,_0x384684){return new BPromise(function(_0x3ff132,_0x3eefcd){return client[_0xb0e3('0xf')](_0x53b526,_0x384684)[_0xb0e3('0x10')](function(_0x1507c3){logger[_0xb0e3('0x11')](_0xb0e3('0x12'),_0x4b90aa,_0xb0e3('0x13'));logger[_0xb0e3('0x14')](_0xb0e3('0x15'),_0x4b90aa,'request\x20sent',JSON['stringify'](_0x1507c3));if(_0x1507c3[_0xb0e3('0x16')]){if(_0x1507c3[_0xb0e3('0x16')]['code']===0x1f4){logger[_0xb0e3('0x16')](_0xb0e3('0x12'),_0x4b90aa,_0x1507c3['error'][_0xb0e3('0x17')]);return _0x3eefcd(_0x1507c3['error'][_0xb0e3('0x17')]);}logger['error'](_0xb0e3('0x12'),_0x4b90aa,_0x1507c3['error'][_0xb0e3('0x17')]);return _0x3ff132(_0x1507c3['error']['message']);}else{logger[_0xb0e3('0x11')](_0xb0e3('0x12'),_0x4b90aa,_0xb0e3('0x13'));_0x3ff132(_0x1507c3[_0xb0e3('0x18')][_0xb0e3('0x17')]);}})[_0xb0e3('0x19')](function(_0x5042bc){logger['error'](_0xb0e3('0x12'),_0x4b90aa,_0x5042bc);_0x3eefcd(_0x5042bc);});});}exports['GetChatQueue']=function(_0x17c83c){var _0x593bb6=this;return new Promise(function(_0x4a3f9b,_0x37be78){return db[_0xb0e3('0x1a')]['findAll']({'raw':_0x17c83c[_0xb0e3('0x1b')]?_0x17c83c[_0xb0e3('0x1b')][_0xb0e3('0x1c')]===undefined?!![]:![]:!![],'where':_0x17c83c['options']?_0x17c83c[_0xb0e3('0x1b')][_0xb0e3('0x1d')]||null:null,'attributes':_0x17c83c[_0xb0e3('0x1b')]?_0x17c83c[_0xb0e3('0x1b')][_0xb0e3('0x1e')]||null:null,'limit':_0x17c83c['options']?_0x17c83c[_0xb0e3('0x1b')]['limit']||null:null,'include':_0x17c83c[_0xb0e3('0x1b')]?_0x17c83c[_0xb0e3('0x1b')][_0xb0e3('0x1f')]?_['map'](_0x17c83c[_0xb0e3('0x1b')]['include'],function(_0xc5286){return{'model':db[_0xc5286['model']],'as':_0xc5286['as'],'attributes':_0xc5286['attributes'],'include':_0xc5286['include']?_[_0xb0e3('0x20')](_0xc5286[_0xb0e3('0x1f')],function(_0x453e94){return{'model':db[_0x453e94['model']],'as':_0x453e94['as'],'attributes':_0x453e94[_0xb0e3('0x1e')],'include':_0x453e94[_0xb0e3('0x1f')]?_[_0xb0e3('0x20')](_0x453e94[_0xb0e3('0x1f')],function(_0x246da2){return{'model':db[_0x246da2[_0xb0e3('0x21')]],'as':_0x246da2['as'],'attributes':_0x246da2[_0xb0e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb0e3('0x10')](function(_0x20dd68){logger[_0xb0e3('0x11')](_0xb0e3('0x22'),_0x17c83c);logger[_0xb0e3('0x14')](_0xb0e3('0x22'),_0x17c83c,JSON[_0xb0e3('0x23')](_0x20dd68));_0x4a3f9b(_0x20dd68);})[_0xb0e3('0x19')](function(_0x8a3727){logger['error'](_0xb0e3('0x22'),_0x8a3727[_0xb0e3('0x17')],_0x17c83c);_0x37be78(_0x593bb6[_0xb0e3('0x16')](0x1f4,_0x8a3727[_0xb0e3('0x17')]));});});};exports[_0xb0e3('0x24')]=function(_0x8fe215){var _0xc7a53f=this;return new Promise(function(_0x2ebb29,_0x563591){return db[_0xb0e3('0x1a')][_0xb0e3('0x25')]({'raw':_0x8fe215['options']?_0x8fe215['options']['raw']===undefined?!![]:![]:!![],'where':_0x8fe215[_0xb0e3('0x1b')]?_0x8fe215[_0xb0e3('0x1b')]['where']||null:null,'attributes':_0x8fe215[_0xb0e3('0x1b')]?_0x8fe215[_0xb0e3('0x1b')][_0xb0e3('0x1e')]||null:null,'include':_0x8fe215['options']?_0x8fe215['options'][_0xb0e3('0x1f')]?_['map'](_0x8fe215[_0xb0e3('0x1b')][_0xb0e3('0x1f')],function(_0x278e98){return{'model':db[_0x278e98[_0xb0e3('0x21')]],'as':_0x278e98['as'],'attributes':_0x278e98[_0xb0e3('0x1e')],'include':_0x278e98['include']?_[_0xb0e3('0x20')](_0x278e98['include'],function(_0x4ca1da){return{'model':db[_0x4ca1da[_0xb0e3('0x21')]],'as':_0x4ca1da['as'],'attributes':_0x4ca1da[_0xb0e3('0x1e')],'include':_0x4ca1da['include']?_[_0xb0e3('0x20')](_0x4ca1da[_0xb0e3('0x1f')],function(_0x3fd3fa){return{'model':db[_0x3fd3fa[_0xb0e3('0x21')]],'as':_0x3fd3fa['as'],'attributes':_0x3fd3fa[_0xb0e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb0e3('0x10')](function(_0x2b4788){logger[_0xb0e3('0x11')](_0xb0e3('0x24'),_0x8fe215);logger[_0xb0e3('0x14')](_0xb0e3('0x24'),_0x8fe215,JSON[_0xb0e3('0x23')](_0x2b4788));_0x2ebb29(_0x2b4788);})[_0xb0e3('0x19')](function(_0x1e02c3){logger['error']('ShowChatQueue',_0x1e02c3[_0xb0e3('0x17')],_0x8fe215);_0x563591(_0xc7a53f['error'](0x1f4,_0x1e02c3[_0xb0e3('0x17')]));});});};
\ No newline at end of file
+var _0x3264=['attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','then','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','catch','ChatQueue','findAll','options','raw','where'];(function(_0x335141,_0x52b910){var _0x4f84da=function(_0x4514ea){while(--_0x4514ea){_0x335141['push'](_0x335141['shift']());}};_0x4f84da(++_0x52b910);}(_0x3264,0x7f));var _0x4326=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x3264[_0x45bf86];return _0x1f02b7;};'use strict';var _=require('lodash');var util=require(_0x4326('0x0'));var moment=require(_0x4326('0x1'));var BPromise=require(_0x4326('0x2'));var rs=require(_0x4326('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4326('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4326('0x5'));var jayson=require(_0x4326('0x6'));var client=jayson[_0x4326('0x7')][_0x4326('0x8')]({'port':0x232a});config['redis']=_[_0x4326('0x9')](config[_0x4326('0xa')],{'host':_0x4326('0xb'),'port':0x18eb});var socket=require(_0x4326('0xc'))(new Redis(config[_0x4326('0xa')]));require(_0x4326('0xd'))[_0x4326('0xe')](socket);function respondWithRpcPromise(_0x5cde0b,_0x58bade,_0x51323a){return new BPromise(function(_0x97d63e,_0x9daa3f){return client[_0x4326('0xf')](_0x5cde0b,_0x51323a)['then'](function(_0x5ac227){logger[_0x4326('0x10')]('ChatQueue,\x20%s,\x20%s',_0x58bade,_0x4326('0x11'));logger[_0x4326('0x12')](_0x4326('0x13'),_0x58bade,'request\x20sent',JSON['stringify'](_0x5ac227));if(_0x5ac227[_0x4326('0x14')]){if(_0x5ac227['error']['code']===0x1f4){logger[_0x4326('0x14')](_0x4326('0x15'),_0x58bade,_0x5ac227[_0x4326('0x14')][_0x4326('0x16')]);return _0x9daa3f(_0x5ac227['error'][_0x4326('0x16')]);}logger[_0x4326('0x14')](_0x4326('0x15'),_0x58bade,_0x5ac227['error'][_0x4326('0x16')]);return _0x97d63e(_0x5ac227[_0x4326('0x14')][_0x4326('0x16')]);}else{logger[_0x4326('0x10')]('ChatQueue,\x20%s,\x20%s',_0x58bade,_0x4326('0x11'));_0x97d63e(_0x5ac227['result'][_0x4326('0x16')]);}})[_0x4326('0x17')](function(_0x35f24b){logger[_0x4326('0x14')](_0x4326('0x15'),_0x58bade,_0x35f24b);_0x9daa3f(_0x35f24b);});});}exports['GetChatQueue']=function(_0x42e4e8){var _0x3d5045=this;return new Promise(function(_0x54e4c4,_0x377a83){return db[_0x4326('0x18')][_0x4326('0x19')]({'raw':_0x42e4e8['options']?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1b')]===undefined?!![]:![]:!![],'where':_0x42e4e8[_0x4326('0x1a')]?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1c')]||null:null,'attributes':_0x42e4e8[_0x4326('0x1a')]?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1d')]||null:null,'limit':_0x42e4e8['options']?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1e')]||null:null,'include':_0x42e4e8['options']?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1f')]?_[_0x4326('0x20')](_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1f')],function(_0x4b5e63){return{'model':db[_0x4b5e63['model']],'as':_0x4b5e63['as'],'attributes':_0x4b5e63[_0x4326('0x1d')],'include':_0x4b5e63[_0x4326('0x1f')]?_[_0x4326('0x20')](_0x4b5e63[_0x4326('0x1f')],function(_0x4a1de7){return{'model':db[_0x4a1de7[_0x4326('0x21')]],'as':_0x4a1de7['as'],'attributes':_0x4a1de7[_0x4326('0x1d')],'include':_0x4a1de7[_0x4326('0x1f')]?_['map'](_0x4a1de7[_0x4326('0x1f')],function(_0x5a1c44){return{'model':db[_0x5a1c44[_0x4326('0x21')]],'as':_0x5a1c44['as'],'attributes':_0x5a1c44[_0x4326('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c56d5){logger[_0x4326('0x10')](_0x4326('0x22'),_0x42e4e8);logger[_0x4326('0x12')]('GetChatQueue',_0x42e4e8,JSON['stringify'](_0x3c56d5));_0x54e4c4(_0x3c56d5);})['catch'](function(_0x430f06){logger[_0x4326('0x14')](_0x4326('0x22'),_0x430f06[_0x4326('0x16')],_0x42e4e8);_0x377a83(_0x3d5045[_0x4326('0x14')](0x1f4,_0x430f06[_0x4326('0x16')]));});});};exports[_0x4326('0x23')]=function(_0xd54ee0){var _0x2a94e7=this;return new Promise(function(_0x28c48a,_0x49a2d1){return db[_0x4326('0x18')][_0x4326('0x24')]({'raw':_0xd54ee0[_0x4326('0x1a')]?_0xd54ee0[_0x4326('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xd54ee0[_0x4326('0x1a')]?_0xd54ee0[_0x4326('0x1a')][_0x4326('0x1c')]||null:null,'attributes':_0xd54ee0[_0x4326('0x1a')]?_0xd54ee0[_0x4326('0x1a')][_0x4326('0x1d')]||null:null,'include':_0xd54ee0['options']?_0xd54ee0[_0x4326('0x1a')][_0x4326('0x1f')]?_[_0x4326('0x20')](_0xd54ee0[_0x4326('0x1a')][_0x4326('0x1f')],function(_0x2138ed){return{'model':db[_0x2138ed[_0x4326('0x21')]],'as':_0x2138ed['as'],'attributes':_0x2138ed['attributes'],'include':_0x2138ed['include']?_[_0x4326('0x20')](_0x2138ed['include'],function(_0x2d5385){return{'model':db[_0x2d5385[_0x4326('0x21')]],'as':_0x2d5385['as'],'attributes':_0x2d5385[_0x4326('0x1d')],'include':_0x2d5385[_0x4326('0x1f')]?_['map'](_0x2d5385['include'],function(_0x1db617){return{'model':db[_0x1db617[_0x4326('0x21')]],'as':_0x1db617['as'],'attributes':_0x1db617['attributes']};}):[]};}):[]};}):[]:[]})[_0x4326('0x25')](function(_0x1233ad){logger[_0x4326('0x10')](_0x4326('0x23'),_0xd54ee0);logger[_0x4326('0x12')](_0x4326('0x23'),_0xd54ee0,JSON[_0x4326('0x26')](_0x1233ad));_0x28c48a(_0x1233ad);})[_0x4326('0x17')](function(_0x3496ac){logger[_0x4326('0x14')]('ShowChatQueue',_0x3496ac['message'],_0xd54ee0);_0x49a2d1(_0x2a94e7['error'](0x1f4,_0x3496ac[_0x4326('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 86de0ba..444b0bb 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 _0xedd9=['removeListener','register','length','chatQueue:','save','remove','update','emit'];(function(_0x47027e,_0xb7bb40){var _0xabcfc=function(_0x254f1c){while(--_0x254f1c){_0x47027e['push'](_0x47027e['shift']());}};_0xabcfc(++_0xb7bb40);}(_0xedd9,0xfc));var _0x9edd=function(_0x15fd40,_0x11d3ae){_0x15fd40=_0x15fd40-0x0;var _0x1d151d=_0xedd9[_0x15fd40];return _0x1d151d;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatQueueEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatQueueEvents['on'](_0x571af9,_0x172522);}};
\ No newline at end of file
+var _0x6334=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x476718,_0x4fb3c6){var _0x1a2b16=function(_0x5b93b0){while(--_0x5b93b0){_0x476718['push'](_0x476718['shift']());}};_0x1a2b16(++_0x4fb3c6);}(_0x6334,0x119));var _0x4633=function(_0x3ae34a,_0x143082){_0x3ae34a=_0x3ae34a-0x0;var _0x4c9edc=_0x6334[_0x3ae34a];return _0x4c9edc;};'use strict';var ChatQueueEvents=require(_0x4633('0x0'));var events=[_0x4633('0x1'),_0x4633('0x2'),_0x4633('0x3')];function createListener(_0x1e53a0,_0x47254b){return function(_0x5109db){_0x47254b[_0x4633('0x4')](_0x1e53a0,_0x5109db);};}function removeListener(_0x205442,_0x2a2b3c){return function(){ChatQueueEvents[_0x4633('0x5')](_0x205442,_0x2a2b3c);};}exports[_0x4633('0x6')]=function(_0x6493dc){for(var _0x175e14=0x0,_0x4a8997=events[_0x4633('0x7')];_0x175e14<_0x4a8997;_0x175e14++){var _0x56891d=events[_0x175e14];var _0x21af74=createListener(_0x4633('0x8')+_0x56891d,_0x6493dc);ChatQueueEvents['on'](_0x56891d,_0x21af74);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e1c1be6..c033c15 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x33085e,_0x571ae7){var _0x43928b=function(_0x2cc736){while(--_0x2cc736){_0x33085e['push'](_0x33085e['shift']());}};_0x43928b(++_0x571ae7);}(_0xe14b,0x93));var _0xbe14=function(_0x593433,_0x462bd1){_0x593433=_0x593433-0x0;var _0x25f371=_0xe14b[_0x593433];return _0x25f371;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x46ae97,_0x1457ea){var _0x4d0c37=function(_0x387581){while(--_0x387581){_0x46ae97['push'](_0x46ae97['shift']());}};_0x4d0c37(++_0x1457ea);}(_0x55ca,0x126));var _0xa55c=function(_0x1877e2,_0x2b76d4){_0x1877e2=_0x1877e2-0x0;var _0x44e96a=_0x55ca[_0x1877e2];return _0x44e96a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 25d1374..0e2cc20 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 _0xf9d9=['STRING','DATE','exports'];(function(_0x3c749c,_0x1c78d0){var _0x12f6e6=function(_0x467dd0){while(--_0x467dd0){_0x3c749c['push'](_0x3c749c['shift']());}};_0x12f6e6(++_0x1c78d0);}(_0xf9d9,0x182));var _0x9f9d=function(_0x2ab251,_0x41f7bb){_0x2ab251=_0x2ab251-0x0;var _0x4461c4=_0xf9d9[_0x2ab251];return _0x4461c4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9f9d('0x0')]={'uniqueid':{'type':Sequelize[_0x9f9d('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9f9d('0x2')]},'acceptAt':{'type':Sequelize[_0x9f9d('0x2')]},'exitAt':{'type':Sequelize[_0x9f9d('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3870=['STRING','DATE','moment','sequelize'];(function(_0x73d817,_0x54eed1){var _0x178cf8=function(_0x3cdf24){while(--_0x3cdf24){_0x73d817['push'](_0x73d817['shift']());}};_0x178cf8(++_0x54eed1);}(_0x3870,0x19e));var _0x0387=function(_0x42a6b9,_0x164483){_0x42a6b9=_0x42a6b9-0x0;var _0x420139=_0x3870[_0x42a6b9];return _0x420139;};'use strict';var moment=require(_0x0387('0x0'));var Sequelize=require(_0x0387('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0387('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0387('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0387('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0387('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index badfe1d..b5cfddc 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 _0x1c75=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','undefined','limit','count','offset','json','apply','reject','save','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','includeAll','include','findAll','rows','show','params','keys','catch','body','update','find','destroy','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x354fc7,_0x10bd45){var _0x462135=function(_0x8d4cd2){while(--_0x8d4cd2){_0x354fc7['push'](_0x354fc7['shift']());}};_0x462135(++_0x10bd45);}(_0x1c75,0xce));var _0x51c7=function(_0x1fd675,_0x587658){_0x1fd675=_0x1fd675-0x0;var _0x521d1c=_0x1c75[_0x1fd675];return _0x521d1c;};'use strict';var emlformat=require(_0x51c7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51c7('0x1'));var moment=require(_0x51c7('0x2'));var BPromise=require(_0x51c7('0x3'));var Mustache=require(_0x51c7('0x4'));var util=require(_0x51c7('0x5'));var path=require(_0x51c7('0x6'));var sox=require(_0x51c7('0x7'));var csv=require(_0x51c7('0x8'));var ejs=require(_0x51c7('0x9'));var fs=require('fs');var fs_extra=require(_0x51c7('0xa'));var _=require(_0x51c7('0xb'));var squel=require('squel');var crypto=require(_0x51c7('0xc'));var jsforce=require(_0x51c7('0xd'));var deskjs=require(_0x51c7('0xe'));var toCsv=require(_0x51c7('0x8'));var querystring=require('querystring');var Papa=require(_0x51c7('0xf'));var Redis=require('ioredis');var authService=require(_0x51c7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x51c7('0x11'));var hardwareService=require(_0x51c7('0x12'));var logger=require('../../config/logger')(_0x51c7('0x13'));var utils=require(_0x51c7('0x14'));var config=require(_0x51c7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52fa27,_0xedfd17){_0xedfd17=_0xedfd17||0xcc;return function(_0xefc2ff){if(_0xefc2ff){return _0x52fa27[_0x51c7('0x16')](_0xedfd17);}return _0x52fa27['status'](_0xedfd17)[_0x51c7('0x17')]();};}function respondWithResult(_0x51e0be,_0x2c8db4){_0x2c8db4=_0x2c8db4||0xc8;return function(_0x5a5ea9){if(_0x5a5ea9){return _0x51e0be[_0x51c7('0x18')](_0x2c8db4)['json'](_0x5a5ea9);}};}function respondWithFilteredResult(_0x730429,_0x317fa7){return function(_0x44c13d){if(_0x44c13d){var _0x39da99=typeof _0x317fa7['offset']===_0x51c7('0x19')&&typeof _0x317fa7[_0x51c7('0x1a')]===_0x51c7('0x19');var _0x3079b7=_0x44c13d[_0x51c7('0x1b')];var _0x36b29a=_0x39da99?0x0:_0x317fa7['offset'];var _0xe4cf49=_0x39da99?_0x44c13d[_0x51c7('0x1b')]:_0x317fa7[_0x51c7('0x1c')]+_0x317fa7['limit'];var _0x3c1f43;if(_0xe4cf49>=_0x3079b7){_0xe4cf49=_0x3079b7;_0x3c1f43=0xc8;}else{_0x3c1f43=0xce;}_0x730429[_0x51c7('0x18')](_0x3c1f43);return _0x730429['set']('Content-Range',_0x36b29a+'-'+_0xe4cf49+'/'+_0x3079b7)[_0x51c7('0x1d')](_0x44c13d);}return null;};}function patchUpdates(_0x1881f3){return function(_0x45b181){try{jsonpatch[_0x51c7('0x1e')](_0x45b181,_0x1881f3,!![]);}catch(_0x4072b9){return BPromise[_0x51c7('0x1f')](_0x4072b9);}return _0x45b181[_0x51c7('0x20')]();};}function saveUpdates(_0x5248e2,_0x3dbfbc){return function(_0x11c83d){if(_0x11c83d){return _0x11c83d['update'](_0x5248e2)[_0x51c7('0x21')](function(_0x48b259){return _0x48b259;});}return null;};}function removeEntity(_0x2a8a7d,_0x3f7858){return function(_0x414de0){if(_0x414de0){return _0x414de0['destroy']()[_0x51c7('0x21')](function(){_0x2a8a7d[_0x51c7('0x18')](0xcc)[_0x51c7('0x17')]();});}};}function handleEntityNotFound(_0x13a3ad,_0x44de99){return function(_0x1c3935){if(!_0x1c3935){_0x13a3ad['sendStatus'](0x194);}return _0x1c3935;};}function handleError(_0x438887,_0x528c19){_0x528c19=_0x528c19||0x1f4;return function(_0x3d9ec8){logger[_0x51c7('0x22')](_0x3d9ec8[_0x51c7('0x23')]);if(_0x3d9ec8[_0x51c7('0x24')]){delete _0x3d9ec8[_0x51c7('0x24')];}_0x438887[_0x51c7('0x18')](_0x528c19)[_0x51c7('0x25')](_0x3d9ec8);};}exports[_0x51c7('0x26')]=function(_0x42745b,_0x2a18e0){var _0x104315={},_0x16db1b={},_0x59cb23={'count':0x0,'rows':[]};var _0xc1688f=_[_0x51c7('0x27')](db[_0x51c7('0x28')][_0x51c7('0x29')],function(_0x588fbb){return{'name':_0x588fbb[_0x51c7('0x2a')],'type':_0x588fbb[_0x51c7('0x2b')][_0x51c7('0x2c')]};});_0x16db1b[_0x51c7('0x2d')]=_[_0x51c7('0x27')](_0xc1688f,'name');_0x16db1b[_0x51c7('0x2e')]=_['keys'](_0x42745b[_0x51c7('0x2e')]);_0x16db1b[_0x51c7('0x2f')]=_[_0x51c7('0x30')](_0x16db1b[_0x51c7('0x2d')],_0x16db1b[_0x51c7('0x2e')]);_0x104315[_0x51c7('0x31')]=_[_0x51c7('0x30')](_0x16db1b[_0x51c7('0x2d')],qs[_0x51c7('0x32')](_0x42745b[_0x51c7('0x2e')]['fields']));_0x104315[_0x51c7('0x31')]=_0x104315['attributes'][_0x51c7('0x33')]?_0x104315[_0x51c7('0x31')]:_0x16db1b['model'];if(!_0x42745b[_0x51c7('0x2e')][_0x51c7('0x34')](_0x51c7('0x35'))){_0x104315[_0x51c7('0x1a')]=qs['limit'](_0x42745b[_0x51c7('0x2e')][_0x51c7('0x1a')]);_0x104315[_0x51c7('0x1c')]=qs[_0x51c7('0x1c')](_0x42745b['query'][_0x51c7('0x1c')]);}_0x104315[_0x51c7('0x36')]=qs[_0x51c7('0x37')](_0x42745b[_0x51c7('0x2e')][_0x51c7('0x37')]);_0x104315['where']=qs[_0x51c7('0x2f')](_['pick'](_0x42745b[_0x51c7('0x2e')],_0x16db1b['filters']),_0xc1688f);if(_0x42745b[_0x51c7('0x2e')][_0x51c7('0x38')]){_0x104315['where']=_[_0x51c7('0x39')](_0x104315[_0x51c7('0x3a')],{'$or':_[_0x51c7('0x27')](_0xc1688f,function(_0x2b02d6){if(_0x2b02d6['type']!=='VIRTUAL'){var _0xde9936={};_0xde9936[_0x2b02d6[_0x51c7('0x24')]]={'$like':'%'+_0x42745b[_0x51c7('0x2e')][_0x51c7('0x38')]+'%'};return _0xde9936;}})});}_0x104315=_['merge']({},_0x104315,_0x42745b[_0x51c7('0x3b')]);var _0x4c0a28={'where':_0x104315[_0x51c7('0x3a')]};return db[_0x51c7('0x28')][_0x51c7('0x1b')](_0x4c0a28)[_0x51c7('0x21')](function(_0x53a154){_0x59cb23[_0x51c7('0x1b')]=_0x53a154;if(_0x42745b[_0x51c7('0x2e')][_0x51c7('0x3c')]){_0x104315[_0x51c7('0x3d')]=[{'all':!![]}];}return db[_0x51c7('0x28')][_0x51c7('0x3e')](_0x104315);})['then'](function(_0x4e908a){_0x59cb23[_0x51c7('0x3f')]=_0x4e908a;return _0x59cb23;})[_0x51c7('0x21')](respondWithFilteredResult(_0x2a18e0,_0x104315))['catch'](handleError(_0x2a18e0,null));};exports[_0x51c7('0x40')]=function(_0x20aa9f,_0xe82611){var _0x3d8994={'raw':!![],'where':{'id':_0x20aa9f[_0x51c7('0x41')]['id']}},_0x3add13={};_0x3add13[_0x51c7('0x2d')]=_[_0x51c7('0x42')](db[_0x51c7('0x28')][_0x51c7('0x29')]);_0x3add13['query']=_['keys'](_0x20aa9f[_0x51c7('0x2e')]);_0x3add13[_0x51c7('0x2f')]=_[_0x51c7('0x30')](_0x3add13[_0x51c7('0x2d')],_0x3add13['query']);_0x3d8994['attributes']=_[_0x51c7('0x30')](_0x3add13[_0x51c7('0x2d')],qs[_0x51c7('0x32')](_0x20aa9f['query'][_0x51c7('0x32')]));_0x3d8994[_0x51c7('0x31')]=_0x3d8994[_0x51c7('0x31')][_0x51c7('0x33')]?_0x3d8994['attributes']:_0x3add13[_0x51c7('0x2d')];if(_0x20aa9f['query'][_0x51c7('0x3c')]){_0x3d8994[_0x51c7('0x3d')]=[{'all':!![]}];}_0x3d8994=_[_0x51c7('0x39')]({},_0x3d8994,_0x20aa9f[_0x51c7('0x3b')]);return db['ChatQueueReport']['find'](_0x3d8994)['then'](handleEntityNotFound(_0xe82611,null))[_0x51c7('0x21')](respondWithResult(_0xe82611,null))[_0x51c7('0x43')](handleError(_0xe82611,null));};exports['create']=function(_0x57c878,_0x54b156){return db[_0x51c7('0x28')]['create'](_0x57c878[_0x51c7('0x44')],{})[_0x51c7('0x21')](respondWithResult(_0x54b156,0xc9))[_0x51c7('0x43')](handleError(_0x54b156,null));};exports[_0x51c7('0x45')]=function(_0x513743,_0x44f2ad){if(_0x513743[_0x51c7('0x44')]['id']){delete _0x513743[_0x51c7('0x44')]['id'];}return db[_0x51c7('0x28')][_0x51c7('0x46')]({'where':{'id':_0x513743[_0x51c7('0x41')]['id']}})[_0x51c7('0x21')](handleEntityNotFound(_0x44f2ad,null))[_0x51c7('0x21')](saveUpdates(_0x513743['body'],null))[_0x51c7('0x21')](respondWithResult(_0x44f2ad,null))[_0x51c7('0x43')](handleError(_0x44f2ad,null));};exports[_0x51c7('0x47')]=function(_0x5b3023,_0x1134ac){return db['ChatQueueReport'][_0x51c7('0x46')]({'where':{'id':_0x5b3023[_0x51c7('0x41')]['id']}})[_0x51c7('0x21')](handleEntityNotFound(_0x1134ac,null))[_0x51c7('0x21')](removeEntity(_0x1134ac,null))[_0x51c7('0x43')](handleError(_0x1134ac,null));};exports[_0x51c7('0x48')]=function(_0x58097b,_0x59c57b){return db[_0x51c7('0x28')][_0x51c7('0x48')]()[_0x51c7('0x21')](respondWithResult(_0x59c57b,null))[_0x51c7('0x43')](handleError(_0x59c57b,null));};
\ No newline at end of file
+var _0xdd68=['name','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','error','stack'];(function(_0x1f8223,_0x2e2b29){var _0x4aa535=function(_0x338b17){while(--_0x338b17){_0x1f8223['push'](_0x1f8223['shift']());}};_0x4aa535(++_0x2e2b29);}(_0xdd68,0x196));var _0x8dd6=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xdd68[_0x39780c];return _0x53c19b;};'use strict';var emlformat=require(_0x8dd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dd6('0x1'));var jsonpatch=require(_0x8dd6('0x2'));var rp=require(_0x8dd6('0x3'));var moment=require(_0x8dd6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8dd6('0x5'));var util=require(_0x8dd6('0x6'));var path=require('path');var sox=require(_0x8dd6('0x7'));var csv=require(_0x8dd6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8dd6('0x9'));var _=require('lodash');var squel=require(_0x8dd6('0xa'));var crypto=require('crypto');var jsforce=require(_0x8dd6('0xb'));var deskjs=require(_0x8dd6('0xc'));var toCsv=require(_0x8dd6('0x8'));var querystring=require('querystring');var Papa=require(_0x8dd6('0xd'));var Redis=require(_0x8dd6('0xe'));var authService=require(_0x8dd6('0xf'));var qs=require(_0x8dd6('0x10'));var as=require(_0x8dd6('0x11'));var hardwareService=require(_0x8dd6('0x12'));var logger=require(_0x8dd6('0x13'))(_0x8dd6('0x14'));var utils=require(_0x8dd6('0x15'));var config=require(_0x8dd6('0x16'));var licenseUtil=require(_0x8dd6('0x17'));var db=require(_0x8dd6('0x18'))['db'];function respondWithStatusCode(_0x3e7182,_0x59456c){_0x59456c=_0x59456c||0xcc;return function(_0x3bf24f){if(_0x3bf24f){return _0x3e7182[_0x8dd6('0x19')](_0x59456c);}return _0x3e7182[_0x8dd6('0x1a')](_0x59456c)['end']();};}function respondWithResult(_0x5957be,_0x41b21f){_0x41b21f=_0x41b21f||0xc8;return function(_0x4c8ff4){if(_0x4c8ff4){return _0x5957be['status'](_0x41b21f)[_0x8dd6('0x1b')](_0x4c8ff4);}};}function respondWithFilteredResult(_0xd906ee,_0x2e9882){return function(_0x469c11){if(_0x469c11){var _0x124e1d=typeof _0x2e9882[_0x8dd6('0x1c')]===_0x8dd6('0x1d')&&typeof _0x2e9882[_0x8dd6('0x1e')]===_0x8dd6('0x1d');var _0x5496cc=_0x469c11[_0x8dd6('0x1f')];var _0x1f910a=_0x124e1d?0x0:_0x2e9882[_0x8dd6('0x1c')];var _0x168a30=_0x124e1d?_0x469c11[_0x8dd6('0x1f')]:_0x2e9882[_0x8dd6('0x1c')]+_0x2e9882[_0x8dd6('0x1e')];var _0x40f9eb;if(_0x168a30>=_0x5496cc){_0x168a30=_0x5496cc;_0x40f9eb=0xc8;}else{_0x40f9eb=0xce;}_0xd906ee['status'](_0x40f9eb);return _0xd906ee[_0x8dd6('0x20')](_0x8dd6('0x21'),_0x1f910a+'-'+_0x168a30+'/'+_0x5496cc)['json'](_0x469c11);}return null;};}function patchUpdates(_0x40d5a5){return function(_0x107bdd){try{jsonpatch[_0x8dd6('0x22')](_0x107bdd,_0x40d5a5,!![]);}catch(_0x2c67e8){return BPromise['reject'](_0x2c67e8);}return _0x107bdd['save']();};}function saveUpdates(_0x488b47,_0x138216){return function(_0xe6b099){if(_0xe6b099){return _0xe6b099['update'](_0x488b47)[_0x8dd6('0x23')](function(_0x31b588){return _0x31b588;});}return null;};}function removeEntity(_0x29d4c8,_0x1485d4){return function(_0x3a4c9f){if(_0x3a4c9f){return _0x3a4c9f['destroy']()[_0x8dd6('0x23')](function(){_0x29d4c8[_0x8dd6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50f513,_0x1784a9){return function(_0xeeda3){if(!_0xeeda3){_0x50f513['sendStatus'](0x194);}return _0xeeda3;};}function handleError(_0x2d3205,_0x3e05fa){_0x3e05fa=_0x3e05fa||0x1f4;return function(_0x14cce1){logger[_0x8dd6('0x24')](_0x14cce1[_0x8dd6('0x25')]);if(_0x14cce1['name']){delete _0x14cce1[_0x8dd6('0x26')];}_0x2d3205[_0x8dd6('0x1a')](_0x3e05fa)['send'](_0x14cce1);};}exports['index']=function(_0x25eba7,_0x3f4975){var _0x4328c4={},_0x44c282={},_0x2bbe93={'count':0x0,'rows':[]};var _0x3da00d=_[_0x8dd6('0x27')](db[_0x8dd6('0x28')][_0x8dd6('0x29')],function(_0x35c9ae){return{'name':_0x35c9ae[_0x8dd6('0x2a')],'type':_0x35c9ae[_0x8dd6('0x2b')][_0x8dd6('0x2c')]};});_0x44c282[_0x8dd6('0x2d')]=_[_0x8dd6('0x27')](_0x3da00d,_0x8dd6('0x26'));_0x44c282[_0x8dd6('0x2e')]=_[_0x8dd6('0x2f')](_0x25eba7[_0x8dd6('0x2e')]);_0x44c282[_0x8dd6('0x30')]=_[_0x8dd6('0x31')](_0x44c282[_0x8dd6('0x2d')],_0x44c282['query']);_0x4328c4[_0x8dd6('0x32')]=_[_0x8dd6('0x31')](_0x44c282[_0x8dd6('0x2d')],qs[_0x8dd6('0x33')](_0x25eba7['query'][_0x8dd6('0x33')]));_0x4328c4['attributes']=_0x4328c4['attributes'][_0x8dd6('0x34')]?_0x4328c4[_0x8dd6('0x32')]:_0x44c282['model'];if(!_0x25eba7[_0x8dd6('0x2e')][_0x8dd6('0x35')](_0x8dd6('0x36'))){_0x4328c4[_0x8dd6('0x1e')]=qs[_0x8dd6('0x1e')](_0x25eba7['query'][_0x8dd6('0x1e')]);_0x4328c4[_0x8dd6('0x1c')]=qs[_0x8dd6('0x1c')](_0x25eba7[_0x8dd6('0x2e')][_0x8dd6('0x1c')]);}_0x4328c4[_0x8dd6('0x37')]=qs[_0x8dd6('0x38')](_0x25eba7['query'][_0x8dd6('0x38')]);_0x4328c4[_0x8dd6('0x39')]=qs[_0x8dd6('0x30')](_[_0x8dd6('0x3a')](_0x25eba7[_0x8dd6('0x2e')],_0x44c282[_0x8dd6('0x30')]),_0x3da00d);if(_0x25eba7['query'][_0x8dd6('0x3b')]){_0x4328c4[_0x8dd6('0x39')]=_[_0x8dd6('0x3c')](_0x4328c4[_0x8dd6('0x39')],{'$or':_[_0x8dd6('0x27')](_0x3da00d,function(_0x1bf125){if(_0x1bf125[_0x8dd6('0x2b')]!=='VIRTUAL'){var _0x1b3f5d={};_0x1b3f5d[_0x1bf125[_0x8dd6('0x26')]]={'$like':'%'+_0x25eba7[_0x8dd6('0x2e')]['filter']+'%'};return _0x1b3f5d;}})});}_0x4328c4=_[_0x8dd6('0x3c')]({},_0x4328c4,_0x25eba7['options']);var _0x83ec4b={'where':_0x4328c4[_0x8dd6('0x39')]};return db[_0x8dd6('0x28')][_0x8dd6('0x1f')](_0x83ec4b)['then'](function(_0x1fea6d){_0x2bbe93[_0x8dd6('0x1f')]=_0x1fea6d;if(_0x25eba7[_0x8dd6('0x2e')][_0x8dd6('0x3d')]){_0x4328c4[_0x8dd6('0x3e')]=[{'all':!![]}];}return db[_0x8dd6('0x28')][_0x8dd6('0x3f')](_0x4328c4);})[_0x8dd6('0x23')](function(_0x1e1830){_0x2bbe93['rows']=_0x1e1830;return _0x2bbe93;})[_0x8dd6('0x23')](respondWithFilteredResult(_0x3f4975,_0x4328c4))[_0x8dd6('0x40')](handleError(_0x3f4975,null));};exports[_0x8dd6('0x41')]=function(_0x4309a6,_0x22d3b8){var _0x45577e={'raw':!![],'where':{'id':_0x4309a6[_0x8dd6('0x42')]['id']}},_0x31f1d3={};_0x31f1d3[_0x8dd6('0x2d')]=_[_0x8dd6('0x2f')](db['ChatQueueReport'][_0x8dd6('0x29')]);_0x31f1d3['query']=_[_0x8dd6('0x2f')](_0x4309a6[_0x8dd6('0x2e')]);_0x31f1d3['filters']=_[_0x8dd6('0x31')](_0x31f1d3[_0x8dd6('0x2d')],_0x31f1d3[_0x8dd6('0x2e')]);_0x45577e[_0x8dd6('0x32')]=_[_0x8dd6('0x31')](_0x31f1d3[_0x8dd6('0x2d')],qs['fields'](_0x4309a6[_0x8dd6('0x2e')]['fields']));_0x45577e[_0x8dd6('0x32')]=_0x45577e[_0x8dd6('0x32')]['length']?_0x45577e[_0x8dd6('0x32')]:_0x31f1d3['model'];if(_0x4309a6['query'][_0x8dd6('0x3d')]){_0x45577e['include']=[{'all':!![]}];}_0x45577e=_[_0x8dd6('0x3c')]({},_0x45577e,_0x4309a6[_0x8dd6('0x43')]);return db[_0x8dd6('0x28')][_0x8dd6('0x44')](_0x45577e)['then'](handleEntityNotFound(_0x22d3b8,null))[_0x8dd6('0x23')](respondWithResult(_0x22d3b8,null))[_0x8dd6('0x40')](handleError(_0x22d3b8,null));};exports[_0x8dd6('0x45')]=function(_0x22a0b1,_0x701549){return db[_0x8dd6('0x28')][_0x8dd6('0x45')](_0x22a0b1[_0x8dd6('0x46')],{})['then'](respondWithResult(_0x701549,0xc9))[_0x8dd6('0x40')](handleError(_0x701549,null));};exports[_0x8dd6('0x47')]=function(_0x212929,_0x4a1550){if(_0x212929['body']['id']){delete _0x212929[_0x8dd6('0x46')]['id'];}return db[_0x8dd6('0x28')][_0x8dd6('0x44')]({'where':{'id':_0x212929['params']['id']}})[_0x8dd6('0x23')](handleEntityNotFound(_0x4a1550,null))[_0x8dd6('0x23')](saveUpdates(_0x212929['body'],null))['then'](respondWithResult(_0x4a1550,null))['catch'](handleError(_0x4a1550,null));};exports[_0x8dd6('0x48')]=function(_0x513178,_0x1a919a){return db['ChatQueueReport'][_0x8dd6('0x44')]({'where':{'id':_0x513178[_0x8dd6('0x42')]['id']}})[_0x8dd6('0x23')](handleEntityNotFound(_0x1a919a,null))['then'](removeEntity(_0x1a919a,null))[_0x8dd6('0x40')](handleError(_0x1a919a,null));};exports[_0x8dd6('0x49')]=function(_0x4699be,_0x75dfcc){return db[_0x8dd6('0x28')][_0x8dd6('0x49')]()[_0x8dd6('0x23')](respondWithResult(_0x75dfcc,null))[_0x8dd6('0x40')](handleError(_0x75dfcc,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 6af70a5..2f1e0b6 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x4fb2dd,_0x6f90bb){var _0x2156d9=function(_0x4d1f06){while(--_0x4d1f06){_0x4fb2dd['push'](_0x4fb2dd['shift']());}};_0x2156d9(++_0x6f90bb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xb7e7[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x26bae4,_0x59cb48){var _0xa38b80=function(_0x401077){while(--_0x401077){_0x26bae4['push'](_0x26bae4['shift']());}};_0xa38b80(++_0x59cb48);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'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 1bc2975..2967576 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 _0xcc5e=['message','catch','CreateChatQueueReport','create','body','options','raw','then','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s'];(function(_0x165f3f,_0x3605d2){var _0xeb50aa=function(_0x50105c){while(--_0x50105c){_0x165f3f['push'](_0x165f3f['shift']());}};_0xeb50aa(++_0x3605d2);}(_0xcc5e,0x12b));var _0xecc5=function(_0x5944e9,_0xf3da60){_0x5944e9=_0x5944e9-0x0;var _0x1098b8=_0xcc5e[_0x5944e9];return _0x1098b8;};'use strict';var _=require(_0xecc5('0x0'));var util=require('util');var moment=require(_0xecc5('0x1'));var BPromise=require(_0xecc5('0x2'));var rs=require(_0xecc5('0x3'));var fs=require('fs');var Redis=require(_0xecc5('0x4'));var db=require(_0xecc5('0x5'))['db'];var utils=require(_0xecc5('0x6'));var logger=require('../../config/logger')(_0xecc5('0x7'));var config=require(_0xecc5('0x8'));var jayson=require(_0xecc5('0x9'));var client=jayson[_0xecc5('0xa')][_0xecc5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4184f8,_0x6ab1cb,_0x3db0d6){return new BPromise(function(_0x3ab37f,_0x458eb7){return client[_0xecc5('0xc')](_0x4184f8,_0x3db0d6)['then'](function(_0x13624b){logger[_0xecc5('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x6ab1cb,_0xecc5('0xe'));logger[_0xecc5('0xf')](_0xecc5('0x10'),_0x6ab1cb,_0xecc5('0xe'),JSON[_0xecc5('0x11')](_0x13624b));if(_0x13624b[_0xecc5('0x12')]){if(_0x13624b[_0xecc5('0x12')][_0xecc5('0x13')]===0x1f4){logger[_0xecc5('0x12')](_0xecc5('0x14'),_0x6ab1cb,_0x13624b[_0xecc5('0x12')][_0xecc5('0x15')]);return _0x458eb7(_0x13624b[_0xecc5('0x12')][_0xecc5('0x15')]);}logger[_0xecc5('0x12')](_0xecc5('0x14'),_0x6ab1cb,_0x13624b[_0xecc5('0x12')]['message']);return _0x3ab37f(_0x13624b['error']['message']);}else{logger[_0xecc5('0xd')](_0xecc5('0x14'),_0x6ab1cb,_0xecc5('0xe'));_0x3ab37f(_0x13624b['result'][_0xecc5('0x15')]);}})[_0xecc5('0x16')](function(_0x5e8447){logger[_0xecc5('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x6ab1cb,_0x5e8447);_0x458eb7(_0x5e8447);});});}exports[_0xecc5('0x17')]=function(_0x1f17cb){var _0x230b5b=this;return new Promise(function(_0x513884,_0x4022f8){return db['ChatQueueReport'][_0xecc5('0x18')](_0x1f17cb[_0xecc5('0x19')],{'raw':_0x1f17cb[_0xecc5('0x1a')]?_0x1f17cb[_0xecc5('0x1a')][_0xecc5('0x1b')]===undefined?!![]:![]:!![]})[_0xecc5('0x1c')](function(_0x209887){logger[_0xecc5('0xd')](_0xecc5('0x17'),_0x1f17cb);logger[_0xecc5('0xf')](_0xecc5('0x17'),_0x1f17cb,JSON[_0xecc5('0x11')](_0x209887));_0x513884(_0x209887);})[_0xecc5('0x16')](function(_0x3e5ea9){logger[_0xecc5('0x12')](_0xecc5('0x17'),_0x3e5ea9[_0xecc5('0x15')],_0x1f17cb);_0x4022f8(_0x230b5b['error'](0x1f4,_0x3e5ea9[_0xecc5('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x201114){var _0x594dd3=this;return new Promise(function(_0x3698e8,_0x275726){return db['ChatQueueReport']['update'](_0x201114[_0xecc5('0x19')],{'raw':_0x201114['options']?_0x201114['options'][_0xecc5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201114[_0xecc5('0x1a')]?_0x201114['options']['where']||null:null,'attributes':_0x201114[_0xecc5('0x1a')]?_0x201114[_0xecc5('0x1a')][_0xecc5('0x1d')]||null:null,'limit':_0x201114[_0xecc5('0x1a')]?_0x201114[_0xecc5('0x1a')][_0xecc5('0x1e')]||null:null})[_0xecc5('0x1c')](function(_0x4cbc08){logger[_0xecc5('0xd')](_0xecc5('0x1f'),_0x201114);logger['debug'](_0xecc5('0x1f'),_0x201114,JSON[_0xecc5('0x11')](_0x4cbc08));_0x3698e8(_0x4cbc08);})['catch'](function(_0x2dd470){logger[_0xecc5('0x12')]('UpdateChatQueueReport',_0x2dd470[_0xecc5('0x15')],_0x201114);_0x275726(_0x594dd3[_0xecc5('0x12')](0x1f4,_0x2dd470[_0xecc5('0x15')]));});});};
\ No newline at end of file
+var _0x37e9=['client','http','request','then','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','attributes','limit','info','UpdateChatQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x37e9,0x1f4));var _0x937e=function(_0x3db6cb,_0x558f96){_0x3db6cb=_0x3db6cb-0x0;var _0xffd156=_0x37e9[_0x3db6cb];return _0xffd156;};'use strict';var _=require('lodash');var util=require(_0x937e('0x0'));var moment=require(_0x937e('0x1'));var BPromise=require(_0x937e('0x2'));var rs=require(_0x937e('0x3'));var fs=require('fs');var Redis=require(_0x937e('0x4'));var db=require(_0x937e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x937e('0x6'))(_0x937e('0x7'));var config=require(_0x937e('0x8'));var jayson=require(_0x937e('0x9'));var client=jayson[_0x937e('0xa')][_0x937e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a648d,_0x3bc4c4,_0x214b0d){return new BPromise(function(_0x327f70,_0x54a357){return client[_0x937e('0xc')](_0x5a648d,_0x214b0d)[_0x937e('0xd')](function(_0x109aa3){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x3bc4c4,_0x937e('0xe'));logger['debug'](_0x937e('0xf'),_0x3bc4c4,_0x937e('0xe'),JSON[_0x937e('0x10')](_0x109aa3));if(_0x109aa3['error']){if(_0x109aa3[_0x937e('0x11')][_0x937e('0x12')]===0x1f4){logger['error'](_0x937e('0x13'),_0x3bc4c4,_0x109aa3[_0x937e('0x11')][_0x937e('0x14')]);return _0x54a357(_0x109aa3[_0x937e('0x11')][_0x937e('0x14')]);}logger[_0x937e('0x11')](_0x937e('0x13'),_0x3bc4c4,_0x109aa3[_0x937e('0x11')]['message']);return _0x327f70(_0x109aa3[_0x937e('0x11')][_0x937e('0x14')]);}else{logger['info'](_0x937e('0x13'),_0x3bc4c4,_0x937e('0xe'));_0x327f70(_0x109aa3[_0x937e('0x15')][_0x937e('0x14')]);}})[_0x937e('0x16')](function(_0x3b2647){logger[_0x937e('0x11')](_0x937e('0x13'),_0x3bc4c4,_0x3b2647);_0x54a357(_0x3b2647);});});}exports[_0x937e('0x17')]=function(_0xe76e5b){var _0x1a059f=this;return new Promise(function(_0x4ae425,_0x4da5b6){return db[_0x937e('0x18')][_0x937e('0x19')](_0xe76e5b[_0x937e('0x1a')],{'raw':_0xe76e5b[_0x937e('0x1b')]?_0xe76e5b[_0x937e('0x1b')][_0x937e('0x1c')]===undefined?!![]:![]:!![]})[_0x937e('0xd')](function(_0xb3fdfe){logger['info'](_0x937e('0x17'),_0xe76e5b);logger['debug'](_0x937e('0x17'),_0xe76e5b,JSON[_0x937e('0x10')](_0xb3fdfe));_0x4ae425(_0xb3fdfe);})[_0x937e('0x16')](function(_0x35d7ef){logger[_0x937e('0x11')](_0x937e('0x17'),_0x35d7ef[_0x937e('0x14')],_0xe76e5b);_0x4da5b6(_0x1a059f['error'](0x1f4,_0x35d7ef[_0x937e('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2e5a16){var _0x2c7e2c=this;return new Promise(function(_0x3ac0fb,_0x578b72){return db[_0x937e('0x18')][_0x937e('0x1d')](_0x2e5a16[_0x937e('0x1a')],{'raw':_0x2e5a16[_0x937e('0x1b')]?_0x2e5a16[_0x937e('0x1b')][_0x937e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e5a16[_0x937e('0x1b')]?_0x2e5a16[_0x937e('0x1b')]['where']||null:null,'attributes':_0x2e5a16['options']?_0x2e5a16[_0x937e('0x1b')][_0x937e('0x1e')]||null:null,'limit':_0x2e5a16[_0x937e('0x1b')]?_0x2e5a16[_0x937e('0x1b')][_0x937e('0x1f')]||null:null})['then'](function(_0x511fe4){logger[_0x937e('0x20')](_0x937e('0x21'),_0x2e5a16);logger['debug'](_0x937e('0x21'),_0x2e5a16,JSON['stringify'](_0x511fe4));_0x3ac0fb(_0x511fe4);})[_0x937e('0x16')](function(_0x2ee7c3){logger[_0x937e('0x11')]('UpdateChatQueueReport',_0x2ee7c3['message'],_0x2e5a16);_0x578b72(_0x2c7e2c[_0x937e('0x11')](0x1f4,_0x2ee7c3['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 74493bc..7e867fc 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 _0xfdfe=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','put'];(function(_0x4fd533,_0x32eb4b){var _0x3c7964=function(_0x30de83){while(--_0x30de83){_0x4fd533['push'](_0x4fd533['shift']());}};_0x3c7964(++_0x32eb4b);}(_0xfdfe,0xf5));var _0xefdf=function(_0x521aa0,_0x1a71c2){_0x521aa0=_0x521aa0-0x0;var _0x2e102c=_0xfdfe[_0x521aa0];return _0x2e102c;};'use strict';var multer=require(_0xefdf('0x0'));var util=require(_0xefdf('0x1'));var path=require(_0xefdf('0x2'));var timeout=require(_0xefdf('0x3'));var express=require('express');var router=express[_0xefdf('0x4')]();var fs_extra=require(_0xefdf('0x5'));var auth=require(_0xefdf('0x6'));var interaction=require(_0xefdf('0x7'));var config=require(_0xefdf('0x8'));var controller=require('./chatQueueReport.controller');router[_0xefdf('0x9')]('/',auth['isAuthenticated'](),controller[_0xefdf('0xa')]);router[_0xefdf('0x9')](_0xefdf('0xb'),auth[_0xefdf('0xc')](),controller[_0xefdf('0xd')]);router[_0xefdf('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xefdf('0xc')](),controller['create']);router[_0xefdf('0xe')](_0xefdf('0xf'),auth[_0xefdf('0xc')](),controller[_0xefdf('0x10')]);router[_0xefdf('0x11')]('/:id',auth[_0xefdf('0xc')](),controller[_0xefdf('0x12')]);module[_0xefdf('0x13')]=router;
\ No newline at end of file
+var _0xedfb=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','isAuthenticated','describe','show','post','create','put','/:id'];(function(_0x18a5a0,_0x55f44a){var _0x4854e9=function(_0x5ec295){while(--_0x5ec295){_0x18a5a0['push'](_0x18a5a0['shift']());}};_0x4854e9(++_0x55f44a);}(_0xedfb,0x192));var _0xbedf=function(_0x3079b9,_0x58d2f4){_0x3079b9=_0x3079b9-0x0;var _0x105101=_0xedfb[_0x3079b9];return _0x105101;};'use strict';var multer=require(_0xbedf('0x0'));var util=require(_0xbedf('0x1'));var path=require(_0xbedf('0x2'));var timeout=require(_0xbedf('0x3'));var express=require(_0xbedf('0x4'));var router=express['Router']();var fs_extra=require(_0xbedf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbedf('0x6'));var config=require(_0xbedf('0x7'));var controller=require(_0xbedf('0x8'));router[_0xbedf('0x9')]('/',auth['isAuthenticated'](),controller[_0xbedf('0xa')]);router[_0xbedf('0x9')]('/describe',auth[_0xbedf('0xb')](),controller[_0xbedf('0xc')]);router['get']('/:id',auth[_0xbedf('0xb')](),controller[_0xbedf('0xd')]);router[_0xbedf('0xe')]('/',auth[_0xbedf('0xb')](),controller[_0xbedf('0xf')]);router[_0xbedf('0x10')](_0xbedf('0x11'),auth[_0xbedf('0xb')](),controller['update']);router[_0xbedf('0x12')](_0xbedf('0x11'),auth[_0xbedf('0xb')](),controller[_0xbedf('0x13')]);module[_0xbedf('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 7e4ed11..11cd549 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x53832d,_0x49cec2){var _0x20efe2=function(_0x7fd41c){while(--_0x7fd41c){_0x53832d['push'](_0x53832d['shift']());}};_0x20efe2(++_0x49cec2);}(_0x008c,0x188));var _0xc008=function(_0xcc26d2,_0x20c921){_0xcc26d2=_0xcc26d2-0x0;var _0x3841e2=_0x008c[_0xcc26d2];return _0x3841e2;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3cdfeb,_0x1ff1ad){var _0x23b4e6=function(_0x1c2581){while(--_0x1c2581){_0x3cdfeb['push'](_0x3cdfeb['shift']());}};_0x23b4e6(++_0x1ff1ad);}(_0xf4eb,0xec));var _0xbf4e=function(_0x445068,_0x250944){_0x445068=_0x445068-0x0;var _0x234ca9=_0xf4eb[_0x445068];return _0x234ca9;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index debebba..7ff0412 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 _0xd574=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','describe'];(function(_0xe7a4b5,_0x200412){var _0xe5bb55=function(_0x3ab258){while(--_0x3ab258){_0xe7a4b5['push'](_0xe7a4b5['shift']());}};_0xe5bb55(++_0x200412);}(_0xd574,0x18b));var _0x4d57=function(_0x4074ea,_0x2a0627){_0x4074ea=_0x4074ea-0x0;var _0x1bb15d=_0xd574[_0x4074ea];return _0x1bb15d;};'use strict';var emlformat=require(_0x4d57('0x0'));var rimraf=require(_0x4d57('0x1'));var zipdir=require(_0x4d57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d57('0x3'));var moment=require(_0x4d57('0x4'));var BPromise=require(_0x4d57('0x5'));var Mustache=require(_0x4d57('0x6'));var util=require(_0x4d57('0x7'));var path=require(_0x4d57('0x8'));var sox=require(_0x4d57('0x9'));var csv=require(_0x4d57('0xa'));var ejs=require(_0x4d57('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d57('0xc'));var squel=require(_0x4d57('0xd'));var crypto=require(_0x4d57('0xe'));var jsforce=require(_0x4d57('0xf'));var deskjs=require(_0x4d57('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4d57('0x11'));var Papa=require('papaparse');var Redis=require(_0x4d57('0x12'));var authService=require(_0x4d57('0x13'));var qs=require(_0x4d57('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d57('0x15'));var logger=require('../../config/logger')(_0x4d57('0x16'));var utils=require(_0x4d57('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4d57('0x18'));var db=require(_0x4d57('0x19'))['db'];function respondWithStatusCode(_0x33840d,_0x42855c){_0x42855c=_0x42855c||0xcc;return function(_0x20b846){if(_0x20b846){return _0x33840d[_0x4d57('0x1a')](_0x42855c);}return _0x33840d[_0x4d57('0x1b')](_0x42855c)['end']();};}function respondWithResult(_0x9b6f66,_0x1ee587){_0x1ee587=_0x1ee587||0xc8;return function(_0x23a102){if(_0x23a102){return _0x9b6f66['status'](_0x1ee587)['json'](_0x23a102);}};}function respondWithFilteredResult(_0x586480,_0x3b2956){return function(_0x20ed64){if(_0x20ed64){var _0x319f5f=typeof _0x3b2956[_0x4d57('0x1c')]==='undefined'&&typeof _0x3b2956[_0x4d57('0x1d')]===_0x4d57('0x1e');var _0x298df0=_0x20ed64[_0x4d57('0x1f')];var _0x41a0af=_0x319f5f?0x0:_0x3b2956[_0x4d57('0x1c')];var _0x84dfbc=_0x319f5f?_0x20ed64['count']:_0x3b2956['offset']+_0x3b2956[_0x4d57('0x1d')];var _0x446005;if(_0x84dfbc>=_0x298df0){_0x84dfbc=_0x298df0;_0x446005=0xc8;}else{_0x446005=0xce;}_0x586480[_0x4d57('0x1b')](_0x446005);return _0x586480[_0x4d57('0x20')](_0x4d57('0x21'),_0x41a0af+'-'+_0x84dfbc+'/'+_0x298df0)['json'](_0x20ed64);}return null;};}function patchUpdates(_0x200ad9){return function(_0x6c097d){try{jsonpatch[_0x4d57('0x22')](_0x6c097d,_0x200ad9,!![]);}catch(_0x135da0){return BPromise[_0x4d57('0x23')](_0x135da0);}return _0x6c097d[_0x4d57('0x24')]();};}function saveUpdates(_0x109352,_0x17cdb8){return function(_0x639625){if(_0x639625){return _0x639625[_0x4d57('0x25')](_0x109352)[_0x4d57('0x26')](function(_0x39d0da){return _0x39d0da;});}return null;};}function removeEntity(_0x16a37d,_0x34c215){return function(_0x5c2dcb){if(_0x5c2dcb){return _0x5c2dcb[_0x4d57('0x27')]()[_0x4d57('0x26')](function(){_0x16a37d[_0x4d57('0x1b')](0xcc)[_0x4d57('0x28')]();});}};}function handleEntityNotFound(_0x1ee597,_0x4017c7){return function(_0x223880){if(!_0x223880){_0x1ee597[_0x4d57('0x1a')](0x194);}return _0x223880;};}function handleError(_0x585649,_0x212a6f){_0x212a6f=_0x212a6f||0x1f4;return function(_0x4c05ad){logger['error'](_0x4c05ad[_0x4d57('0x29')]);if(_0x4c05ad[_0x4d57('0x2a')]){delete _0x4c05ad[_0x4d57('0x2a')];}_0x585649[_0x4d57('0x1b')](_0x212a6f)[_0x4d57('0x2b')](_0x4c05ad);};}exports['index']=function(_0x3d2efc,_0x17f2a3){var _0xa00024={},_0x1909e0={},_0x55e3f4={'count':0x0,'rows':[]};var _0x1a2673=_[_0x4d57('0x2c')](db[_0x4d57('0x2d')][_0x4d57('0x2e')],function(_0x2c99f8){return{'name':_0x2c99f8[_0x4d57('0x2f')],'type':_0x2c99f8[_0x4d57('0x30')][_0x4d57('0x31')]};});_0x1909e0[_0x4d57('0x32')]=_[_0x4d57('0x2c')](_0x1a2673,_0x4d57('0x2a'));_0x1909e0[_0x4d57('0x33')]=_[_0x4d57('0x34')](_0x3d2efc[_0x4d57('0x33')]);_0x1909e0[_0x4d57('0x35')]=_[_0x4d57('0x36')](_0x1909e0[_0x4d57('0x32')],_0x1909e0[_0x4d57('0x33')]);_0xa00024['attributes']=_[_0x4d57('0x36')](_0x1909e0[_0x4d57('0x32')],qs['fields'](_0x3d2efc['query'][_0x4d57('0x37')]));_0xa00024[_0x4d57('0x38')]=_0xa00024[_0x4d57('0x38')][_0x4d57('0x39')]?_0xa00024['attributes']:_0x1909e0[_0x4d57('0x32')];if(!_0x3d2efc['query'][_0x4d57('0x3a')](_0x4d57('0x3b'))){_0xa00024[_0x4d57('0x1d')]=qs[_0x4d57('0x1d')](_0x3d2efc['query']['limit']);_0xa00024[_0x4d57('0x1c')]=qs['offset'](_0x3d2efc[_0x4d57('0x33')]['offset']);}_0xa00024[_0x4d57('0x3c')]=qs[_0x4d57('0x3d')](_0x3d2efc['query'][_0x4d57('0x3d')]);_0xa00024[_0x4d57('0x3e')]=qs[_0x4d57('0x35')](_[_0x4d57('0x3f')](_0x3d2efc[_0x4d57('0x33')],_0x1909e0[_0x4d57('0x35')]),_0x1a2673);if(_0x3d2efc[_0x4d57('0x33')][_0x4d57('0x40')]){_0xa00024[_0x4d57('0x3e')]=_[_0x4d57('0x41')](_0xa00024[_0x4d57('0x3e')],{'$or':_[_0x4d57('0x2c')](_0x1a2673,function(_0x2fabc4){if(_0x2fabc4[_0x4d57('0x30')]!==_0x4d57('0x42')){var _0x167120={};_0x167120[_0x2fabc4[_0x4d57('0x2a')]]={'$like':'%'+_0x3d2efc[_0x4d57('0x33')][_0x4d57('0x40')]+'%'};return _0x167120;}})});}_0xa00024=_[_0x4d57('0x41')]({},_0xa00024,_0x3d2efc['options']);var _0x5d89b5={'where':_0xa00024[_0x4d57('0x3e')]};return db[_0x4d57('0x2d')]['count'](_0x5d89b5)['then'](function(_0x42cab4){_0x55e3f4[_0x4d57('0x1f')]=_0x42cab4;if(_0x3d2efc[_0x4d57('0x33')][_0x4d57('0x43')]){_0xa00024['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x4d57('0x44')](_0xa00024);})['then'](function(_0x72a11){_0x55e3f4[_0x4d57('0x45')]=_0x72a11;return _0x55e3f4;})[_0x4d57('0x26')](respondWithFilteredResult(_0x17f2a3,_0xa00024))[_0x4d57('0x46')](handleError(_0x17f2a3,null));};exports[_0x4d57('0x47')]=function(_0x418ad0,_0x36d113){var _0x114ff2={'raw':!![],'where':{'id':_0x418ad0['params']['id']}},_0x578810={};_0x578810['model']=_['keys'](db[_0x4d57('0x2d')][_0x4d57('0x2e')]);_0x578810[_0x4d57('0x33')]=_['keys'](_0x418ad0[_0x4d57('0x33')]);_0x578810[_0x4d57('0x35')]=_[_0x4d57('0x36')](_0x578810['model'],_0x578810[_0x4d57('0x33')]);_0x114ff2['attributes']=_[_0x4d57('0x36')](_0x578810[_0x4d57('0x32')],qs[_0x4d57('0x37')](_0x418ad0['query'][_0x4d57('0x37')]));_0x114ff2['attributes']=_0x114ff2['attributes'][_0x4d57('0x39')]?_0x114ff2['attributes']:_0x578810[_0x4d57('0x32')];if(_0x418ad0[_0x4d57('0x33')][_0x4d57('0x43')]){_0x114ff2[_0x4d57('0x48')]=[{'all':!![]}];}_0x114ff2=_[_0x4d57('0x41')]({},_0x114ff2,_0x418ad0[_0x4d57('0x49')]);return db[_0x4d57('0x2d')][_0x4d57('0x4a')](_0x114ff2)[_0x4d57('0x26')](handleEntityNotFound(_0x36d113,null))[_0x4d57('0x26')](respondWithResult(_0x36d113,null))['catch'](handleError(_0x36d113,null));};exports[_0x4d57('0x4b')]=function(_0x24262f,_0xaad5f4){return db[_0x4d57('0x2d')][_0x4d57('0x4b')](_0x24262f[_0x4d57('0x4c')],{})[_0x4d57('0x26')](respondWithResult(_0xaad5f4,0xc9))[_0x4d57('0x46')](handleError(_0xaad5f4,null));};exports[_0x4d57('0x25')]=function(_0x9529f5,_0x401a48){if(_0x9529f5[_0x4d57('0x4c')]['id']){delete _0x9529f5['body']['id'];}return db['ChatTransferReport'][_0x4d57('0x4a')]({'where':{'id':_0x9529f5[_0x4d57('0x4d')]['id']}})[_0x4d57('0x26')](handleEntityNotFound(_0x401a48,null))[_0x4d57('0x26')](saveUpdates(_0x9529f5[_0x4d57('0x4c')],null))[_0x4d57('0x26')](respondWithResult(_0x401a48,null))['catch'](handleError(_0x401a48,null));};exports[_0x4d57('0x27')]=function(_0x2e2686,_0x146274){return db['ChatTransferReport'][_0x4d57('0x4a')]({'where':{'id':_0x2e2686[_0x4d57('0x4d')]['id']}})[_0x4d57('0x26')](handleEntityNotFound(_0x146274,null))[_0x4d57('0x26')](removeEntity(_0x146274,null))['catch'](handleError(_0x146274,null));};exports[_0x4d57('0x4e')]=function(_0x2bb32c,_0x402304){return db[_0x4d57('0x2d')][_0x4d57('0x4e')]()[_0x4d57('0x26')](respondWithResult(_0x402304,null))[_0x4d57('0x46')](handleError(_0x402304,null));};
\ No newline at end of file
+var _0x6a49=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','json','undefined','limit','count','offset','status','set','apply','reject','save','update','then','destroy','error','stack','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x44e4e1,_0x5637b2){var _0x300cd2=function(_0x189eeb){while(--_0x189eeb){_0x44e4e1['push'](_0x44e4e1['shift']());}};_0x300cd2(++_0x5637b2);}(_0x6a49,0x176));var _0x96a4=function(_0x4fcd39,_0x13594a){_0x4fcd39=_0x4fcd39-0x0;var _0x151cf0=_0x6a49[_0x4fcd39];return _0x151cf0;};'use strict';var emlformat=require(_0x96a4('0x0'));var rimraf=require(_0x96a4('0x1'));var zipdir=require(_0x96a4('0x2'));var jsonpatch=require(_0x96a4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x96a4('0x4'));var Mustache=require('mustache');var util=require(_0x96a4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x96a4('0x6'));var ejs=require(_0x96a4('0x7'));var fs=require('fs');var fs_extra=require(_0x96a4('0x8'));var _=require(_0x96a4('0x9'));var squel=require(_0x96a4('0xa'));var crypto=require(_0x96a4('0xb'));var jsforce=require(_0x96a4('0xc'));var deskjs=require(_0x96a4('0xd'));var toCsv=require(_0x96a4('0x6'));var querystring=require(_0x96a4('0xe'));var Papa=require(_0x96a4('0xf'));var Redis=require(_0x96a4('0x10'));var authService=require(_0x96a4('0x11'));var qs=require(_0x96a4('0x12'));var as=require(_0x96a4('0x13'));var hardwareService=require(_0x96a4('0x14'));var logger=require(_0x96a4('0x15'))(_0x96a4('0x16'));var utils=require(_0x96a4('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f1356,_0x3ec4d3){_0x3ec4d3=_0x3ec4d3||0xcc;return function(_0x52782e){if(_0x52782e){return _0x4f1356[_0x96a4('0x18')](_0x3ec4d3);}return _0x4f1356['status'](_0x3ec4d3)[_0x96a4('0x19')]();};}function respondWithResult(_0x5178ce,_0x396878){_0x396878=_0x396878||0xc8;return function(_0x99a567){if(_0x99a567){return _0x5178ce['status'](_0x396878)[_0x96a4('0x1a')](_0x99a567);}};}function respondWithFilteredResult(_0xa8e3de,_0x382486){return function(_0x1e58bc){if(_0x1e58bc){var _0x59b65a=typeof _0x382486['offset']===_0x96a4('0x1b')&&typeof _0x382486[_0x96a4('0x1c')]===_0x96a4('0x1b');var _0x13bddc=_0x1e58bc['count'];var _0x28237a=_0x59b65a?0x0:_0x382486['offset'];var _0x296752=_0x59b65a?_0x1e58bc[_0x96a4('0x1d')]:_0x382486[_0x96a4('0x1e')]+_0x382486[_0x96a4('0x1c')];var _0xb55b8b;if(_0x296752>=_0x13bddc){_0x296752=_0x13bddc;_0xb55b8b=0xc8;}else{_0xb55b8b=0xce;}_0xa8e3de[_0x96a4('0x1f')](_0xb55b8b);return _0xa8e3de[_0x96a4('0x20')]('Content-Range',_0x28237a+'-'+_0x296752+'/'+_0x13bddc)[_0x96a4('0x1a')](_0x1e58bc);}return null;};}function patchUpdates(_0x3b875e){return function(_0x5597e0){try{jsonpatch[_0x96a4('0x21')](_0x5597e0,_0x3b875e,!![]);}catch(_0x138936){return BPromise[_0x96a4('0x22')](_0x138936);}return _0x5597e0[_0x96a4('0x23')]();};}function saveUpdates(_0x5d1941,_0x5e989c){return function(_0x34efbc){if(_0x34efbc){return _0x34efbc[_0x96a4('0x24')](_0x5d1941)[_0x96a4('0x25')](function(_0x3f026b){return _0x3f026b;});}return null;};}function removeEntity(_0xba7c2f,_0x5a5bbd){return function(_0x5def61){if(_0x5def61){return _0x5def61[_0x96a4('0x26')]()[_0x96a4('0x25')](function(){_0xba7c2f[_0x96a4('0x1f')](0xcc)[_0x96a4('0x19')]();});}};}function handleEntityNotFound(_0x160cd3,_0x3a3990){return function(_0x4bb7d3){if(!_0x4bb7d3){_0x160cd3[_0x96a4('0x18')](0x194);}return _0x4bb7d3;};}function handleError(_0x38ffa4,_0x52e326){_0x52e326=_0x52e326||0x1f4;return function(_0x446197){logger[_0x96a4('0x27')](_0x446197[_0x96a4('0x28')]);if(_0x446197['name']){delete _0x446197['name'];}_0x38ffa4[_0x96a4('0x1f')](_0x52e326)[_0x96a4('0x29')](_0x446197);};}exports[_0x96a4('0x2a')]=function(_0x1a539f,_0x1fba24){var _0x4a797c={},_0x4aad83={},_0x50d2a2={'count':0x0,'rows':[]};var _0x58b022=_[_0x96a4('0x2b')](db[_0x96a4('0x2c')][_0x96a4('0x2d')],function(_0x12fa4c){return{'name':_0x12fa4c[_0x96a4('0x2e')],'type':_0x12fa4c['type'][_0x96a4('0x2f')]};});_0x4aad83[_0x96a4('0x30')]=_['map'](_0x58b022,_0x96a4('0x31'));_0x4aad83[_0x96a4('0x32')]=_[_0x96a4('0x33')](_0x1a539f[_0x96a4('0x32')]);_0x4aad83[_0x96a4('0x34')]=_[_0x96a4('0x35')](_0x4aad83[_0x96a4('0x30')],_0x4aad83[_0x96a4('0x32')]);_0x4a797c[_0x96a4('0x36')]=_[_0x96a4('0x35')](_0x4aad83[_0x96a4('0x30')],qs[_0x96a4('0x37')](_0x1a539f[_0x96a4('0x32')][_0x96a4('0x37')]));_0x4a797c[_0x96a4('0x36')]=_0x4a797c[_0x96a4('0x36')][_0x96a4('0x38')]?_0x4a797c['attributes']:_0x4aad83[_0x96a4('0x30')];if(!_0x1a539f[_0x96a4('0x32')]['hasOwnProperty'](_0x96a4('0x39'))){_0x4a797c[_0x96a4('0x1c')]=qs['limit'](_0x1a539f['query'][_0x96a4('0x1c')]);_0x4a797c['offset']=qs[_0x96a4('0x1e')](_0x1a539f['query']['offset']);}_0x4a797c[_0x96a4('0x3a')]=qs['sort'](_0x1a539f[_0x96a4('0x32')][_0x96a4('0x3b')]);_0x4a797c['where']=qs[_0x96a4('0x34')](_[_0x96a4('0x3c')](_0x1a539f['query'],_0x4aad83[_0x96a4('0x34')]),_0x58b022);if(_0x1a539f[_0x96a4('0x32')][_0x96a4('0x3d')]){_0x4a797c[_0x96a4('0x3e')]=_['merge'](_0x4a797c[_0x96a4('0x3e')],{'$or':_[_0x96a4('0x2b')](_0x58b022,function(_0x5aa2fa){if(_0x5aa2fa[_0x96a4('0x3f')]!==_0x96a4('0x40')){var _0x2fe685={};_0x2fe685[_0x5aa2fa[_0x96a4('0x31')]]={'$like':'%'+_0x1a539f['query'][_0x96a4('0x3d')]+'%'};return _0x2fe685;}})});}_0x4a797c=_[_0x96a4('0x41')]({},_0x4a797c,_0x1a539f[_0x96a4('0x42')]);var _0x273dcb={'where':_0x4a797c['where']};return db[_0x96a4('0x2c')][_0x96a4('0x1d')](_0x273dcb)[_0x96a4('0x25')](function(_0x49737f){_0x50d2a2[_0x96a4('0x1d')]=_0x49737f;if(_0x1a539f['query'][_0x96a4('0x43')]){_0x4a797c[_0x96a4('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x96a4('0x45')](_0x4a797c);})['then'](function(_0x3858a8){_0x50d2a2['rows']=_0x3858a8;return _0x50d2a2;})[_0x96a4('0x25')](respondWithFilteredResult(_0x1fba24,_0x4a797c))[_0x96a4('0x46')](handleError(_0x1fba24,null));};exports[_0x96a4('0x47')]=function(_0x334149,_0x1a2658){var _0x317a97={'raw':!![],'where':{'id':_0x334149[_0x96a4('0x48')]['id']}},_0x47e8a0={};_0x47e8a0[_0x96a4('0x30')]=_[_0x96a4('0x33')](db[_0x96a4('0x2c')][_0x96a4('0x2d')]);_0x47e8a0['query']=_['keys'](_0x334149[_0x96a4('0x32')]);_0x47e8a0[_0x96a4('0x34')]=_[_0x96a4('0x35')](_0x47e8a0['model'],_0x47e8a0['query']);_0x317a97[_0x96a4('0x36')]=_[_0x96a4('0x35')](_0x47e8a0['model'],qs[_0x96a4('0x37')](_0x334149[_0x96a4('0x32')][_0x96a4('0x37')]));_0x317a97[_0x96a4('0x36')]=_0x317a97[_0x96a4('0x36')][_0x96a4('0x38')]?_0x317a97[_0x96a4('0x36')]:_0x47e8a0[_0x96a4('0x30')];if(_0x334149['query']['includeAll']){_0x317a97[_0x96a4('0x44')]=[{'all':!![]}];}_0x317a97=_['merge']({},_0x317a97,_0x334149[_0x96a4('0x42')]);return db['ChatTransferReport'][_0x96a4('0x49')](_0x317a97)[_0x96a4('0x25')](handleEntityNotFound(_0x1a2658,null))['then'](respondWithResult(_0x1a2658,null))[_0x96a4('0x46')](handleError(_0x1a2658,null));};exports[_0x96a4('0x4a')]=function(_0x52115f,_0x52b87c){return db['ChatTransferReport'][_0x96a4('0x4a')](_0x52115f['body'],{})['then'](respondWithResult(_0x52b87c,0xc9))[_0x96a4('0x46')](handleError(_0x52b87c,null));};exports[_0x96a4('0x24')]=function(_0x50985b,_0x41fb0b){if(_0x50985b[_0x96a4('0x4b')]['id']){delete _0x50985b['body']['id'];}return db[_0x96a4('0x2c')][_0x96a4('0x49')]({'where':{'id':_0x50985b[_0x96a4('0x48')]['id']}})[_0x96a4('0x25')](handleEntityNotFound(_0x41fb0b,null))[_0x96a4('0x25')](saveUpdates(_0x50985b[_0x96a4('0x4b')],null))[_0x96a4('0x25')](respondWithResult(_0x41fb0b,null))[_0x96a4('0x46')](handleError(_0x41fb0b,null));};exports['destroy']=function(_0x4ae79b,_0x1f4c72){return db[_0x96a4('0x2c')]['find']({'where':{'id':_0x4ae79b[_0x96a4('0x48')]['id']}})[_0x96a4('0x25')](handleEntityNotFound(_0x1f4c72,null))[_0x96a4('0x25')](removeEntity(_0x1f4c72,null))['catch'](handleError(_0x1f4c72,null));};exports[_0x96a4('0x4c')]=function(_0x316663,_0x5c79bd){return db[_0x96a4('0x2c')][_0x96a4('0x4c')]()[_0x96a4('0x25')](respondWithResult(_0x5c79bd,null))['catch'](handleError(_0x5c79bd,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 992942d..652ce15 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 _0x0e5e=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer'];(function(_0x13aa15,_0x54e773){var _0x4fba46=function(_0x502698){while(--_0x502698){_0x13aa15['push'](_0x13aa15['shift']());}};_0x4fba46(++_0x54e773);}(_0x0e5e,0xef));var _0xe0e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e5e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe0e5('0x0'));var util=require(_0xe0e5('0x1'));var logger=require(_0xe0e5('0x2'))(_0xe0e5('0x3'));var moment=require(_0xe0e5('0x4'));var BPromise=require(_0xe0e5('0x5'));var rp=require(_0xe0e5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0e5('0x7'));var config=require(_0xe0e5('0x8'));var attributes=require(_0xe0e5('0x9'));module[_0xe0e5('0xa')]=function(_0xd70a03,_0x1a2337){return _0xd70a03['define'](_0xe0e5('0xb'),attributes,{'tableName':_0xe0e5('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe0e5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbcca=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xbcca,0x1cd));var _0xabcc=function(_0xb1fcde,_0x1a23ea){_0xb1fcde=_0xb1fcde-0x0;var _0x175df2=_0xbcca[_0xb1fcde];return _0x175df2;};'use strict';var _=require(_0xabcc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xabcc('0x1'));var moment=require(_0xabcc('0x2'));var BPromise=require(_0xabcc('0x3'));var rp=require(_0xabcc('0x4'));var fs=require('fs');var path=require(_0xabcc('0x5'));var rimraf=require('rimraf');var config=require(_0xabcc('0x6'));var attributes=require(_0xabcc('0x7'));module[_0xabcc('0x8')]=function(_0x35ffe2,_0x1e3593){return _0x35ffe2[_0xabcc('0x9')](_0xabcc('0xa'),attributes,{'tableName':_0xabcc('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 6aa6de5..72222ad 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 _0x07be=['jayson/promise','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4bfbae,_0x2f3d5c){var _0x28a223=function(_0x445d55){while(--_0x445d55){_0x4bfbae['push'](_0x4bfbae['shift']());}};_0x28a223(++_0x2f3d5c);}(_0x07be,0x1db));var _0xe07b=function(_0x1119a2,_0x31d95b){_0x1119a2=_0x1119a2-0x0;var _0x1e633a=_0x07be[_0x1119a2];return _0x1e633a;};'use strict';var _=require(_0xe07b('0x0'));var util=require(_0xe07b('0x1'));var moment=require('moment');var BPromise=require(_0xe07b('0x2'));var rs=require(_0xe07b('0x3'));var fs=require('fs');var Redis=require(_0xe07b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe07b('0x5'));var logger=require(_0xe07b('0x6'))(_0xe07b('0x7'));var config=require(_0xe07b('0x8'));var jayson=require(_0xe07b('0x9'));var client=jayson['client'][_0xe07b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x342d14,_0x2c61d5,_0xae23e7){return new BPromise(function(_0x483b79,_0x5a55be){return client[_0xe07b('0xb')](_0x342d14,_0xae23e7)[_0xe07b('0xc')](function(_0x236f12){logger[_0xe07b('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x2c61d5,_0xe07b('0xe'));logger[_0xe07b('0xf')](_0xe07b('0x10'),_0x2c61d5,_0xe07b('0xe'),JSON['stringify'](_0x236f12));if(_0x236f12[_0xe07b('0x11')]){if(_0x236f12[_0xe07b('0x11')][_0xe07b('0x12')]===0x1f4){logger['error'](_0xe07b('0x13'),_0x2c61d5,_0x236f12[_0xe07b('0x11')]['message']);return _0x5a55be(_0x236f12[_0xe07b('0x11')][_0xe07b('0x14')]);}logger[_0xe07b('0x11')](_0xe07b('0x13'),_0x2c61d5,_0x236f12[_0xe07b('0x11')][_0xe07b('0x14')]);return _0x483b79(_0x236f12['error']['message']);}else{logger[_0xe07b('0xd')](_0xe07b('0x13'),_0x2c61d5,_0xe07b('0xe'));_0x483b79(_0x236f12[_0xe07b('0x15')][_0xe07b('0x14')]);}})['catch'](function(_0x346515){logger[_0xe07b('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x2c61d5,_0x346515);_0x5a55be(_0x346515);});});}
\ No newline at end of file
+var _0x7efc=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18b027,_0x4d0486){var _0x19643f=function(_0x36753b){while(--_0x36753b){_0x18b027['push'](_0x18b027['shift']());}};_0x19643f(++_0x4d0486);}(_0x7efc,0x180));var _0xc7ef=function(_0x280c4b,_0xfe785d){_0x280c4b=_0x280c4b-0x0;var _0x2a5e90=_0x7efc[_0x280c4b];return _0x2a5e90;};'use strict';var _=require(_0xc7ef('0x0'));var util=require(_0xc7ef('0x1'));var moment=require(_0xc7ef('0x2'));var BPromise=require(_0xc7ef('0x3'));var rs=require(_0xc7ef('0x4'));var fs=require('fs');var Redis=require(_0xc7ef('0x5'));var db=require(_0xc7ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc7ef('0x7'));var config=require(_0xc7ef('0x8'));var jayson=require(_0xc7ef('0x9'));var client=jayson[_0xc7ef('0xa')][_0xc7ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36fb25,_0x278d32,_0x2729c2){return new BPromise(function(_0x4fc9bf,_0x2a7701){return client['request'](_0x36fb25,_0x2729c2)[_0xc7ef('0xc')](function(_0x3ba427){logger[_0xc7ef('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x278d32,_0xc7ef('0xe'));logger[_0xc7ef('0xf')](_0xc7ef('0x10'),_0x278d32,_0xc7ef('0xe'),JSON[_0xc7ef('0x11')](_0x3ba427));if(_0x3ba427[_0xc7ef('0x12')]){if(_0x3ba427[_0xc7ef('0x12')]['code']===0x1f4){logger['error'](_0xc7ef('0x13'),_0x278d32,_0x3ba427[_0xc7ef('0x12')][_0xc7ef('0x14')]);return _0x2a7701(_0x3ba427[_0xc7ef('0x12')][_0xc7ef('0x14')]);}logger[_0xc7ef('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x278d32,_0x3ba427['error'][_0xc7ef('0x14')]);return _0x4fc9bf(_0x3ba427['error'][_0xc7ef('0x14')]);}else{logger['info'](_0xc7ef('0x13'),_0x278d32,_0xc7ef('0xe'));_0x4fc9bf(_0x3ba427[_0xc7ef('0x15')][_0xc7ef('0x14')]);}})[_0xc7ef('0x16')](function(_0x5563a0){logger[_0xc7ef('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x278d32,_0x5563a0);_0x2a7701(_0x5563a0);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 06d9d25..178d7e9 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 _0xf68a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf68a,0x66));var _0xaf68=function(_0x477d6e,_0x15001b){_0x477d6e=_0x477d6e-0x0;var _0x151daf=_0xf68a[_0x477d6e];return _0x151daf;};'use strict';var multer=require(_0xaf68('0x0'));var util=require(_0xaf68('0x1'));var path=require(_0xaf68('0x2'));var timeout=require(_0xaf68('0x3'));var express=require('express');var router=express[_0xaf68('0x4')]();var fs_extra=require(_0xaf68('0x5'));var auth=require(_0xaf68('0x6'));var interaction=require(_0xaf68('0x7'));var config=require(_0xaf68('0x8'));var controller=require('./chatTransferReport.controller');router[_0xaf68('0x9')]('/',auth['isAuthenticated'](),controller[_0xaf68('0xa')]);router['get'](_0xaf68('0xb'),auth[_0xaf68('0xc')](),controller[_0xaf68('0xd')]);router['get'](_0xaf68('0xe'),auth[_0xaf68('0xc')](),controller['show']);router[_0xaf68('0xf')]('/',auth['isAuthenticated'](),controller[_0xaf68('0x10')]);router[_0xaf68('0x11')](_0xaf68('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xaf68('0x12')](_0xaf68('0xe'),auth[_0xaf68('0xc')](),controller[_0xaf68('0x13')]);module[_0xaf68('0x14')]=router;
\ No newline at end of file
+var _0x8e2b=['index','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x502ed1,_0xd79589){var _0x3dd009=function(_0x41d675){while(--_0x41d675){_0x502ed1['push'](_0x502ed1['shift']());}};_0x3dd009(++_0xd79589);}(_0x8e2b,0x95));var _0xb8e2=function(_0x3e522f,_0x5c7a86){_0x3e522f=_0x3e522f-0x0;var _0x289067=_0x8e2b[_0x3e522f];return _0x289067;};'use strict';var multer=require(_0xb8e2('0x0'));var util=require('util');var path=require(_0xb8e2('0x1'));var timeout=require(_0xb8e2('0x2'));var express=require(_0xb8e2('0x3'));var router=express[_0xb8e2('0x4')]();var fs_extra=require(_0xb8e2('0x5'));var auth=require(_0xb8e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb8e2('0x7'));var controller=require(_0xb8e2('0x8'));router[_0xb8e2('0x9')]('/',auth[_0xb8e2('0xa')](),controller[_0xb8e2('0xb')]);router[_0xb8e2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb8e2('0xc')]);router['get'](_0xb8e2('0xd'),auth[_0xb8e2('0xa')](),controller[_0xb8e2('0xe')]);router[_0xb8e2('0xf')]('/',auth[_0xb8e2('0xa')](),controller[_0xb8e2('0x10')]);router['put'](_0xb8e2('0xd'),auth[_0xb8e2('0xa')](),controller[_0xb8e2('0x11')]);router[_0xb8e2('0x12')](_0xb8e2('0xd'),auth[_0xb8e2('0xa')](),controller[_0xb8e2('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 22f5da4..eedee10 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 _0xd60e=['onlineForm','Comments','offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','INTEGER','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','thumb','stringify','input','name','getDataValue'];(function(_0x3c5916,_0x90a4f4){var _0x5575af=function(_0x1f0e66){while(--_0x1f0e66){_0x3c5916['push'](_0x3c5916['shift']());}};_0x5575af(++_0x90a4f4);}(_0xd60e,0x180));var _0xed60=function(_0x52989a,_0x7cee7c){_0x52989a=_0x52989a-0x0;var _0x316d89=_0xd60e[_0x52989a];return _0x316d89;};'use strict';var Sequelize=require(_0xed60('0x0'));var rs=require(_0xed60('0x1'));module[_0xed60('0x2')]={'name':{'type':Sequelize[_0xed60('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xed60('0x3')],'allowNull':![],'unique':_0xed60('0x4')},'description':{'type':Sequelize[_0xed60('0x3')]},'mapKey':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xed60('0x5')},'key':{'type':Sequelize[_0xed60('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x6')},'customerAlias':{'type':Sequelize[_0xed60('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xed60('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xed60('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xed60('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xed60('0x3')]},'animation':{'type':Sequelize[_0xed60('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xed60('0x9')),'defaultValue':_0xed60('0xa')},'header_online':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0xb')},'start_chat_button':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0xc')},'offline_chat_button':{'type':Sequelize[_0xed60('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xed60('0xd')},'download_transcript':{'type':Sequelize[_0xed60('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xed60('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xed60('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xed60('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xed60('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xed60('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x11')},'noteTitle':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x12')},'placeholderMessage':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x13')},'closingMessage':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x14')},'closingMessageButton':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xed60('0x16')},'conditionAgreement':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xed60('0x17')},'ratingType':{'type':Sequelize[_0xed60('0x18')]('star',_0xed60('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xed60('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xed60('0xe')],'defaultValue':function(){return JSON[_0xed60('0x1a')]({'items':[{'type':_0xed60('0x1b'),'variable':null,'config':{'placeholder':_0xed60('0x1c'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xed60('0x1b'),'props':{'title':_0xed60('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xed60('0x5'),'type':_0xed60('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xed60('0x1d')](_0xed60('0x1e'))?JSON['parse'](this[_0xed60('0x1d')](_0xed60('0x1e'))):{};},'set':function(_0x5b97a0){return this['setDataValue']('onlineForm',JSON[_0xed60('0x1a')](_0x5b97a0));}},'offlineForm':{'type':Sequelize[_0xed60('0xe')],'defaultValue':function(){return JSON[_0xed60('0x1a')]({'items':[{'type':_0xed60('0x1b'),'props':{'title':_0xed60('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xed60('0x5'),'type':_0xed60('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xed60('0x1f')},'props':{'title':_0xed60('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xed60('0x1d')](_0xed60('0x20'))?JSON['parse'](this[_0xed60('0x1d')]('offlineForm')):{};},'set':function(_0x4ffbad){return this[_0xed60('0x21')](_0xed60('0x20'),JSON['stringify'](_0x4ffbad));}},'token':{'type':Sequelize[_0xed60('0x3')],'defaultValue':function(){return rs[_0xed60('0x22')]();}},'autoclose':{'type':Sequelize[_0xed60('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xed60('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x24')},'offlineMessageBody':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xed60('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xed60('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x16')},'sendUnmanaged':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x15')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xed60('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xed60('0xe')],'defaultValue':function(){return _0xed60('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xed60('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xed60('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xed60('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xed60('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xed60('0x3')],'defaultValue':_0xed60('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xed60('0xe')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xed60('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xed60('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xed60('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xed60('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xed60('0x7')],'comment':_0xed60('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xed60('0x2b'),'set':function(_0x60be0a){if(!_0x60be0a)this['setDataValue'](_0xed60('0x2c'),null);this[_0xed60('0x21')](_0xed60('0x2d'),_0x60be0a);}},'vidaooEscalation':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xed60('0x3')]},'vidaooTopic':{'type':Sequelize[_0xed60('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xed60('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xed60('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xed60('0xe')]}};
\ No newline at end of file
+var _0x09b6=['website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','address','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','TEXT','stringify','name','text','email','getDataValue','onlineForm','parse','setDataValue','input','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x17a0a0,_0x1befaa){var _0x4da752=function(_0x429829){while(--_0x429829){_0x17a0a0['push'](_0x17a0a0['shift']());}};_0x4da752(++_0x1befaa);}(_0x09b6,0x121));var _0x609b=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0x09b6[_0x539533];return _0x3942f3;};'use strict';var Sequelize=require(_0x609b('0x0'));var rs=require('randomstring');module[_0x609b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'unique':_0x609b('0x3')},'description':{'type':Sequelize[_0x609b('0x2')]},'mapKey':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x609b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':_0x609b('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':_0x609b('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':_0x609b('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x609b('0x8')](_0x609b('0x9'),_0x609b('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xc')},'header_offline':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xd')},'download_transcript':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x10')},'noteTitle':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x11')},'placeholderMessage':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x12')},'closingMessageButton':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x609b('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x609b('0x8')](_0x609b('0x14'),_0x609b('0x15')),'defaultValue':_0x609b('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x609b('0x16')],'defaultValue':function(){return JSON[_0x609b('0x17')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x609b('0x18'),'type':_0x609b('0x19'),'required':!![]},'props':{'title':_0x609b('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x609b('0x1a'),'helpText':''},'config':{'required':!![],'placeholder':_0x609b('0x1a'),'type':_0x609b('0x1a')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x609b('0x1b')](_0x609b('0x1c'))?JSON[_0x609b('0x1d')](this[_0x609b('0x1b')](_0x609b('0x1c'))):{};},'set':function(_0x23c8c6){return this[_0x609b('0x1e')]('onlineForm',JSON[_0x609b('0x17')](_0x23c8c6));}},'offlineForm':{'type':Sequelize[_0x609b('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x609b('0x1f'),'props':{'title':_0x609b('0x1a'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x609b('0x1a')},'variable':null},{'type':'textarea','config':{'placeholder':_0x609b('0x20')},'props':{'title':_0x609b('0x20'),'helpText':_0x609b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x609b('0x1b')]('offlineForm')?JSON['parse'](this[_0x609b('0x1b')](_0x609b('0x22'))):{};},'set':function(_0xc5ee97){return this[_0x609b('0x1e')]('offlineForm',JSON[_0x609b('0x17')](_0xc5ee97));}},'token':{'type':Sequelize[_0x609b('0x2')],'defaultValue':function(){return rs[_0x609b('0x23')]();}},'autoclose':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x609b('0x2')]},'forwardOffline':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x609b('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x609b('0x26')},'skipUnmanaged':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x13')},'sendUnmanaged':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x609b('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x609b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x609b('0x16')],'defaultValue':function(){return _0x609b('0x27');}},'notificationSound':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x28')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x29')},'verticalAlignment':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x2a')},'defaultTitle':{'type':Sequelize[_0x609b('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x609b('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x609b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x2c')},'systemAvatar':{'type':Sequelize[_0x609b('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x609b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x272290){if(!_0x272290)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x609b('0x1e')](_0x609b('0x2e'),_0x272290);}},'vidaooEscalation':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x609b('0x2')]},'vidaooTopic':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x609b('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index fc95c64..bf8098c 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 _0x960f=['removeAnswers','ids','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','notify','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','Applications','List','account','applications','list','orderBy','asc','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','spread','utf8','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','increment','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','render','alignment','verticalAlignment','backgroundColor','addApplications','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','rimraf','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','merge','options','include','findAll','rows','show','intersection','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','create','getDispositions','findOne','pick','filter','includeAll','removeDispositions','CannedAnswer','order'];(function(_0x767aa3,_0x3b82b1){var _0x39bf0f=function(_0x5f2bf8){while(--_0x5f2bf8){_0x767aa3['push'](_0x767aa3['shift']());}};_0x39bf0f(++_0x3b82b1);}(_0x960f,0xc7));var _0xf960=function(_0x40f991,_0x576819){_0x40f991=_0x40f991-0x0;var _0x38eca2=_0x960f[_0x40f991];return _0x38eca2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf960('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf960('0x1'));var rp=require('request-promise');var moment=require(_0xf960('0x2'));var BPromise=require(_0xf960('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf960('0x4'));var csv=require(_0xf960('0x5'));var ejs=require(_0xf960('0x6'));var fs=require('fs');var fs_extra=require(_0xf960('0x7'));var _=require(_0xf960('0x8'));var squel=require(_0xf960('0x9'));var crypto=require('crypto');var jsforce=require(_0xf960('0xa'));var deskjs=require(_0xf960('0xb'));var toCsv=require(_0xf960('0x5'));var querystring=require(_0xf960('0xc'));var Papa=require(_0xf960('0xd'));var Redis=require(_0xf960('0xe'));var authService=require(_0xf960('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf960('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf960('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xf960('0x12'));var db=require(_0xf960('0x13'))['db'];config[_0xf960('0x14')]=_[_0xf960('0x15')](config['redis'],{'host':_0xf960('0x16'),'port':0x18eb});var socket=require(_0xf960('0x17'))(new Redis(config[_0xf960('0x14')]));require(_0xf960('0x18'))[_0xf960('0x19')](socket);var jayson=require(_0xf960('0x1a'));var client=jayson[_0xf960('0x1b')][_0xf960('0x1c')]({'port':0x232c});var client9002=jayson[_0xf960('0x1b')]['http']({'port':0x232a});var client9003=jayson[_0xf960('0x1b')][_0xf960('0x1c')]({'port':0x232b});var client9001=jayson[_0xf960('0x1b')]['http']({'port':0x2329});function respondWithRpcPromise(_0xd9b88b,_0x18726a,_0x228ae0,_0x3b0bf6){return new BPromise(function(_0x327d0b,_0x3029e2){var _0x513677=_0x3b0bf6||client;return _0x513677[_0xf960('0x1d')](_0xd9b88b,_0x228ae0)[_0xf960('0x1e')](function(_0x53bff0){logger[_0xf960('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x18726a,_0xf960('0x20'));logger[_0xf960('0x21')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x18726a,_0xf960('0x20'),JSON[_0xf960('0x22')](_0x53bff0));if(_0x53bff0['error']){if(_0x53bff0[_0xf960('0x23')]['code']===0x1f4){logger[_0xf960('0x23')](_0xf960('0x24'),_0x18726a,_0x53bff0[_0xf960('0x23')]['message']);return _0x3029e2(_0x53bff0[_0xf960('0x23')][_0xf960('0x25')]);}logger[_0xf960('0x23')](_0xf960('0x24'),_0x18726a,_0x53bff0['error'][_0xf960('0x25')]);return _0x327d0b(_0x53bff0[_0xf960('0x23')]['message']);}else{logger[_0xf960('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x18726a,'request\x20sent');_0x327d0b(_0x53bff0[_0xf960('0x26')][_0xf960('0x25')]);}})[_0xf960('0x27')](function(_0x2ce86c){logger[_0xf960('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x18726a,_0x2ce86c);_0x3029e2(_0x2ce86c);});});}function respondWithStatusCode(_0x209ff0,_0x26440f){_0x26440f=_0x26440f||0xcc;return function(_0x1e945b){if(_0x1e945b){return _0x209ff0['sendStatus'](_0x26440f);}return _0x209ff0[_0xf960('0x28')](_0x26440f)[_0xf960('0x29')]();};}function respondWithResult(_0x3fe388,_0x29e7ac){_0x29e7ac=_0x29e7ac||0xc8;return function(_0x5741ef){if(_0x5741ef){return _0x3fe388[_0xf960('0x28')](_0x29e7ac)['json'](_0x5741ef);}};}function respondWithFilteredResult(_0x3263d5,_0x2697c1){return function(_0x240951){if(_0x240951){var _0xc7adca=typeof _0x2697c1[_0xf960('0x2a')]===_0xf960('0x2b')&&typeof _0x2697c1[_0xf960('0x2c')]===_0xf960('0x2b');var _0x5dc6d1=_0x240951[_0xf960('0x2d')];var _0x1dcb7d=_0xc7adca?0x0:_0x2697c1[_0xf960('0x2a')];var _0x127d34=_0xc7adca?_0x240951['count']:_0x2697c1[_0xf960('0x2a')]+_0x2697c1[_0xf960('0x2c')];var _0x199f78;if(_0x127d34>=_0x5dc6d1){_0x127d34=_0x5dc6d1;_0x199f78=0xc8;}else{_0x199f78=0xce;}_0x3263d5[_0xf960('0x28')](_0x199f78);return _0x3263d5['set'](_0xf960('0x2e'),_0x1dcb7d+'-'+_0x127d34+'/'+_0x5dc6d1)[_0xf960('0x2f')](_0x240951);}return null;};}function patchUpdates(_0x15b692){return function(_0x519abc){try{jsonpatch['apply'](_0x519abc,_0x15b692,!![]);}catch(_0x9efc33){return BPromise[_0xf960('0x30')](_0x9efc33);}return _0x519abc[_0xf960('0x31')]();};}function saveUpdates(_0x4baba1,_0x554400){return function(_0x4e4b71){if(_0x4e4b71){return _0x4e4b71[_0xf960('0x32')](_0x4baba1)[_0xf960('0x1e')](function(_0x3dd7f2){return _0x3dd7f2;});}return null;};}function removeEntity(_0x21ab8b,_0x524a95){return function(_0x4ebbbb){if(_0x4ebbbb){return _0x4ebbbb[_0xf960('0x33')]()[_0xf960('0x1e')](function(){var _0x26b47a=_0x4ebbbb[_0xf960('0x34')]({'plain':!![]});var _0x305fe9=_0xf960('0x35');return db[_0xf960('0x36')][_0xf960('0x33')]({'where':{'type':_0x305fe9,'resourceId':_0x26b47a['id']}})[_0xf960('0x1e')](function(){return _0x4ebbbb;});})['then'](function(){_0x21ab8b['status'](0xcc)[_0xf960('0x29')]();});}};}function handleEntityNotFound(_0x560635,_0x3b1f2e){return function(_0x590b29){if(!_0x590b29){_0x560635[_0xf960('0x37')](0x194);}return _0x590b29;};}function handleError(_0x4bd210,_0x471fb3){_0x471fb3=_0x471fb3||0x1f4;return function(_0x1bb02f){logger[_0xf960('0x23')](_0x1bb02f[_0xf960('0x38')]);if(_0x1bb02f[_0xf960('0x39')]){delete _0x1bb02f[_0xf960('0x39')];}_0x4bd210[_0xf960('0x28')](_0x471fb3)[_0xf960('0x3a')](_0x1bb02f);};}exports[_0xf960('0x3b')]=function(_0x1bc376,_0x5ba98c){var _0x3e1c03={'include':[{'model':db['Pause'],'as':_0xf960('0x3c')}]},_0x5ab036={},_0x479135={'count':0x0,'rows':[]};var _0x3120e5=_['map'](db[_0xf960('0x3d')][_0xf960('0x3e')],function(_0x3fe149){return{'name':_0x3fe149['fieldName'],'type':_0x3fe149['type'][_0xf960('0x3f')]};});_0x5ab036[_0xf960('0x40')]=_[_0xf960('0x41')](_0x3120e5,_0xf960('0x39'));_0x5ab036[_0xf960('0x42')]=_[_0xf960('0x43')](_0x1bc376[_0xf960('0x42')]);_0x5ab036[_0xf960('0x44')]=_['intersection'](_0x5ab036[_0xf960('0x40')],_0x5ab036[_0xf960('0x42')]);_0x3e1c03['attributes']=_['intersection'](_0x5ab036[_0xf960('0x40')],qs[_0xf960('0x45')](_0x1bc376[_0xf960('0x42')][_0xf960('0x45')]));_0x3e1c03[_0xf960('0x46')]=_0x3e1c03[_0xf960('0x46')][_0xf960('0x47')]?_0x3e1c03[_0xf960('0x46')]:_0x5ab036[_0xf960('0x40')];if(!_0x1bc376[_0xf960('0x42')][_0xf960('0x48')](_0xf960('0x49'))){_0x3e1c03['limit']=qs['limit'](_0x1bc376['query'][_0xf960('0x2c')]);_0x3e1c03[_0xf960('0x2a')]=qs[_0xf960('0x2a')](_0x1bc376[_0xf960('0x42')][_0xf960('0x2a')]);}_0x3e1c03['order']=qs['sort'](_0x1bc376[_0xf960('0x42')][_0xf960('0x4a')]);_0x3e1c03[_0xf960('0x4b')]=qs['filters'](_['pick'](_0x1bc376[_0xf960('0x42')],_0x5ab036[_0xf960('0x44')]),_0x3120e5);if(_0x1bc376[_0xf960('0x42')]['filter']){_0x3e1c03[_0xf960('0x4b')]=_['merge'](_0x3e1c03[_0xf960('0x4b')],{'$or':_[_0xf960('0x41')](_0x3120e5,function(_0x4122e0){if(_0x4122e0[_0xf960('0x4c')]!==_0xf960('0x4d')){var _0x14d3f8={};_0x14d3f8[_0x4122e0[_0xf960('0x39')]]={'$like':'%'+_0x1bc376[_0xf960('0x42')]['filter']+'%'};return _0x14d3f8;}})});}_0x3e1c03=_[_0xf960('0x4e')]({},_0x3e1c03,_0x1bc376[_0xf960('0x4f')]);var _0x7a0e13={'where':_0x3e1c03['where']};return db[_0xf960('0x3d')][_0xf960('0x2d')](_0x7a0e13)[_0xf960('0x1e')](function(_0x2c9c24){_0x479135[_0xf960('0x2d')]=_0x2c9c24;if(_0x1bc376['query']['includeAll']){_0x3e1c03[_0xf960('0x50')]=[{'all':!![]}];}return db['ChatWebsite'][_0xf960('0x51')](_0x3e1c03);})[_0xf960('0x1e')](function(_0x1cef87){_0x479135[_0xf960('0x52')]=_0x1cef87;return _0x479135;})[_0xf960('0x1e')](respondWithFilteredResult(_0x5ba98c,_0x3e1c03))['catch'](handleError(_0x5ba98c,null));};exports[_0xf960('0x53')]=function(_0x59ef84,_0x4c7f39){var _0x1e5b8b={'raw':![],'where':{'id':_0x59ef84['params']['id']},'include':[{'model':db['Pause'],'as':_0xf960('0x3c')}]},_0x295318={};_0x295318[_0xf960('0x40')]=_[_0xf960('0x43')](db[_0xf960('0x3d')][_0xf960('0x3e')]);_0x295318[_0xf960('0x42')]=_[_0xf960('0x43')](_0x59ef84[_0xf960('0x42')]);_0x295318[_0xf960('0x44')]=_['intersection'](_0x295318[_0xf960('0x40')],_0x295318[_0xf960('0x42')]);_0x1e5b8b['attributes']=_[_0xf960('0x54')](_0x295318[_0xf960('0x40')],qs[_0xf960('0x45')](_0x59ef84[_0xf960('0x42')]['fields']));_0x1e5b8b[_0xf960('0x46')]=_0x1e5b8b[_0xf960('0x46')][_0xf960('0x47')]?_0x1e5b8b[_0xf960('0x46')]:_0x295318[_0xf960('0x40')];if(_0x59ef84[_0xf960('0x42')]['includeAll']){_0x1e5b8b[_0xf960('0x50')]=[{'all':!![]}];}_0x1e5b8b=_['merge']({},_0x1e5b8b,_0x59ef84[_0xf960('0x4f')]);return db[_0xf960('0x3d')][_0xf960('0x55')](_0x1e5b8b)[_0xf960('0x1e')](handleEntityNotFound(_0x4c7f39,null))[_0xf960('0x1e')](respondWithResult(_0x4c7f39,null))[_0xf960('0x27')](handleError(_0x4c7f39,null));};exports['create']=function(_0x5a2e68,_0x392128){return db[_0xf960('0x3d')]['create'](_0x5a2e68[_0xf960('0x56')],{})[_0xf960('0x1e')](function(_0x4d19dc){var _0x2975a5=_0x5a2e68[_0xf960('0x57')]['get']({'plain':!![]});if(!_0x2975a5)throw new Error(_0xf960('0x58'));if(_0x2975a5[_0xf960('0x59')]===_0xf960('0x57')){var _0x4de0bc=_0x4d19dc[_0xf960('0x34')]({'plain':!![]});var _0x3d341b=_0xf960('0x35');return db['UserProfileSection'][_0xf960('0x55')]({'where':{'name':_0x3d341b,'userProfileId':_0x2975a5[_0xf960('0x5a')]},'raw':!![]})[_0xf960('0x1e')](function(_0x21868b){if(_0x21868b&&_0x21868b[_0xf960('0x5b')]===0x0){return db[_0xf960('0x36')]['create']({'name':_0x4de0bc[_0xf960('0x39')],'resourceId':_0x4de0bc['id'],'type':_0x21868b[_0xf960('0x39')],'sectionId':_0x21868b['id']},{})[_0xf960('0x1e')](function(){return _0x4d19dc;});}else{return _0x4d19dc;}})[_0xf960('0x27')](function(_0xc9d5dd){logger[_0xf960('0x23')](_0xf960('0x5c'),_0xc9d5dd);throw _0xc9d5dd;});}return _0x4d19dc;})[_0xf960('0x1e')](respondWithResult(_0x392128,0xc9))['catch'](handleError(_0x392128,null));};exports[_0xf960('0x32')]=function(_0x1a5321,_0x262a97){if(_0x1a5321[_0xf960('0x56')]['id']){delete _0x1a5321[_0xf960('0x56')]['id'];}return db[_0xf960('0x3d')]['find']({'where':{'id':_0x1a5321[_0xf960('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0xf960('0x3c')}]})[_0xf960('0x1e')](handleEntityNotFound(_0x262a97,null))[_0xf960('0x1e')](saveUpdates(_0x1a5321[_0xf960('0x56')],null))['then'](respondWithResult(_0x262a97,null))['catch'](handleError(_0x262a97,null));};exports[_0xf960('0x33')]=function(_0x871965,_0x19a85c){return db[_0xf960('0x3d')][_0xf960('0x55')]({'where':{'id':_0x871965[_0xf960('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19a85c,null))[_0xf960('0x1e')](removeEntity(_0x19a85c,null))['catch'](handleError(_0x19a85c,null));};exports[_0xf960('0x5e')]=function(_0x52ac54,_0x27a25b){return db['ChatWebsite'][_0xf960('0x5e')]()[_0xf960('0x1e')](respondWithResult(_0x27a25b,null))[_0xf960('0x27')](handleError(_0x27a25b,null));};exports[_0xf960('0x5f')]=function(_0x344e86,_0x363004,_0x932428){if(_0x344e86[_0xf960('0x56')]['id']){delete _0x344e86[_0xf960('0x56')]['id'];}return db[_0xf960('0x3d')][_0xf960('0x55')]({'where':{'id':_0x344e86['params']['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x363004,null))['then'](function(_0x34d24f){if(_0x34d24f){_0x344e86[_0xf960('0x56')][_0xf960('0x60')]=_0x34d24f['id'];return db[_0xf960('0x61')][_0xf960('0x62')](_0x344e86[_0xf960('0x56')]);}})[_0xf960('0x1e')](respondWithResult(_0x363004,null))[_0xf960('0x27')](handleError(_0x363004,null));};exports[_0xf960('0x63')]=function(_0x1d5c57,_0x493cca,_0x54ec3d){var _0x152e54={'raw':![],'where':{}};var _0x2541fa={};var _0x4e5950={'count':0x0,'rows':[]};return db[_0xf960('0x3d')][_0xf960('0x64')]({'where':{'id':_0x1d5c57['params']['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x493cca,null))[_0xf960('0x1e')](function(_0x439619){if(_0x439619){_0x2541fa[_0xf960('0x40')]=_['keys'](db[_0xf960('0x61')][_0xf960('0x3e')]);_0x2541fa[_0xf960('0x42')]=_['keys'](_0x1d5c57[_0xf960('0x42')]);_0x2541fa['filters']=_[_0xf960('0x54')](_0x2541fa[_0xf960('0x40')],_0x2541fa[_0xf960('0x42')]);_0x152e54['attributes']=_[_0xf960('0x54')](_0x2541fa['model'],qs[_0xf960('0x45')](_0x1d5c57[_0xf960('0x42')][_0xf960('0x45')]));_0x152e54[_0xf960('0x46')]=_0x152e54[_0xf960('0x46')][_0xf960('0x47')]?_0x152e54[_0xf960('0x46')]:_0x2541fa[_0xf960('0x40')];if(!_0x1d5c57['query'][_0xf960('0x48')](_0xf960('0x49'))){_0x152e54[_0xf960('0x2c')]=qs['limit'](_0x1d5c57['query'][_0xf960('0x2c')]);_0x152e54['offset']=qs['offset'](_0x1d5c57[_0xf960('0x42')]['offset']);}_0x152e54['order']=qs['sort'](_0x1d5c57[_0xf960('0x42')][_0xf960('0x4a')]);_0x152e54[_0xf960('0x4b')]=qs[_0xf960('0x44')](_[_0xf960('0x65')](_0x1d5c57[_0xf960('0x42')],_0x2541fa[_0xf960('0x44')]));_0x152e54[_0xf960('0x4b')][_0xf960('0x60')]=_0x439619['id'];if(_0x1d5c57[_0xf960('0x42')][_0xf960('0x66')]){_0x152e54['where']=_[_0xf960('0x4e')](_0x152e54[_0xf960('0x4b')],{'$or':_[_0xf960('0x41')](_0x152e54[_0xf960('0x46')],function(_0x4127dc){var _0xf897bc={};_0xf897bc[_0x4127dc]={'$like':'%'+_0x1d5c57[_0xf960('0x42')][_0xf960('0x66')]+'%'};return _0xf897bc;})});}_0x152e54=_[_0xf960('0x4e')]({},_0x152e54,_0x1d5c57[_0xf960('0x4f')]);return db['Disposition'][_0xf960('0x2d')]({'where':_0x152e54[_0xf960('0x4b')]})[_0xf960('0x1e')](function(_0x2be2d6){_0x4e5950[_0xf960('0x2d')]=_0x2be2d6;if(_0x1d5c57[_0xf960('0x42')][_0xf960('0x67')]){_0x152e54[_0xf960('0x50')]=[{'all':!![]}];}return db[_0xf960('0x61')]['findAll'](_0x152e54);})['then'](function(_0xd69038){_0x4e5950[_0xf960('0x52')]=_0xd69038;return _0x4e5950;});}})[_0xf960('0x1e')](respondWithFilteredResult(_0x493cca,_0x152e54))['catch'](handleError(_0x493cca,null));};exports[_0xf960('0x68')]=function(_0x14e7f1,_0x5b45a0,_0x54769c){return db[_0xf960('0x3d')][_0xf960('0x55')]({'where':{'id':_0x14e7f1[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x5b45a0,null))[_0xf960('0x1e')](function(_0x57176e){if(_0x57176e){return _0x57176e[_0xf960('0x68')](_0x14e7f1[_0xf960('0x42')]['ids']);}})[_0xf960('0x1e')](respondWithStatusCode(_0x5b45a0,null))['catch'](handleError(_0x5b45a0,null));};exports['addAnswer']=function(_0xa78f31,_0x564e75,_0x65d7f4){if(_0xa78f31[_0xf960('0x56')]['id']){delete _0xa78f31[_0xf960('0x56')]['id'];}return db['ChatWebsite'][_0xf960('0x55')]({'where':{'id':_0xa78f31[_0xf960('0x5d')]['id']}})['then'](handleEntityNotFound(_0x564e75,null))[_0xf960('0x1e')](function(_0x5e6c47){if(_0x5e6c47){_0xa78f31[_0xf960('0x56')][_0xf960('0x60')]=_0x5e6c47['id'];return db[_0xf960('0x69')][_0xf960('0x62')](_0xa78f31[_0xf960('0x56')]);}})[_0xf960('0x1e')](respondWithResult(_0x564e75,null))[_0xf960('0x27')](handleError(_0x564e75,null));};exports['getAnswers']=function(_0xa64df7,_0x18a108,_0x9fc466){var _0x17ccc6={'raw':![],'where':{}};var _0x163b22={};var _0x218b83={'count':0x0,'rows':[]};return db[_0xf960('0x3d')][_0xf960('0x64')]({'where':{'id':_0xa64df7['params']['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x18a108,null))['then'](function(_0x47091e){if(_0x47091e){_0x163b22[_0xf960('0x40')]=_[_0xf960('0x43')](db['CannedAnswer'][_0xf960('0x3e')]);_0x163b22[_0xf960('0x42')]=_[_0xf960('0x43')](_0xa64df7[_0xf960('0x42')]);_0x163b22[_0xf960('0x44')]=_['intersection'](_0x163b22[_0xf960('0x40')],_0x163b22[_0xf960('0x42')]);_0x17ccc6[_0xf960('0x46')]=_[_0xf960('0x54')](_0x163b22[_0xf960('0x40')],qs[_0xf960('0x45')](_0xa64df7[_0xf960('0x42')][_0xf960('0x45')]));_0x17ccc6[_0xf960('0x46')]=_0x17ccc6['attributes'][_0xf960('0x47')]?_0x17ccc6['attributes']:_0x163b22[_0xf960('0x40')];if(!_0xa64df7[_0xf960('0x42')][_0xf960('0x48')](_0xf960('0x49'))){_0x17ccc6[_0xf960('0x2c')]=qs['limit'](_0xa64df7[_0xf960('0x42')][_0xf960('0x2c')]);_0x17ccc6[_0xf960('0x2a')]=qs[_0xf960('0x2a')](_0xa64df7[_0xf960('0x42')]['offset']);}_0x17ccc6[_0xf960('0x6a')]=qs[_0xf960('0x4a')](_0xa64df7[_0xf960('0x42')][_0xf960('0x4a')]);_0x17ccc6['where']=qs[_0xf960('0x44')](_[_0xf960('0x65')](_0xa64df7[_0xf960('0x42')],_0x163b22['filters']));_0x17ccc6[_0xf960('0x4b')][_0xf960('0x60')]=_0x47091e['id'];if(_0xa64df7[_0xf960('0x42')]['filter']){_0x17ccc6[_0xf960('0x4b')]=_['merge'](_0x17ccc6[_0xf960('0x4b')],{'$or':_[_0xf960('0x41')](_0x17ccc6[_0xf960('0x46')],function(_0x498448){var _0x2e73f6={};_0x2e73f6[_0x498448]={'$like':'%'+_0xa64df7[_0xf960('0x42')][_0xf960('0x66')]+'%'};return _0x2e73f6;})});}_0x17ccc6=_[_0xf960('0x4e')]({},_0x17ccc6,_0xa64df7[_0xf960('0x4f')]);return db[_0xf960('0x69')][_0xf960('0x2d')]({'where':_0x17ccc6['where']})[_0xf960('0x1e')](function(_0xfcfb8c){_0x218b83[_0xf960('0x2d')]=_0xfcfb8c;if(_0xa64df7['query']['includeAll']){_0x17ccc6[_0xf960('0x50')]=[{'all':!![]}];}return db[_0xf960('0x69')][_0xf960('0x51')](_0x17ccc6);})[_0xf960('0x1e')](function(_0x372803){_0x218b83[_0xf960('0x52')]=_0x372803;return _0x218b83;});}})['then'](respondWithFilteredResult(_0x18a108,_0x17ccc6))['catch'](handleError(_0x18a108,null));};exports[_0xf960('0x6b')]=function(_0x1be26e,_0x23c611,_0x13aba8){return db[_0xf960('0x3d')][_0xf960('0x55')]({'where':{'id':_0x1be26e[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x23c611,null))[_0xf960('0x1e')](function(_0x41232c){if(_0x41232c){return _0x41232c['removeAnswers'](_0x1be26e[_0xf960('0x42')][_0xf960('0x6c')]);}})[_0xf960('0x1e')](respondWithStatusCode(_0x23c611,null))[_0xf960('0x27')](handleError(_0x23c611,null));};exports[_0xf960('0x6d')]=function(_0x364ded,_0x2f15c9,_0x316c45){_0x364ded[_0xf960('0x56')][_0xf960('0x6e')]=_0x364ded[_0xf960('0x6f')]['filename'];return db[_0xf960('0x3d')]['find']({'where':{'id':_0x364ded[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x2f15c9,null))[_0xf960('0x1e')](saveUpdates(_0x364ded[_0xf960('0x56')],null))['then'](respondWithResult(_0x2f15c9,null))[_0xf960('0x27')](handleError(_0x2f15c9,null));};exports[_0xf960('0x70')]=function(_0x4e6767,_0x366a7a,_0x4a3269){_0x4e6767['body'][_0xf960('0x71')]=_0x4e6767[_0xf960('0x6f')][_0xf960('0x72')];return db[_0xf960('0x3d')]['find']({'where':{'id':_0x4e6767[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x366a7a,null))[_0xf960('0x1e')](saveUpdates(_0x4e6767[_0xf960('0x56')],null))[_0xf960('0x1e')](respondWithResult(_0x366a7a,null))['catch'](handleError(_0x366a7a,null));};exports[_0xf960('0x73')]=function(_0x459a17,_0x5071d6,_0x18ac14){_0x459a17[_0xf960('0x56')]['customerAvatar']=_0x459a17['file'][_0xf960('0x72')];return db[_0xf960('0x3d')]['find']({'where':{'id':_0x459a17[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x5071d6,null))[_0xf960('0x1e')](saveUpdates(_0x459a17[_0xf960('0x56')],null))[_0xf960('0x1e')](respondWithResult(_0x5071d6,null))[_0xf960('0x27')](handleError(_0x5071d6,null));};exports[_0xf960('0x74')]=function(_0x2ed276,_0x725a9d,_0x5dc744){_0x2ed276['body'][_0xf960('0x75')]=_0x2ed276[_0xf960('0x6f')]['filename'];return db[_0xf960('0x3d')]['find']({'where':{'id':_0x2ed276['params']['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x725a9d,null))[_0xf960('0x1e')](saveUpdates(_0x2ed276['body'],null))['then'](respondWithResult(_0x725a9d,null))[_0xf960('0x27')](handleError(_0x725a9d,null));};exports[_0xf960('0x76')]=function(_0x5c5b9e,_0x1808fb,_0x3a4eac){var _0x20a003=path['join'](config[_0xf960('0x77')],_0xf960('0x78'));var _0x44200a={'where':{'id':_0x5c5b9e[_0xf960('0x5d')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2d4913=![];return require('../../config/license/util')[_0xf960('0x79')]()['then'](function(_0x2d1ef6){if(_0x2d1ef6){_0x2d4913=_0x2d1ef6[_0xf960('0x7a')];}})[_0xf960('0x1e')](function(){return db[_0xf960('0x3d')]['find'](_0x44200a);})[_0xf960('0x1e')](handleEntityNotFound(_0x1808fb,null))[_0xf960('0x1e')](function(_0x2e7393){if(_0x2e7393){if(!_[_0xf960('0x7b')](_0x2e7393[_0xf960('0x6e')])){if(fs[_0xf960('0x7c')](path[_0xf960('0x7d')](config[_0xf960('0x77')],'server/files/images/logos/',_0x2e7393[_0xf960('0x6e')]))&&_0x2d4913){_0x20a003=path['join'](config[_0xf960('0x77')],_0xf960('0x7e'),_0x2e7393[_0xf960('0x6e')]);}}return _0x1808fb['download'](_0x20a003);}})[_0xf960('0x27')](handleError(_0x1808fb,null));};exports[_0xf960('0x7f')]=function(_0x5d127b,_0x2f9de4,_0x4f2349){var _0xe55c1b=path['join'](config[_0xf960('0x77')],_0xf960('0x80'));var _0x506c51={'where':{'id':_0x5d127b[_0xf960('0x5d')]['id']},'attributes':['id',_0xf960('0x71')],'raw':!![]};return db[_0xf960('0x3d')][_0xf960('0x55')](_0x506c51)[_0xf960('0x1e')](handleEntityNotFound(_0x2f9de4,null))[_0xf960('0x1e')](function(_0x34bdb3){if(_0x34bdb3){if(!_[_0xf960('0x7b')](_0x34bdb3[_0xf960('0x71')])){if(fs[_0xf960('0x7c')](path[_0xf960('0x7d')](config['root'],_0xf960('0x81'),_0x34bdb3[_0xf960('0x71')]))){_0xe55c1b=path[_0xf960('0x7d')](config[_0xf960('0x77')],_0xf960('0x81'),_0x34bdb3['agentAvatar']);}}return _0x2f9de4[_0xf960('0x82')](_0xe55c1b);}})[_0xf960('0x27')](handleError(_0x2f9de4,null));};exports[_0xf960('0x83')]=function(_0x743e76,_0x578224,_0xa7ee44){var _0x161051=path[_0xf960('0x7d')](config['root'],_0xf960('0x84'));var _0x1578ce={'where':{'id':_0x743e76[_0xf960('0x5d')]['id']},'attributes':['id','customerAvatar',_0xf960('0x85')],'raw':!![]};return db['ChatWebsite'][_0xf960('0x55')](_0x1578ce)[_0xf960('0x1e')](handleEntityNotFound(_0x578224,null))['then'](function(_0x2e6543){if(_0x2e6543){if(!_[_0xf960('0x7b')](_0x2e6543[_0xf960('0x86')])){if(fs[_0xf960('0x7c')](path[_0xf960('0x7d')](config['root'],'server/files/images/avatars/',_0x2e6543[_0xf960('0x86')]))&&_0x2e6543[_0xf960('0x85')]){_0x161051=path[_0xf960('0x7d')](config['root'],_0xf960('0x81'),_0x2e6543['customerAvatar']);}}return _0x578224[_0xf960('0x82')](_0x161051);}})['catch'](handleError(_0x578224,null));};exports[_0xf960('0x87')]=function(_0x3445d4,_0x2e9ef1,_0x43146f){var _0x477fe2=path[_0xf960('0x7d')](config[_0xf960('0x77')],'server/files/images/avatars/system_avatar.png');var _0x51a9a6={'where':{'id':_0x3445d4[_0xf960('0x5d')]['id']},'attributes':['id',_0xf960('0x75')],'raw':!![]};return db[_0xf960('0x3d')]['find'](_0x51a9a6)[_0xf960('0x1e')](handleEntityNotFound(_0x2e9ef1,null))[_0xf960('0x1e')](function(_0x220a1b){if(_0x220a1b){if(!_[_0xf960('0x7b')](_0x220a1b[_0xf960('0x75')])){if(fs[_0xf960('0x7c')](path[_0xf960('0x7d')](config[_0xf960('0x77')],_0xf960('0x81'),_0x220a1b[_0xf960('0x75')]))){_0x477fe2=path['join'](config[_0xf960('0x77')],_0xf960('0x81'),_0x220a1b[_0xf960('0x75')]);}}return _0x2e9ef1['download'](_0x477fe2);}})[_0xf960('0x27')](handleError(_0x2e9ef1,null));};exports[_0xf960('0x88')]=function(_0x3b61f3,_0x96a8d8,_0x2193fd){var _0x312e85=require('user-agent-parser');var _0x2af62d=new _0x312e85();var _0x4a77ba=_0x2af62d[_0xf960('0x89')](_0x3b61f3[_0xf960('0x8a')][_0xf960('0x8b')])[_0xf960('0x8c')]();var _0x1093cd={'body':_0x3b61f3[_0xf960('0x56')],'channel':_0xf960('0x8d')};var _0x3067ca=[];var _0x3fa2c3=[];var _0x52265e={};var _0x184caa=![];return db[_0xf960('0x8e')][_0xf960('0x5e')]()[_0xf960('0x1e')](function(_0x419e84){if(!_0x419e84){throw new db['Sequelize']['ValidationError'](_0xf960('0x8f'));}_0x3067ca=_[_0xf960('0x90')](_[_0xf960('0x43')](_0x419e84),['createdAt',_0xf960('0x91')]);_0x3fa2c3=_['difference'](_[_0xf960('0x43')](_0x419e84),[_0xf960('0x92'),_0xf960('0x91'),_0xf960('0x93'),_0xf960('0x94')]);if(_0x3b61f3[_0xf960('0x56')]['id']){delete _0x3b61f3[_0xf960('0x56')]['id'];}if(_[_0xf960('0x7b')](_0x3b61f3[_0xf960('0x56')][_0xf960('0x95')])){throw new db['Sequelize'][(_0xf960('0x96'))](_0xf960('0x97'));}if(_[_0xf960('0x7b')](_0x3b61f3[_0xf960('0x56')][_0xf960('0x56')])||_0x3b61f3[_0xf960('0x56')]['body']===''){throw new db[(_0xf960('0x98'))]['ValidationError'](_0xf960('0x99'));}if(_['isNil'](_0x3b61f3['body'][_0xf960('0x9a')])){throw new db[(_0xf960('0x98'))][(_0xf960('0x96'))](_0xf960('0x9b')+_0x3fa2c3);}if(!_[_0xf960('0x9c')](_0x3fa2c3,_0x3b61f3['body'][_0xf960('0x9a')])){throw new db[(_0xf960('0x98'))]['ValidationError'](_0xf960('0x9d')+_0x3fa2c3);}_0x52265e[_0x3b61f3[_0xf960('0x56')][_0xf960('0x9a')]]=_0x3b61f3[_0xf960('0x56')][_0xf960('0x95')];})[_0xf960('0x1e')](function(){return db[_0xf960('0x3d')]['find']({'where':{'id':_0x3b61f3[_0xf960('0x5d')]['id']},'include':[{'model':db[_0xf960('0x9e')],'as':'List','include':[{'model':db[_0xf960('0x8e')],'as':_0xf960('0x9f'),'where':_0x52265e,'limit':0x1,'order':[[_0xf960('0x91'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xf960('0xa0')}]});})['then'](handleEntityNotFound(_0x96a8d8,null))[_0xf960('0x1e')](function(_0x481c27){if(_0x481c27&&_0x481c27[_0xf960('0xa1')]){_0x1093cd[_0xf960('0xa2')]=_0x481c27;_0x1093cd[_0xf960('0xa3')]=_0x481c27[_0xf960('0xa0')];_0x1093cd[_0xf960('0xa4')]=_0x481c27[_0xf960('0xa1')];_0x1093cd[_0xf960('0xa3')]=_[_0xf960('0xa5')](_0x1093cd['applications'],['priority'],[_0xf960('0xa6')]);if(_0x1093cd[_0xf960('0xa2')][_0xf960('0xa0')]){delete _0x1093cd['account'][_0xf960('0xa0')];}if(_0x1093cd['account']['List']&&_0x1093cd[_0xf960('0xa2')]['List']['Contacts']['length']){return _0x1093cd[_0xf960('0xa2')][_0xf960('0xa1')][_0xf960('0x9f')][0x0];}var _0x1be185=_[_0xf960('0x15')](_0x3b61f3[_0xf960('0x56')],{'firstName':_0x3b61f3[_0xf960('0x56')][_0xf960('0x95')],'ListId':_0x481c27['ListId']});_0x1be185[_0x3b61f3['body'][_0xf960('0x9a')]]=_0x3b61f3[_0xf960('0x56')]['from'];return db[_0xf960('0x8e')]['create'](_0x1be185,{'fields':_0x3067ca,'raw':!![]});}})['then'](handleEntityNotFound(_0x96a8d8,null))['then'](function(_0x3b2399){_0x1093cd['contact']=_0x3b2399;var _0x3854e0=_0x3b61f3[_0xf960('0x56')]['customerIp'];if(_0x3b61f3['headers'][_0xf960('0xa7')]){_0x3854e0=_0x3b61f3[_0xf960('0x8a')]['cf-connecting-ip'];}else if(_0x3b61f3[_0xf960('0x8a')][_0xf960('0xa8')]){_0x3854e0=_[_0xf960('0xa9')](_0x3b61f3[_0xf960('0x8a')][_0xf960('0xa8')][_0xf960('0xaa')](','));}if(_0x3b2399){var _0x2fc28c={'ContactId':_0x3b2399['id'],'ChatWebsiteId':_0x3b61f3[_0xf960('0x5d')]['id'],'from':(_0x3b2399[_0xf960('0xab')]||'')+'\x20'+(_0x3b2399[_0xf960('0xac')]||''),'customerIp':_0x3854e0,'customerPort':_0x3b61f3[_0xf960('0x8a')]['x-real-port']?_0x3b61f3['headers']['x-real-port']:null,'referer':_0x3b61f3[_0xf960('0x56')][_0xf960('0xad')],'browserName':_0x4a77ba[_0xf960('0xae')]['name']&&_0x4a77ba[_0xf960('0xae')][_0xf960('0xaf')]?util[_0xf960('0xb0')](_0xf960('0xb1'),_0x4a77ba['browser'][_0xf960('0x39')],_0x4a77ba[_0xf960('0xae')]['version']):'unknown','browserVersion':_0x4a77ba[_0xf960('0xae')]['version']||_0xf960('0xb2'),'osName':util[_0xf960('0xb0')]('%s\x20%s',_0x4a77ba['os'][_0xf960('0x39')],_0x4a77ba['os'][_0xf960('0xaf')]),'osVersion':_0x4a77ba['os'][_0xf960('0xaf')],'deviceModel':_0x4a77ba[_0xf960('0xb3')][_0xf960('0x40')]&&_0x4a77ba[_0xf960('0xb3')]['vendor']?util[_0xf960('0xb0')](_0xf960('0xb4'),_0x4a77ba[_0xf960('0xb3')][_0xf960('0x40')],_0x4a77ba['device'][_0xf960('0xb5')],_0x4a77ba['device'][_0xf960('0x4c')]):null,'deviceVendor':_0x4a77ba[_0xf960('0xb3')][_0xf960('0xb5')],'deviceType':_0x4a77ba[_0xf960('0xb3')][_0xf960('0x4c')],'formData':JSON[_0xf960('0x22')](_0x3b61f3['body'])};var _0x4efc06={'ChatWebsiteId':_0x3b61f3[_0xf960('0x5d')]['id'],'closed':![]};if(_0x3b61f3[_0xf960('0x56')][_0xf960('0xb6')]){_0x4efc06[_0xf960('0xb6')]=_0x3b61f3['body']['threadId'];return db[_0xf960('0xb7')][_0xf960('0x55')]({'where':_0x4efc06})[_0xf960('0x1e')](function(_0x4c99af){if(_0x4c99af){return[_0x4c99af,![]];}_0x2fc28c['threadId']=_0x3b61f3['body']['threadId'];_0x2fc28c['externalUrl']=_0x3b61f3['body'][_0xf960('0xb8')];return db[_0xf960('0xb7')]['create'](_0x2fc28c)[_0xf960('0x1e')](function(_0x783929){return[_0x783929,!![]];});});}_0x4efc06[_0xf960('0xb9')]=_0x3b2399['id'];if(_0x3b61f3[_0xf960('0x56')][_0xf960('0xba')]&&_0x3b61f3[_0xf960('0x56')]['interaction']['id']){_0x4efc06['id']=_0x3b61f3[_0xf960('0x56')]['interaction']['id'];return db[_0xf960('0xb7')]['find']({'where':_0x4efc06})[_0xf960('0x1e')](function(_0x6ecfda){if(_0x6ecfda){return[_0x6ecfda,![]];}return db[_0xf960('0xb7')][_0xf960('0x62')](_0x2fc28c)[_0xf960('0x1e')](function(_0xbe1d22){return[_0xbe1d22,!![]];});});}return db['ChatInteraction'][_0xf960('0x62')](_0x2fc28c)['then'](function(_0x41e6e1){return[_0x41e6e1,!![]];});}})['spread'](function(_0x1aa0a7,_0x45bd0c){if(_0x1aa0a7){_0x184caa=_0x45bd0c;if(!_0x45bd0c){var _0x155abe={'from':(_0x1093cd[_0xf960('0xbb')][_0xf960('0xab')]||'')+'\x20'+(_0x1093cd['contact'][_0xf960('0xac')]||'')};if(_0x3b61f3[_0xf960('0x56')][_0xf960('0xb6')]&&_0x3b61f3[_0xf960('0x56')][_0xf960('0xbc')]&&_0x3b61f3[_0xf960('0x56')][_0xf960('0xb6')]!=_0x3b61f3['body'][_0xf960('0xbc')]){_0x155abe['threadId']=_0x3b61f3[_0xf960('0x56')][_0xf960('0xbc')];}return _0x1aa0a7['update'](_0x155abe);}else{return _0x1aa0a7;}}})[_0xf960('0x1e')](function(_0x2f2ea6){_0x1093cd[_0xf960('0xba')]=_0x2f2ea6[_0xf960('0x34')]({'plain':!![]});_0x1093cd['interaction'][_0xf960('0xbd')]=_0x184caa;if(_0x1093cd['interaction']['created']){if(_0x1093cd[_0xf960('0xa2')][_0xf960('0xbe')]){_0x1093cd['applications'][_0xf960('0xbf')]({'id':0x0,'priority':_0x1093cd['applications']['length']+0x1,'app':_0xf960('0xc0'),'appdata':_0xf960('0xc1'),'interval':_0xf960('0xc2')});}}return db[_0xf960('0xc3')][_0xf960('0x62')]({'body':_0x3b61f3[_0xf960('0x56')]['body'],'ChatWebsiteId':_0x3b61f3[_0xf960('0x5d')]['id'],'ChatInteractionId':_0x2f2ea6['id'],'direction':'in','ContactId':_0x1093cd['contact']['id'],'AttachmentId':_0x3b61f3['body'][_0xf960('0xc4')]});})[_0xf960('0x1e')](function(_0xfcd725){_0x1093cd[_0xf960('0x25')]=_0xfcd725;if(_0x1093cd[_0xf960('0xba')][_0xf960('0xc5')]){return db['User'][_0xf960('0x55')]({'attributes':['id','name'],'where':{'id':_0x1093cd[_0xf960('0xba')][_0xf960('0xc5')]}})[_0xf960('0x1e')](function(_0x128d92){if(_0x128d92){_0x1093cd[_0xf960('0xa3')][_0xf960('0xc6')]({'id':0x0,'priority':0x0,'app':_0xf960('0xc7'),'appdata':_0x128d92['name']+','+(_0x1093cd[_0xf960('0xa2')][_0xf960('0xc8')]||0xa),'interval':_0xf960('0xc2')});_0x1093cd[_0xf960('0xc9')]=!![];}return respondWithRpcPromise(_0xf960('0xca'),_0xf960('0xcb'),_0x1093cd);});}return respondWithRpcPromise('Start',_0xf960('0xcb'),_0x1093cd);})[_0xf960('0x1e')](function(_0x159403){respondWithRpcPromise(_0xf960('0xcc'),_0xf960('0xcc'),{'event':'notify','message':_0x159403},client9002);return _0x159403;})[_0xf960('0x1e')](respondWithResult(_0x96a8d8,null))[_0xf960('0x27')](handleError(_0x96a8d8,null));};exports['offline']=function(_0x1ece76,_0x395d41,_0xce94bf){var _0x52c7ce,_0xd81aa6,_0x4d135c;var _0x25d599=[];var _0x2f1a6b=[];var _0x36ecde={};var _0x191b92=_0x1ece76[_0xf960('0xcd')]||[];var _0x45b02=[];var _0x569c97;return db[_0xf960('0x8e')][_0xf960('0x5e')]()[_0xf960('0x1e')](function(_0x15e004){if(!_0x15e004){throw new db[(_0xf960('0x98'))]['ValidationError'](_0xf960('0x8f'));}_0x2f1a6b=_['difference'](_['keys'](_0x15e004),[_0xf960('0x92'),'updatedAt']);_0x25d599=_['difference'](_[_0xf960('0x43')](_0x15e004),[_0xf960('0x92'),_0xf960('0x91'),'CompanyId',_0xf960('0x94')]);if(_0x1ece76['body']['id']){delete _0x1ece76[_0xf960('0x56')]['id'];}if(_['isNil'](_0x1ece76[_0xf960('0x56')][_0xf960('0x95')])){throw _0x395d41[_0xf960('0x28')](0x1f4)[_0xf960('0x3a')](new db[(_0xf960('0x98'))][(_0xf960('0x96'))](_0xf960('0x97')));}if(_[_0xf960('0x7b')](_0x1ece76['body']['body'])||_0x1ece76[_0xf960('0x56')][_0xf960('0x56')]===''){throw _0x395d41['status'](0x1f4)[_0xf960('0x3a')](new db[(_0xf960('0x98'))][(_0xf960('0x96'))](_0xf960('0x99')));}if(_[_0xf960('0x7b')](_0x1ece76[_0xf960('0x56')]['mapKeyOffline'])){throw _0x395d41[_0xf960('0x28')](0x1f4)[_0xf960('0x3a')](new db['Sequelize'][(_0xf960('0x96'))](_0xf960('0xce')+_0x25d599));}if(!_[_0xf960('0x9c')](_0x25d599,_0x1ece76[_0xf960('0x56')][_0xf960('0xcf')])){throw _0x395d41['status'](0x1f4)[_0xf960('0x3a')](new db[(_0xf960('0x98'))][(_0xf960('0x96'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25d599));}_0x36ecde[_0x1ece76[_0xf960('0x56')]['mapKeyOffline']]=_0x1ece76[_0xf960('0x56')][_0xf960('0x95')];})['then'](function(){return db[_0xf960('0x3d')][_0xf960('0x55')]({'where':{'id':_0x1ece76[_0xf960('0x5d')]['id']},'include':[{'model':db[_0xf960('0x9e')],'as':'List'},{'model':db[_0xf960('0xd0')],'as':_0xf960('0xd0')}]});})[_0xf960('0x1e')](handleEntityNotFound(_0x395d41,null))[_0xf960('0x1e')](function(_0x3d0811){if(_0x3d0811&&_0x3d0811[_0xf960('0xa1')]){_0xd81aa6=_0x3d0811;var _0x2d9f5a=_[_0xf960('0x15')](_0x1ece76[_0xf960('0x56')],{'firstName':_0x1ece76[_0xf960('0x56')][_0xf960('0x95')],'phone':_0x1ece76[_0xf960('0x56')]['from'],'ListId':_0x3d0811[_0xf960('0x94')]});_0x2d9f5a[_0x1ece76['body'][_0xf960('0xcf')]]=_0x1ece76[_0xf960('0x56')]['from'];return db[_0xf960('0x8e')][_0xf960('0xd1')]({'where':_0x36ecde,'defaults':_0x2d9f5a});}})[_0xf960('0xd2')](function(_0xbea8da){if(_0xbea8da){_0x4d135c=_0xbea8da;var _0xff2b82=fs['readFileSync'](path[_0xf960('0x7d')](config[_0xf960('0x77')],'server/files/templates/chatOfflineMessage.ejs'),_0xf960('0xd3'));var _0x1e1762=ejs['render'](_0xff2b82,{'body':_['toPairs'](_0x1ece76['body']['body']),'bodyTitle':_0xd81aa6['offlineMessageBody']});return db[_0xf960('0xd4')]['create']({'body':_0x1e1762,'ContactId':_0xbea8da['id'],'ChatWebsiteId':_0xd81aa6['id']});}})[_0xf960('0x1e')](function(_0xdf6e34){_0x569c97=_0xdf6e34;if(_0x191b92[_0xf960('0x47')]){var _0x59dd7d=_0x191b92[_0xf960('0x41')](function(_0x5189aa){return{'name':_0x5189aa[_0xf960('0xd5')],'basename':_0x5189aa[_0xf960('0x72')],'type':_0x5189aa[_0xf960('0xd6')],'ChatOfflineMessageId':_0xdf6e34['id']};});_0x45b02=_0x59dd7d['map'](_0x29eb5d=>{var _0x2fb038={'filename':_0x29eb5d[_0xf960('0x39')],'path':path[_0xf960('0x7d')](config[_0xf960('0x77')],_0xf960('0xd7'),_0xf960('0xcd'),_0xf960('0xd8'),_0xf960('0xd9'),_0x29eb5d[_0xf960('0xda')])};return _0x2fb038;});if(!_0xd81aa6[_0xf960('0xdb')]){return db[_0xf960('0xdc')][_0xf960('0xdd')](function(_0x107d31){return db[_0xf960('0xde')][_0xf960('0xdf')](_0x59dd7d,{'transaction':_0x107d31});});}}})[_0xf960('0x1e')](function(){if(_0x569c97){_0x52c7ce=_0x569c97;return db[_0xf960('0xd0')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xf960('0xe0')],'as':_0xf960('0xe1'),'raw':!![]}]});}})[_0xf960('0x1e')](function(_0x38e91d){if(_0x38e91d&&_0x38e91d[_0xf960('0xe1')]&&_0xd81aa6[_0xf960('0xe2')]&&_0xd81aa6[_0xf960('0xe3')]){var _0x29a6c5={'tls':{'rejectUnauthorized':![]}};if(_0x38e91d['Smtp'][_0xf960('0xe4')]){_0x29a6c5['service']=_0x38e91d[_0xf960('0xe1')][_0xf960('0xe4')];}else{_0x29a6c5[_0xf960('0xe5')]=_0x38e91d[_0xf960('0xe1')][_0xf960('0xe5')];_0x29a6c5[_0xf960('0xe6')]=_0x38e91d[_0xf960('0xe1')][_0xf960('0xe6')];_0x29a6c5[_0xf960('0xe7')]=_0x38e91d[_0xf960('0xe1')][_0xf960('0xe7')];}if(_0x38e91d[_0xf960('0xe1')][_0xf960('0xe8')]){_0x29a6c5[_0xf960('0xe9')]={'user':_0x38e91d[_0xf960('0xe1')][_0xf960('0x57')],'pass':_0x38e91d[_0xf960('0xe1')][_0xf960('0xea')]};}return respondWithRpcPromise('SendMail',_0xf960('0xeb'),{'account':_0x29a6c5,'message':{'from':util['format'](_0xf960('0xec'),_0x38e91d[_0xf960('0x39')],_0x38e91d[_0xf960('0xed')]||_0x38e91d[_0xf960('0xe1')][_0xf960('0x57')]),'to':_0xd81aa6[_0xf960('0xe3')],'subject':_0xd81aa6['offlineMessageSubject'],'html':_0x52c7ce[_0xf960('0x56')],'attachments':_0x45b02}},client9003)[_0xf960('0x1e')](function(){return _0x52c7ce;})[_0xf960('0x27')](function(_0x5d4f1e){console['error'](_0x5d4f1e);});}})['then'](function(){if(_0xd81aa6&&_0xd81aa6[_0xf960('0xdb')]&&_0xd81aa6[_0xf960('0xee')]){var _0x2686d2=[];if(_0x191b92['length']){_0x2686d2=_0x191b92[_0xf960('0x41')](function(_0x57221e){return{'name':_0x57221e[_0xf960('0xd5')],'basename':_0x57221e[_0xf960('0x72')],'type':_0x57221e[_0xf960('0xd6')],'ChatOfflineMessageId':_0x569c97['id']};});}var _0x39f532;if(!_['isNil'](_0xd81aa6[_0xf960('0xef')])){var _0x6132ef=_[_0xf960('0x41')](_0x1ece76[_0xf960('0x56')],function(_0x3fabae){return _0x3fabae;});var _0x1e461f=_[_0xf960('0xf0')](_0x6132ef)[0x0];var _0x492952=_[_0xf960('0xf1')](_0x1e461f,function(_0x3eda44){return _0x3eda44;});_0x39f532=_0x492952[0x1][_0xd81aa6[_0xf960('0xef')]];}var _0x3a732a={'from':_0x4d135c[_0xf960('0xed')],'firstName':_0x4d135c[_0xf960('0xab')],'lastName':_0x4d135c[_0xf960('0xac')],'mapKey':_0xf960('0xed'),'message':{'from':_0x4d135c[_0xf960('0xed')],'to':_0xd81aa6['MailAccount']['email'],'cc':'','subject':_[_0xf960('0x7b')](_0x39f532)?_0xd81aa6['offlineMessageSubject']:_0x39f532,'messageId':'','sentAt':new Date(),'attach':_0x2686d2[_0xf960('0x47')],'attachments':_0x2686d2,'originChannel':_0xf960('0xf2'),'ChatWebsiteId':_0xd81aa6['id'],'ChatOfflineMessageId':_0x52c7ce['id'],'originTo':_0xd81aa6[_0xf960('0xd0')]['email']},'body':_0x52c7ce[_0xf960('0x56')]};var _0x29ce95={'account':{'id':_0xd81aa6[_0xf960('0xee')]},'body':_0x3a732a,'log':_0xf960('0xf3')};return respondWithRpcPromise(_0xf960('0xf3'),_0xf960('0xf4'),_0x29ce95,client9001)[_0xf960('0x1e')](function(){return _0x52c7ce;})[_0xf960('0x27')](function(_0x5b86e1){console[_0xf960('0x23')](_0x5b86e1);});}return;})[_0xf960('0x1e')](function(){if(_0x52c7ce){return _0x52c7ce;}})[_0xf960('0x1e')](respondWithResult(_0x395d41,null))['catch'](function(_0xa59c7f){console[_0xf960('0x23')]('catch',_0xa59c7f);for(var _0x2542f5 of _0x191b92){var _0x530d17=path['join'](config[_0xf960('0x77')],'server',_0xf960('0xcd'),_0xf960('0xd8'),_0xf960('0xd9'),_0x2542f5[_0xf960('0x72')]);fs_extra[_0xf960('0xf5')](_0x530d17)[_0xf960('0x27')](function(_0x12a64f){console[_0xf960('0x23')](_0xf960('0xf6'),_0x530d17,_0x12a64f);});}});};exports[_0xf960('0xf7')]=function(_0x101b34,_0x305da5,_0x24a411){return db[_0xf960('0xb7')][_0xf960('0x55')]({'where':{'id':_0x101b34[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x305da5,null))['then'](function(_0x1199ab){if(_0x1199ab){return _0x1199ab['addInteraction'](_0x101b34[_0xf960('0x56')][_0xf960('0x6c')],_[_0xf960('0xf8')](_0x101b34[_0xf960('0x56')],['ids','id'])||{});}})[_0xf960('0x1e')](respondWithResult(_0x305da5,null))[_0xf960('0x27')](handleError(_0x305da5,null));};exports[_0xf960('0xf9')]=function(_0x5a0675,_0x5549cb,_0x4a939e){var _0x331ed8={'raw':![],'where':{}};var _0xed5e69={};var _0x3ef694={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf960('0x64')]({'where':{'id':_0x5a0675[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x5549cb,null))[_0xf960('0x1e')](function(_0x6e7ff){if(_0x6e7ff){_0xed5e69['model']=_[_0xf960('0x43')](db['ChatInteraction'][_0xf960('0x3e')]);_0xed5e69['query']=_[_0xf960('0x43')](_0x5a0675[_0xf960('0x42')]);_0xed5e69[_0xf960('0x44')]=_['intersection'](_0xed5e69['model'],_0xed5e69[_0xf960('0x42')]);_0x331ed8[_0xf960('0x46')]=_[_0xf960('0x54')](_0xed5e69['model'],qs[_0xf960('0x45')](_0x5a0675['query'][_0xf960('0x45')]));_0x331ed8[_0xf960('0x46')]=_0x331ed8[_0xf960('0x46')][_0xf960('0x47')]?_0x331ed8[_0xf960('0x46')]:_0xed5e69[_0xf960('0x40')];if(!_0x5a0675[_0xf960('0x42')][_0xf960('0x48')]('nolimit')){_0x331ed8[_0xf960('0x2c')]=qs['limit'](_0x5a0675[_0xf960('0x42')][_0xf960('0x2c')]);_0x331ed8[_0xf960('0x2a')]=qs['offset'](_0x5a0675['query'][_0xf960('0x2a')]);}_0x331ed8['order']=qs[_0xf960('0x4a')](_0x5a0675[_0xf960('0x42')][_0xf960('0x4a')]);_0x331ed8[_0xf960('0x4b')]=qs['filters'](_[_0xf960('0x65')](_0x5a0675['query'],_0xed5e69['filters']));_0x331ed8['where'][_0xf960('0x60')]=_0x6e7ff['id'];if(_0x5a0675[_0xf960('0x42')][_0xf960('0x66')]){_0x331ed8[_0xf960('0x4b')]=_[_0xf960('0x4e')](_0x331ed8['where'],{'$or':_[_0xf960('0x41')](_0x331ed8[_0xf960('0x46')],function(_0x166ba7){var _0x57c1f6={};_0x57c1f6[_0x166ba7]={'$like':'%'+_0x5a0675[_0xf960('0x42')]['filter']+'%'};return _0x57c1f6;})});}_0x331ed8=_[_0xf960('0x4e')]({},_0x331ed8,_0x5a0675[_0xf960('0x4f')]);return db['ChatInteraction']['count']({'where':_0x331ed8[_0xf960('0x4b')]})[_0xf960('0x1e')](function(_0x52bc2a){_0x3ef694[_0xf960('0x2d')]=_0x52bc2a;if(_0x5a0675[_0xf960('0x42')][_0xf960('0x67')]){_0x331ed8[_0xf960('0x50')]=[{'model':db['CmContact'],'as':_0xf960('0xfa'),'required':![]},{'model':db['User'],'as':_0xf960('0xfb'),'attributes':[_0xf960('0x39'),_0xf960('0xfc'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xf960('0xfd'),'attributes':['id','name',_0xf960('0xfe')],'where':_0x5a0675[_0xf960('0x42')]['tag']?{'id':_0x5a0675[_0xf960('0x42')][_0xf960('0xff')]}:undefined,'required':_0x5a0675['query'][_0xf960('0xff')]?!![]:![]}];}return db[_0xf960('0xb7')][_0xf960('0x51')](_0x331ed8);})['then'](function(_0x193c2d){_0x3ef694[_0xf960('0x52')]=_0x193c2d;return _0x3ef694;});}})[_0xf960('0x1e')](respondWithFilteredResult(_0x5549cb,_0x331ed8))[_0xf960('0x27')](handleError(_0x5549cb,null));};function iftimePromise(_0x444eef,_0x2bd268){return respondWithRpcPromise(_0xf960('0x100'),_0xf960('0x101'),{'command':_0x2bd268['timezone']?util[_0xf960('0xb0')](_0xf960('0x102'),_0x444eef[_0xf960('0x103')],_0x2bd268[_0xf960('0x104')]):util[_0xf960('0xb0')](_0xf960('0x105'),_0x444eef[_0xf960('0x103')])},client9002)[_0xf960('0x1e')](function(_0x1e4c11){var _0x1062f8=_0x1e4c11&&_0x1e4c11['indexOf']('true')>=0x0?!![]:![];logger[_0xf960('0x1f')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2bd268['id'],_0x444eef['id'],_0x444eef[_0xf960('0x103')],_0x1062f8?'ONLINE':_0xf960('0x106'),_0x2bd268[_0xf960('0x104')]?_0x2bd268[_0xf960('0x104')]:_0xf960('0x107'));return _0x1062f8;})[_0xf960('0x27')](function(_0xdff9f3){logger['error'](_0xf960('0x108'),_0x2bd268['id'],_0x444eef['id'],_0x444eef[_0xf960('0x103')],util[_0xf960('0x109')](_0xdff9f3,{'showHidden':![],'depth':null}),_0x2bd268[_0xf960('0x104')]?_0x2bd268['timezone']:_0xf960('0x107'));return![];});}exports[_0xf960('0x101')]=function(_0x550fe5,_0x2f623d,_0x519818){var _0x120514=0x0;var _0x39caf=0x0;var _0x11e847=![];var _0x3c90ad;var _0x5a2c4e;return db[_0xf960('0x3d')]['find']({'where':{'id':_0x550fe5[_0xf960('0x5d')]['id']},'include':[{'model':db[_0xf960('0x10a')],'as':'Interval','include':[{'model':db[_0xf960('0x10a')],'as':_0xf960('0x10b'),'attributes':['id',_0xf960('0x103')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2f623d,null))[_0xf960('0x1e')](function(_0x4ee288){if(_0x4ee288){_0x3c90ad=_0x4ee288;return _0x4ee288[_0xf960('0x10c')]({'raw':!![]});}})[_0xf960('0x1e')](function(_0x589997){if(_0x3c90ad){if(_0x589997){_0x5a2c4e=_0x589997;}}return require(_0xf960('0x12'))[_0xf960('0x79')]();})['then'](function(_0x5ec79e){if(_0x5ec79e){_0x39caf=_0x5ec79e[_0xf960('0x10d')];_0x11e847=_0x5ec79e['custom'];}})[_0xf960('0x1e')](function(){return db[_0xf960('0xb7')][_0xf960('0x2d')]({'where':{'closed':![]}});})[_0xf960('0x1e')](function(_0x2b211c){_0x120514=_0x2b211c;if(_0x39caf&&_0x2b211c>_0x39caf){return db['License']['findOne']({'where':{'id':0x1}})[_0xf960('0x1e')](function(_0x5cc845){if(_0x5cc845){_0x5cc845[_0xf960('0x10e')]('chatLicenseExceeded');}});}})[_0xf960('0x1e')](function(){if(_0x3c90ad[_0xf960('0x10a')]&&_0x3c90ad[_0xf960('0x10a')][_0xf960('0x10b')]){var _0xc288c5=[];for(var _0x538578=0x0;_0x538578<_0x3c90ad[_0xf960('0x10a')][_0xf960('0x10b')][_0xf960('0x47')];_0x538578++){var _0x17481f=_0x3c90ad['Interval'][_0xf960('0x10b')][_0x538578]['get']({'plain':!![]});_0xc288c5[_0xf960('0xbf')](iftimePromise(_0x17481f,_0x3c90ad));}return BPromise[_0xf960('0x10f')](_0xc288c5)[_0xf960('0x1e')](function(_0x538118){return _[_0xf960('0x110')](_0x538118);});}else{return!![];}})[_0xf960('0x1e')](function(_0x22ef50){var _0x5cd547=fs[_0xf960('0x111')](path['join'](config[_0xf960('0x77')],_0xf960('0x112')),_0xf960('0xd3'));var _0x393b55={'remote':_0x3c90ad[_0xf960('0x113')],'query':querystring[_0xf960('0x22')](_[_0xf960('0x4e')](_0x3c90ad['get']({'plain':!![]}),{'customerIp':_0x550fe5[_0xf960('0x8a')][_0xf960('0xa8')]||_0x550fe5[_0xf960('0x8a')][_0xf960('0x114')]||_0x550fe5[_0xf960('0x115')]['remoteAddress']||_0x550fe5['ip'],'referer':_0x550fe5['headers']['referer'],'openedInteractions':_0x120514,'maxInteractions':_0x39caf,'virtual':_0x11e847[_0xf960('0x10d')],'online':_0x22ef50,'custom':_0x11e847}))[_0xf960('0x116')](/'/g,'\x5c\x27')};_0x2f623d[_0xf960('0x3a')](ejs['render'](Mustache[_0xf960('0x117')](_0x5cd547,_0x393b55),{'proactiveActions':_0x5a2c4e,'alignment':_0x3c90ad[_0xf960('0x118')],'verticalAlignment':_0x3c90ad[_0xf960('0x119')],'div_color':_0x3c90ad[_0xf960('0xfe')],'text_color':_0x3c90ad['textColor'],'button_color':_0x3c90ad['color_button'],'background_color':_0x3c90ad[_0xf960('0x11a')]}));})[_0xf960('0x27')](handleError(_0x2f623d,null));};exports[_0xf960('0x11b')]=function(_0x3fe4c2,_0x638332,_0x240c7d){return db[_0xf960('0x3d')][_0xf960('0x64')]({'where':{'id':_0x3fe4c2[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x638332,null))[_0xf960('0x1e')](function(_0x219c17){if(_0x219c17){return db[_0xf960('0xdc')]['transaction'](function(_0x4cb23e){return db['ChatApplication'][_0xf960('0x33')]({'where':{'ChatWebsiteId':_0x3fe4c2['params']['id']},'transaction':_0x4cb23e})[_0xf960('0x1e')](function(_0x317d15){var _0xac4397=_[_0xf960('0x41')](_0x3fe4c2['body'],function(_0x4bfacc){_0x4bfacc[_0xf960('0x60')]=_0x3fe4c2[_0xf960('0x5d')]['id'];return _0x4bfacc;});return db[_0xf960('0x11c')][_0xf960('0xdf')](_0xac4397,{'transaction':_0x4cb23e});});})['then'](function(){return db[_0xf960('0x11c')][_0xf960('0x11d')]({'where':{'ChatWebsiteId':_0x3fe4c2[_0xf960('0x5d')]['id']},'order':_0xf960('0x11e')});});}})[_0xf960('0x1e')](respondWithResult(_0x638332,null))[_0xf960('0x27')](handleError(_0x638332,null));};exports[_0xf960('0x11f')]=function(_0x23f967,_0x378b9b,_0xed9686){var _0x458033={};var _0x543066={};var _0x799da6;var _0x1ee811;return db[_0xf960('0x3d')][_0xf960('0x64')]({'where':{'id':_0x23f967[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x378b9b,null))['then'](function(_0x4d354f){if(_0x4d354f){_0x799da6=_0x4d354f;_0x543066[_0xf960('0x40')]=_[_0xf960('0x43')](db[_0xf960('0x11c')][_0xf960('0x3e')]);_0x543066[_0xf960('0x42')]=_[_0xf960('0x43')](_0x23f967[_0xf960('0x42')]);_0x543066['filters']=_[_0xf960('0x54')](_0x543066[_0xf960('0x40')],_0x543066[_0xf960('0x42')]);_0x458033[_0xf960('0x46')]=_[_0xf960('0x54')](_0x543066['model'],qs['fields'](_0x23f967['query'][_0xf960('0x45')]));_0x458033[_0xf960('0x46')]=_0x458033['attributes'][_0xf960('0x47')]?_0x458033[_0xf960('0x46')]:_0x543066[_0xf960('0x40')];_0x458033[_0xf960('0x6a')]=qs[_0xf960('0x4a')](_0x23f967['query'][_0xf960('0x4a')]);_0x458033[_0xf960('0x4b')]=qs[_0xf960('0x44')](_[_0xf960('0x65')](_0x23f967[_0xf960('0x42')],_0x543066[_0xf960('0x44')]));if(_0x23f967[_0xf960('0x42')][_0xf960('0x66')]){_0x458033['where']=_[_0xf960('0x4e')](_0x458033[_0xf960('0x4b')],{'$or':_[_0xf960('0x41')](_0x458033[_0xf960('0x46')],function(_0x471431){var _0x1cac34={};_0x1cac34[_0x471431]={'$like':'%'+_0x23f967[_0xf960('0x42')][_0xf960('0x66')]+'%'};return _0x1cac34;})});}_0x458033=_[_0xf960('0x4e')]({},_0x458033,_0x23f967['options']);return _0x799da6[_0xf960('0x11f')](_0x458033);}})[_0xf960('0x1e')](function(_0x54b345){if(_0x54b345){_0x1ee811=_0x54b345[_0xf960('0x47')];if(!_0x23f967[_0xf960('0x42')][_0xf960('0x48')](_0xf960('0x49'))){_0x458033[_0xf960('0x2c')]=qs[_0xf960('0x2c')](_0x23f967[_0xf960('0x42')][_0xf960('0x2c')]);_0x458033[_0xf960('0x2a')]=qs[_0xf960('0x2a')](_0x23f967[_0xf960('0x42')][_0xf960('0x2a')]);}return _0x799da6[_0xf960('0x11f')](_0x458033);}})[_0xf960('0x1e')](function(_0xd9cfe2){if(_0xd9cfe2){return _0xd9cfe2?{'count':_0x1ee811,'rows':_0xd9cfe2}:null;}})[_0xf960('0x1e')](respondWithResult(_0x378b9b,null))[_0xf960('0x27')](handleError(_0x378b9b,null));};exports[_0xf960('0x120')]=function(_0x77bc03,_0x24d953,_0x2b7b2c){return db[_0xf960('0x121')][_0xf960('0x55')]({'where':{'id':_0x77bc03[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x24d953,null))['then'](function(_0x2407da){if(_0x2407da){return _0x2407da[_0xf960('0x120')](_0x77bc03[_0xf960('0x56')][_0xf960('0x6c')],_[_0xf960('0xf8')](_0x77bc03[_0xf960('0x56')],['ids','id'])||{});}})['then'](respondWithResult(_0x24d953,null))[_0xf960('0x27')](handleError(_0x24d953,null));};exports[_0xf960('0x10c')]=function(_0x4b03af,_0x29be6c,_0x8e190e){var _0x3047b5={};var _0x1e19db={};var _0x995e52;var _0x43a7e7;return db['ChatWebsite'][_0xf960('0x64')]({'where':{'id':_0x4b03af[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x29be6c,null))['then'](function(_0x66b1d6){if(_0x66b1d6){_0x995e52=_0x66b1d6;_0x1e19db[_0xf960('0x40')]=_['keys'](db[_0xf960('0x122')][_0xf960('0x3e')]);_0x1e19db[_0xf960('0x42')]=_[_0xf960('0x43')](_0x4b03af[_0xf960('0x42')]);_0x1e19db['filters']=_['intersection'](_0x1e19db[_0xf960('0x40')],_0x1e19db[_0xf960('0x42')]);_0x3047b5[_0xf960('0x46')]=_[_0xf960('0x54')](_0x1e19db[_0xf960('0x40')],qs['fields'](_0x4b03af[_0xf960('0x42')]['fields']));_0x3047b5[_0xf960('0x46')]=_0x3047b5[_0xf960('0x46')][_0xf960('0x47')]?_0x3047b5[_0xf960('0x46')]:_0x1e19db['model'];_0x3047b5[_0xf960('0x6a')]=qs['sort'](_0x4b03af[_0xf960('0x42')][_0xf960('0x4a')]);_0x3047b5['where']=qs[_0xf960('0x44')](_[_0xf960('0x65')](_0x4b03af[_0xf960('0x42')],_0x1e19db[_0xf960('0x44')]));if(_0x4b03af[_0xf960('0x42')]['filter']){_0x3047b5[_0xf960('0x4b')]=_[_0xf960('0x4e')](_0x3047b5[_0xf960('0x4b')],{'$or':_[_0xf960('0x41')](_0x3047b5[_0xf960('0x46')],function(_0x4701f3){var _0x1164d7={};_0x1164d7[_0x4701f3]={'$like':'%'+_0x4b03af[_0xf960('0x42')][_0xf960('0x66')]+'%'};return _0x1164d7;})});}_0x3047b5=_[_0xf960('0x4e')]({},_0x3047b5,_0x4b03af[_0xf960('0x4f')]);return _0x995e52[_0xf960('0x10c')](_0x3047b5);}})['then'](function(_0x37a8a3){if(_0x37a8a3){_0x43a7e7=_0x37a8a3['length'];if(!_0x4b03af[_0xf960('0x42')][_0xf960('0x48')]('nolimit')){_0x3047b5[_0xf960('0x2c')]=qs['limit'](_0x4b03af[_0xf960('0x42')]['limit']);_0x3047b5[_0xf960('0x2a')]=qs['offset'](_0x4b03af[_0xf960('0x42')][_0xf960('0x2a')]);}return _0x995e52[_0xf960('0x10c')](_0x3047b5);}})[_0xf960('0x1e')](function(_0xa0beaf){if(_0xa0beaf){return _0xa0beaf?{'count':_0x43a7e7,'rows':_0xa0beaf}:null;}})[_0xf960('0x1e')](respondWithResult(_0x29be6c,null))[_0xf960('0x27')](handleError(_0x29be6c,null));};exports[_0xf960('0x123')]=function(_0xfdbf2c,_0x7ee2f5,_0x4b9f23){var _0x49e11b=_0xfdbf2c['query'][_0xf960('0x124')]===_0xf960('0x125')?_0xf960('0x126'):_0xf960('0x127');return db[_0xf960('0x3d')][_0xf960('0x55')]({'attributes':['id',_0x49e11b],'where':{'id':_0xfdbf2c['params']['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x7ee2f5,null))['then'](function(_0x3659f8){if(_0x3659f8){var _0x1e33d5=_0x3659f8[_0x49e11b];var _0x376952=_0x1e33d5&&_0x1e33d5[_0xf960('0x128')]?_0x1e33d5[_0xf960('0x128')]:[];_0x7ee2f5[_0xf960('0x3a')]({'fromKey':_[_0xf960('0x7b')](_0x1e33d5['fromKey'])?undefined:_0x1e33d5[_0xf960('0x129')],'count':_0x376952[_0xf960('0x47')],'rows':_0x376952});}})['catch'](handleError(_0x7ee2f5,null));};exports[_0xf960('0x12a')]=function(_0x17e461,_0x4a0429,_0x38770f){var _0xb57568={'raw':![],'where':{}};var _0x597371={};var _0x38f0a6={'count':0x0,'rows':[]};return db[_0xf960('0x3d')]['findOne']({'where':{'id':_0x17e461[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x4a0429,null))[_0xf960('0x1e')](function(_0x5d8b23){if(_0x5d8b23){_0x597371[_0xf960('0x40')]=_[_0xf960('0x43')](db[_0xf960('0xd4')][_0xf960('0x3e')]);_0x597371[_0xf960('0x42')]=_[_0xf960('0x43')](_0x17e461['query']);_0x597371['filters']=_[_0xf960('0x54')](_0x597371['model'],_0x597371[_0xf960('0x42')]);_0xb57568[_0xf960('0x46')]=_['intersection'](_0x597371[_0xf960('0x40')],qs['fields'](_0x17e461['query'][_0xf960('0x45')]));_0xb57568[_0xf960('0x46')]=_0xb57568[_0xf960('0x46')][_0xf960('0x47')]?_0xb57568[_0xf960('0x46')]:_0x597371[_0xf960('0x40')];if(!_0x17e461[_0xf960('0x42')]['hasOwnProperty'](_0xf960('0x49'))){_0xb57568['limit']=qs[_0xf960('0x2c')](_0x17e461[_0xf960('0x42')][_0xf960('0x2c')]);_0xb57568[_0xf960('0x2a')]=qs[_0xf960('0x2a')](_0x17e461[_0xf960('0x42')]['offset']);}_0xb57568[_0xf960('0x6a')]=qs[_0xf960('0x4a')](_0x17e461[_0xf960('0x42')][_0xf960('0x4a')]);_0xb57568[_0xf960('0x4b')]=qs['filters'](_[_0xf960('0x65')](_0x17e461[_0xf960('0x42')],_0x597371[_0xf960('0x44')]));_0xb57568[_0xf960('0x4b')]['ChatWebsiteId']=_0x5d8b23['id'];if(_0x17e461[_0xf960('0x42')][_0xf960('0x66')]){_0xb57568['where']=_[_0xf960('0x4e')](_0xb57568[_0xf960('0x4b')],{'$or':_[_0xf960('0x41')](_0xb57568['attributes'],function(_0x3bfb98){var _0x50440e={};_0x50440e[_0x3bfb98]={'$like':'%'+_0x17e461[_0xf960('0x42')]['filter']+'%'};return _0x50440e;})});}_0xb57568=_[_0xf960('0x4e')]({},_0xb57568,_0x17e461[_0xf960('0x4f')]);return db['ChatOfflineMessage'][_0xf960('0x2d')]({'where':_0xb57568[_0xf960('0x4b')]})[_0xf960('0x1e')](function(_0x508254){_0x38f0a6[_0xf960('0x2d')]=_0x508254;if(_0x17e461[_0xf960('0x42')][_0xf960('0x67')]){_0xb57568['include']=[{'all':!![]}];}else{_0xb57568[_0xf960('0x50')]=[{'model':db['CmContact'],'as':_0xf960('0xfa'),'required':![]},{'model':db[_0xf960('0xde')],'as':_0xf960('0x12b'),'required':![]}];}return db[_0xf960('0xd4')][_0xf960('0x51')](_0xb57568);})[_0xf960('0x1e')](function(_0x3b733b){_0x38f0a6[_0xf960('0x52')]=_0x3b733b;return _0x38f0a6;});}})[_0xf960('0x1e')](respondWithFilteredResult(_0x4a0429,_0xb57568))['catch'](handleError(_0x4a0429,null));};exports[_0xf960('0x12c')]=function(_0x5dd607,_0x49c96a,_0x54095b){return db[_0xf960('0x3d')]['find']({'where':{'id':_0x5dd607[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x49c96a,null))[_0xf960('0x1e')](function(_0x35e302){if(_0x35e302){return _0x35e302[_0xf960('0x12c')](_0x5dd607[_0xf960('0x56')]['ids'],_['omit'](_0x5dd607[_0xf960('0x56')],[_0xf960('0x6c'),'id'])||{})['spread'](function(_0x430fcd){for(var _0x5455b4=0x0;_0x5455b4<_0x5dd607[_0xf960('0x56')][_0xf960('0x6c')][_0xf960('0x47')];_0x5455b4+=0x1){socket['emit'](_0xf960('0x12d'),{'UserId':Number(_0x5dd607[_0xf960('0x56')][_0xf960('0x6c')][_0x5455b4]),'ChatWebsiteId':Number(_0x5dd607[_0xf960('0x5d')]['id'])});}return _0x430fcd;});}})[_0xf960('0x1e')](respondWithResult(_0x49c96a,null))['catch'](handleError(_0x49c96a,null));};exports[_0xf960('0x12e')]=function(_0x2b84c5,_0x2cd2c4,_0x224fe4){return db[_0xf960('0x3d')]['find']({'where':{'id':_0x2b84c5[_0xf960('0x5d')]['id']}})[_0xf960('0x1e')](handleEntityNotFound(_0x2cd2c4,null))[_0xf960('0x1e')](function(_0x518f7b){if(_0x518f7b){return _0x518f7b[_0xf960('0x12e')](_0x2b84c5[_0xf960('0x42')][_0xf960('0x6c')])[_0xf960('0x1e')](function(){if(_['isArray'](_0x2b84c5['query'][_0xf960('0x6c')])){for(var _0x7b76b4=0x0;_0x7b76b4<_0x2b84c5[_0xf960('0x42')]['ids'][_0xf960('0x47')];_0x7b76b4+=0x1){socket[_0xf960('0x12f')](_0xf960('0x130'),{'UserId':Number(_0x2b84c5['query']['ids'][_0x7b76b4]),'ChatWebsiteId':Number(_0x2b84c5['params']['id'])});}}else{socket[_0xf960('0x12f')](_0xf960('0x130'),{'UserId':Number(_0x2b84c5[_0xf960('0x42')][_0xf960('0x6c')]),'ChatWebsiteId':Number(_0x2b84c5[_0xf960('0x5d')]['id'])});}});}})[_0xf960('0x1e')](respondWithStatusCode(_0x2cd2c4,null))[_0xf960('0x27')](handleError(_0x2cd2c4,null));};exports[_0xf960('0x131')]=function(_0x436dbb,_0xa712ef,_0x3322f5){var _0x329f82={};var _0x22f372={};var _0x3a7b93;var _0x1852c6;return db['ChatWebsite'][_0xf960('0x64')]({'where':{'id':_0x436dbb[_0xf960('0x5d')]['id']}})['then'](handleEntityNotFound(_0xa712ef,null))[_0xf960('0x1e')](function(_0x349817){if(_0x349817){_0x3a7b93=_0x349817;_0x22f372[_0xf960('0x40')]=_[_0xf960('0x43')](db['User']['rawAttributes']);_0x22f372[_0xf960('0x42')]=_[_0xf960('0x43')](_0x436dbb[_0xf960('0x42')]);_0x22f372[_0xf960('0x44')]=_[_0xf960('0x54')](_0x22f372[_0xf960('0x40')],_0x22f372[_0xf960('0x42')]);_0x329f82[_0xf960('0x46')]=_[_0xf960('0x54')](_0x22f372['model'],qs[_0xf960('0x45')](_0x436dbb[_0xf960('0x42')][_0xf960('0x45')]));_0x329f82['attributes']=_0x329f82['attributes'][_0xf960('0x47')]?_0x329f82[_0xf960('0x46')]:_0x22f372[_0xf960('0x40')];_0x329f82[_0xf960('0x6a')]=qs[_0xf960('0x4a')](_0x436dbb[_0xf960('0x42')][_0xf960('0x4a')]);_0x329f82[_0xf960('0x4b')]=qs[_0xf960('0x44')](_[_0xf960('0x65')](_0x436dbb[_0xf960('0x42')],_0x22f372[_0xf960('0x44')]));if(_0x436dbb[_0xf960('0x42')][_0xf960('0x66')]){_0x329f82[_0xf960('0x4b')]=_['merge'](_0x329f82[_0xf960('0x4b')],{'$or':_['map'](_0x329f82[_0xf960('0x46')],function(_0x581ab8){var _0x4f99cf={};_0x4f99cf[_0x581ab8]={'$like':'%'+_0x436dbb[_0xf960('0x42')][_0xf960('0x66')]+'%'};return _0x4f99cf;})});}_0x329f82=_['merge']({},_0x329f82,_0x436dbb[_0xf960('0x4f')]);return _0x3a7b93[_0xf960('0x131')](_0x329f82);}})['then'](function(_0x4a9eb7){if(_0x4a9eb7){_0x1852c6=_0x4a9eb7['length'];if(!_0x436dbb[_0xf960('0x42')]['hasOwnProperty']('nolimit')){_0x329f82[_0xf960('0x2c')]=qs['limit'](_0x436dbb['query'][_0xf960('0x2c')]);_0x329f82['offset']=qs[_0xf960('0x2a')](_0x436dbb[_0xf960('0x42')][_0xf960('0x2a')]);}return _0x3a7b93[_0xf960('0x131')](_0x329f82);}})[_0xf960('0x1e')](function(_0x45c81e){if(_0x45c81e){return _0x45c81e?{'count':_0x1852c6,'rows':_0x45c81e}:null;}})[_0xf960('0x1e')](respondWithResult(_0xa712ef,null))[_0xf960('0x27')](handleError(_0xa712ef,null));};
\ No newline at end of file
+var _0x64cd=['length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','params','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','findAll','removeDispositions','ids','CannedAnswer','getAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','firstName','lastName','x-real-port','referer','version','format','%s\x20%s','browser','unknown','device','%s\x20%s\x20%s','type','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','contact','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','EventManager','notify','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','subjectOffline','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','OFFLINE','No\x20timezone','Interval','getProactiveActions','getLicense','virtual','custom','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remoteAddress','alignment','verticalAlignment','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','offlineForm','onlineForm','fromKey','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatWebsite.socket','register','jayson/promise','client','http','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','then','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64cd,0xe2));var _0xd64c=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x64cd[_0x5519a9];return _0x32f2cc;};'use strict';var emlformat=require(_0xd64c('0x0'));var rimraf=require(_0xd64c('0x1'));var zipdir=require(_0xd64c('0x2'));var jsonpatch=require(_0xd64c('0x3'));var rp=require(_0xd64c('0x4'));var moment=require(_0xd64c('0x5'));var BPromise=require(_0xd64c('0x6'));var Mustache=require('mustache');var util=require(_0xd64c('0x7'));var path=require(_0xd64c('0x8'));var sox=require(_0xd64c('0x9'));var csv=require(_0xd64c('0xa'));var ejs=require(_0xd64c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd64c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd64c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd64c('0xe'));var qs=require(_0xd64c('0xf'));var as=require(_0xd64c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd64c('0x11'));var utils=require('../../config/utils');var config=require(_0xd64c('0x12'));var licenseUtil=require(_0xd64c('0x13'));var db=require(_0xd64c('0x14'))['db'];config[_0xd64c('0x15')]=_[_0xd64c('0x16')](config[_0xd64c('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd64c('0x15')]));require(_0xd64c('0x17'))[_0xd64c('0x18')](socket);var jayson=require(_0xd64c('0x19'));var client=jayson[_0xd64c('0x1a')][_0xd64c('0x1b')]({'port':0x232c});var client9002=jayson[_0xd64c('0x1a')][_0xd64c('0x1b')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xd64c('0x1a')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3af324,_0x70b536,_0x3b9d15,_0x4006e9){return new BPromise(function(_0x4946bb,_0x1392f5){var _0x296f41=_0x4006e9||client;return _0x296f41['request'](_0x3af324,_0x3b9d15)['then'](function(_0x324750){logger[_0xd64c('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x70b536,_0xd64c('0x1d'));logger['debug'](_0xd64c('0x1e'),_0x70b536,_0xd64c('0x1d'),JSON[_0xd64c('0x1f')](_0x324750));if(_0x324750['error']){if(_0x324750[_0xd64c('0x20')][_0xd64c('0x21')]===0x1f4){logger[_0xd64c('0x20')](_0xd64c('0x22'),_0x70b536,_0x324750[_0xd64c('0x20')]['message']);return _0x1392f5(_0x324750[_0xd64c('0x20')]['message']);}logger[_0xd64c('0x20')](_0xd64c('0x22'),_0x70b536,_0x324750[_0xd64c('0x20')][_0xd64c('0x23')]);return _0x4946bb(_0x324750[_0xd64c('0x20')][_0xd64c('0x23')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x70b536,_0xd64c('0x1d'));_0x4946bb(_0x324750[_0xd64c('0x24')][_0xd64c('0x23')]);}})[_0xd64c('0x25')](function(_0xe4bde1){logger[_0xd64c('0x20')](_0xd64c('0x22'),_0x70b536,_0xe4bde1);_0x1392f5(_0xe4bde1);});});}function respondWithStatusCode(_0x4b8fd5,_0x5b9e47){_0x5b9e47=_0x5b9e47||0xcc;return function(_0x278eb2){if(_0x278eb2){return _0x4b8fd5[_0xd64c('0x26')](_0x5b9e47);}return _0x4b8fd5[_0xd64c('0x27')](_0x5b9e47)['end']();};}function respondWithResult(_0xd17fc1,_0x4b523f){_0x4b523f=_0x4b523f||0xc8;return function(_0x43de1f){if(_0x43de1f){return _0xd17fc1['status'](_0x4b523f)[_0xd64c('0x28')](_0x43de1f);}};}function respondWithFilteredResult(_0x4ea696,_0x2119e1){return function(_0x8e5d4a){if(_0x8e5d4a){var _0x27ef7a=typeof _0x2119e1[_0xd64c('0x29')]===_0xd64c('0x2a')&&typeof _0x2119e1[_0xd64c('0x2b')]===_0xd64c('0x2a');var _0x17ed38=_0x8e5d4a[_0xd64c('0x2c')];var _0x1379fa=_0x27ef7a?0x0:_0x2119e1[_0xd64c('0x29')];var _0x3b3f06=_0x27ef7a?_0x8e5d4a['count']:_0x2119e1['offset']+_0x2119e1['limit'];var _0x3a4b10;if(_0x3b3f06>=_0x17ed38){_0x3b3f06=_0x17ed38;_0x3a4b10=0xc8;}else{_0x3a4b10=0xce;}_0x4ea696[_0xd64c('0x27')](_0x3a4b10);return _0x4ea696['set']('Content-Range',_0x1379fa+'-'+_0x3b3f06+'/'+_0x17ed38)['json'](_0x8e5d4a);}return null;};}function patchUpdates(_0x3221c7){return function(_0x212f93){try{jsonpatch[_0xd64c('0x2d')](_0x212f93,_0x3221c7,!![]);}catch(_0xbeaeae){return BPromise['reject'](_0xbeaeae);}return _0x212f93['save']();};}function saveUpdates(_0x39dabd,_0x22070e){return function(_0x872806){if(_0x872806){return _0x872806['update'](_0x39dabd)[_0xd64c('0x2e')](function(_0x2917c3){return _0x2917c3;});}return null;};}function removeEntity(_0x36eebe,_0x5c2b73){return function(_0x40a72a){if(_0x40a72a){return _0x40a72a['destroy']()[_0xd64c('0x2e')](function(){var _0x58b0f2=_0x40a72a[_0xd64c('0x2f')]({'plain':!![]});var _0x41d0a3=_0xd64c('0x30');return db[_0xd64c('0x31')][_0xd64c('0x32')]({'where':{'type':_0x41d0a3,'resourceId':_0x58b0f2['id']}})['then'](function(){return _0x40a72a;});})[_0xd64c('0x2e')](function(){_0x36eebe[_0xd64c('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa46e42,_0x1ec5a7){return function(_0xb4174d){if(!_0xb4174d){_0xa46e42[_0xd64c('0x26')](0x194);}return _0xb4174d;};}function handleError(_0x163932,_0x26600c){_0x26600c=_0x26600c||0x1f4;return function(_0x3be5eb){logger[_0xd64c('0x20')](_0x3be5eb[_0xd64c('0x33')]);if(_0x3be5eb[_0xd64c('0x34')]){delete _0x3be5eb[_0xd64c('0x34')];}_0x163932['status'](_0x26600c)[_0xd64c('0x35')](_0x3be5eb);};}exports[_0xd64c('0x36')]=function(_0x266b78,_0x5c1241){var _0x323fa6={'include':[{'model':db[_0xd64c('0x37')],'as':_0xd64c('0x38')}]},_0x1a1854={},_0x3f98fd={'count':0x0,'rows':[]};var _0x25b429=_[_0xd64c('0x39')](db[_0xd64c('0x3a')][_0xd64c('0x3b')],function(_0xbaa12d){return{'name':_0xbaa12d[_0xd64c('0x3c')],'type':_0xbaa12d['type'][_0xd64c('0x3d')]};});_0x1a1854[_0xd64c('0x3e')]=_[_0xd64c('0x39')](_0x25b429,_0xd64c('0x34'));_0x1a1854[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x266b78[_0xd64c('0x3f')]);_0x1a1854[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x1a1854[_0xd64c('0x3e')],_0x1a1854['query']);_0x323fa6[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x1a1854[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x266b78[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x323fa6['attributes']=_0x323fa6[_0xd64c('0x43')][_0xd64c('0x45')]?_0x323fa6[_0xd64c('0x43')]:_0x1a1854[_0xd64c('0x3e')];if(!_0x266b78[_0xd64c('0x3f')][_0xd64c('0x46')](_0xd64c('0x47'))){_0x323fa6[_0xd64c('0x2b')]=qs[_0xd64c('0x2b')](_0x266b78['query']['limit']);_0x323fa6['offset']=qs[_0xd64c('0x29')](_0x266b78[_0xd64c('0x3f')][_0xd64c('0x29')]);}_0x323fa6['order']=qs[_0xd64c('0x48')](_0x266b78[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x323fa6[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x266b78[_0xd64c('0x3f')],_0x1a1854['filters']),_0x25b429);if(_0x266b78[_0xd64c('0x3f')][_0xd64c('0x4b')]){_0x323fa6[_0xd64c('0x49')]=_['merge'](_0x323fa6[_0xd64c('0x49')],{'$or':_['map'](_0x25b429,function(_0x50ab26){if(_0x50ab26['type']!==_0xd64c('0x4c')){var _0x171a7b={};_0x171a7b[_0x50ab26[_0xd64c('0x34')]]={'$like':'%'+_0x266b78[_0xd64c('0x3f')]['filter']+'%'};return _0x171a7b;}})});}_0x323fa6=_['merge']({},_0x323fa6,_0x266b78[_0xd64c('0x4d')]);var _0x2afa24={'where':_0x323fa6[_0xd64c('0x49')]};return db[_0xd64c('0x3a')][_0xd64c('0x2c')](_0x2afa24)['then'](function(_0x5f1fe9){_0x3f98fd[_0xd64c('0x2c')]=_0x5f1fe9;if(_0x266b78[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x323fa6[_0xd64c('0x4f')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x323fa6);})[_0xd64c('0x2e')](function(_0xc08422){_0x3f98fd[_0xd64c('0x50')]=_0xc08422;return _0x3f98fd;})[_0xd64c('0x2e')](respondWithFilteredResult(_0x5c1241,_0x323fa6))['catch'](handleError(_0x5c1241,null));};exports['show']=function(_0x4b4f13,_0x28d976){var _0x29f368={'raw':![],'where':{'id':_0x4b4f13[_0xd64c('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0xd64c('0x38')}]},_0x445d57={};_0x445d57['model']=_[_0xd64c('0x40')](db[_0xd64c('0x3a')][_0xd64c('0x3b')]);_0x445d57[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x4b4f13[_0xd64c('0x3f')]);_0x445d57['filters']=_['intersection'](_0x445d57[_0xd64c('0x3e')],_0x445d57[_0xd64c('0x3f')]);_0x29f368[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x445d57[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x4b4f13[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x29f368[_0xd64c('0x43')]=_0x29f368['attributes'][_0xd64c('0x45')]?_0x29f368[_0xd64c('0x43')]:_0x445d57[_0xd64c('0x3e')];if(_0x4b4f13[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x29f368[_0xd64c('0x4f')]=[{'all':!![]}];}_0x29f368=_[_0xd64c('0x52')]({},_0x29f368,_0x4b4f13[_0xd64c('0x4d')]);return db[_0xd64c('0x3a')][_0xd64c('0x53')](_0x29f368)[_0xd64c('0x2e')](handleEntityNotFound(_0x28d976,null))['then'](respondWithResult(_0x28d976,null))[_0xd64c('0x25')](handleError(_0x28d976,null));};exports[_0xd64c('0x54')]=function(_0x414ed8,_0x51ff78){return db[_0xd64c('0x3a')][_0xd64c('0x54')](_0x414ed8[_0xd64c('0x55')],{})[_0xd64c('0x2e')](function(_0x2b6114){var _0x4ba468=_0x414ed8[_0xd64c('0x56')][_0xd64c('0x2f')]({'plain':!![]});if(!_0x4ba468)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ba468[_0xd64c('0x57')]===_0xd64c('0x56')){var _0x592d48=_0x2b6114[_0xd64c('0x2f')]({'plain':!![]});var _0x20aa7e=_0xd64c('0x30');return db[_0xd64c('0x58')][_0xd64c('0x53')]({'where':{'name':_0x20aa7e,'userProfileId':_0x4ba468[_0xd64c('0x59')]},'raw':!![]})[_0xd64c('0x2e')](function(_0x250d3f){if(_0x250d3f&&_0x250d3f[_0xd64c('0x5a')]===0x0){return db[_0xd64c('0x31')][_0xd64c('0x54')]({'name':_0x592d48[_0xd64c('0x34')],'resourceId':_0x592d48['id'],'type':_0x250d3f[_0xd64c('0x34')],'sectionId':_0x250d3f['id']},{})['then'](function(){return _0x2b6114;});}else{return _0x2b6114;}})[_0xd64c('0x25')](function(_0x258844){logger[_0xd64c('0x20')](_0xd64c('0x5b'),_0x258844);throw _0x258844;});}return _0x2b6114;})[_0xd64c('0x2e')](respondWithResult(_0x51ff78,0xc9))[_0xd64c('0x25')](handleError(_0x51ff78,null));};exports['update']=function(_0x237280,_0x498ae2){if(_0x237280['body']['id']){delete _0x237280[_0xd64c('0x55')]['id'];}return db[_0xd64c('0x3a')]['find']({'where':{'id':_0x237280[_0xd64c('0x51')]['id']},'include':[{'model':db[_0xd64c('0x37')],'as':_0xd64c('0x38')}]})[_0xd64c('0x2e')](handleEntityNotFound(_0x498ae2,null))[_0xd64c('0x2e')](saveUpdates(_0x237280[_0xd64c('0x55')],null))[_0xd64c('0x2e')](respondWithResult(_0x498ae2,null))[_0xd64c('0x25')](handleError(_0x498ae2,null));};exports['destroy']=function(_0x353b91,_0x146fff){return db['ChatWebsite'][_0xd64c('0x53')]({'where':{'id':_0x353b91['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x146fff,null))[_0xd64c('0x2e')](removeEntity(_0x146fff,null))[_0xd64c('0x25')](handleError(_0x146fff,null));};exports[_0xd64c('0x5c')]=function(_0x15f2fe,_0x46a794){return db[_0xd64c('0x3a')][_0xd64c('0x5c')]()[_0xd64c('0x2e')](respondWithResult(_0x46a794,null))['catch'](handleError(_0x46a794,null));};exports[_0xd64c('0x5d')]=function(_0x403d7e,_0x4f7e09,_0x31efa8){if(_0x403d7e[_0xd64c('0x55')]['id']){delete _0x403d7e[_0xd64c('0x55')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x403d7e[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x4f7e09,null))['then'](function(_0x51053f){if(_0x51053f){_0x403d7e[_0xd64c('0x55')][_0xd64c('0x5e')]=_0x51053f['id'];return db[_0xd64c('0x5f')]['create'](_0x403d7e['body']);}})[_0xd64c('0x2e')](respondWithResult(_0x4f7e09,null))[_0xd64c('0x25')](handleError(_0x4f7e09,null));};exports[_0xd64c('0x60')]=function(_0x585617,_0x703f6c,_0x1ca934){var _0x4ad6de={'raw':![],'where':{}};var _0x2977b3={};var _0x56f4bc={'count':0x0,'rows':[]};return db[_0xd64c('0x3a')][_0xd64c('0x61')]({'where':{'id':_0x585617[_0xd64c('0x51')]['id']}})['then'](handleEntityNotFound(_0x703f6c,null))['then'](function(_0x2878ca){if(_0x2878ca){_0x2977b3[_0xd64c('0x3e')]=_['keys'](db[_0xd64c('0x5f')]['rawAttributes']);_0x2977b3[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x585617[_0xd64c('0x3f')]);_0x2977b3[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x2977b3[_0xd64c('0x3e')],_0x2977b3[_0xd64c('0x3f')]);_0x4ad6de['attributes']=_[_0xd64c('0x42')](_0x2977b3['model'],qs[_0xd64c('0x44')](_0x585617[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x4ad6de[_0xd64c('0x43')]=_0x4ad6de['attributes']['length']?_0x4ad6de['attributes']:_0x2977b3[_0xd64c('0x3e')];if(!_0x585617[_0xd64c('0x3f')][_0xd64c('0x46')](_0xd64c('0x47'))){_0x4ad6de['limit']=qs[_0xd64c('0x2b')](_0x585617[_0xd64c('0x3f')][_0xd64c('0x2b')]);_0x4ad6de[_0xd64c('0x29')]=qs['offset'](_0x585617['query'][_0xd64c('0x29')]);}_0x4ad6de[_0xd64c('0x62')]=qs['sort'](_0x585617[_0xd64c('0x3f')]['sort']);_0x4ad6de[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x585617[_0xd64c('0x3f')],_0x2977b3[_0xd64c('0x41')]));_0x4ad6de['where'][_0xd64c('0x5e')]=_0x2878ca['id'];if(_0x585617[_0xd64c('0x3f')][_0xd64c('0x4b')]){_0x4ad6de[_0xd64c('0x49')]=_['merge'](_0x4ad6de[_0xd64c('0x49')],{'$or':_['map'](_0x4ad6de['attributes'],function(_0x23e94c){var _0xbd581f={};_0xbd581f[_0x23e94c]={'$like':'%'+_0x585617[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0xbd581f;})});}_0x4ad6de=_[_0xd64c('0x52')]({},_0x4ad6de,_0x585617['options']);return db[_0xd64c('0x5f')][_0xd64c('0x2c')]({'where':_0x4ad6de['where']})['then'](function(_0xafa053){_0x56f4bc[_0xd64c('0x2c')]=_0xafa053;if(_0x585617[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x4ad6de['include']=[{'all':!![]}];}return db[_0xd64c('0x5f')][_0xd64c('0x63')](_0x4ad6de);})['then'](function(_0x27ebc4){_0x56f4bc['rows']=_0x27ebc4;return _0x56f4bc;});}})[_0xd64c('0x2e')](respondWithFilteredResult(_0x703f6c,_0x4ad6de))[_0xd64c('0x25')](handleError(_0x703f6c,null));};exports[_0xd64c('0x64')]=function(_0x331593,_0x3aac41,_0x28e45b){return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x331593[_0xd64c('0x51')]['id']}})['then'](handleEntityNotFound(_0x3aac41,null))[_0xd64c('0x2e')](function(_0xe86ba2){if(_0xe86ba2){return _0xe86ba2[_0xd64c('0x64')](_0x331593[_0xd64c('0x3f')][_0xd64c('0x65')]);}})[_0xd64c('0x2e')](respondWithStatusCode(_0x3aac41,null))['catch'](handleError(_0x3aac41,null));};exports['addAnswer']=function(_0x47c618,_0x4eca8a,_0x25a644){if(_0x47c618[_0xd64c('0x55')]['id']){delete _0x47c618[_0xd64c('0x55')]['id'];}return db[_0xd64c('0x3a')]['find']({'where':{'id':_0x47c618[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x4eca8a,null))[_0xd64c('0x2e')](function(_0x6d3616){if(_0x6d3616){_0x47c618[_0xd64c('0x55')][_0xd64c('0x5e')]=_0x6d3616['id'];return db[_0xd64c('0x66')][_0xd64c('0x54')](_0x47c618[_0xd64c('0x55')]);}})[_0xd64c('0x2e')](respondWithResult(_0x4eca8a,null))[_0xd64c('0x25')](handleError(_0x4eca8a,null));};exports[_0xd64c('0x67')]=function(_0x19c8cd,_0x28a517,_0x1be8d3){var _0x32007a={'raw':![],'where':{}};var _0x5b9313={};var _0x28fc09={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x19c8cd[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x28a517,null))[_0xd64c('0x2e')](function(_0x1de2f5){if(_0x1de2f5){_0x5b9313['model']=_['keys'](db[_0xd64c('0x66')][_0xd64c('0x3b')]);_0x5b9313[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x19c8cd[_0xd64c('0x3f')]);_0x5b9313[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x5b9313[_0xd64c('0x3e')],_0x5b9313[_0xd64c('0x3f')]);_0x32007a[_0xd64c('0x43')]=_['intersection'](_0x5b9313['model'],qs[_0xd64c('0x44')](_0x19c8cd[_0xd64c('0x3f')]['fields']));_0x32007a[_0xd64c('0x43')]=_0x32007a['attributes'][_0xd64c('0x45')]?_0x32007a[_0xd64c('0x43')]:_0x5b9313['model'];if(!_0x19c8cd['query']['hasOwnProperty'](_0xd64c('0x47'))){_0x32007a['limit']=qs[_0xd64c('0x2b')](_0x19c8cd[_0xd64c('0x3f')][_0xd64c('0x2b')]);_0x32007a[_0xd64c('0x29')]=qs['offset'](_0x19c8cd[_0xd64c('0x3f')]['offset']);}_0x32007a[_0xd64c('0x62')]=qs['sort'](_0x19c8cd[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x32007a[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x19c8cd['query'],_0x5b9313[_0xd64c('0x41')]));_0x32007a[_0xd64c('0x49')]['ChatWebsiteId']=_0x1de2f5['id'];if(_0x19c8cd['query'][_0xd64c('0x4b')]){_0x32007a[_0xd64c('0x49')]=_[_0xd64c('0x52')](_0x32007a[_0xd64c('0x49')],{'$or':_[_0xd64c('0x39')](_0x32007a['attributes'],function(_0x289235){var _0x1ebe34={};_0x1ebe34[_0x289235]={'$like':'%'+_0x19c8cd[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0x1ebe34;})});}_0x32007a=_[_0xd64c('0x52')]({},_0x32007a,_0x19c8cd[_0xd64c('0x4d')]);return db[_0xd64c('0x66')][_0xd64c('0x2c')]({'where':_0x32007a[_0xd64c('0x49')]})['then'](function(_0x1d012d){_0x28fc09[_0xd64c('0x2c')]=_0x1d012d;if(_0x19c8cd[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x32007a[_0xd64c('0x4f')]=[{'all':!![]}];}return db[_0xd64c('0x66')][_0xd64c('0x63')](_0x32007a);})[_0xd64c('0x2e')](function(_0x12d99a){_0x28fc09[_0xd64c('0x50')]=_0x12d99a;return _0x28fc09;});}})[_0xd64c('0x2e')](respondWithFilteredResult(_0x28a517,_0x32007a))[_0xd64c('0x25')](handleError(_0x28a517,null));};exports['removeAnswers']=function(_0x56e5dd,_0x33e477,_0x2be9d9){return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x56e5dd[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x33e477,null))['then'](function(_0xf5c89b){if(_0xf5c89b){return _0xf5c89b['removeAnswers'](_0x56e5dd[_0xd64c('0x3f')]['ids']);}})[_0xd64c('0x2e')](respondWithStatusCode(_0x33e477,null))[_0xd64c('0x25')](handleError(_0x33e477,null));};exports[_0xd64c('0x68')]=function(_0x1af79f,_0xd39937,_0x3f08c7){_0x1af79f['body'][_0xd64c('0x69')]=_0x1af79f[_0xd64c('0x6a')][_0xd64c('0x6b')];return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x1af79f[_0xd64c('0x51')]['id']}})['then'](handleEntityNotFound(_0xd39937,null))[_0xd64c('0x2e')](saveUpdates(_0x1af79f[_0xd64c('0x55')],null))['then'](respondWithResult(_0xd39937,null))[_0xd64c('0x25')](handleError(_0xd39937,null));};exports[_0xd64c('0x6c')]=function(_0x8b17f,_0x1d5555,_0x5410ac){_0x8b17f[_0xd64c('0x55')][_0xd64c('0x6d')]=_0x8b17f['file'][_0xd64c('0x6b')];return db['ChatWebsite'][_0xd64c('0x53')]({'where':{'id':_0x8b17f[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x1d5555,null))[_0xd64c('0x2e')](saveUpdates(_0x8b17f[_0xd64c('0x55')],null))[_0xd64c('0x2e')](respondWithResult(_0x1d5555,null))[_0xd64c('0x25')](handleError(_0x1d5555,null));};exports[_0xd64c('0x6e')]=function(_0x14db15,_0x226156,_0xc289ad){_0x14db15[_0xd64c('0x55')][_0xd64c('0x6f')]=_0x14db15[_0xd64c('0x6a')][_0xd64c('0x6b')];return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x14db15['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x226156,null))['then'](saveUpdates(_0x14db15[_0xd64c('0x55')],null))[_0xd64c('0x2e')](respondWithResult(_0x226156,null))[_0xd64c('0x25')](handleError(_0x226156,null));};exports['addSystemAvatar']=function(_0x22fde7,_0x35306f,_0x50a142){_0x22fde7[_0xd64c('0x55')][_0xd64c('0x70')]=_0x22fde7[_0xd64c('0x6a')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x22fde7[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x35306f,null))['then'](saveUpdates(_0x22fde7[_0xd64c('0x55')],null))[_0xd64c('0x2e')](respondWithResult(_0x35306f,null))[_0xd64c('0x25')](handleError(_0x35306f,null));};exports[_0xd64c('0x71')]=function(_0x29f6d7,_0x527283,_0x470d94){var _0x33fd8e=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x74'));var _0x1b570b={'where':{'id':_0x29f6d7['params']['id']},'attributes':['id',_0xd64c('0x69')],'raw':!![]};var _0x1b9fa4=![];return require(_0xd64c('0x13'))['getLicense']()[_0xd64c('0x2e')](function(_0x5c11b8){if(_0x5c11b8){_0x1b9fa4=_0x5c11b8['custom'];}})[_0xd64c('0x2e')](function(){return db['ChatWebsite']['find'](_0x1b570b);})[_0xd64c('0x2e')](handleEntityNotFound(_0x527283,null))[_0xd64c('0x2e')](function(_0x2d8da1){if(_0x2d8da1){if(!_[_0xd64c('0x75')](_0x2d8da1[_0xd64c('0x69')])){if(fs[_0xd64c('0x76')](path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x77'),_0x2d8da1[_0xd64c('0x69')]))&&_0x1b9fa4){_0x33fd8e=path['join'](config[_0xd64c('0x73')],_0xd64c('0x77'),_0x2d8da1['sitepic']);}}return _0x527283[_0xd64c('0x78')](_0x33fd8e);}})[_0xd64c('0x25')](handleError(_0x527283,null));};exports[_0xd64c('0x79')]=function(_0x2e4913,_0x2f37a7,_0x3f68f2){var _0x19dc0f=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x7a'));var _0x37810={'where':{'id':_0x2e4913[_0xd64c('0x51')]['id']},'attributes':['id',_0xd64c('0x6d')],'raw':!![]};return db['ChatWebsite'][_0xd64c('0x53')](_0x37810)[_0xd64c('0x2e')](handleEntityNotFound(_0x2f37a7,null))[_0xd64c('0x2e')](function(_0x319cdd){if(_0x319cdd){if(!_[_0xd64c('0x75')](_0x319cdd['agentAvatar'])){if(fs['existsSync'](path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x7b'),_0x319cdd[_0xd64c('0x6d')]))){_0x19dc0f=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x7b'),_0x319cdd[_0xd64c('0x6d')]);}}return _0x2f37a7['download'](_0x19dc0f);}})[_0xd64c('0x25')](handleError(_0x2f37a7,null));};exports[_0xd64c('0x7c')]=function(_0x9a58b,_0x234678,_0x5af6c8){var _0x5ba061=path[_0xd64c('0x72')](config['root'],_0xd64c('0x7d'));var _0x40eb1b={'where':{'id':_0x9a58b[_0xd64c('0x51')]['id']},'attributes':['id','customerAvatar',_0xd64c('0x7e')],'raw':!![]};return db[_0xd64c('0x3a')][_0xd64c('0x53')](_0x40eb1b)[_0xd64c('0x2e')](handleEntityNotFound(_0x234678,null))[_0xd64c('0x2e')](function(_0x4c5829){if(_0x4c5829){if(!_[_0xd64c('0x75')](_0x4c5829[_0xd64c('0x6f')])){if(fs[_0xd64c('0x76')](path[_0xd64c('0x72')](config['root'],_0xd64c('0x7b'),_0x4c5829[_0xd64c('0x6f')]))&&_0x4c5829[_0xd64c('0x7e')]){_0x5ba061=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x7b'),_0x4c5829[_0xd64c('0x6f')]);}}return _0x234678[_0xd64c('0x78')](_0x5ba061);}})[_0xd64c('0x25')](handleError(_0x234678,null));};exports[_0xd64c('0x7f')]=function(_0x22a69c,_0x53a674,_0x32d822){var _0x4baa50=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x80'));var _0x11cacb={'where':{'id':_0x22a69c[_0xd64c('0x51')]['id']},'attributes':['id',_0xd64c('0x70')],'raw':!![]};return db[_0xd64c('0x3a')][_0xd64c('0x53')](_0x11cacb)[_0xd64c('0x2e')](handleEntityNotFound(_0x53a674,null))['then'](function(_0xf20ff9){if(_0xf20ff9){if(!_['isNil'](_0xf20ff9[_0xd64c('0x70')])){if(fs[_0xd64c('0x76')](path[_0xd64c('0x72')](config['root'],_0xd64c('0x7b'),_0xf20ff9[_0xd64c('0x70')]))){_0x4baa50=path['join'](config[_0xd64c('0x73')],_0xd64c('0x7b'),_0xf20ff9[_0xd64c('0x70')]);}}return _0x53a674[_0xd64c('0x78')](_0x4baa50);}})['catch'](handleError(_0x53a674,null));};exports['notify']=function(_0x168bd6,_0x5e6b44,_0x4b26f2){var _0xf6300c=require(_0xd64c('0x81'));var _0x173fbc=new _0xf6300c();var _0x1b0f15=_0x173fbc[_0xd64c('0x82')](_0x168bd6['headers'][_0xd64c('0x83')])['getResult']();var _0x2fd0f7={'body':_0x168bd6[_0xd64c('0x55')],'channel':'chat'};var _0x114913=[];var _0x3dd435=[];var _0x4a2102={};var _0x53085c=![];return db[_0xd64c('0x84')][_0xd64c('0x5c')]()[_0xd64c('0x2e')](function(_0x377173){if(!_0x377173){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x87'));}_0x114913=_[_0xd64c('0x88')](_['keys'](_0x377173),['createdAt','updatedAt']);_0x3dd435=_['difference'](_[_0xd64c('0x40')](_0x377173),[_0xd64c('0x89'),_0xd64c('0x8a'),_0xd64c('0x8b'),_0xd64c('0x8c')]);if(_0x168bd6[_0xd64c('0x55')]['id']){delete _0x168bd6[_0xd64c('0x55')]['id'];}if(_['isNil'](_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8d')])){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x168bd6[_0xd64c('0x55')][_0xd64c('0x55')])||_0x168bd6['body'][_0xd64c('0x55')]===''){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x8e'));}if(_[_0xd64c('0x75')](_0x168bd6['body'][_0xd64c('0x8f')])){throw new db[(_0xd64c('0x85'))]['ValidationError'](_0xd64c('0x90')+_0x3dd435);}if(!_['includes'](_0x3dd435,_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8f')])){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x91')+_0x3dd435);}_0x4a2102[_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8f')]]=_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8d')];})[_0xd64c('0x2e')](function(){return db[_0xd64c('0x3a')]['find']({'where':{'id':_0x168bd6[_0xd64c('0x51')]['id']},'include':[{'model':db[_0xd64c('0x92')],'as':_0xd64c('0x93'),'include':[{'model':db[_0xd64c('0x84')],'as':_0xd64c('0x94'),'where':_0x4a2102,'limit':0x1,'order':[[_0xd64c('0x8a'),_0xd64c('0x95')]]}]},{'model':db[_0xd64c('0x96')],'as':_0xd64c('0x97')}]});})[_0xd64c('0x2e')](handleEntityNotFound(_0x5e6b44,null))[_0xd64c('0x2e')](function(_0x1db47e){if(_0x1db47e&&_0x1db47e[_0xd64c('0x93')]){_0x2fd0f7[_0xd64c('0x98')]=_0x1db47e;_0x2fd0f7[_0xd64c('0x99')]=_0x1db47e['Applications'];_0x2fd0f7[_0xd64c('0x9a')]=_0x1db47e['List'];_0x2fd0f7['applications']=_[_0xd64c('0x9b')](_0x2fd0f7[_0xd64c('0x99')],[_0xd64c('0x9c')],[_0xd64c('0x9d')]);if(_0x2fd0f7['account'][_0xd64c('0x97')]){delete _0x2fd0f7[_0xd64c('0x98')][_0xd64c('0x97')];}if(_0x2fd0f7[_0xd64c('0x98')][_0xd64c('0x93')]&&_0x2fd0f7[_0xd64c('0x98')]['List']['Contacts'][_0xd64c('0x45')]){return _0x2fd0f7['account'][_0xd64c('0x93')]['Contacts'][0x0];}var _0x5e3002=_[_0xd64c('0x16')](_0x168bd6[_0xd64c('0x55')],{'firstName':_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8d')],'ListId':_0x1db47e['ListId']});_0x5e3002[_0x168bd6['body'][_0xd64c('0x8f')]]=_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8d')];return db['CmContact']['create'](_0x5e3002,{'fields':_0x114913,'raw':!![]});}})[_0xd64c('0x2e')](handleEntityNotFound(_0x5e6b44,null))['then'](function(_0x3ba1a6){_0x2fd0f7['contact']=_0x3ba1a6;var _0x15a973=_0x168bd6['body'][_0xd64c('0x9e')];if(_0x168bd6['headers'][_0xd64c('0x9f')]){_0x15a973=_0x168bd6[_0xd64c('0xa0')][_0xd64c('0x9f')];}else if(_0x168bd6['headers'][_0xd64c('0xa1')]){_0x15a973=_[_0xd64c('0xa2')](_0x168bd6[_0xd64c('0xa0')]['x-forwarded-for']['split'](','));}if(_0x3ba1a6){var _0x1e420c={'ContactId':_0x3ba1a6['id'],'ChatWebsiteId':_0x168bd6[_0xd64c('0x51')]['id'],'from':(_0x3ba1a6[_0xd64c('0xa3')]||'')+'\x20'+(_0x3ba1a6[_0xd64c('0xa4')]||''),'customerIp':_0x15a973,'customerPort':_0x168bd6[_0xd64c('0xa0')]['x-real-port']?_0x168bd6['headers'][_0xd64c('0xa5')]:null,'referer':_0x168bd6[_0xd64c('0x55')][_0xd64c('0xa6')],'browserName':_0x1b0f15['browser'][_0xd64c('0x34')]&&_0x1b0f15['browser'][_0xd64c('0xa7')]?util[_0xd64c('0xa8')](_0xd64c('0xa9'),_0x1b0f15[_0xd64c('0xaa')]['name'],_0x1b0f15[_0xd64c('0xaa')][_0xd64c('0xa7')]):_0xd64c('0xab'),'browserVersion':_0x1b0f15['browser']['version']||_0xd64c('0xab'),'osName':util['format'](_0xd64c('0xa9'),_0x1b0f15['os'][_0xd64c('0x34')],_0x1b0f15['os'][_0xd64c('0xa7')]),'osVersion':_0x1b0f15['os'][_0xd64c('0xa7')],'deviceModel':_0x1b0f15[_0xd64c('0xac')][_0xd64c('0x3e')]&&_0x1b0f15[_0xd64c('0xac')]['vendor']?util[_0xd64c('0xa8')](_0xd64c('0xad'),_0x1b0f15[_0xd64c('0xac')][_0xd64c('0x3e')],_0x1b0f15[_0xd64c('0xac')]['vendor'],_0x1b0f15[_0xd64c('0xac')][_0xd64c('0xae')]):null,'deviceVendor':_0x1b0f15[_0xd64c('0xac')][_0xd64c('0xaf')],'deviceType':_0x1b0f15[_0xd64c('0xac')][_0xd64c('0xae')],'formData':JSON[_0xd64c('0x1f')](_0x168bd6['body'])};var _0x2c8326={'ChatWebsiteId':_0x168bd6[_0xd64c('0x51')]['id'],'closed':![]};if(_0x168bd6['body'][_0xd64c('0xb0')]){_0x2c8326['threadId']=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb0')];return db['ChatInteraction'][_0xd64c('0x53')]({'where':_0x2c8326})[_0xd64c('0x2e')](function(_0x162f2c){if(_0x162f2c){return[_0x162f2c,![]];}_0x1e420c['threadId']=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb0')];_0x1e420c['externalUrl']=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb1')];return db[_0xd64c('0xb2')][_0xd64c('0x54')](_0x1e420c)[_0xd64c('0x2e')](function(_0x50f922){return[_0x50f922,!![]];});});}_0x2c8326[_0xd64c('0xb3')]=_0x3ba1a6['id'];if(_0x168bd6['body'][_0xd64c('0xb4')]&&_0x168bd6[_0xd64c('0x55')]['interaction']['id']){_0x2c8326['id']=_0x168bd6['body'][_0xd64c('0xb4')]['id'];return db[_0xd64c('0xb2')][_0xd64c('0x53')]({'where':_0x2c8326})[_0xd64c('0x2e')](function(_0x158ddc){if(_0x158ddc){return[_0x158ddc,![]];}return db[_0xd64c('0xb2')][_0xd64c('0x54')](_0x1e420c)[_0xd64c('0x2e')](function(_0x2d24a7){return[_0x2d24a7,!![]];});});}return db[_0xd64c('0xb2')][_0xd64c('0x54')](_0x1e420c)[_0xd64c('0x2e')](function(_0x2fb8bc){return[_0x2fb8bc,!![]];});}})[_0xd64c('0xb5')](function(_0x500d1e,_0x2ecf74){if(_0x500d1e){_0x53085c=_0x2ecf74;if(!_0x2ecf74){var _0x306a65={'from':(_0x2fd0f7['contact'][_0xd64c('0xa3')]||'')+'\x20'+(_0x2fd0f7['contact'][_0xd64c('0xa4')]||'')};if(_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb0')]&&_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb6')]&&_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb0')]!=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb6')]){_0x306a65['threadId']=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb6')];}return _0x500d1e[_0xd64c('0xb7')](_0x306a65);}else{return _0x500d1e;}}})[_0xd64c('0x2e')](function(_0x23ebaa){_0x2fd0f7[_0xd64c('0xb4')]=_0x23ebaa['get']({'plain':!![]});_0x2fd0f7[_0xd64c('0xb4')]['created']=_0x53085c;if(_0x2fd0f7[_0xd64c('0xb4')][_0xd64c('0xb8')]){if(_0x2fd0f7[_0xd64c('0x98')][_0xd64c('0xb9')]){_0x2fd0f7['applications'][_0xd64c('0xba')]({'id':0x0,'priority':_0x2fd0f7[_0xd64c('0x99')][_0xd64c('0x45')]+0x1,'app':_0xd64c('0xbb'),'appdata':_0xd64c('0xbc'),'interval':_0xd64c('0xbd')});}}return db[_0xd64c('0xbe')][_0xd64c('0x54')]({'body':_0x168bd6[_0xd64c('0x55')][_0xd64c('0x55')],'ChatWebsiteId':_0x168bd6[_0xd64c('0x51')]['id'],'ChatInteractionId':_0x23ebaa['id'],'direction':'in','ContactId':_0x2fd0f7[_0xd64c('0xbf')]['id'],'AttachmentId':_0x168bd6[_0xd64c('0x55')][_0xd64c('0xc0')]});})['then'](function(_0x500105){_0x2fd0f7[_0xd64c('0x23')]=_0x500105;if(_0x2fd0f7['interaction'][_0xd64c('0xc1')]){return db['User'][_0xd64c('0x53')]({'attributes':['id',_0xd64c('0x34')],'where':{'id':_0x2fd0f7['interaction'][_0xd64c('0xc1')]}})[_0xd64c('0x2e')](function(_0x3007d0){if(_0x3007d0){_0x2fd0f7[_0xd64c('0x99')][_0xd64c('0xc2')]({'id':0x0,'priority':0x0,'app':_0xd64c('0xc3'),'appdata':_0x3007d0[_0xd64c('0x34')]+','+(_0x2fd0f7[_0xd64c('0x98')]['waitForTheAssignedAgent']||0xa),'interval':_0xd64c('0xbd')});_0x2fd0f7[_0xd64c('0xc4')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x2fd0f7);});}return respondWithRpcPromise(_0xd64c('0xc5'),'startRouting',_0x2fd0f7);})[_0xd64c('0x2e')](function(_0x5c9aeb){respondWithRpcPromise(_0xd64c('0xc6'),_0xd64c('0xc6'),{'event':_0xd64c('0xc7'),'message':_0x5c9aeb},client9002);return _0x5c9aeb;})[_0xd64c('0x2e')](respondWithResult(_0x5e6b44,null))[_0xd64c('0x25')](handleError(_0x5e6b44,null));};exports[_0xd64c('0xc8')]=function(_0x4d55d6,_0x1fc382,_0x2c42eb){var _0x2caf0c,_0x2c3cb3,_0x1171bc;var _0x326e8f=[];var _0x11be0d=[];var _0x162870={};var _0x465035=_0x4d55d6[_0xd64c('0xc9')]||[];var _0x59e80f=[];var _0x32a600;return db[_0xd64c('0x84')]['describe']()[_0xd64c('0x2e')](function(_0x1c3d0f){if(!_0x1c3d0f){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x87'));}_0x11be0d=_[_0xd64c('0x88')](_[_0xd64c('0x40')](_0x1c3d0f),[_0xd64c('0x89'),_0xd64c('0x8a')]);_0x326e8f=_[_0xd64c('0x88')](_['keys'](_0x1c3d0f),[_0xd64c('0x89'),_0xd64c('0x8a'),_0xd64c('0x8b'),'ListId']);if(_0x4d55d6[_0xd64c('0x55')]['id']){delete _0x4d55d6[_0xd64c('0x55')]['id'];}if(_['isNil'](_0x4d55d6[_0xd64c('0x55')]['from'])){throw _0x1fc382['status'](0x1f4)[_0xd64c('0x35')](new db['Sequelize'][(_0xd64c('0x86'))](_0xd64c('0xca')));}if(_[_0xd64c('0x75')](_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x55')])||_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x55')]===''){throw _0x1fc382[_0xd64c('0x27')](0x1f4)[_0xd64c('0x35')](new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x8e')));}if(_['isNil'](_0x4d55d6[_0xd64c('0x55')][_0xd64c('0xcb')])){throw _0x1fc382[_0xd64c('0x27')](0x1f4)[_0xd64c('0x35')](new db[(_0xd64c('0x85'))]['ValidationError'](_0xd64c('0xcc')+_0x326e8f));}if(!_[_0xd64c('0xcd')](_0x326e8f,_0x4d55d6['body'][_0xd64c('0xcb')])){throw _0x1fc382[_0xd64c('0x27')](0x1f4)[_0xd64c('0x35')](new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0xce')+_0x326e8f));}_0x162870[_0x4d55d6[_0xd64c('0x55')][_0xd64c('0xcb')]]=_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x8d')];})['then'](function(){return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x4d55d6[_0xd64c('0x51')]['id']},'include':[{'model':db[_0xd64c('0x92')],'as':_0xd64c('0x93')},{'model':db[_0xd64c('0xcf')],'as':_0xd64c('0xcf')}]});})['then'](handleEntityNotFound(_0x1fc382,null))[_0xd64c('0x2e')](function(_0x39c317){if(_0x39c317&&_0x39c317[_0xd64c('0x93')]){_0x2c3cb3=_0x39c317;var _0x35183e=_[_0xd64c('0x16')](_0x4d55d6['body'],{'firstName':_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x8d')],'phone':_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x8d')],'ListId':_0x39c317['ListId']});_0x35183e[_0x4d55d6[_0xd64c('0x55')][_0xd64c('0xcb')]]=_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x8d')];return db[_0xd64c('0x84')]['findOrCreate']({'where':_0x162870,'defaults':_0x35183e});}})[_0xd64c('0xb5')](function(_0xf9cf37){if(_0xf9cf37){_0x1171bc=_0xf9cf37;var _0x516556=fs[_0xd64c('0xd0')](path['join'](config[_0xd64c('0x73')],_0xd64c('0xd1')),_0xd64c('0xd2'));var _0x29bd2b=ejs[_0xd64c('0xd3')](_0x516556,{'body':_[_0xd64c('0xd4')](_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x55')]),'bodyTitle':_0x2c3cb3['offlineMessageBody']});return db[_0xd64c('0xd5')][_0xd64c('0x54')]({'body':_0x29bd2b,'ContactId':_0xf9cf37['id'],'ChatWebsiteId':_0x2c3cb3['id']});}})[_0xd64c('0x2e')](function(_0x26b169){_0x32a600=_0x26b169;if(_0x465035[_0xd64c('0x45')]){var _0xe9a295=_0x465035[_0xd64c('0x39')](function(_0x409f6b){return{'name':_0x409f6b[_0xd64c('0xd6')],'basename':_0x409f6b['filename'],'type':_0x409f6b[_0xd64c('0xd7')],'ChatOfflineMessageId':_0x26b169['id']};});_0x59e80f=_0xe9a295[_0xd64c('0x39')](_0x48e5d6=>{var _0x340a03={'filename':_0x48e5d6[_0xd64c('0x34')],'path':path['join'](config[_0xd64c('0x73')],_0xd64c('0xd8'),_0xd64c('0xc9'),_0xd64c('0xd9'),'offline-chat',_0x48e5d6[_0xd64c('0xda')])};return _0x340a03;});if(!_0x2c3cb3['openNewInteraction']){return db[_0xd64c('0xdb')]['transaction'](function(_0x23b42c){return db[_0xd64c('0xdc')][_0xd64c('0xdd')](_0xe9a295,{'transaction':_0x23b42c});});}}})[_0xd64c('0x2e')](function(){if(_0x32a600){_0x2caf0c=_0x32a600;return db[_0xd64c('0xcf')][_0xd64c('0x61')]({'where':{'active':!![]},'include':[{'model':db[_0xd64c('0xde')],'as':_0xd64c('0xdf'),'raw':!![]}]});}})[_0xd64c('0x2e')](function(_0x698179){if(_0x698179&&_0x698179[_0xd64c('0xdf')]&&_0x2c3cb3[_0xd64c('0xe0')]&&_0x2c3cb3[_0xd64c('0xe1')]){var _0x2e6dd3={'tls':{'rejectUnauthorized':![]}};if(_0x698179['Smtp']['service']){_0x2e6dd3[_0xd64c('0xe2')]=_0x698179[_0xd64c('0xdf')]['service'];}else{_0x2e6dd3[_0xd64c('0xe3')]=_0x698179['Smtp'][_0xd64c('0xe3')];_0x2e6dd3[_0xd64c('0xe4')]=_0x698179[_0xd64c('0xdf')][_0xd64c('0xe4')];_0x2e6dd3[_0xd64c('0xe5')]=_0x698179[_0xd64c('0xdf')]['secure'];}if(_0x698179[_0xd64c('0xdf')][_0xd64c('0xe6')]){_0x2e6dd3[_0xd64c('0xe7')]={'user':_0x698179[_0xd64c('0xdf')][_0xd64c('0x56')],'pass':_0x698179[_0xd64c('0xdf')][_0xd64c('0xe8')]};}return respondWithRpcPromise(_0xd64c('0xe9'),_0xd64c('0xea'),{'account':_0x2e6dd3,'message':{'from':util[_0xd64c('0xa8')]('\x22%s\x22\x20<%s>',_0x698179[_0xd64c('0x34')],_0x698179[_0xd64c('0xeb')]||_0x698179[_0xd64c('0xdf')][_0xd64c('0x56')]),'to':_0x2c3cb3[_0xd64c('0xe1')],'subject':_0x2c3cb3[_0xd64c('0xec')],'html':_0x2caf0c[_0xd64c('0x55')],'attachments':_0x59e80f}},client9003)['then'](function(){return _0x2caf0c;})[_0xd64c('0x25')](function(_0xc3124a){console[_0xd64c('0x20')](_0xc3124a);});}})[_0xd64c('0x2e')](function(){if(_0x2c3cb3&&_0x2c3cb3[_0xd64c('0xed')]&&_0x2c3cb3[_0xd64c('0xee')]){var _0x49ec6b=[];if(_0x465035[_0xd64c('0x45')]){_0x49ec6b=_0x465035['map'](function(_0x12aa65){return{'name':_0x12aa65[_0xd64c('0xd6')],'basename':_0x12aa65[_0xd64c('0x6b')],'type':_0x12aa65[_0xd64c('0xd7')],'ChatOfflineMessageId':_0x32a600['id']};});}var _0xab5dfb;if(!_[_0xd64c('0x75')](_0x2c3cb3['subjectOffline'])){var _0x497631=_['map'](_0x4d55d6[_0xd64c('0x55')],function(_0x3d8e3a){return _0x3d8e3a;});var _0x2a74cd=_[_0xd64c('0xef')](_0x497631)[0x0];var _0x1a8096=_['mapValues'](_0x2a74cd,function(_0x344504){return _0x344504;});_0xab5dfb=_0x1a8096[0x1][_0x2c3cb3[_0xd64c('0xf0')]];}var _0x928eea={'from':_0x1171bc[_0xd64c('0xeb')],'firstName':_0x1171bc[_0xd64c('0xa3')],'lastName':_0x1171bc[_0xd64c('0xa4')],'mapKey':'email','message':{'from':_0x1171bc[_0xd64c('0xeb')],'to':_0x2c3cb3[_0xd64c('0xcf')][_0xd64c('0xeb')],'cc':'','subject':_[_0xd64c('0x75')](_0xab5dfb)?_0x2c3cb3['offlineMessageSubject']:_0xab5dfb,'messageId':'','sentAt':new Date(),'attach':_0x49ec6b[_0xd64c('0x45')],'attachments':_0x49ec6b,'originChannel':'Chat','ChatWebsiteId':_0x2c3cb3['id'],'ChatOfflineMessageId':_0x2caf0c['id'],'originTo':_0x2c3cb3['MailAccount']['email']},'body':_0x2caf0c[_0xd64c('0x55')]};var _0x4f2f66={'account':{'id':_0x2c3cb3[_0xd64c('0xee')]},'body':_0x928eea,'log':_0xd64c('0xf1')};return respondWithRpcPromise(_0xd64c('0xf1'),_0xd64c('0xf2'),_0x4f2f66,client9001)[_0xd64c('0x2e')](function(){return _0x2caf0c;})[_0xd64c('0x25')](function(_0x2b71f6){console[_0xd64c('0x20')](_0x2b71f6);});}return;})[_0xd64c('0x2e')](function(){if(_0x2caf0c){return _0x2caf0c;}})[_0xd64c('0x2e')](respondWithResult(_0x1fc382,null))[_0xd64c('0x25')](function(_0x5750fd){console['error'](_0xd64c('0x25'),_0x5750fd);for(var _0x2031d6 of _0x465035){var _0x17a462=path[_0xd64c('0x72')](config['root'],'server',_0xd64c('0xc9'),_0xd64c('0xd9'),'offline-chat',_0x2031d6[_0xd64c('0x6b')]);fs_extra[_0xd64c('0xf3')](_0x17a462)[_0xd64c('0x25')](function(_0x1eb49f){console[_0xd64c('0x20')](_0xd64c('0xf4'),_0x17a462,_0x1eb49f);});}});};exports[_0xd64c('0xf5')]=function(_0x41b2c7,_0x3b6758,_0x30540c){return db[_0xd64c('0xb2')][_0xd64c('0x53')]({'where':{'id':_0x41b2c7[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x3b6758,null))[_0xd64c('0x2e')](function(_0x302b92){if(_0x302b92){return _0x302b92[_0xd64c('0xf5')](_0x41b2c7[_0xd64c('0x55')][_0xd64c('0x65')],_[_0xd64c('0xf6')](_0x41b2c7['body'],[_0xd64c('0x65'),'id'])||{});}})[_0xd64c('0x2e')](respondWithResult(_0x3b6758,null))[_0xd64c('0x25')](handleError(_0x3b6758,null));};exports[_0xd64c('0xf7')]=function(_0x47ed30,_0x3cac25,_0x2173ee){var _0x4df8a6={'raw':![],'where':{}};var _0x46f897={};var _0x517080={'count':0x0,'rows':[]};return db[_0xd64c('0x3a')][_0xd64c('0x61')]({'where':{'id':_0x47ed30['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x3cac25,null))['then'](function(_0x9a9dd1){if(_0x9a9dd1){_0x46f897['model']=_['keys'](db[_0xd64c('0xb2')][_0xd64c('0x3b')]);_0x46f897[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x47ed30[_0xd64c('0x3f')]);_0x46f897['filters']=_['intersection'](_0x46f897['model'],_0x46f897[_0xd64c('0x3f')]);_0x4df8a6[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x46f897[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x47ed30[_0xd64c('0x3f')]['fields']));_0x4df8a6[_0xd64c('0x43')]=_0x4df8a6[_0xd64c('0x43')]['length']?_0x4df8a6[_0xd64c('0x43')]:_0x46f897['model'];if(!_0x47ed30['query']['hasOwnProperty'](_0xd64c('0x47'))){_0x4df8a6['limit']=qs[_0xd64c('0x2b')](_0x47ed30['query']['limit']);_0x4df8a6[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x47ed30[_0xd64c('0x3f')]['offset']);}_0x4df8a6['order']=qs[_0xd64c('0x48')](_0x47ed30[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x4df8a6[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x47ed30['query'],_0x46f897[_0xd64c('0x41')]));_0x4df8a6['where'][_0xd64c('0x5e')]=_0x9a9dd1['id'];if(_0x47ed30[_0xd64c('0x3f')][_0xd64c('0x4b')]){_0x4df8a6[_0xd64c('0x49')]=_['merge'](_0x4df8a6[_0xd64c('0x49')],{'$or':_[_0xd64c('0x39')](_0x4df8a6[_0xd64c('0x43')],function(_0x4d9e1a){var _0x2c6a9e={};_0x2c6a9e[_0x4d9e1a]={'$like':'%'+_0x47ed30[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0x2c6a9e;})});}_0x4df8a6=_['merge']({},_0x4df8a6,_0x47ed30[_0xd64c('0x4d')]);return db[_0xd64c('0xb2')][_0xd64c('0x2c')]({'where':_0x4df8a6['where']})[_0xd64c('0x2e')](function(_0x1783cc){_0x517080['count']=_0x1783cc;if(_0x47ed30['query'][_0xd64c('0x4e')]){_0x4df8a6[_0xd64c('0x4f')]=[{'model':db[_0xd64c('0x84')],'as':_0xd64c('0xf8'),'required':![]},{'model':db['User'],'as':_0xd64c('0xf9'),'attributes':['name',_0xd64c('0xfa'),_0xd64c('0xfb')],'required':![]},{'model':db[_0xd64c('0xfc')],'as':_0xd64c('0xfd'),'attributes':['id',_0xd64c('0x34'),_0xd64c('0xfe')],'where':_0x47ed30[_0xd64c('0x3f')]['tag']?{'id':_0x47ed30[_0xd64c('0x3f')]['tag']}:undefined,'required':_0x47ed30[_0xd64c('0x3f')]['tag']?!![]:![]}];}return db[_0xd64c('0xb2')][_0xd64c('0x63')](_0x4df8a6);})[_0xd64c('0x2e')](function(_0x12697a){_0x517080[_0xd64c('0x50')]=_0x12697a;return _0x517080;});}})[_0xd64c('0x2e')](respondWithFilteredResult(_0x3cac25,_0x4df8a6))[_0xd64c('0x25')](handleError(_0x3cac25,null));};function iftimePromise(_0x425c5b,_0x14c93e){return respondWithRpcPromise(_0xd64c('0xff'),_0xd64c('0x100'),{'command':_0x14c93e[_0xd64c('0x101')]?util[_0xd64c('0xa8')](_0xd64c('0x102'),_0x425c5b[_0xd64c('0x103')],_0x14c93e[_0xd64c('0x101')]):util['format'](_0xd64c('0x104'),_0x425c5b['interval'])},client9002)['then'](function(_0x5dc790){var _0x1432bf=_0x5dc790&&_0x5dc790['indexOf']('true')>=0x0?!![]:![];logger[_0xd64c('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x14c93e['id'],_0x425c5b['id'],_0x425c5b[_0xd64c('0x103')],_0x1432bf?'ONLINE':_0xd64c('0x105'),_0x14c93e[_0xd64c('0x101')]?_0x14c93e[_0xd64c('0x101')]:_0xd64c('0x106'));return _0x1432bf;})[_0xd64c('0x25')](function(_0x358a1b){logger[_0xd64c('0x20')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x14c93e['id'],_0x425c5b['id'],_0x425c5b[_0xd64c('0x103')],util['inspect'](_0x358a1b,{'showHidden':![],'depth':null}),_0x14c93e[_0xd64c('0x101')]?_0x14c93e[_0xd64c('0x101')]:_0xd64c('0x106'));return![];});}exports[_0xd64c('0x100')]=function(_0x19b8ff,_0x5e6255,_0x559b7d){var _0x3e5b6c=0x0;var _0x21fddc=0x0;var _0xd33e07=![];var _0x66e23;var _0x524d23;return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x19b8ff['params']['id']},'include':[{'model':db[_0xd64c('0x107')],'as':_0xd64c('0x107'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xd64c('0x2e')](handleEntityNotFound(_0x5e6255,null))[_0xd64c('0x2e')](function(_0x165059){if(_0x165059){_0x66e23=_0x165059;return _0x165059[_0xd64c('0x108')]({'raw':!![]});}})[_0xd64c('0x2e')](function(_0x51e3e9){if(_0x66e23){if(_0x51e3e9){_0x524d23=_0x51e3e9;}}return require(_0xd64c('0x13'))[_0xd64c('0x109')]();})[_0xd64c('0x2e')](function(_0x5f31df){if(_0x5f31df){_0x21fddc=_0x5f31df[_0xd64c('0x10a')];_0xd33e07=_0x5f31df[_0xd64c('0x10b')];}})[_0xd64c('0x2e')](function(){return db[_0xd64c('0xb2')][_0xd64c('0x2c')]({'where':{'closed':![]}});})[_0xd64c('0x2e')](function(_0x610d2d){_0x3e5b6c=_0x610d2d;if(_0x21fddc&&_0x610d2d>_0x21fddc){return db[_0xd64c('0x10c')][_0xd64c('0x61')]({'where':{'id':0x1}})[_0xd64c('0x2e')](function(_0x57e7b8){if(_0x57e7b8){_0x57e7b8[_0xd64c('0x10d')](_0xd64c('0x10e'));}});}})[_0xd64c('0x2e')](function(){if(_0x66e23[_0xd64c('0x107')]&&_0x66e23[_0xd64c('0x107')]['Intervals']){var _0x2402b3=[];for(var _0x17407c=0x0;_0x17407c<_0x66e23[_0xd64c('0x107')][_0xd64c('0x10f')][_0xd64c('0x45')];_0x17407c++){var _0x532bb4=_0x66e23[_0xd64c('0x107')][_0xd64c('0x10f')][_0x17407c][_0xd64c('0x2f')]({'plain':!![]});_0x2402b3['push'](iftimePromise(_0x532bb4,_0x66e23));}return BPromise[_0xd64c('0x110')](_0x2402b3)[_0xd64c('0x2e')](function(_0x134492){return _[_0xd64c('0x111')](_0x134492);});}else{return!![];}})[_0xd64c('0x2e')](function(_0x4f1f13){var _0x47c0a7=fs[_0xd64c('0xd0')](path['join'](config[_0xd64c('0x73')],_0xd64c('0x112')),_0xd64c('0xd2'));var _0x2900c1={'remote':_0x66e23['remote'],'query':querystring[_0xd64c('0x1f')](_[_0xd64c('0x52')](_0x66e23['get']({'plain':!![]}),{'customerIp':_0x19b8ff[_0xd64c('0xa0')][_0xd64c('0xa1')]||_0x19b8ff[_0xd64c('0xa0')]['x-real-ip']||_0x19b8ff['connection'][_0xd64c('0x113')]||_0x19b8ff['ip'],'referer':_0x19b8ff[_0xd64c('0xa0')][_0xd64c('0xa6')],'openedInteractions':_0x3e5b6c,'maxInteractions':_0x21fddc,'virtual':_0xd33e07[_0xd64c('0x10a')],'online':_0x4f1f13,'custom':_0xd33e07}))['replace'](/'/g,'\x5c\x27')};_0x5e6255[_0xd64c('0x35')](ejs[_0xd64c('0xd3')](Mustache[_0xd64c('0xd3')](_0x47c0a7,_0x2900c1),{'proactiveActions':_0x524d23,'alignment':_0x66e23[_0xd64c('0x114')],'verticalAlignment':_0x66e23[_0xd64c('0x115')],'div_color':_0x66e23[_0xd64c('0xfe')],'text_color':_0x66e23['textColor'],'button_color':_0x66e23['color_button'],'background_color':_0x66e23[_0xd64c('0x116')]}));})[_0xd64c('0x25')](handleError(_0x5e6255,null));};exports[_0xd64c('0x117')]=function(_0x1c496f,_0x293306,_0x530932){return db[_0xd64c('0x3a')][_0xd64c('0x61')]({'where':{'id':_0x1c496f[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x293306,null))[_0xd64c('0x2e')](function(_0x6293e0){if(_0x6293e0){return db[_0xd64c('0xdb')][_0xd64c('0x118')](function(_0x4e11aa){return db[_0xd64c('0x96')][_0xd64c('0x32')]({'where':{'ChatWebsiteId':_0x1c496f['params']['id']},'transaction':_0x4e11aa})[_0xd64c('0x2e')](function(_0x3d4547){var _0x56327e=_[_0xd64c('0x39')](_0x1c496f[_0xd64c('0x55')],function(_0xa5d4e1){_0xa5d4e1[_0xd64c('0x5e')]=_0x1c496f[_0xd64c('0x51')]['id'];return _0xa5d4e1;});return db['ChatApplication']['bulkCreate'](_0x56327e,{'transaction':_0x4e11aa});});})[_0xd64c('0x2e')](function(){return db['ChatApplication'][_0xd64c('0x119')]({'where':{'ChatWebsiteId':_0x1c496f['params']['id']},'order':_0xd64c('0x9c')});});}})[_0xd64c('0x2e')](respondWithResult(_0x293306,null))[_0xd64c('0x25')](handleError(_0x293306,null));};exports[_0xd64c('0x11a')]=function(_0x48d285,_0x413314,_0x5f20fc){var _0x2d87da={};var _0x3c65a7={};var _0x31dbd3;var _0x4192cc;return db['ChatWebsite']['findOne']({'where':{'id':_0x48d285['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x413314,null))[_0xd64c('0x2e')](function(_0x228ba1){if(_0x228ba1){_0x31dbd3=_0x228ba1;_0x3c65a7['model']=_[_0xd64c('0x40')](db['ChatApplication'][_0xd64c('0x3b')]);_0x3c65a7[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x48d285[_0xd64c('0x3f')]);_0x3c65a7['filters']=_['intersection'](_0x3c65a7[_0xd64c('0x3e')],_0x3c65a7['query']);_0x2d87da['attributes']=_[_0xd64c('0x42')](_0x3c65a7[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x48d285[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x2d87da[_0xd64c('0x43')]=_0x2d87da[_0xd64c('0x43')][_0xd64c('0x45')]?_0x2d87da[_0xd64c('0x43')]:_0x3c65a7[_0xd64c('0x3e')];_0x2d87da[_0xd64c('0x62')]=qs[_0xd64c('0x48')](_0x48d285[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x2d87da[_0xd64c('0x49')]=qs['filters'](_['pick'](_0x48d285['query'],_0x3c65a7['filters']));if(_0x48d285['query']['filter']){_0x2d87da[_0xd64c('0x49')]=_[_0xd64c('0x52')](_0x2d87da[_0xd64c('0x49')],{'$or':_[_0xd64c('0x39')](_0x2d87da[_0xd64c('0x43')],function(_0x14437b){var _0x50b8fd={};_0x50b8fd[_0x14437b]={'$like':'%'+_0x48d285['query'][_0xd64c('0x4b')]+'%'};return _0x50b8fd;})});}_0x2d87da=_['merge']({},_0x2d87da,_0x48d285[_0xd64c('0x4d')]);return _0x31dbd3[_0xd64c('0x11a')](_0x2d87da);}})[_0xd64c('0x2e')](function(_0x573494){if(_0x573494){_0x4192cc=_0x573494[_0xd64c('0x45')];if(!_0x48d285['query'][_0xd64c('0x46')](_0xd64c('0x47'))){_0x2d87da[_0xd64c('0x2b')]=qs[_0xd64c('0x2b')](_0x48d285[_0xd64c('0x3f')][_0xd64c('0x2b')]);_0x2d87da[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x48d285[_0xd64c('0x3f')]['offset']);}return _0x31dbd3['getApplications'](_0x2d87da);}})[_0xd64c('0x2e')](function(_0x4dcc6e){if(_0x4dcc6e){return _0x4dcc6e?{'count':_0x4192cc,'rows':_0x4dcc6e}:null;}})['then'](respondWithResult(_0x413314,null))['catch'](handleError(_0x413314,null));};exports[_0xd64c('0x11b')]=function(_0x3389f6,_0x21b7c,_0x4236e8){return db['chatProactiveAction'][_0xd64c('0x53')]({'where':{'id':_0x3389f6[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x21b7c,null))['then'](function(_0xc351a8){if(_0xc351a8){return _0xc351a8[_0xd64c('0x11b')](_0x3389f6['body'][_0xd64c('0x65')],_[_0xd64c('0xf6')](_0x3389f6[_0xd64c('0x55')],[_0xd64c('0x65'),'id'])||{});}})[_0xd64c('0x2e')](respondWithResult(_0x21b7c,null))[_0xd64c('0x25')](handleError(_0x21b7c,null));};exports[_0xd64c('0x108')]=function(_0x4bf270,_0x2bef91,_0x678774){var _0x5e00d9={};var _0x34875a={};var _0x4ce6e2;var _0x2a2020;return db[_0xd64c('0x3a')][_0xd64c('0x61')]({'where':{'id':_0x4bf270[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x2bef91,null))[_0xd64c('0x2e')](function(_0x41e2fd){if(_0x41e2fd){_0x4ce6e2=_0x41e2fd;_0x34875a[_0xd64c('0x3e')]=_[_0xd64c('0x40')](db[_0xd64c('0x11c')][_0xd64c('0x3b')]);_0x34875a[_0xd64c('0x3f')]=_['keys'](_0x4bf270[_0xd64c('0x3f')]);_0x34875a[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x34875a['model'],_0x34875a['query']);_0x5e00d9[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x34875a[_0xd64c('0x3e')],qs['fields'](_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x5e00d9[_0xd64c('0x43')]=_0x5e00d9[_0xd64c('0x43')][_0xd64c('0x45')]?_0x5e00d9['attributes']:_0x34875a['model'];_0x5e00d9[_0xd64c('0x62')]=qs[_0xd64c('0x48')](_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x5e00d9[_0xd64c('0x49')]=qs['filters'](_[_0xd64c('0x4a')](_0x4bf270[_0xd64c('0x3f')],_0x34875a[_0xd64c('0x41')]));if(_0x4bf270['query'][_0xd64c('0x4b')]){_0x5e00d9[_0xd64c('0x49')]=_[_0xd64c('0x52')](_0x5e00d9[_0xd64c('0x49')],{'$or':_[_0xd64c('0x39')](_0x5e00d9[_0xd64c('0x43')],function(_0x262d25){var _0x335950={};_0x335950[_0x262d25]={'$like':'%'+_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0x335950;})});}_0x5e00d9=_[_0xd64c('0x52')]({},_0x5e00d9,_0x4bf270[_0xd64c('0x4d')]);return _0x4ce6e2[_0xd64c('0x108')](_0x5e00d9);}})[_0xd64c('0x2e')](function(_0x54a125){if(_0x54a125){_0x2a2020=_0x54a125[_0xd64c('0x45')];if(!_0x4bf270['query'][_0xd64c('0x46')](_0xd64c('0x47'))){_0x5e00d9[_0xd64c('0x2b')]=qs[_0xd64c('0x2b')](_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x2b')]);_0x5e00d9[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x29')]);}return _0x4ce6e2['getProactiveActions'](_0x5e00d9);}})[_0xd64c('0x2e')](function(_0x36755e){if(_0x36755e){return _0x36755e?{'count':_0x2a2020,'rows':_0x36755e}:null;}})[_0xd64c('0x2e')](respondWithResult(_0x2bef91,null))[_0xd64c('0x25')](handleError(_0x2bef91,null));};exports['getFields']=function(_0x16ca70,_0x51da11,_0xac1ddc){var _0x79fd2f=_0x16ca70[_0xd64c('0x3f')]['online']==='false'?_0xd64c('0x11d'):_0xd64c('0x11e');return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'attributes':['id',_0x79fd2f],'where':{'id':_0x16ca70[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x51da11,null))[_0xd64c('0x2e')](function(_0x184d2d){if(_0x184d2d){var _0x57ea35=_0x184d2d[_0x79fd2f];var _0x56dbf0=_0x57ea35&&_0x57ea35['items']?_0x57ea35['items']:[];_0x51da11['send']({'fromKey':_[_0xd64c('0x75')](_0x57ea35['fromKey'])?undefined:_0x57ea35[_0xd64c('0x11f')],'count':_0x56dbf0[_0xd64c('0x45')],'rows':_0x56dbf0});}})[_0xd64c('0x25')](handleError(_0x51da11,null));};exports['getOfflineMessages']=function(_0x2292af,_0x46b00a,_0x5d524f){var _0x289f39={'raw':![],'where':{}};var _0x43ab37={};var _0x432b26={'count':0x0,'rows':[]};return db[_0xd64c('0x3a')]['findOne']({'where':{'id':_0x2292af['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x46b00a,null))[_0xd64c('0x2e')](function(_0x39e2a2){if(_0x39e2a2){_0x43ab37[_0xd64c('0x3e')]=_[_0xd64c('0x40')](db['ChatOfflineMessage'][_0xd64c('0x3b')]);_0x43ab37[_0xd64c('0x3f')]=_['keys'](_0x2292af[_0xd64c('0x3f')]);_0x43ab37[_0xd64c('0x41')]=_['intersection'](_0x43ab37[_0xd64c('0x3e')],_0x43ab37[_0xd64c('0x3f')]);_0x289f39[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x43ab37[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x2292af['query'][_0xd64c('0x44')]));_0x289f39['attributes']=_0x289f39[_0xd64c('0x43')]['length']?_0x289f39[_0xd64c('0x43')]:_0x43ab37[_0xd64c('0x3e')];if(!_0x2292af[_0xd64c('0x3f')][_0xd64c('0x46')](_0xd64c('0x47'))){_0x289f39[_0xd64c('0x2b')]=qs[_0xd64c('0x2b')](_0x2292af['query'][_0xd64c('0x2b')]);_0x289f39[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x2292af[_0xd64c('0x3f')][_0xd64c('0x29')]);}_0x289f39[_0xd64c('0x62')]=qs[_0xd64c('0x48')](_0x2292af[_0xd64c('0x3f')]['sort']);_0x289f39[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x2292af[_0xd64c('0x3f')],_0x43ab37[_0xd64c('0x41')]));_0x289f39[_0xd64c('0x49')][_0xd64c('0x5e')]=_0x39e2a2['id'];if(_0x2292af[_0xd64c('0x3f')][_0xd64c('0x4b')]){_0x289f39[_0xd64c('0x49')]=_[_0xd64c('0x52')](_0x289f39['where'],{'$or':_[_0xd64c('0x39')](_0x289f39['attributes'],function(_0x421cd9){var _0x530f6c={};_0x530f6c[_0x421cd9]={'$like':'%'+_0x2292af[_0xd64c('0x3f')]['filter']+'%'};return _0x530f6c;})});}_0x289f39=_[_0xd64c('0x52')]({},_0x289f39,_0x2292af[_0xd64c('0x4d')]);return db[_0xd64c('0xd5')][_0xd64c('0x2c')]({'where':_0x289f39['where']})[_0xd64c('0x2e')](function(_0x2ed3f2){_0x432b26[_0xd64c('0x2c')]=_0x2ed3f2;if(_0x2292af[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x289f39['include']=[{'all':!![]}];}else{_0x289f39[_0xd64c('0x4f')]=[{'model':db[_0xd64c('0x84')],'as':_0xd64c('0xf8'),'required':![]},{'model':db[_0xd64c('0xdc')],'as':'Attachments','required':![]}];}return db[_0xd64c('0xd5')][_0xd64c('0x63')](_0x289f39);})['then'](function(_0x386cd0){_0x432b26['rows']=_0x386cd0;return _0x432b26;});}})[_0xd64c('0x2e')](respondWithFilteredResult(_0x46b00a,_0x289f39))[_0xd64c('0x25')](handleError(_0x46b00a,null));};exports[_0xd64c('0x120')]=function(_0x4aebf7,_0x2e058e,_0x51a048){return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x4aebf7[_0xd64c('0x51')]['id']}})['then'](handleEntityNotFound(_0x2e058e,null))['then'](function(_0x1879f9){if(_0x1879f9){return _0x1879f9[_0xd64c('0x120')](_0x4aebf7[_0xd64c('0x55')]['ids'],_[_0xd64c('0xf6')](_0x4aebf7[_0xd64c('0x55')],[_0xd64c('0x65'),'id'])||{})[_0xd64c('0xb5')](function(_0x1cd860){for(var _0x2a0ea9=0x0;_0x2a0ea9<_0x4aebf7[_0xd64c('0x55')][_0xd64c('0x65')][_0xd64c('0x45')];_0x2a0ea9+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x4aebf7[_0xd64c('0x55')][_0xd64c('0x65')][_0x2a0ea9]),'ChatWebsiteId':Number(_0x4aebf7[_0xd64c('0x51')]['id'])});}return _0x1cd860;});}})[_0xd64c('0x2e')](respondWithResult(_0x2e058e,null))[_0xd64c('0x25')](handleError(_0x2e058e,null));};exports[_0xd64c('0x121')]=function(_0xa4800d,_0x4c0372,_0x8f8652){return db['ChatWebsite'][_0xd64c('0x53')]({'where':{'id':_0xa4800d[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x4c0372,null))[_0xd64c('0x2e')](function(_0x4a9930){if(_0x4a9930){return _0x4a9930[_0xd64c('0x121')](_0xa4800d[_0xd64c('0x3f')][_0xd64c('0x65')])[_0xd64c('0x2e')](function(){if(_[_0xd64c('0x122')](_0xa4800d['query']['ids'])){for(var _0x48c04d=0x0;_0x48c04d<_0xa4800d['query'][_0xd64c('0x65')][_0xd64c('0x45')];_0x48c04d+=0x1){socket[_0xd64c('0x123')]('userChatWebsite:remove',{'UserId':Number(_0xa4800d[_0xd64c('0x3f')][_0xd64c('0x65')][_0x48c04d]),'ChatWebsiteId':Number(_0xa4800d[_0xd64c('0x51')]['id'])});}}else{socket[_0xd64c('0x123')](_0xd64c('0x124'),{'UserId':Number(_0xa4800d['query'][_0xd64c('0x65')]),'ChatWebsiteId':Number(_0xa4800d[_0xd64c('0x51')]['id'])});}});}})[_0xd64c('0x2e')](respondWithStatusCode(_0x4c0372,null))[_0xd64c('0x25')](handleError(_0x4c0372,null));};exports[_0xd64c('0x125')]=function(_0x440c1a,_0x13590e,_0x1f6ec8){var _0x4a3e1c={};var _0x103175={};var _0x5c9173;var _0x5d3007;return db[_0xd64c('0x3a')]['findOne']({'where':{'id':_0x440c1a['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x13590e,null))[_0xd64c('0x2e')](function(_0x3340ef){if(_0x3340ef){_0x5c9173=_0x3340ef;_0x103175['model']=_[_0xd64c('0x40')](db[_0xd64c('0x126')][_0xd64c('0x3b')]);_0x103175[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x440c1a['query']);_0x103175[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x103175['model'],_0x103175[_0xd64c('0x3f')]);_0x4a3e1c[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x103175[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x440c1a[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x4a3e1c[_0xd64c('0x43')]=_0x4a3e1c[_0xd64c('0x43')][_0xd64c('0x45')]?_0x4a3e1c[_0xd64c('0x43')]:_0x103175[_0xd64c('0x3e')];_0x4a3e1c[_0xd64c('0x62')]=qs[_0xd64c('0x48')](_0x440c1a[_0xd64c('0x3f')]['sort']);_0x4a3e1c[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x440c1a[_0xd64c('0x3f')],_0x103175[_0xd64c('0x41')]));if(_0x440c1a['query'][_0xd64c('0x4b')]){_0x4a3e1c[_0xd64c('0x49')]=_['merge'](_0x4a3e1c[_0xd64c('0x49')],{'$or':_['map'](_0x4a3e1c[_0xd64c('0x43')],function(_0x296c0c){var _0x880a58={};_0x880a58[_0x296c0c]={'$like':'%'+_0x440c1a[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0x880a58;})});}_0x4a3e1c=_[_0xd64c('0x52')]({},_0x4a3e1c,_0x440c1a[_0xd64c('0x4d')]);return _0x5c9173['getAgents'](_0x4a3e1c);}})[_0xd64c('0x2e')](function(_0x4f9666){if(_0x4f9666){_0x5d3007=_0x4f9666[_0xd64c('0x45')];if(!_0x440c1a['query'][_0xd64c('0x46')](_0xd64c('0x47'))){_0x4a3e1c['limit']=qs[_0xd64c('0x2b')](_0x440c1a['query'][_0xd64c('0x2b')]);_0x4a3e1c[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x440c1a[_0xd64c('0x3f')][_0xd64c('0x29')]);}return _0x5c9173[_0xd64c('0x125')](_0x4a3e1c);}})[_0xd64c('0x2e')](function(_0x49d8a2){if(_0x49d8a2){return _0x49d8a2?{'count':_0x5d3007,'rows':_0x49d8a2}:null;}})[_0xd64c('0x2e')](respondWithResult(_0x13590e,null))[_0xd64c('0x25')](handleError(_0x13590e,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index fdb1289..a90428c 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 _0x1782=['hasOwnProperty','hook','../../mysqldb','ChatWebsite','update','emit'];(function(_0x11ad65,_0x352d3c){var _0x35590c=function(_0x2c3845){while(--_0x2c3845){_0x11ad65['push'](_0x11ad65['shift']());}};_0x35590c(++_0x352d3c);}(_0x1782,0x188));var _0x2178=function(_0x59941b,_0x121697){_0x59941b=_0x59941b-0x0;var _0x43d0b2=_0x1782[_0x59941b];return _0x43d0b2;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x2178('0x0'))['db'][_0x2178('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2178('0x2'),'afterDestroy':'remove'};function emitEvent(_0xf336e1){return function(_0x24c4cd,_0x4a3e99,_0x40f25d){ChatWebsiteEvents['emit'](_0xf336e1+':'+_0x24c4cd['id'],_0x24c4cd);ChatWebsiteEvents[_0x2178('0x3')](_0xf336e1,_0x24c4cd);_0x40f25d(null);};}for(var e in events){if(events[_0x2178('0x4')](e)){var event=events[e];ChatWebsite[_0x2178('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc7b4=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x326863,_0x48bc96){var _0x3cc1e9=function(_0x54cd54){while(--_0x54cd54){_0x326863['push'](_0x326863['shift']());}};_0x3cc1e9(++_0x48bc96);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4c7b('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4c7b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4c7b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4c7b('0x3'),'afterDestroy':_0x4c7b('0x4')};function emitEvent(_0x279c21){return function(_0x2a8b1d,_0x109687,_0x5a20ca){ChatWebsiteEvents[_0x4c7b('0x5')](_0x279c21+':'+_0x2a8b1d['id'],_0x2a8b1d);ChatWebsiteEvents[_0x4c7b('0x5')](_0x279c21,_0x2a8b1d);_0x5a20ca(null);};}for(var e in events){if(events[_0x4c7b('0x6')](e)){var event=events[e];ChatWebsite[_0x4c7b('0x7')](e,emitEvent(event));}}module[_0x4c7b('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 d99e90d..afa2562 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 _0x2ad7=['exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x535929,_0x2729d9){var _0x571dfd=function(_0x17e260){while(--_0x17e260){_0x535929['push'](_0x535929['shift']());}};_0x571dfd(++_0x2729d9);}(_0x2ad7,0xb5));var _0x72ad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2ad7[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x72ad('0x0'));var util=require(_0x72ad('0x1'));var logger=require(_0x72ad('0x2'))(_0x72ad('0x3'));var moment=require(_0x72ad('0x4'));var BPromise=require(_0x72ad('0x5'));var rp=require(_0x72ad('0x6'));var fs=require('fs');var path=require(_0x72ad('0x7'));var rimraf=require(_0x72ad('0x8'));var config=require(_0x72ad('0x9'));var attributes=require(_0x72ad('0xa'));module[_0x72ad('0xb')]=function(_0x307874,_0x5f5cda){return _0x307874['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a92=['chat_websites','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x2f62a5,_0x43985d){var _0x32f3a7=function(_0x487d0b){while(--_0x487d0b){_0x2f62a5['push'](_0x2f62a5['shift']());}};_0x32f3a7(++_0x43985d);}(_0x7a92,0x1e5));var _0x27a9=function(_0x3149da,_0x49d0a3){_0x3149da=_0x3149da-0x0;var _0x180dc3=_0x7a92[_0x3149da];return _0x180dc3;};'use strict';var _=require('lodash');var util=require(_0x27a9('0x0'));var logger=require(_0x27a9('0x1'))('api');var moment=require(_0x27a9('0x2'));var BPromise=require(_0x27a9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x27a9('0x4'));var config=require(_0x27a9('0x5'));var attributes=require(_0x27a9('0x6'));module[_0x27a9('0x7')]=function(_0x1845c4,_0x2083ef){return _0x1845c4[_0x27a9('0x8')](_0x27a9('0x9'),attributes,{'tableName':_0x27a9('0xa'),'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 8121226..b5d997b 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 _0xad7e=['stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0xad7e,0x1e6));var _0xead7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad7e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xead7('0x0'));var util=require(_0xead7('0x1'));var moment=require('moment');var BPromise=require(_0xead7('0x2'));var rs=require(_0xead7('0x3'));var fs=require('fs');var Redis=require(_0xead7('0x4'));var db=require(_0xead7('0x5'))['db'];var utils=require(_0xead7('0x6'));var logger=require('../../config/logger')(_0xead7('0x7'));var config=require(_0xead7('0x8'));var jayson=require(_0xead7('0x9'));var client=jayson[_0xead7('0xa')][_0xead7('0xb')]({'port':0x232a});config['redis']=_[_0xead7('0xc')](config[_0xead7('0xd')],{'host':_0xead7('0xe'),'port':0x18eb});var socket=require(_0xead7('0xf'))(new Redis(config[_0xead7('0xd')]));require(_0xead7('0x10'))[_0xead7('0x11')](socket);function respondWithRpcPromise(_0x540d38,_0x50f248,_0x400a2f){return new BPromise(function(_0x4674db,_0x4ec4b9){return client[_0xead7('0x12')](_0x540d38,_0x400a2f)[_0xead7('0x13')](function(_0xe75e9f){logger[_0xead7('0x14')](_0xead7('0x15'),_0x50f248,'request\x20sent');logger[_0xead7('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x50f248,_0xead7('0x17'),JSON[_0xead7('0x18')](_0xe75e9f));if(_0xe75e9f['error']){if(_0xe75e9f['error'][_0xead7('0x19')]===0x1f4){logger[_0xead7('0x1a')](_0xead7('0x15'),_0x50f248,_0xe75e9f[_0xead7('0x1a')][_0xead7('0x1b')]);return _0x4ec4b9(_0xe75e9f['error']['message']);}logger[_0xead7('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x50f248,_0xe75e9f[_0xead7('0x1a')][_0xead7('0x1b')]);return _0x4674db(_0xe75e9f['error']['message']);}else{logger['info'](_0xead7('0x15'),_0x50f248,_0xead7('0x17'));_0x4674db(_0xe75e9f[_0xead7('0x1c')][_0xead7('0x1b')]);}})[_0xead7('0x1d')](function(_0x4c703f){logger[_0xead7('0x1a')](_0xead7('0x15'),_0x50f248,_0x4c703f);_0x4ec4b9(_0x4c703f);});});}
\ No newline at end of file
+var _0x1017=['request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','./chatWebsite.socket'];(function(_0x384a44,_0xdc4c20){var _0x314396=function(_0x5dba0c){while(--_0x5dba0c){_0x384a44['push'](_0x384a44['shift']());}};_0x314396(++_0xdc4c20);}(_0x1017,0x1d8));var _0x7101=function(_0x74069a,_0x4f93ee){_0x74069a=_0x74069a-0x0;var _0x2bdc85=_0x1017[_0x74069a];return _0x2bdc85;};'use strict';var _=require(_0x7101('0x0'));var util=require(_0x7101('0x1'));var moment=require('moment');var BPromise=require(_0x7101('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7101('0x3'))['db'];var utils=require(_0x7101('0x4'));var logger=require('../../config/logger')(_0x7101('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7101('0x6')]({'port':0x232a});config[_0x7101('0x7')]=_[_0x7101('0x8')](config[_0x7101('0x7')],{'host':_0x7101('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7101('0xa'))['register'](socket);function respondWithRpcPromise(_0x29abf7,_0x5b3d55,_0x296a9d){return new BPromise(function(_0x486c9e,_0x569952){return client[_0x7101('0xb')](_0x29abf7,_0x296a9d)[_0x7101('0xc')](function(_0xa90941){logger[_0x7101('0xd')](_0x7101('0xe'),_0x5b3d55,'request\x20sent');logger[_0x7101('0xf')](_0x7101('0x10'),_0x5b3d55,_0x7101('0x11'),JSON[_0x7101('0x12')](_0xa90941));if(_0xa90941[_0x7101('0x13')]){if(_0xa90941[_0x7101('0x13')][_0x7101('0x14')]===0x1f4){logger[_0x7101('0x13')](_0x7101('0xe'),_0x5b3d55,_0xa90941[_0x7101('0x13')][_0x7101('0x15')]);return _0x569952(_0xa90941[_0x7101('0x13')][_0x7101('0x15')]);}logger[_0x7101('0x13')](_0x7101('0xe'),_0x5b3d55,_0xa90941['error']['message']);return _0x486c9e(_0xa90941[_0x7101('0x13')][_0x7101('0x15')]);}else{logger[_0x7101('0xd')](_0x7101('0xe'),_0x5b3d55,_0x7101('0x11'));_0x486c9e(_0xa90941['result'][_0x7101('0x15')]);}})[_0x7101('0x16')](function(_0xd5be9b){logger[_0x7101('0x13')](_0x7101('0xe'),_0x5b3d55,_0xd5be9b);_0x569952(_0xd5be9b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 4df5df6..063aea5 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 _0x2ffa=['./chatWebsite.events','save','remove','update','register','length','chatWebsite:'];(function(_0x126d9e,_0x2939b0){var _0xd7be62=function(_0x407930){while(--_0x407930){_0x126d9e['push'](_0x126d9e['shift']());}};_0xd7be62(++_0x2939b0);}(_0x2ffa,0x7e));var _0xa2ff=function(_0x26ba4c,_0x45387a){_0x26ba4c=_0x26ba4c-0x0;var _0x52a42c=_0x2ffa[_0x26ba4c];return _0x52a42c;};'use strict';var ChatWebsiteEvents=require(_0xa2ff('0x0'));var events=[_0xa2ff('0x1'),_0xa2ff('0x2'),_0xa2ff('0x3')];function createListener(_0x51510d,_0x569e86){return function(_0x159131){_0x569e86['emit'](_0x51510d,_0x159131);};}function removeListener(_0x5601ba,_0x518bfa){return function(){ChatWebsiteEvents['removeListener'](_0x5601ba,_0x518bfa);};}exports[_0xa2ff('0x4')]=function(_0x443d6f){for(var _0x16f9b2=0x0,_0xa37c9c=events[_0xa2ff('0x5')];_0x16f9b2<_0xa37c9c;_0x16f9b2++){var _0x5a868c=events[_0x16f9b2];var _0x140f66=createListener(_0xa2ff('0x6')+_0x5a868c,_0x443d6f);ChatWebsiteEvents['on'](_0x5a868c,_0x140f66);}};
\ No newline at end of file
+var _0xaddb=['length','chatWebsite:','save','update','emit','removeListener','register'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xaddb,0xc6));var _0xbadd=function(_0x3820b5,_0x504325){_0x3820b5=_0x3820b5-0x0;var _0xb749d2=_0xaddb[_0x3820b5];return _0xb749d2;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xbadd('0x0'),'remove',_0xbadd('0x1')];function createListener(_0x250cd4,_0x34b7f2){return function(_0x6092b6){_0x34b7f2[_0xbadd('0x2')](_0x250cd4,_0x6092b6);};}function removeListener(_0x2edee6,_0x98f5d5){return function(){ChatWebsiteEvents[_0xbadd('0x3')](_0x2edee6,_0x98f5d5);};}exports[_0xbadd('0x4')]=function(_0x2a8b4d){for(var _0x1d26a0=0x0,_0xe1eb9f=events[_0xbadd('0x5')];_0x1d26a0<_0xe1eb9f;_0x1d26a0++){var _0x14fcbf=events[_0x1d26a0];var _0x27f06a=createListener(_0xbadd('0x6')+_0x14fcbf,_0x2a8b4d);ChatWebsiteEvents['on'](_0x14fcbf,_0x27f06a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7e25703..b4f7245 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 _0x775e=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','diskStorage','join','root','server/files/images/logos/','originalname','single','addLogo','server/files/images/avatars/','format','%s-%s','now','file','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer'];(function(_0x2daf18,_0x3db257){var _0x3b1e89=function(_0x27185f){while(--_0x27185f){_0x2daf18['push'](_0x2daf18['shift']());}};_0x3b1e89(++_0x3db257);}(_0x775e,0x87));var _0xe775=function(_0x1dfa23,_0x19e069){_0x1dfa23=_0x1dfa23-0x0;var _0x134989=_0x775e[_0x1dfa23];return _0x134989;};'use strict';var multer=require(_0xe775('0x0'));var util=require(_0xe775('0x1'));var path=require(_0xe775('0x2'));var timeout=require('connect-timeout');var express=require(_0xe775('0x3'));var router=express['Router']();var fs_extra=require(_0xe775('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe775('0x5'));var config=require(_0xe775('0x6'));var controller=require(_0xe775('0x7'));router[_0xe775('0x8')]('/',auth[_0xe775('0x9')](),controller[_0xe775('0xa')]);router[_0xe775('0x8')]('/describe',auth[_0xe775('0x9')](),controller[_0xe775('0xb')]);router[_0xe775('0x8')](_0xe775('0xc'),auth[_0xe775('0x9')](),controller['show']);router['get'](_0xe775('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xe775('0x8')]('/:id/canned_answers',auth[_0xe775('0x9')](),controller['getAnswers']);router[_0xe775('0x8')](_0xe775('0xe'),controller[_0xe775('0xf')]);router[_0xe775('0x8')](_0xe775('0x10'),controller[_0xe775('0x11')]);router[_0xe775('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router['get'](_0xe775('0x12'),controller[_0xe775('0x13')]);router['get'](_0xe775('0x14'),auth[_0xe775('0x9')](),controller[_0xe775('0x15')]);router['get'](_0xe775('0x16'),controller[_0xe775('0x17')]);router['get'](_0xe775('0x18'),auth[_0xe775('0x9')](),controller[_0xe775('0x19')]);router[_0xe775('0x8')](_0xe775('0x1a'),auth[_0xe775('0x9')](),controller['getProactiveActions']);router['get'](_0xe775('0x1b'),controller['getFields']);router[_0xe775('0x8')](_0xe775('0x1c'),auth[_0xe775('0x9')](),controller[_0xe775('0x1d')]);router[_0xe775('0x8')](_0xe775('0x1e'),auth[_0xe775('0x9')](),controller[_0xe775('0x1f')]);router[_0xe775('0x20')]('/',auth[_0xe775('0x9')](),controller[_0xe775('0x21')]);router['post'](_0xe775('0xd'),auth[_0xe775('0x9')](),controller[_0xe775('0x22')]);router['post'](_0xe775('0x23'),auth[_0xe775('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xe775('0x24')]({'destination':function(_0x8fff0,_0x1a08da,_0x1958dc){_0x1958dc(null,path[_0xe775('0x25')](config[_0xe775('0x26')],_0xe775('0x27')));},'filename':function(_0x15624f,_0x5cbd2c,_0x62d1a){_0x62d1a(null,util['format']('%s-%s',Date['now'](),_0x5cbd2c[_0xe775('0x28')]));}})});router[_0xe775('0x20')]('/:id/logo',upload[_0xe775('0x29')]('file'),controller[_0xe775('0x2a')]);var upload=multer({'storage':multer[_0xe775('0x24')]({'destination':function(_0x425f7c,_0x1535f6,_0x577569){_0x577569(null,path[_0xe775('0x25')](config['root'],_0xe775('0x2b')));},'filename':function(_0x18b963,_0x2acadc,_0x2c8c63){_0x2c8c63(null,util[_0xe775('0x2c')](_0xe775('0x2d'),Date[_0xe775('0x2e')](),_0x2acadc[_0xe775('0x28')]));}})});router[_0xe775('0x20')](_0xe775('0x10'),upload['single'](_0xe775('0x2f')),controller[_0xe775('0x30')]);var upload=multer({'storage':multer[_0xe775('0x24')]({'destination':function(_0x3fac92,_0x55f12d,_0x1f7249){_0x1f7249(null,path['join'](config[_0xe775('0x26')],_0xe775('0x2b')));},'filename':function(_0x1c8172,_0x4e4db5,_0x51b5bd){_0x51b5bd(null,util[_0xe775('0x2c')](_0xe775('0x2d'),Date[_0xe775('0x2e')](),_0x4e4db5[_0xe775('0x28')]));}})});router[_0xe775('0x20')](_0xe775('0x31'),upload[_0xe775('0x29')](_0xe775('0x2f')),controller[_0xe775('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4fee22,_0x555420,_0x235d45){_0x235d45(null,path[_0xe775('0x25')](config[_0xe775('0x26')],_0xe775('0x2b')));},'filename':function(_0x28bdd9,_0x4723e9,_0x1d7507){_0x1d7507(null,util[_0xe775('0x2c')](_0xe775('0x2d'),Date[_0xe775('0x2e')](),_0x4723e9[_0xe775('0x28')]));}})});router['post'](_0xe775('0x12'),upload[_0xe775('0x29')](_0xe775('0x2f')),controller['addSystemAvatar']);router['post'](_0xe775('0x33'),controller[_0xe775('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xe775('0x24')]({'destination':function(_0x3d04ab,_0x59cfba,_0x16f6c8){const _0x2c49ee=path['join'](config['root'],_0xe775('0x35'),'attachments',_0xe775('0x36'));fs_extra[_0xe775('0x37')](_0x2c49ee,function(){_0x16f6c8(null,_0x2c49ee);});},'filename':function(_0x34b1d5,_0x153f18,_0x2417b5){const _0x147b0c=_0x153f18[_0xe775('0x28')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x8334ae=path['extname'](_0x147b0c);const _0x149710=Date[_0xe775('0x2e')]()+'-'+_0x147b0c[_0xe775('0x38')](_0x8334ae,'')+_0x8334ae;_0x2417b5(null,_0x149710);}})});router[_0xe775('0x20')](_0xe775('0x39'),offlineUploadMulter[_0xe775('0x3a')](),controller[_0xe775('0x3b')]);router[_0xe775('0x20')]('/:id/interactions',auth[_0xe775('0x9')](),controller[_0xe775('0x3c')]);router[_0xe775('0x20')](_0xe775('0x18'),auth[_0xe775('0x9')](),controller['addApplications']);router[_0xe775('0x20')](_0xe775('0x1a'),auth[_0xe775('0x9')](),controller['addProactiveActions']);router[_0xe775('0x20')](_0xe775('0x1e'),auth[_0xe775('0x9')](),controller[_0xe775('0x3d')]);router[_0xe775('0x3e')]('/:id',auth[_0xe775('0x9')](),controller['update']);router[_0xe775('0x3f')](_0xe775('0xc'),auth[_0xe775('0x9')](),controller[_0xe775('0x40')]);router[_0xe775('0x3f')](_0xe775('0xd'),auth[_0xe775('0x9')](),controller[_0xe775('0x41')]);router[_0xe775('0x3f')](_0xe775('0x23'),auth[_0xe775('0x9')](),controller[_0xe775('0x42')]);router[_0xe775('0x3f')]('/:id/users',auth[_0xe775('0x9')](),controller[_0xe775('0x43')]);module['exports']=router;
\ No newline at end of file
+var _0xb071=['getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','join','root','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions'];(function(_0x53df25,_0x2a7f81){var _0x434a1b=function(_0x398750){while(--_0x398750){_0x53df25['push'](_0x53df25['shift']());}};_0x434a1b(++_0x2a7f81);}(_0xb071,0xb9));var _0x1b07=function(_0x2881e2,_0x341293){_0x2881e2=_0x2881e2-0x0;var _0x5c1e1f=_0xb071[_0x2881e2];return _0x5c1e1f;};'use strict';var multer=require(_0x1b07('0x0'));var util=require(_0x1b07('0x1'));var path=require(_0x1b07('0x2'));var timeout=require(_0x1b07('0x3'));var express=require(_0x1b07('0x4'));var router=express[_0x1b07('0x5')]();var fs_extra=require(_0x1b07('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b07('0x7'));var controller=require(_0x1b07('0x8'));router['get']('/',auth[_0x1b07('0x9')](),controller[_0x1b07('0xa')]);router[_0x1b07('0xb')](_0x1b07('0xc'),auth[_0x1b07('0x9')](),controller[_0x1b07('0xd')]);router[_0x1b07('0xb')](_0x1b07('0xe'),auth[_0x1b07('0x9')](),controller[_0x1b07('0xf')]);router[_0x1b07('0xb')](_0x1b07('0x10'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x11')]);router[_0x1b07('0xb')](_0x1b07('0x12'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x13')]);router[_0x1b07('0xb')](_0x1b07('0x14'),controller[_0x1b07('0x15')]);router[_0x1b07('0xb')]('/:id/avatar',controller[_0x1b07('0x16')]);router[_0x1b07('0xb')](_0x1b07('0x17'),controller[_0x1b07('0x18')]);router[_0x1b07('0xb')](_0x1b07('0x19'),controller[_0x1b07('0x1a')]);router[_0x1b07('0xb')](_0x1b07('0x1b'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x1c')]);router['get']('/:id/snippet',controller[_0x1b07('0x1d')]);router[_0x1b07('0xb')](_0x1b07('0x1e'),auth['isAuthenticated'](),controller[_0x1b07('0x1f')]);router['get'](_0x1b07('0x20'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x21')]);router[_0x1b07('0xb')]('/:id/fields',controller[_0x1b07('0x22')]);router[_0x1b07('0xb')]('/:id/offline_messages',auth[_0x1b07('0x9')](),controller[_0x1b07('0x23')]);router[_0x1b07('0xb')](_0x1b07('0x24'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x25')]);router[_0x1b07('0x26')]('/',auth[_0x1b07('0x9')](),controller[_0x1b07('0x27')]);router['post'](_0x1b07('0x10'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x28')]);router[_0x1b07('0x26')](_0x1b07('0x12'),auth[_0x1b07('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x7d0d04,_0x11915b,_0x2e61d5){_0x2e61d5(null,path[_0x1b07('0x29')](config[_0x1b07('0x2a')],'server/files/images/logos/'));},'filename':function(_0x422715,_0x28da9e,_0xf87018){_0xf87018(null,util[_0x1b07('0x2b')](_0x1b07('0x2c'),Date[_0x1b07('0x2d')](),_0x28da9e[_0x1b07('0x2e')]));}})});router[_0x1b07('0x26')](_0x1b07('0x14'),upload[_0x1b07('0x2f')](_0x1b07('0x30')),controller[_0x1b07('0x31')]);var upload=multer({'storage':multer[_0x1b07('0x32')]({'destination':function(_0x4dff8a,_0x4dbc33,_0x1f5e62){_0x1f5e62(null,path[_0x1b07('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x5cc4f1,_0x121ae1,_0xceb55a){_0xceb55a(null,util[_0x1b07('0x2b')](_0x1b07('0x2c'),Date['now'](),_0x121ae1['originalname']));}})});router[_0x1b07('0x26')]('/:id/avatar',upload[_0x1b07('0x2f')](_0x1b07('0x30')),controller[_0x1b07('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c461c,_0x101fd1,_0x89254f){_0x89254f(null,path[_0x1b07('0x29')](config[_0x1b07('0x2a')],_0x1b07('0x34')));},'filename':function(_0x1319ef,_0x123d6b,_0x4a9510){_0x4a9510(null,util[_0x1b07('0x2b')](_0x1b07('0x2c'),Date[_0x1b07('0x2d')](),_0x123d6b[_0x1b07('0x2e')]));}})});router['post'](_0x1b07('0x17'),upload[_0x1b07('0x2f')](_0x1b07('0x30')),controller[_0x1b07('0x35')]);var upload=multer({'storage':multer[_0x1b07('0x32')]({'destination':function(_0x26ea11,_0xe47d4d,_0x102a0){_0x102a0(null,path[_0x1b07('0x29')](config[_0x1b07('0x2a')],_0x1b07('0x34')));},'filename':function(_0x19bc0d,_0x314c71,_0x124614){_0x124614(null,util[_0x1b07('0x2b')](_0x1b07('0x2c'),Date[_0x1b07('0x2d')](),_0x314c71['originalname']));}})});router[_0x1b07('0x26')](_0x1b07('0x19'),upload['single'](_0x1b07('0x30')),controller[_0x1b07('0x36')]);router[_0x1b07('0x26')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x40c83f,_0xed8481,_0x50507d){const _0x5cde78=path[_0x1b07('0x29')](config[_0x1b07('0x2a')],_0x1b07('0x37'),'attachments',_0x1b07('0x38'));fs_extra[_0x1b07('0x39')](_0x5cde78,function(){_0x50507d(null,_0x5cde78);});},'filename':function(_0x3e8fa3,_0x13ee3b,_0x47efd1){const _0x26d7c3=_0x13ee3b[_0x1b07('0x2e')][_0x1b07('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x307560=path[_0x1b07('0x3b')](_0x26d7c3);const _0x560697=Date[_0x1b07('0x2d')]()+'-'+_0x26d7c3[_0x1b07('0x3a')](_0x307560,'')+_0x307560;_0x47efd1(null,_0x560697);}})});router[_0x1b07('0x26')](_0x1b07('0x3c'),offlineUploadMulter['any'](),controller[_0x1b07('0x3d')]);router[_0x1b07('0x26')]('/:id/interactions',auth[_0x1b07('0x9')](),controller[_0x1b07('0x3e')]);router[_0x1b07('0x26')](_0x1b07('0x1e'),auth[_0x1b07('0x9')](),controller['addApplications']);router[_0x1b07('0x26')](_0x1b07('0x20'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x3f')]);router[_0x1b07('0x26')]('/:id/users',auth[_0x1b07('0x9')](),controller[_0x1b07('0x40')]);router[_0x1b07('0x41')](_0x1b07('0xe'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x42')]);router[_0x1b07('0x43')]('/:id',auth[_0x1b07('0x9')](),controller['destroy']);router[_0x1b07('0x43')](_0x1b07('0x10'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x44')]);router[_0x1b07('0x43')](_0x1b07('0x12'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x45')]);router[_0x1b07('0x43')](_0x1b07('0x24'),auth['isAuthenticated'](),controller[_0x1b07('0x46')]);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 c912bcd..54d4ef1 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 _0x1623=['STRING','sequelize','ENUM','AmazonAWS','Google'];(function(_0xe91163,_0x52f7cc){var _0x2d5c78=function(_0x42da10){while(--_0x42da10){_0xe91163['push'](_0xe91163['shift']());}};_0x2d5c78(++_0x52f7cc);}(_0x1623,0xab));var _0x3162=function(_0x4b565b,_0x40842a){_0x4b565b=_0x4b565b-0x0;var _0x3aa783=_0x1623[_0x4b565b];return _0x3aa783;};'use strict';var Sequelize=require(_0x3162('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3162('0x1')](_0x3162('0x2'),_0x3162('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3162('0x4')]},'data2':{'type':Sequelize[_0x3162('0x4')]}};
\ No newline at end of file
+var _0x8ace=['sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x37e498,_0x2df21a){var _0x1ab2e4=function(_0x5f142b){while(--_0x5f142b){_0x37e498['push'](_0x37e498['shift']());}};_0x1ab2e4(++_0x2df21a);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x327c12,_0x2874c9){_0x327c12=_0x327c12-0x0;var _0x4cd602=_0x8ace[_0x327c12];return _0x4cd602;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'name':{'type':Sequelize[_0xe8ac('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe8ac('0x3')](_0xe8ac('0x4'),_0xe8ac('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xe8ac('0x2')]},'data2':{'type':Sequelize[_0xe8ac('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 0f21ef8..e1fe9ec 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x192153,_0x3be477){var _0x257fe0=function(_0x442272){while(--_0x442272){_0x192153['push'](_0x192153['shift']());}};_0x257fe0(++_0x3be477);}(_0x2032,0xd9));var _0x2203=function(_0xedb4f0,_0x30d7bf){_0xedb4f0=_0xedb4f0-0x0;var _0x41b807=_0x2032[_0xedb4f0];return _0x41b807;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
+var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x47ad9a,_0x300d49){var _0x24b4b1=function(_0x4ef3f8){while(--_0x4ef3f8){_0x47ad9a['push'](_0x47ad9a['shift']());}};_0x24b4b1(++_0x300d49);}(_0x2ef3,0xba));var _0x32ef=function(_0x5ad1c6,_0x1dfc41){_0x5ad1c6=_0x5ad1c6-0x0;var _0x1fdb68=_0x2ef3[_0x5ad1c6];return _0x1fdb68;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index e89d85b..0aef948 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 _0x6ab1=['CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define'];(function(_0x356054,_0x1c96bf){var _0x434b91=function(_0x25a2a7){while(--_0x25a2a7){_0x356054['push'](_0x356054['shift']());}};_0x434b91(++_0x1c96bf);}(_0x6ab1,0xec));var _0x16ab=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0x6ab1[_0x590a38];return _0xf36626;};'use strict';var _=require('lodash');var util=require(_0x16ab('0x0'));var logger=require(_0x16ab('0x1'))(_0x16ab('0x2'));var moment=require(_0x16ab('0x3'));var BPromise=require(_0x16ab('0x4'));var rp=require(_0x16ab('0x5'));var fs=require('fs');var path=require(_0x16ab('0x6'));var rimraf=require(_0x16ab('0x7'));var config=require('../../config/environment');var attributes=require(_0x16ab('0x8'));module[_0x16ab('0x9')]=function(_0x3cc848,_0x5c2274){return _0x3cc848[_0x16ab('0xa')](_0x16ab('0xb'),attributes,{'tableName':_0x16ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd037=['CloudProvider','cloud_providers','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x6f929,_0x1ee1bd){var _0x2402f1=function(_0x895feb){while(--_0x895feb){_0x6f929['push'](_0x6f929['shift']());}};_0x2402f1(++_0x1ee1bd);}(_0xd037,0xb6));var _0x7d03=function(_0x10553b,_0x40493a){_0x10553b=_0x10553b-0x0;var _0x2a4d03=_0xd037[_0x10553b];return _0x2a4d03;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7d03('0x0'))('api');var moment=require(_0x7d03('0x1'));var BPromise=require(_0x7d03('0x2'));var rp=require(_0x7d03('0x3'));var fs=require('fs');var path=require(_0x7d03('0x4'));var rimraf=require(_0x7d03('0x5'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x7d03('0x6')]=function(_0xd71fc,_0x431e54){return _0xd71fc[_0x7d03('0x7')](_0x7d03('0x8'),attributes,{'tableName':_0x7d03('0x9'),'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 24e7fae..2c38b33 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 _0x7880=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment'];(function(_0x2f8b40,_0x3439bc){var _0x8a8999=function(_0x1e8236){while(--_0x1e8236){_0x2f8b40['push'](_0x2f8b40['shift']());}};_0x8a8999(++_0x3439bc);}(_0x7880,0x10f));var _0x0788=function(_0x3779eb,_0xc19002){_0x3779eb=_0x3779eb-0x0;var _0x50423a=_0x7880[_0x3779eb];return _0x50423a;};'use strict';var _=require(_0x0788('0x0'));var util=require('util');var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0788('0x6'));var config=require('../../config/environment');var jayson=require(_0x0788('0x7'));var client=jayson[_0x0788('0x8')][_0x0788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ece1c,_0x14cfa5,_0x450b71){return new BPromise(function(_0x5366c7,_0x1662a2){return client[_0x0788('0xa')](_0x5ece1c,_0x450b71)[_0x0788('0xb')](function(_0x95ebe3){logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x14cfa5,_0x0788('0xe'),JSON[_0x0788('0x11')](_0x95ebe3));if(_0x95ebe3['error']){if(_0x95ebe3[_0x0788('0x12')]['code']===0x1f4){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x95ebe3[_0x0788('0x12')][_0x0788('0x13')]);return _0x1662a2(_0x95ebe3[_0x0788('0x12')]['message']);}logger[_0x0788('0x12')]('CloudProvider,\x20%s,\x20%s',_0x14cfa5,_0x95ebe3[_0x0788('0x12')]['message']);return _0x5366c7(_0x95ebe3['error'][_0x0788('0x13')]);}else{logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,'request\x20sent');_0x5366c7(_0x95ebe3[_0x0788('0x14')][_0x0788('0x13')]);}})['catch'](function(_0x334f58){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x334f58);_0x1662a2(_0x334f58);});});}
\ No newline at end of file
+var _0x4329=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x10be58,_0x41cdad){var _0x14deb3=function(_0x2a5121){while(--_0x2a5121){_0x10be58['push'](_0x10be58['shift']());}};_0x14deb3(++_0x41cdad);}(_0x4329,0x13b));var _0x9432=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x4329[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x9432('0x0'));var util=require(_0x9432('0x1'));var moment=require(_0x9432('0x2'));var BPromise=require(_0x9432('0x3'));var rs=require(_0x9432('0x4'));var fs=require('fs');var Redis=require(_0x9432('0x5'));var db=require(_0x9432('0x6'))['db'];var utils=require(_0x9432('0x7'));var logger=require(_0x9432('0x8'))(_0x9432('0x9'));var config=require(_0x9432('0xa'));var jayson=require(_0x9432('0xb'));var client=jayson[_0x9432('0xc')][_0x9432('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5568ad,_0x376967,_0x5346c3){return new BPromise(function(_0x10509f,_0x4563c4){return client['request'](_0x5568ad,_0x5346c3)[_0x9432('0xe')](function(_0x2b06c7){logger[_0x9432('0xf')](_0x9432('0x10'),_0x376967,_0x9432('0x11'));logger['debug'](_0x9432('0x12'),_0x376967,_0x9432('0x11'),JSON['stringify'](_0x2b06c7));if(_0x2b06c7['error']){if(_0x2b06c7[_0x9432('0x13')][_0x9432('0x14')]===0x1f4){logger[_0x9432('0x13')](_0x9432('0x10'),_0x376967,_0x2b06c7['error'][_0x9432('0x15')]);return _0x4563c4(_0x2b06c7[_0x9432('0x13')][_0x9432('0x15')]);}logger[_0x9432('0x13')](_0x9432('0x10'),_0x376967,_0x2b06c7['error'][_0x9432('0x15')]);return _0x10509f(_0x2b06c7[_0x9432('0x13')]['message']);}else{logger[_0x9432('0xf')](_0x9432('0x10'),_0x376967,'request\x20sent');_0x10509f(_0x2b06c7[_0x9432('0x16')][_0x9432('0x15')]);}})['catch'](function(_0x5c4360){logger['error']('CloudProvider,\x20%s,\x20%s',_0x376967,_0x5c4360);_0x4563c4(_0x5c4360);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 7fe6e6e..a8b5674 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 _0x2deb=['delete','/:id','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','update'];(function(_0x3e7775,_0x259e7c){var _0x364dcb=function(_0x2c5851){while(--_0x2c5851){_0x3e7775['push'](_0x3e7775['shift']());}};_0x364dcb(++_0x259e7c);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var path=require(_0xb2de('0x2'));var timeout=require(_0xb2de('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb2de('0x4'));var auth=require(_0xb2de('0x5'));var interaction=require(_0xb2de('0x6'));var config=require(_0xb2de('0x7'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0xb2de('0x8')](),controller[_0xb2de('0x9')]);router[_0xb2de('0xa')]('/:id',auth[_0xb2de('0x8')](),controller[_0xb2de('0xb')]);router['post']('/',auth[_0xb2de('0x8')](),controller[_0xb2de('0xc')]);router[_0xb2de('0xd')]('/:id',auth[_0xb2de('0x8')](),controller[_0xb2de('0xe')]);router[_0xb2de('0xf')](_0xb2de('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xb2de('0x11')]=router;
\ No newline at end of file
+var _0x0a1c=['show','post','create','put','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id'];(function(_0x2519d0,_0x305dd4){var _0x5656e3=function(_0x5c317a){while(--_0x5c317a){_0x2519d0['push'](_0x2519d0['shift']());}};_0x5656e3(++_0x305dd4);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x0a1c[_0x445101];return _0x3c3d04;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc0a1('0x0'));var timeout=require(_0xc0a1('0x1'));var express=require(_0xc0a1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc0a1('0x3'));var interaction=require(_0xc0a1('0x4'));var config=require(_0xc0a1('0x5'));var controller=require(_0xc0a1('0x6'));router[_0xc0a1('0x7')]('/',auth[_0xc0a1('0x8')](),controller[_0xc0a1('0x9')]);router[_0xc0a1('0x7')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller[_0xc0a1('0xb')]);router[_0xc0a1('0xc')]('/',auth[_0xc0a1('0x8')](),controller[_0xc0a1('0xd')]);router[_0xc0a1('0xe')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller['update']);router[_0xc0a1('0xf')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller['destroy']);module[_0xc0a1('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 90f37ac..3f81763 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 _0xb439=['sequelize','exports','STRING'];(function(_0x2c1616,_0x32ff80){var _0x3722ec=function(_0x4c4588){while(--_0x4c4588){_0x2c1616['push'](_0x2c1616['shift']());}};_0x3722ec(++_0x32ff80);}(_0xb439,0x87));var _0x9b43=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb439[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x9b43('0x0'));module[_0x9b43('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9b43('0x2')]},'companyId':{'type':Sequelize[_0x9b43('0x2')]},'website':{'type':Sequelize[_0x9b43('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9b43('0x2')]},'type':{'type':Sequelize[_0x9b43('0x2')]},'street':{'type':Sequelize[_0x9b43('0x2')]},'postalCode':{'type':Sequelize[_0x9b43('0x2')]},'city':{'type':Sequelize[_0x9b43('0x2')]},'country':{'type':Sequelize[_0x9b43('0x2')]},'email':{'type':Sequelize[_0x9b43('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9b43('0x2')]},'sStreet':{'type':Sequelize[_0x9b43('0x2')]},'sPostalCode':{'type':Sequelize[_0x9b43('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9b43('0x2')]},'description':{'type':Sequelize[_0x9b43('0x2')]}};
\ No newline at end of file
+var _0xe033=['STRING','exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xe033,0x8b));var _0x3e03=function(_0x1f61a3,_0x524e29){_0x1f61a3=_0x1f61a3-0x0;var _0x5c5818=_0xe033[_0x1f61a3];return _0x5c5818;};'use strict';var Sequelize=require('sequelize');module[_0x3e03('0x0')]={'name':{'type':Sequelize[_0x3e03('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3e03('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3e03('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3e03('0x1')]},'sPostalCode':{'type':Sequelize[_0x3e03('0x1')]},'sCity':{'type':Sequelize[_0x3e03('0x1')]},'sCountry':{'type':Sequelize[_0x3e03('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index e9f3b74..c8a059b 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 _0x0769=['update','then','destroy','get','UserProfileResource','stack','name','index','describe','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','map','merge','options','CmCompany','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x50a865,_0x5a2510){var _0x50cc4e=function(_0x25d969){while(--_0x25d969){_0x50a865['push'](_0x50a865['shift']());}};_0x50cc4e(++_0x5a2510);}(_0x0769,0x83));var _0x9076=function(_0x4d9a4f,_0x4d1ca5){_0x4d9a4f=_0x4d9a4f-0x0;var _0x390fbc=_0x0769[_0x4d9a4f];return _0x390fbc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9076('0x0'));var zipdir=require(_0x9076('0x1'));var jsonpatch=require(_0x9076('0x2'));var rp=require(_0x9076('0x3'));var moment=require('moment');var BPromise=require(_0x9076('0x4'));var Mustache=require(_0x9076('0x5'));var util=require('util');var path=require(_0x9076('0x6'));var sox=require(_0x9076('0x7'));var csv=require(_0x9076('0x8'));var ejs=require(_0x9076('0x9'));var fs=require('fs');var fs_extra=require(_0x9076('0xa'));var _=require(_0x9076('0xb'));var squel=require(_0x9076('0xc'));var crypto=require(_0x9076('0xd'));var jsforce=require(_0x9076('0xe'));var deskjs=require(_0x9076('0xf'));var toCsv=require(_0x9076('0x8'));var querystring=require(_0x9076('0x10'));var Papa=require('papaparse');var Redis=require(_0x9076('0x11'));var authService=require(_0x9076('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9076('0x13'));var hardwareService=require(_0x9076('0x14'));var logger=require(_0x9076('0x15'))(_0x9076('0x16'));var utils=require(_0x9076('0x17'));var config=require(_0x9076('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9076('0x19'))['db'];function respondWithStatusCode(_0x1b64b6,_0x1b1137){_0x1b1137=_0x1b1137||0xcc;return function(_0x1abba7){if(_0x1abba7){return _0x1b64b6[_0x9076('0x1a')](_0x1b1137);}return _0x1b64b6[_0x9076('0x1b')](_0x1b1137)[_0x9076('0x1c')]();};}function respondWithResult(_0x3d651c,_0x2123b6){_0x2123b6=_0x2123b6||0xc8;return function(_0x5dfe90){if(_0x5dfe90){return _0x3d651c['status'](_0x2123b6)[_0x9076('0x1d')](_0x5dfe90);}};}function respondWithFilteredResult(_0x8936d3,_0x4417be){return function(_0x2bb884){if(_0x2bb884){var _0x5b0074=typeof _0x4417be[_0x9076('0x1e')]===_0x9076('0x1f')&&typeof _0x4417be[_0x9076('0x20')]===_0x9076('0x1f');var _0x3e72c4=_0x2bb884[_0x9076('0x21')];var _0x2440d0=_0x5b0074?0x0:_0x4417be[_0x9076('0x1e')];var _0x2da783=_0x5b0074?_0x2bb884[_0x9076('0x21')]:_0x4417be['offset']+_0x4417be[_0x9076('0x20')];var _0x23985a;if(_0x2da783>=_0x3e72c4){_0x2da783=_0x3e72c4;_0x23985a=0xc8;}else{_0x23985a=0xce;}_0x8936d3[_0x9076('0x1b')](_0x23985a);return _0x8936d3[_0x9076('0x22')]('Content-Range',_0x2440d0+'-'+_0x2da783+'/'+_0x3e72c4)[_0x9076('0x1d')](_0x2bb884);}return null;};}function patchUpdates(_0x5e56ce){return function(_0x4daaf8){try{jsonpatch['apply'](_0x4daaf8,_0x5e56ce,!![]);}catch(_0x3089ec){return BPromise['reject'](_0x3089ec);}return _0x4daaf8['save']();};}function saveUpdates(_0x577e2f,_0x3c6ecb){return function(_0x6b053b){if(_0x6b053b){return _0x6b053b[_0x9076('0x23')](_0x577e2f)[_0x9076('0x24')](function(_0x2cc0ae){return _0x2cc0ae;});}return null;};}function removeEntity(_0x5722d8,_0x16b292){return function(_0xd0d150){if(_0xd0d150){return _0xd0d150[_0x9076('0x25')]()[_0x9076('0x24')](function(){var _0x11688a=_0xd0d150[_0x9076('0x26')]({'plain':!![]});var _0x2702c6='Companies';return db[_0x9076('0x27')]['destroy']({'where':{'type':_0x2702c6,'resourceId':_0x11688a['id']}})['then'](function(){return _0xd0d150;});})[_0x9076('0x24')](function(){_0x5722d8[_0x9076('0x1b')](0xcc)[_0x9076('0x1c')]();});}};}function handleEntityNotFound(_0x53e1c5,_0x5230c4){return function(_0x359758){if(!_0x359758){_0x53e1c5[_0x9076('0x1a')](0x194);}return _0x359758;};}function handleError(_0x2c69d0,_0x5c5ec1){_0x5c5ec1=_0x5c5ec1||0x1f4;return function(_0x5c99a3){logger['error'](_0x5c99a3[_0x9076('0x28')]);if(_0x5c99a3[_0x9076('0x29')]){delete _0x5c99a3[_0x9076('0x29')];}_0x2c69d0[_0x9076('0x1b')](_0x5c5ec1)['send'](_0x5c99a3);};}exports[_0x9076('0x2a')]=function(_0x46e9b1,_0x34b3c2){var _0x4e79e1={},_0x2232ff={},_0x57dfe1={'count':0x0,'rows':[]};return db['CmCompany'][_0x9076('0x2b')]()[_0x9076('0x24')](function(_0x2188a3){_0x2232ff[_0x9076('0x2c')]=_[_0x9076('0x2d')](_0x2188a3);_0x2232ff[_0x9076('0x2e')]=_[_0x9076('0x2d')](_0x46e9b1[_0x9076('0x2e')]);_0x2232ff[_0x9076('0x2f')]=_['intersection'](_0x2232ff[_0x9076('0x2c')],_0x2232ff[_0x9076('0x2e')]);_0x4e79e1['attributes']=_[_0x9076('0x30')](_0x2232ff[_0x9076('0x2c')],qs['fields'](_0x46e9b1['query'][_0x9076('0x31')]));_0x4e79e1[_0x9076('0x32')]=_0x4e79e1[_0x9076('0x32')][_0x9076('0x33')]?_0x4e79e1[_0x9076('0x32')]:_0x2232ff['model'];if(!_0x46e9b1['query']['hasOwnProperty'](_0x9076('0x34'))){_0x4e79e1['limit']=qs[_0x9076('0x20')](_0x46e9b1['query']['limit']);_0x4e79e1[_0x9076('0x1e')]=qs[_0x9076('0x1e')](_0x46e9b1[_0x9076('0x2e')][_0x9076('0x1e')]);}_0x4e79e1[_0x9076('0x35')]=qs[_0x9076('0x36')](_0x46e9b1['query'][_0x9076('0x36')]);_0x4e79e1[_0x9076('0x37')]=qs[_0x9076('0x2f')](_[_0x9076('0x38')](_0x46e9b1[_0x9076('0x2e')],_0x2232ff[_0x9076('0x2f')]),_0x2188a3);if(_0x46e9b1[_0x9076('0x2e')][_0x9076('0x39')]){_0x4e79e1[_0x9076('0x37')]=_['merge'](_0x4e79e1[_0x9076('0x37')],{'$or':_[_0x9076('0x3a')](_0x4e79e1[_0x9076('0x32')],function(_0x2526ad){var _0x2de19b={};_0x2de19b[_0x2526ad]={'$like':'%'+_0x46e9b1['query'][_0x9076('0x39')]+'%'};return _0x2de19b;})});}_0x4e79e1=_[_0x9076('0x3b')]({},_0x4e79e1,_0x46e9b1[_0x9076('0x3c')]);var _0x58ace9={'where':_0x4e79e1[_0x9076('0x37')]};return db[_0x9076('0x3d')][_0x9076('0x21')](_0x58ace9)[_0x9076('0x24')](function(_0x4a1b6a){_0x57dfe1['count']=_0x4a1b6a;if(_0x46e9b1[_0x9076('0x2e')]['includeAll']){_0x4e79e1['include']=[{'all':!![]}];}return db['CmCompany'][_0x9076('0x3e')](_0x4e79e1);})[_0x9076('0x24')](function(_0x2cd5ef){_0x57dfe1['rows']=_0x2cd5ef;return _0x57dfe1;})[_0x9076('0x24')](respondWithFilteredResult(_0x34b3c2,_0x4e79e1))[_0x9076('0x3f')](handleError(_0x34b3c2,null));})['catch'](handleError(_0x34b3c2,null));};exports[_0x9076('0x40')]=function(_0x5b866d,_0x589725){var _0x5329ce={'raw':![],'where':{'id':_0x5b866d[_0x9076('0x41')]['id']}},_0x395587={};_0x395587[_0x9076('0x2c')]=_[_0x9076('0x2d')](db[_0x9076('0x3d')]['rawAttributes']);_0x395587[_0x9076('0x2e')]=_[_0x9076('0x2d')](_0x5b866d[_0x9076('0x2e')]);_0x395587['filters']=_[_0x9076('0x30')](_0x395587[_0x9076('0x2c')],_0x395587[_0x9076('0x2e')]);_0x5329ce[_0x9076('0x32')]=_[_0x9076('0x30')](_0x395587[_0x9076('0x2c')],qs[_0x9076('0x31')](_0x5b866d[_0x9076('0x2e')][_0x9076('0x31')]));_0x5329ce[_0x9076('0x32')]=_0x5329ce[_0x9076('0x32')][_0x9076('0x33')]?_0x5329ce[_0x9076('0x32')]:_0x395587[_0x9076('0x2c')];if(_0x5b866d[_0x9076('0x2e')][_0x9076('0x42')]){_0x5329ce['include']=[{'all':!![]}];}_0x5329ce=_[_0x9076('0x3b')]({},_0x5329ce,_0x5b866d['options']);return db[_0x9076('0x3d')][_0x9076('0x43')](_0x5329ce)['then'](handleEntityNotFound(_0x589725,null))[_0x9076('0x24')](respondWithResult(_0x589725,null))[_0x9076('0x3f')](handleError(_0x589725,null));};exports[_0x9076('0x44')]=function(_0x2c14ba,_0x131ebb){return db[_0x9076('0x3d')]['create'](_0x2c14ba[_0x9076('0x45')],{})[_0x9076('0x24')](function(_0x5b9201){var _0xf717f5=_0x2c14ba[_0x9076('0x46')][_0x9076('0x26')]({'plain':!![]});if(!_0xf717f5)throw new Error(_0x9076('0x47'));if(_0xf717f5[_0x9076('0x48')]===_0x9076('0x46')){var _0x532ec7=_0x5b9201[_0x9076('0x26')]({'plain':!![]});var _0x1ec739=_0x9076('0x49');return db[_0x9076('0x4a')]['find']({'where':{'name':_0x1ec739,'userProfileId':_0xf717f5['userProfileId']},'raw':!![]})[_0x9076('0x24')](function(_0x54a3ad){if(_0x54a3ad&&_0x54a3ad['autoAssociation']===0x0){return db[_0x9076('0x27')][_0x9076('0x44')]({'name':_0x532ec7['name'],'resourceId':_0x532ec7['id'],'type':_0x54a3ad[_0x9076('0x29')],'sectionId':_0x54a3ad['id']},{})[_0x9076('0x24')](function(){return _0x5b9201;});}else{return _0x5b9201;}})[_0x9076('0x3f')](function(_0x43ff11){logger[_0x9076('0x4b')](_0x9076('0x4c'),_0x43ff11);throw _0x43ff11;});}return _0x5b9201;})[_0x9076('0x24')](respondWithResult(_0x131ebb,0xc9))[_0x9076('0x3f')](handleError(_0x131ebb,null));};exports[_0x9076('0x23')]=function(_0x5a79ab,_0x521788){if(_0x5a79ab[_0x9076('0x45')]['id']){delete _0x5a79ab['body']['id'];}return db[_0x9076('0x3d')][_0x9076('0x43')]({'where':{'id':_0x5a79ab[_0x9076('0x41')]['id']}})[_0x9076('0x24')](handleEntityNotFound(_0x521788,null))[_0x9076('0x24')](saveUpdates(_0x5a79ab['body'],null))['then'](respondWithResult(_0x521788,null))[_0x9076('0x3f')](handleError(_0x521788,null));};exports['destroy']=function(_0x49ef98,_0x1af5e2){return db[_0x9076('0x3d')][_0x9076('0x43')]({'where':{'id':_0x49ef98[_0x9076('0x41')]['id']}})['then'](handleEntityNotFound(_0x1af5e2,null))[_0x9076('0x24')](removeEntity(_0x1af5e2,null))['catch'](handleError(_0x1af5e2,null));};exports[_0x9076('0x2b')]=function(_0x1a2ca0,_0x4f5b02){return db['CmCompany']['describe']()['then'](respondWithResult(_0x4f5b02,null))['catch'](handleError(_0x4f5b02,null));};exports[_0x9076('0x4d')]=function(_0x48a386,_0x1ab38c,_0x26878b){return db[_0x9076('0x4e')]['find']({'where':{'id':_0x48a386[_0x9076('0x41')]['id']}})[_0x9076('0x24')](handleEntityNotFound(_0x1ab38c,null))[_0x9076('0x24')](function(_0x5b69cc){if(_0x5b69cc){return _0x5b69cc[_0x9076('0x4d')](_0x48a386[_0x9076('0x45')][_0x9076('0x4f')],_[_0x9076('0x50')](_0x48a386[_0x9076('0x45')],[_0x9076('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x1ab38c,null))[_0x9076('0x3f')](handleError(_0x1ab38c,null));};exports[_0x9076('0x51')]=function(_0x2188e4,_0x3bc0dd,_0x590f77){var _0x1376a5={};var _0xd5260b={};var _0x5296d1;var _0x3f52d5;return db[_0x9076('0x3d')]['findOne']({'where':{'id':_0x2188e4[_0x9076('0x41')]['id']}})[_0x9076('0x24')](handleEntityNotFound(_0x3bc0dd,null))[_0x9076('0x24')](function(_0xd367af){if(_0xd367af){_0x5296d1=_0xd367af;_0xd5260b[_0x9076('0x2c')]=_[_0x9076('0x2d')](db['CmContact']['rawAttributes']);_0xd5260b[_0x9076('0x2e')]=_[_0x9076('0x2d')](_0x2188e4[_0x9076('0x2e')]);_0xd5260b[_0x9076('0x2f')]=_[_0x9076('0x30')](_0xd5260b[_0x9076('0x2c')],_0xd5260b[_0x9076('0x2e')]);_0x1376a5[_0x9076('0x32')]=_['intersection'](_0xd5260b[_0x9076('0x2c')],qs['fields'](_0x2188e4[_0x9076('0x2e')][_0x9076('0x31')]));_0x1376a5[_0x9076('0x32')]=_0x1376a5['attributes']['length']?_0x1376a5[_0x9076('0x32')]:_0xd5260b[_0x9076('0x2c')];_0x1376a5['order']=qs[_0x9076('0x36')](_0x2188e4['query'][_0x9076('0x36')]);_0x1376a5[_0x9076('0x37')]=qs[_0x9076('0x2f')](_[_0x9076('0x38')](_0x2188e4[_0x9076('0x2e')],_0xd5260b[_0x9076('0x2f')]));if(_0x2188e4[_0x9076('0x2e')][_0x9076('0x39')]){_0x1376a5['where']=_['merge'](_0x1376a5['where'],{'$or':_[_0x9076('0x3a')](_0x1376a5[_0x9076('0x32')],function(_0x533a84){var _0x126f21={};_0x126f21[_0x533a84]={'$like':'%'+_0x2188e4['query'][_0x9076('0x39')]+'%'};return _0x126f21;})});}_0x1376a5=_[_0x9076('0x3b')]({},_0x1376a5,_0x2188e4[_0x9076('0x3c')]);return _0x5296d1['getContacts'](_0x1376a5);}})[_0x9076('0x24')](function(_0x215742){if(_0x215742){_0x3f52d5=_0x215742['length'];if(!_0x2188e4['query'][_0x9076('0x52')]('nolimit')){_0x1376a5[_0x9076('0x20')]=qs[_0x9076('0x20')](_0x2188e4[_0x9076('0x2e')][_0x9076('0x20')]);_0x1376a5[_0x9076('0x1e')]=qs['offset'](_0x2188e4[_0x9076('0x2e')]['offset']);}return _0x5296d1[_0x9076('0x51')](_0x1376a5);}})[_0x9076('0x24')](function(_0x3bf269){if(_0x3bf269){return _0x3bf269?{'count':_0x3f52d5,'rows':_0x3bf269}:null;}})[_0x9076('0x24')](respondWithResult(_0x3bc0dd,null))[_0x9076('0x3f')](handleError(_0x3bc0dd,null));};
\ No newline at end of file
+var _0x3c0d=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','destroy','get','UserProfileResource','then','error','stack','name','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','nolimit','sort','filters','filter','merge','where','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','order','pick','getContacts','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0xd26750,_0x2c1103){var _0x3e310b=function(_0x28ae2b){while(--_0x28ae2b){_0xd26750['push'](_0xd26750['shift']());}};_0x3e310b(++_0x2c1103);}(_0x3c0d,0x149));var _0xd3c0=function(_0x220b7e,_0x2eed81){_0x220b7e=_0x220b7e-0x0;var _0x4ac073=_0x3c0d[_0x220b7e];return _0x4ac073;};'use strict';var emlformat=require(_0xd3c0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3c0('0x1'));var jsonpatch=require(_0xd3c0('0x2'));var rp=require(_0xd3c0('0x3'));var moment=require('moment');var BPromise=require(_0xd3c0('0x4'));var Mustache=require(_0xd3c0('0x5'));var util=require(_0xd3c0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd3c0('0x7'));var ejs=require(_0xd3c0('0x8'));var fs=require('fs');var fs_extra=require(_0xd3c0('0x9'));var _=require('lodash');var squel=require(_0xd3c0('0xa'));var crypto=require(_0xd3c0('0xb'));var jsforce=require(_0xd3c0('0xc'));var deskjs=require(_0xd3c0('0xd'));var toCsv=require(_0xd3c0('0x7'));var querystring=require(_0xd3c0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd3c0('0xf'));var qs=require(_0xd3c0('0x10'));var as=require(_0xd3c0('0x11'));var hardwareService=require(_0xd3c0('0x12'));var logger=require('../../config/logger')(_0xd3c0('0x13'));var utils=require('../../config/utils');var config=require(_0xd3c0('0x14'));var licenseUtil=require(_0xd3c0('0x15'));var db=require(_0xd3c0('0x16'))['db'];function respondWithStatusCode(_0x52043f,_0x286379){_0x286379=_0x286379||0xcc;return function(_0x3df5c8){if(_0x3df5c8){return _0x52043f[_0xd3c0('0x17')](_0x286379);}return _0x52043f[_0xd3c0('0x18')](_0x286379)[_0xd3c0('0x19')]();};}function respondWithResult(_0x274b98,_0x1a6e53){_0x1a6e53=_0x1a6e53||0xc8;return function(_0xd2bf53){if(_0xd2bf53){return _0x274b98[_0xd3c0('0x18')](_0x1a6e53)[_0xd3c0('0x1a')](_0xd2bf53);}};}function respondWithFilteredResult(_0x458dc4,_0x49f6ab){return function(_0x451235){if(_0x451235){var _0x4fa7d4=typeof _0x49f6ab['offset']===_0xd3c0('0x1b')&&typeof _0x49f6ab[_0xd3c0('0x1c')]===_0xd3c0('0x1b');var _0x567efe=_0x451235[_0xd3c0('0x1d')];var _0x5b09a0=_0x4fa7d4?0x0:_0x49f6ab[_0xd3c0('0x1e')];var _0x3fd7c9=_0x4fa7d4?_0x451235[_0xd3c0('0x1d')]:_0x49f6ab['offset']+_0x49f6ab[_0xd3c0('0x1c')];var _0x486142;if(_0x3fd7c9>=_0x567efe){_0x3fd7c9=_0x567efe;_0x486142=0xc8;}else{_0x486142=0xce;}_0x458dc4['status'](_0x486142);return _0x458dc4[_0xd3c0('0x1f')]('Content-Range',_0x5b09a0+'-'+_0x3fd7c9+'/'+_0x567efe)['json'](_0x451235);}return null;};}function patchUpdates(_0x219592){return function(_0x4d74b8){try{jsonpatch[_0xd3c0('0x20')](_0x4d74b8,_0x219592,!![]);}catch(_0x54a11d){return BPromise[_0xd3c0('0x21')](_0x54a11d);}return _0x4d74b8[_0xd3c0('0x22')]();};}function saveUpdates(_0x3264bd,_0x89c3c2){return function(_0x526b00){if(_0x526b00){return _0x526b00['update'](_0x3264bd)['then'](function(_0x4546fd){return _0x4546fd;});}return null;};}function removeEntity(_0x45b12f,_0x3246da){return function(_0x4653b3){if(_0x4653b3){return _0x4653b3[_0xd3c0('0x23')]()['then'](function(){var _0x4ea830=_0x4653b3[_0xd3c0('0x24')]({'plain':!![]});var _0xa1136e='Companies';return db[_0xd3c0('0x25')][_0xd3c0('0x23')]({'where':{'type':_0xa1136e,'resourceId':_0x4ea830['id']}})[_0xd3c0('0x26')](function(){return _0x4653b3;});})[_0xd3c0('0x26')](function(){_0x45b12f[_0xd3c0('0x18')](0xcc)[_0xd3c0('0x19')]();});}};}function handleEntityNotFound(_0x515f0a,_0x2fb3e8){return function(_0x484f5a){if(!_0x484f5a){_0x515f0a[_0xd3c0('0x17')](0x194);}return _0x484f5a;};}function handleError(_0x185370,_0x4031e6){_0x4031e6=_0x4031e6||0x1f4;return function(_0x525c72){logger[_0xd3c0('0x27')](_0x525c72[_0xd3c0('0x28')]);if(_0x525c72[_0xd3c0('0x29')]){delete _0x525c72[_0xd3c0('0x29')];}_0x185370[_0xd3c0('0x18')](_0x4031e6)['send'](_0x525c72);};}exports[_0xd3c0('0x2a')]=function(_0x2b92ca,_0x3dbbc1){var _0x4e1117={},_0x124228={},_0xeaf45d={'count':0x0,'rows':[]};return db[_0xd3c0('0x2b')][_0xd3c0('0x2c')]()[_0xd3c0('0x26')](function(_0x5500ca){_0x124228[_0xd3c0('0x2d')]=_[_0xd3c0('0x2e')](_0x5500ca);_0x124228[_0xd3c0('0x2f')]=_[_0xd3c0('0x2e')](_0x2b92ca[_0xd3c0('0x2f')]);_0x124228['filters']=_[_0xd3c0('0x30')](_0x124228[_0xd3c0('0x2d')],_0x124228[_0xd3c0('0x2f')]);_0x4e1117[_0xd3c0('0x31')]=_[_0xd3c0('0x30')](_0x124228[_0xd3c0('0x2d')],qs[_0xd3c0('0x32')](_0x2b92ca[_0xd3c0('0x2f')][_0xd3c0('0x32')]));_0x4e1117[_0xd3c0('0x31')]=_0x4e1117['attributes'][_0xd3c0('0x33')]?_0x4e1117[_0xd3c0('0x31')]:_0x124228[_0xd3c0('0x2d')];if(!_0x2b92ca[_0xd3c0('0x2f')]['hasOwnProperty'](_0xd3c0('0x34'))){_0x4e1117['limit']=qs['limit'](_0x2b92ca[_0xd3c0('0x2f')][_0xd3c0('0x1c')]);_0x4e1117[_0xd3c0('0x1e')]=qs['offset'](_0x2b92ca[_0xd3c0('0x2f')][_0xd3c0('0x1e')]);}_0x4e1117['order']=qs[_0xd3c0('0x35')](_0x2b92ca['query'][_0xd3c0('0x35')]);_0x4e1117['where']=qs[_0xd3c0('0x36')](_['pick'](_0x2b92ca[_0xd3c0('0x2f')],_0x124228[_0xd3c0('0x36')]),_0x5500ca);if(_0x2b92ca[_0xd3c0('0x2f')][_0xd3c0('0x37')]){_0x4e1117['where']=_[_0xd3c0('0x38')](_0x4e1117[_0xd3c0('0x39')],{'$or':_[_0xd3c0('0x3a')](_0x4e1117[_0xd3c0('0x31')],function(_0x129261){var _0x3818cc={};_0x3818cc[_0x129261]={'$like':'%'+_0x2b92ca[_0xd3c0('0x2f')]['filter']+'%'};return _0x3818cc;})});}_0x4e1117=_[_0xd3c0('0x38')]({},_0x4e1117,_0x2b92ca[_0xd3c0('0x3b')]);var _0x4738f2={'where':_0x4e1117[_0xd3c0('0x39')]};return db[_0xd3c0('0x2b')][_0xd3c0('0x1d')](_0x4738f2)[_0xd3c0('0x26')](function(_0x337fba){_0xeaf45d['count']=_0x337fba;if(_0x2b92ca['query'][_0xd3c0('0x3c')]){_0x4e1117[_0xd3c0('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0xd3c0('0x3e')](_0x4e1117);})[_0xd3c0('0x26')](function(_0x34b251){_0xeaf45d['rows']=_0x34b251;return _0xeaf45d;})[_0xd3c0('0x26')](respondWithFilteredResult(_0x3dbbc1,_0x4e1117))[_0xd3c0('0x3f')](handleError(_0x3dbbc1,null));})['catch'](handleError(_0x3dbbc1,null));};exports[_0xd3c0('0x40')]=function(_0x2f6dc6,_0xc846db){var _0x44af89={'raw':![],'where':{'id':_0x2f6dc6[_0xd3c0('0x41')]['id']}},_0x5a2944={};_0x5a2944[_0xd3c0('0x2d')]=_['keys'](db[_0xd3c0('0x2b')][_0xd3c0('0x42')]);_0x5a2944[_0xd3c0('0x2f')]=_[_0xd3c0('0x2e')](_0x2f6dc6['query']);_0x5a2944[_0xd3c0('0x36')]=_[_0xd3c0('0x30')](_0x5a2944[_0xd3c0('0x2d')],_0x5a2944[_0xd3c0('0x2f')]);_0x44af89[_0xd3c0('0x31')]=_[_0xd3c0('0x30')](_0x5a2944[_0xd3c0('0x2d')],qs[_0xd3c0('0x32')](_0x2f6dc6['query'][_0xd3c0('0x32')]));_0x44af89[_0xd3c0('0x31')]=_0x44af89[_0xd3c0('0x31')][_0xd3c0('0x33')]?_0x44af89[_0xd3c0('0x31')]:_0x5a2944[_0xd3c0('0x2d')];if(_0x2f6dc6[_0xd3c0('0x2f')][_0xd3c0('0x3c')]){_0x44af89[_0xd3c0('0x3d')]=[{'all':!![]}];}_0x44af89=_[_0xd3c0('0x38')]({},_0x44af89,_0x2f6dc6[_0xd3c0('0x3b')]);return db['CmCompany'][_0xd3c0('0x43')](_0x44af89)[_0xd3c0('0x26')](handleEntityNotFound(_0xc846db,null))[_0xd3c0('0x26')](respondWithResult(_0xc846db,null))[_0xd3c0('0x3f')](handleError(_0xc846db,null));};exports[_0xd3c0('0x44')]=function(_0x18b1cd,_0x517494){return db['CmCompany']['create'](_0x18b1cd[_0xd3c0('0x45')],{})[_0xd3c0('0x26')](function(_0x54294b){var _0x287db3=_0x18b1cd[_0xd3c0('0x46')][_0xd3c0('0x24')]({'plain':!![]});if(!_0x287db3)throw new Error(_0xd3c0('0x47'));if(_0x287db3[_0xd3c0('0x48')]==='user'){var _0x4b0440=_0x54294b[_0xd3c0('0x24')]({'plain':!![]});var _0x2c64bd=_0xd3c0('0x49');return db[_0xd3c0('0x4a')][_0xd3c0('0x43')]({'where':{'name':_0x2c64bd,'userProfileId':_0x287db3['userProfileId']},'raw':!![]})[_0xd3c0('0x26')](function(_0x32dec3){if(_0x32dec3&&_0x32dec3[_0xd3c0('0x4b')]===0x0){return db[_0xd3c0('0x25')]['create']({'name':_0x4b0440[_0xd3c0('0x29')],'resourceId':_0x4b0440['id'],'type':_0x32dec3['name'],'sectionId':_0x32dec3['id']},{})[_0xd3c0('0x26')](function(){return _0x54294b;});}else{return _0x54294b;}})[_0xd3c0('0x3f')](function(_0x1d565d){logger[_0xd3c0('0x27')](_0xd3c0('0x4c'),_0x1d565d);throw _0x1d565d;});}return _0x54294b;})[_0xd3c0('0x26')](respondWithResult(_0x517494,0xc9))[_0xd3c0('0x3f')](handleError(_0x517494,null));};exports['update']=function(_0x241bbf,_0x3ea555){if(_0x241bbf['body']['id']){delete _0x241bbf[_0xd3c0('0x45')]['id'];}return db[_0xd3c0('0x2b')][_0xd3c0('0x43')]({'where':{'id':_0x241bbf[_0xd3c0('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ea555,null))['then'](saveUpdates(_0x241bbf[_0xd3c0('0x45')],null))[_0xd3c0('0x26')](respondWithResult(_0x3ea555,null))[_0xd3c0('0x3f')](handleError(_0x3ea555,null));};exports[_0xd3c0('0x23')]=function(_0xd88da4,_0x55e3ae){return db[_0xd3c0('0x2b')][_0xd3c0('0x43')]({'where':{'id':_0xd88da4[_0xd3c0('0x41')]['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0x55e3ae,null))[_0xd3c0('0x26')](removeEntity(_0x55e3ae,null))[_0xd3c0('0x3f')](handleError(_0x55e3ae,null));};exports[_0xd3c0('0x2c')]=function(_0x2c5ef0,_0x3eeb34){return db[_0xd3c0('0x2b')][_0xd3c0('0x2c')]()[_0xd3c0('0x26')](respondWithResult(_0x3eeb34,null))[_0xd3c0('0x3f')](handleError(_0x3eeb34,null));};exports[_0xd3c0('0x4d')]=function(_0xc9088a,_0x5ba47d,_0x50787a){return db[_0xd3c0('0x4e')]['find']({'where':{'id':_0xc9088a[_0xd3c0('0x41')]['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0x5ba47d,null))['then'](function(_0x707f07){if(_0x707f07){return _0x707f07[_0xd3c0('0x4d')](_0xc9088a[_0xd3c0('0x45')][_0xd3c0('0x4f')],_['omit'](_0xc9088a[_0xd3c0('0x45')],[_0xd3c0('0x4f'),'id'])||{});}})[_0xd3c0('0x26')](respondWithResult(_0x5ba47d,null))[_0xd3c0('0x3f')](handleError(_0x5ba47d,null));};exports['getContacts']=function(_0x3fd934,_0x2aaa7d,_0x3d9375){var _0x24cdd4={};var _0x16f027={};var _0x44319d;var _0x187e9b;return db[_0xd3c0('0x2b')]['findOne']({'where':{'id':_0x3fd934['params']['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0x2aaa7d,null))['then'](function(_0x1dfdd3){if(_0x1dfdd3){_0x44319d=_0x1dfdd3;_0x16f027[_0xd3c0('0x2d')]=_['keys'](db[_0xd3c0('0x4e')]['rawAttributes']);_0x16f027['query']=_[_0xd3c0('0x2e')](_0x3fd934['query']);_0x16f027['filters']=_[_0xd3c0('0x30')](_0x16f027['model'],_0x16f027['query']);_0x24cdd4[_0xd3c0('0x31')]=_['intersection'](_0x16f027[_0xd3c0('0x2d')],qs[_0xd3c0('0x32')](_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x32')]));_0x24cdd4['attributes']=_0x24cdd4['attributes'][_0xd3c0('0x33')]?_0x24cdd4[_0xd3c0('0x31')]:_0x16f027[_0xd3c0('0x2d')];_0x24cdd4[_0xd3c0('0x50')]=qs[_0xd3c0('0x35')](_0x3fd934['query'][_0xd3c0('0x35')]);_0x24cdd4['where']=qs[_0xd3c0('0x36')](_[_0xd3c0('0x51')](_0x3fd934['query'],_0x16f027[_0xd3c0('0x36')]));if(_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x37')]){_0x24cdd4[_0xd3c0('0x39')]=_[_0xd3c0('0x38')](_0x24cdd4[_0xd3c0('0x39')],{'$or':_[_0xd3c0('0x3a')](_0x24cdd4[_0xd3c0('0x31')],function(_0x2f6d79){var _0x3cbf1c={};_0x3cbf1c[_0x2f6d79]={'$like':'%'+_0x3fd934['query'][_0xd3c0('0x37')]+'%'};return _0x3cbf1c;})});}_0x24cdd4=_[_0xd3c0('0x38')]({},_0x24cdd4,_0x3fd934[_0xd3c0('0x3b')]);return _0x44319d[_0xd3c0('0x52')](_0x24cdd4);}})[_0xd3c0('0x26')](function(_0x45d558){if(_0x45d558){_0x187e9b=_0x45d558[_0xd3c0('0x33')];if(!_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x53')]('nolimit')){_0x24cdd4[_0xd3c0('0x1c')]=qs[_0xd3c0('0x1c')](_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x1c')]);_0x24cdd4['offset']=qs[_0xd3c0('0x1e')](_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x1e')]);}return _0x44319d[_0xd3c0('0x52')](_0x24cdd4);}})[_0xd3c0('0x26')](function(_0x4136de){if(_0x4136de){return _0x4136de?{'count':_0x187e9b,'rows':_0x4136de}:null;}})['then'](respondWithResult(_0x2aaa7d,null))['catch'](handleError(_0x2aaa7d,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 276d15f..d5782d5 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 _0xf39c=['bluebird','request-promise','rimraf','./cmCompany.attributes','exports','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf39c,0x165));var _0xcf39=function(_0x528941,_0x2f50ed){_0x528941=_0x528941-0x0;var _0xbfd8f9=_0xf39c[_0x528941];return _0xbfd8f9;};'use strict';var _=require(_0xcf39('0x0'));var util=require(_0xcf39('0x1'));var logger=require('../../config/logger')(_0xcf39('0x2'));var moment=require('moment');var BPromise=require(_0xcf39('0x3'));var rp=require(_0xcf39('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf39('0x5'));var config=require('../../config/environment');var attributes=require(_0xcf39('0x6'));module[_0xcf39('0x7')]=function(_0x180c7a,_0x25cd47){return _0x180c7a['define']('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x828f=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x237398,_0xc0ef22){var _0x5598de=function(_0x3118fa){while(--_0x3118fa){_0x237398['push'](_0x237398['shift']());}};_0x5598de(++_0xc0ef22);}(_0x828f,0x164));var _0xf828=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x828f[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0xf828('0x0'));var util=require(_0xf828('0x1'));var logger=require('../../config/logger')(_0xf828('0x2'));var moment=require(_0xf828('0x3'));var BPromise=require(_0xf828('0x4'));var rp=require(_0xf828('0x5'));var fs=require('fs');var path=require(_0xf828('0x6'));var rimraf=require(_0xf828('0x7'));var config=require(_0xf828('0x8'));var attributes=require(_0xf828('0x9'));module[_0xf828('0xa')]=function(_0x3c539b,_0x6c62e2){return _0x3c539b[_0xf828('0xb')](_0xf828('0xc'),attributes,{'tableName':_0xf828('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 675a770..263157a 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 _0x4cc5=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4cc5,0x120));var _0x54cc=function(_0x1915b9,_0x4929bc){_0x1915b9=_0x1915b9-0x0;var _0x2b6658=_0x4cc5[_0x1915b9];return _0x2b6658;};'use strict';var _=require(_0x54cc('0x0'));var util=require(_0x54cc('0x1'));var moment=require(_0x54cc('0x2'));var BPromise=require(_0x54cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54cc('0x4'));var db=require(_0x54cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x54cc('0x6'))('rpc');var config=require(_0x54cc('0x7'));var jayson=require(_0x54cc('0x8'));var client=jayson[_0x54cc('0x9')][_0x54cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdd4a,_0x172bf1,_0x28e0ea){return new BPromise(function(_0x5261b1,_0x564cc8){return client[_0x54cc('0xb')](_0x2fdd4a,_0x28e0ea)[_0x54cc('0xc')](function(_0x1e3944){logger[_0x54cc('0xd')]('CmCompany,\x20%s,\x20%s',_0x172bf1,_0x54cc('0xe'));logger['debug'](_0x54cc('0xf'),_0x172bf1,_0x54cc('0xe'),JSON[_0x54cc('0x10')](_0x1e3944));if(_0x1e3944['error']){if(_0x1e3944[_0x54cc('0x11')][_0x54cc('0x12')]===0x1f4){logger[_0x54cc('0x11')](_0x54cc('0x13'),_0x172bf1,_0x1e3944['error'][_0x54cc('0x14')]);return _0x564cc8(_0x1e3944[_0x54cc('0x11')][_0x54cc('0x14')]);}logger[_0x54cc('0x11')](_0x54cc('0x13'),_0x172bf1,_0x1e3944['error']['message']);return _0x5261b1(_0x1e3944[_0x54cc('0x11')][_0x54cc('0x14')]);}else{logger[_0x54cc('0xd')](_0x54cc('0x13'),_0x172bf1,_0x54cc('0xe'));_0x5261b1(_0x1e3944['result'][_0x54cc('0x14')]);}})['catch'](function(_0x494a9f){logger[_0x54cc('0x11')](_0x54cc('0x13'),_0x172bf1,_0x494a9f);_0x564cc8(_0x494a9f);});});}
\ No newline at end of file
+var _0x95b0=['client','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3579ad,_0x31c43d){var _0x33bcad=function(_0x443171){while(--_0x443171){_0x3579ad['push'](_0x3579ad['shift']());}};_0x33bcad(++_0x31c43d);}(_0x95b0,0xbc));var _0x095b=function(_0x545acc,_0x3d188a){_0x545acc=_0x545acc-0x0;var _0x5b5e30=_0x95b0[_0x545acc];return _0x5b5e30;};'use strict';var _=require(_0x095b('0x0'));var util=require(_0x095b('0x1'));var moment=require(_0x095b('0x2'));var BPromise=require(_0x095b('0x3'));var rs=require(_0x095b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x095b('0x5'))['db'];var utils=require(_0x095b('0x6'));var logger=require(_0x095b('0x7'))(_0x095b('0x8'));var config=require(_0x095b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x095b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3545,_0x4f130d,_0x155354){return new BPromise(function(_0x2890c1,_0x227bd7){return client[_0x095b('0xb')](_0x2f3545,_0x155354)[_0x095b('0xc')](function(_0xab6b1a){logger['info'](_0x095b('0xd'),_0x4f130d,_0x095b('0xe'));logger[_0x095b('0xf')](_0x095b('0x10'),_0x4f130d,_0x095b('0xe'),JSON['stringify'](_0xab6b1a));if(_0xab6b1a['error']){if(_0xab6b1a[_0x095b('0x11')][_0x095b('0x12')]===0x1f4){logger[_0x095b('0x11')](_0x095b('0xd'),_0x4f130d,_0xab6b1a[_0x095b('0x11')][_0x095b('0x13')]);return _0x227bd7(_0xab6b1a[_0x095b('0x11')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x4f130d,_0xab6b1a[_0x095b('0x11')]['message']);return _0x2890c1(_0xab6b1a[_0x095b('0x11')]['message']);}else{logger[_0x095b('0x14')](_0x095b('0xd'),_0x4f130d,'request\x20sent');_0x2890c1(_0xab6b1a['result']['message']);}})[_0x095b('0x15')](function(_0x44c9d8){logger[_0x095b('0x11')](_0x095b('0xd'),_0x4f130d,_0x44c9d8);_0x227bd7(_0x44c9d8);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 918e749..f557864 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 _0x3760=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','addContacts','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x3760,0x81));var _0x0376=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0x3760[_0x48a96f];return _0x3ff3ef;};'use strict';var multer=require(_0x0376('0x0'));var util=require('util');var path=require(_0x0376('0x1'));var timeout=require(_0x0376('0x2'));var express=require(_0x0376('0x3'));var router=express['Router']();var fs_extra=require(_0x0376('0x4'));var auth=require(_0x0376('0x5'));var interaction=require(_0x0376('0x6'));var config=require(_0x0376('0x7'));var controller=require(_0x0376('0x8'));router[_0x0376('0x9')]('/',auth[_0x0376('0xa')](),controller[_0x0376('0xb')]);router[_0x0376('0x9')](_0x0376('0xc'),auth['isAuthenticated'](),controller[_0x0376('0xd')]);router['get'](_0x0376('0xe'),auth[_0x0376('0xa')](),controller['show']);router[_0x0376('0x9')](_0x0376('0xf'),auth[_0x0376('0xa')](),controller[_0x0376('0x10')]);router['post']('/',auth[_0x0376('0xa')](),controller['create']);router['post'](_0x0376('0xf'),auth['isAuthenticated'](),controller[_0x0376('0x11')]);router[_0x0376('0x12')](_0x0376('0xe'),auth['isAuthenticated'](),controller[_0x0376('0x13')]);router[_0x0376('0x14')](_0x0376('0xe'),auth[_0x0376('0xa')](),controller['destroy']);module[_0x0376('0x15')]=router;
\ No newline at end of file
+var _0x0fb4=['update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','post','create','addContacts'];(function(_0x56f56d,_0x366e03){var _0x16d690=function(_0x3e99d5){while(--_0x3e99d5){_0x56f56d['push'](_0x56f56d['shift']());}};_0x16d690(++_0x366e03);}(_0x0fb4,0x17e));var _0x40fb=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x0fb4[_0x3c6ae2];return _0x4edda;};'use strict';var multer=require(_0x40fb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x40fb('0x1'));var express=require(_0x40fb('0x2'));var router=express[_0x40fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x40fb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x40fb('0x5'));var controller=require(_0x40fb('0x6'));router[_0x40fb('0x7')]('/',auth[_0x40fb('0x8')](),controller[_0x40fb('0x9')]);router[_0x40fb('0x7')]('/describe',auth[_0x40fb('0x8')](),controller[_0x40fb('0xa')]);router['get'](_0x40fb('0xb'),auth[_0x40fb('0x8')](),controller[_0x40fb('0xc')]);router['get'](_0x40fb('0xd'),auth[_0x40fb('0x8')](),controller['getContacts']);router[_0x40fb('0xe')]('/',auth[_0x40fb('0x8')](),controller[_0x40fb('0xf')]);router['post']('/:id/contacts',auth[_0x40fb('0x8')](),controller[_0x40fb('0x10')]);router['put'](_0x40fb('0xb'),auth[_0x40fb('0x8')](),controller[_0x40fb('0x11')]);router[_0x40fb('0x12')](_0x40fb('0xb'),auth['isAuthenticated'](),controller[_0x40fb('0x13')]);module[_0x40fb('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index cf1f892..6a58e0e 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 _0x01eb=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x01eb,0x1e8));var _0xb01e=function(_0x52b7a2,_0x5458c3){_0x52b7a2=_0x52b7a2-0x0;var _0xa34627=_0x01eb[_0x52b7a2];return _0xa34627;};'use strict';var _=require(_0xb01e('0x0'));var Sequelize=require(_0xb01e('0x1'));module[_0xb01e('0x2')]={'firstName':{'type':Sequelize[_0xb01e('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb01e('0x3')]},'street':{'type':Sequelize[_0xb01e('0x3')]},'postalCode':{'type':Sequelize[_0xb01e('0x3')]},'city':{'type':Sequelize[_0xb01e('0x3')]},'country':{'type':Sequelize[_0xb01e('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb01e('0x3')]},'description':{'type':Sequelize[_0xb01e('0x4')]},'phone':{'type':Sequelize[_0xb01e('0x3')]},'mobile':{'type':Sequelize[_0xb01e('0x3')]},'fax':{'type':Sequelize[_0xb01e('0x3')]},'email':{'type':Sequelize[_0xb01e('0x3')]},'url':{'type':Sequelize[_0xb01e('0x3')]},'facebook':{'type':Sequelize[_0xb01e('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xb01e('0x3')]},'skype':{'type':Sequelize[_0xb01e('0x3')]},'teams':{'type':Sequelize[_0xb01e('0x3')]},'viber':{'type':Sequelize[_0xb01e('0x3')]},'line':{'type':Sequelize[_0xb01e('0x3')]},'wechat':{'type':Sequelize[_0xb01e('0x3')]},'telegram':{'type':Sequelize[_0xb01e('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xb01e('0x5')](0x2)[_0xb01e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb01e('0x7')],'defaultValue':Sequelize[_0xb01e('0x8')]}};
\ No newline at end of file
+var _0xe3ff=['UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x4b9b90,_0x148e57){var _0x137e8d=function(_0x97a4d4){while(--_0x97a4d4){_0x4b9b90['push'](_0x4b9b90['shift']());}};_0x137e8d(++_0x148e57);}(_0xe3ff,0x142));var _0xfe3f=function(_0x48447c,_0x2cd985){_0x48447c=_0x48447c-0x0;var _0x7a4cfd=_0xe3ff[_0x48447c];return _0x7a4cfd;};'use strict';var _=require(_0xfe3f('0x0'));var Sequelize=require(_0xfe3f('0x1'));module[_0xfe3f('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xfe3f('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xfe3f('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfe3f('0x3')]},'dateOfBirth':{'type':Sequelize[_0xfe3f('0x3')]},'description':{'type':Sequelize[_0xfe3f('0x4')]},'phone':{'type':Sequelize[_0xfe3f('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfe3f('0x3')]},'email':{'type':Sequelize[_0xfe3f('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xfe3f('0x3')]},'fb_data':{'type':Sequelize[_0xfe3f('0x3')]},'twitter':{'type':Sequelize[_0xfe3f('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xfe3f('0x3')]},'viber':{'type':Sequelize[_0xfe3f('0x3')]},'line':{'type':Sequelize[_0xfe3f('0x3')]},'wechat':{'type':Sequelize[_0xfe3f('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xfe3f('0x5')]},'priority':{'type':Sequelize[_0xfe3f('0x5')](0x2)[_0xfe3f('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xfe3f('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 52fa248..6f54f06 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 _0x457f=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','CmContact','keys','startsWith','push','CmCustomField','cf_','all','length','fieldType','type','model','query','intersection','fields','attributes','nolimit','sort','where','filters','pick','select','field','color','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','tools_tags','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','forEach','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','value','start','map','hasOwnProperty','filter','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','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?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','clone','order','DESC','having','t.id\x20IN\x20?','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','toString','sequelize','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','describe','tags','columnName','displayName','findAll','alias','custom','values','body','get','mergeWith','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','join','bulkCreate','each','duplicates','$or','findOrCreate','spread','error','show','$and','omit','cf_%d','pickBy','format','table','setFields','id\x20=\x20?','phone','getTags','findOne','rawAttributes','options','setTags','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','file','meta','import','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','chat','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','VoiceCallReport','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Owner','flatten','sortBy','reverse','slice','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse'];(function(_0x1b0f40,_0x5ec41b){var _0xfc7db4=function(_0x22dc93){while(--_0x22dc93){_0x1b0f40['push'](_0x1b0f40['shift']());}};_0xfc7db4(++_0x5ec41b);}(_0x457f,0x129));var _0xf457=function(_0x3a827d,_0x28fad4){_0x3a827d=_0x3a827d-0x0;var _0x3571c0=_0x457f[_0x3a827d];return _0x3571c0;};'use strict';var emlformat=require(_0xf457('0x0'));var rimraf=require(_0xf457('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf457('0x2'));var rp=require(_0xf457('0x3'));var moment=require(_0xf457('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf457('0x5'));var path=require(_0xf457('0x6'));var sox=require(_0xf457('0x7'));var csv=require(_0xf457('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf457('0x9'));var squel=require(_0xf457('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf457('0xb'));var toCsv=require(_0xf457('0x8'));var querystring=require(_0xf457('0xc'));var Papa=require(_0xf457('0xd'));var Redis=require('ioredis');var authService=require(_0xf457('0xe'));var qs=require(_0xf457('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf457('0x10'));var logger=require(_0xf457('0x11'))(_0xf457('0x12'));var utils=require('../../config/utils');var config=require(_0xf457('0x13'));var licenseUtil=require(_0xf457('0x14'));var db=require(_0xf457('0x15'))['db'];config[_0xf457('0x16')]=_[_0xf457('0x17')](config[_0xf457('0x16')],{'host':_0xf457('0x18'),'port':0x18eb});var socket=require(_0xf457('0x19'))(new Redis(config[_0xf457('0x16')]));require(_0xf457('0x1a'))[_0xf457('0x1b')](socket);function respondWithStatusCode(_0x17fd80,_0x496bb8){_0x496bb8=_0x496bb8||0xcc;return function(_0xc9575a){if(_0xc9575a){return _0x17fd80[_0xf457('0x1c')](_0x496bb8);}return _0x17fd80[_0xf457('0x1d')](_0x496bb8)[_0xf457('0x1e')]();};}function respondWithResult(_0x18abeb,_0x1ced6b){_0x1ced6b=_0x1ced6b||0xc8;return function(_0x3be575){if(_0x3be575){return _0x18abeb[_0xf457('0x1d')](_0x1ced6b)[_0xf457('0x1f')](_0x3be575);}};}function respondWithFilteredResult(_0x1e0aa7,_0x4decf6){return function(_0xbd8935){if(_0xbd8935){var _0x76eefe=typeof _0x4decf6[_0xf457('0x20')]===_0xf457('0x21')&&typeof _0x4decf6[_0xf457('0x22')]===_0xf457('0x21');var _0x4fc8a6=_0xbd8935[_0xf457('0x23')];var _0x427280=_0x76eefe?0x0:_0x4decf6['offset'];var _0x33c0d0=_0x76eefe?_0xbd8935['count']:_0x4decf6[_0xf457('0x20')]+_0x4decf6['limit'];var _0x5c741f;if(_0x33c0d0>=_0x4fc8a6){_0x33c0d0=_0x4fc8a6;_0x5c741f=0xc8;}else{_0x5c741f=0xce;}_0x1e0aa7[_0xf457('0x1d')](_0x5c741f);return _0x1e0aa7[_0xf457('0x24')](_0xf457('0x25'),_0x427280+'-'+_0x33c0d0+'/'+_0x4fc8a6)[_0xf457('0x1f')](_0xbd8935);}return null;};}function patchUpdates(_0x11247c){return function(_0x5c0551){try{jsonpatch[_0xf457('0x26')](_0x5c0551,_0x11247c,!![]);}catch(_0x3f9f9d){return BPromise[_0xf457('0x27')](_0x3f9f9d);}return _0x5c0551[_0xf457('0x28')]();};}function saveUpdates(_0x1083f9,_0x2bfc8f){return function(_0x3e7f93){if(_0x3e7f93){return _0x3e7f93[_0xf457('0x29')](_0x1083f9)[_0xf457('0x2a')](function(_0x5d72e3){return _0x5d72e3;});}return null;};}function removeEntity(_0x4c7b1c,_0x20031a){return function(_0x41edc8){if(_0x41edc8){return _0x41edc8[_0xf457('0x2b')]()[_0xf457('0x2a')](function(){_0x4c7b1c[_0xf457('0x1d')](0xcc)[_0xf457('0x1e')]();});}};}function handleEntityNotFound(_0x56858b,_0x36823d){return function(_0x338ac6){if(!_0x338ac6){_0x56858b['sendStatus'](0x194);}return _0x338ac6;};}function handleError(_0x2c3f67,_0x271441){_0x271441=_0x271441||0x1f4;return function(_0x34834e){logger['error'](_0x34834e[_0xf457('0x2c')]);if(_0x34834e[_0xf457('0x2d')]){delete _0x34834e[_0xf457('0x2d')];}_0x2c3f67['status'](_0x271441)[_0xf457('0x2e')](_0x34834e);};}exports[_0xf457('0x2f')]=function(_0x209029,_0x2266fc){var _0x56b0e4={},_0x1f4cc4={},_0x3eccce={'count':0x0,'rows':[]};return db[_0xf457('0x30')]['describe']()[_0xf457('0x2a')](function(_0x484fd1){var _0x5a0a85=[];for(var _0x56d4ca=0x0;_0x56d4ca
','Attachments','Title'];(function(_0x2714ce,_0x4214b3){var _0x1d5cba=function(_0x321964){while(--_0x321964){_0x2714ce['push'](_0x2714ce['shift']());}};_0x1d5cba(++_0x4214b3);}(_0x9aac,0x135));var _0xc9aa=function(_0x55799d,_0x5c6242){_0x55799d=_0x55799d-0x0;var _0x10425a=_0x9aac[_0x55799d];return _0x10425a;};'use strict';var _=require(_0xc9aa('0x0'));var moment=require('moment');var random=require(_0xc9aa('0x1'));var fs=require('fs');var path=require(_0xc9aa('0x2'));var util=require('util');var tnef=require(_0xc9aa('0x3'));var logger=require('../../../config/logger')(_0xc9aa('0x4'));var config=require('../../../config/environment');function getAddress(_0x28c49c){var _0x267772=_['head'](_0x28c49c[_0xc9aa('0x5')]);return _0x267772&&_0x267772[_0xc9aa('0x6')]?_0x267772[_0xc9aa('0x6')]:'anonymous'+random[_0xc9aa('0x7')](0x6)+_0xc9aa('0x8');}function getFirstName(_0x2acfd4){var _0x4d8071=_[_0xc9aa('0x9')](_0x2acfd4[_0xc9aa('0x5')]);if(_0x4d8071&&_0x4d8071[_0xc9aa('0xa')]){if(_0x4d8071['name']==_0x4d8071['address']){return _0x4d8071[_0xc9aa('0xa')]['substring'](0x0,_0x4d8071[_0xc9aa('0xa')][_0xc9aa('0xb')]('@'));}var _0x248d4e=_0x4d8071[_0xc9aa('0xa')][_0xc9aa('0xc')](/\s+/);return _0x248d4e[_0xc9aa('0xd')]>0x1?_0x248d4e[_0xc9aa('0xe')](0x0,-0x1)[_0xc9aa('0xf')]('\x20'):_0x4d8071[_0xc9aa('0xa')];}return _0xc9aa('0x10');}function getLastName(_0x441ef7){var _0x884c9d=_[_0xc9aa('0x9')](_0x441ef7[_0xc9aa('0x5')]);if(_0x884c9d&&_0x884c9d[_0xc9aa('0xa')]){var _0x340243=_0x884c9d[_0xc9aa('0xa')]['split'](/\s+/);return _0x340243[_0xc9aa('0xd')]>0x1?_0x340243['pop']():'';}return'';}function getMails(_0x5b351f,_0x477ca5){var _0x553805='';for(var _0x13ed6c=0x0;_0x13ed6c<_0x477ca5[_0xc9aa('0x5')]['length'];_0x13ed6c+=0x1){if(_0x477ca5[_0xc9aa('0x5')][_0x13ed6c][_0xc9aa('0x6')]!==_0x5b351f){if(!_[_0xc9aa('0x11')](_0x553805)){_0x553805+=',';}_0x553805+=_0x477ca5['value'][_0x13ed6c][_0xc9aa('0xa')]||_0x477ca5[_0xc9aa('0x5')][_0x13ed6c][_0xc9aa('0x6')]||'';_0x553805+='\x20<';_0x553805+=_0x477ca5[_0xc9aa('0x5')][_0x13ed6c][_0xc9aa('0x6')]?_0x477ca5[_0xc9aa('0x5')][_0x13ed6c]['address']:_0xc9aa('0x12')+random['generate'](0x6)+_0xc9aa('0x8');_0x553805+='>';}}return _0x553805;}function parseEmail(_0x5b5ffc,_0x7c837f,_0x5e51e9){if(_0x7c837f[_0xc9aa('0x13')]){var _0x3f8bfd=/