From 1bf39bba9879c25dc2bdacd2d2a032fbb3f4d425 Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Tue, 18 Jan 2022 15:19:11 +0100
Subject: [PATCH] Built motion from commit 6b365f78.|2.5.48
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/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/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/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/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1169 files changed, 1169 insertions(+), 1169 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index b73b732..8992a13 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-18T08:32:58.639Z",
+ "time": "2022-01-18T13:45:36.079Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index af5da7e..1d9dd9d 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-18T08:32:58.639Z",
+ "time": "2022-01-18T13:45:36.079Z",
"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 ee8f18a..048b16e 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 _0x7fcf=['action','contactManager','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL'];(function(_0x49ee70,_0x115b1e){var _0x3a7254=function(_0x1bc688){while(--_0x1bc688){_0x49ee70['push'](_0x49ee70['shift']());}};_0x3a7254(++_0x115b1e);}(_0x7fcf,0xce));var _0xf7fc=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7fcf[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require('sequelize');module[_0xf7fc('0x0')]={'name':{'type':Sequelize[_0xf7fc('0x1')],'get':function(_0x340c94){return this['getDataValue'](_0xf7fc('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xf7fc('0x3'),'integration','motionbar',_0xf7fc('0x4'),_0xf7fc('0x5'),_0xf7fc('0x6'),'bot',_0xf7fc('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xf7fc('0x8')},'data1':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':_0xf7fc('0xa')},'data2':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comment':_0xf7fc('0xb')},'data4':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xf7fc('0x9')](0x1000),'comments':_0xf7fc('0xc')},'data6':{'type':Sequelize[_0xf7fc('0x9')],'comments':_0xf7fc('0xd')},'data7':{'type':Sequelize[_0xf7fc('0xe')],'comments':_0xf7fc('0xf')}};
\ No newline at end of file
+var _0x8593=['jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','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],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','motionbar'];(function(_0x1b62c1,_0x3d5b59){var _0x2229c2=function(_0x4f9c86){while(--_0x4f9c86){_0x1b62c1['push'](_0x1b62c1['shift']());}};_0x2229c2(++_0x3d5b59);}(_0x8593,0x107));var _0x3859=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x8593[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x3859('0x0'));module[_0x3859('0x1')]={'name':{'type':Sequelize[_0x3859('0x2')],'get':function(_0x19acaa){return this[_0x3859('0x3')](_0x3859('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3859('0x5'),'integration',_0x3859('0x6'),_0x3859('0x7'),'urlForward',_0x3859('0x8'),_0x3859('0x9'),'script']],'msg':_0x3859('0xa')}},'comment':_0x3859('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3859('0xb')},'data2':{'type':Sequelize[_0x3859('0xc')](0x1000),'comment':_0x3859('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x3859('0xc')](0x1000),'comments':_0x3859('0xe')},'data5':{'type':Sequelize[_0x3859('0xc')](0x1000),'comments':_0x3859('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x3859('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x3859('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 2376e7e..0deb8e7 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 _0xf622=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x21f7c2,_0x1b2426){var _0x3f3279=function(_0xaa480f){while(--_0xaa480f){_0x21f7c2['push'](_0x21f7c2['shift']());}};_0x3f3279(++_0x1b2426);}(_0xf622,0xfa));var _0x2f62=function(_0x3d9956,_0x3afd72){_0x3d9956=_0x3d9956-0x0;var _0x7cf682=_0xf622[_0x3d9956];return _0x7cf682;};'use strict';var emlformat=require(_0x2f62('0x0'));var rimraf=require(_0x2f62('0x1'));var zipdir=require(_0x2f62('0x2'));var jsonpatch=require(_0x2f62('0x3'));var rp=require(_0x2f62('0x4'));var moment=require(_0x2f62('0x5'));var BPromise=require(_0x2f62('0x6'));var Mustache=require('mustache');var util=require(_0x2f62('0x7'));var path=require(_0x2f62('0x8'));var sox=require(_0x2f62('0x9'));var csv=require(_0x2f62('0xa'));var ejs=require(_0x2f62('0xb'));var fs=require('fs');var fs_extra=require(_0x2f62('0xc'));var _=require(_0x2f62('0xd'));var squel=require(_0x2f62('0xe'));var crypto=require(_0x2f62('0xf'));var jsforce=require(_0x2f62('0x10'));var deskjs=require(_0x2f62('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2f62('0x12'));var Papa=require(_0x2f62('0x13'));var Redis=require(_0x2f62('0x14'));var authService=require(_0x2f62('0x15'));var qs=require(_0x2f62('0x16'));var as=require(_0x2f62('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f62('0x18'))(_0x2f62('0x19'));var utils=require(_0x2f62('0x1a'));var config=require(_0x2f62('0x1b'));var licenseUtil=require(_0x2f62('0x1c'));var db=require(_0x2f62('0x1d'))['db'];function respondWithStatusCode(_0x58345c,_0x39f8fa){_0x39f8fa=_0x39f8fa||0xcc;return function(_0x4a2315){if(_0x4a2315){return _0x58345c['sendStatus'](_0x39f8fa);}return _0x58345c[_0x2f62('0x1e')](_0x39f8fa)[_0x2f62('0x1f')]();};}function respondWithResult(_0xc5077c,_0x20bfe3){_0x20bfe3=_0x20bfe3||0xc8;return function(_0x15043c){if(_0x15043c){return _0xc5077c[_0x2f62('0x1e')](_0x20bfe3)[_0x2f62('0x20')](_0x15043c);}};}function respondWithFilteredResult(_0x27000f,_0x480a57){return function(_0x59cff0){if(_0x59cff0){var _0x1ae546=typeof _0x480a57['offset']===_0x2f62('0x21')&&typeof _0x480a57[_0x2f62('0x22')]===_0x2f62('0x21');var _0xbfd199=_0x59cff0[_0x2f62('0x23')];var _0x5bbe94=_0x1ae546?0x0:_0x480a57[_0x2f62('0x24')];var _0x3c35c9=_0x1ae546?_0x59cff0[_0x2f62('0x23')]:_0x480a57['offset']+_0x480a57[_0x2f62('0x22')];var _0xce062b;if(_0x3c35c9>=_0xbfd199){_0x3c35c9=_0xbfd199;_0xce062b=0xc8;}else{_0xce062b=0xce;}_0x27000f[_0x2f62('0x1e')](_0xce062b);return _0x27000f['set'](_0x2f62('0x25'),_0x5bbe94+'-'+_0x3c35c9+'/'+_0xbfd199)[_0x2f62('0x20')](_0x59cff0);}return null;};}function patchUpdates(_0x2dcaa2){return function(_0x2fc5d8){try{jsonpatch[_0x2f62('0x26')](_0x2fc5d8,_0x2dcaa2,!![]);}catch(_0x114a6a){return BPromise[_0x2f62('0x27')](_0x114a6a);}return _0x2fc5d8['save']();};}function saveUpdates(_0x18b34d,_0x37d4c3){return function(_0x2e34d7){if(_0x2e34d7){return _0x2e34d7['update'](_0x18b34d)[_0x2f62('0x28')](function(_0x1f6203){return _0x1f6203;});}return null;};}function removeEntity(_0x1b9771,_0x68a9d1){return function(_0x417e79){if(_0x417e79){return _0x417e79[_0x2f62('0x29')]()[_0x2f62('0x28')](function(){_0x1b9771[_0x2f62('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x243da7,_0x25260b){return function(_0x46016a){if(!_0x46016a){_0x243da7[_0x2f62('0x2a')](0x194);}return _0x46016a;};}function handleError(_0xa20a80,_0x52ae02){_0x52ae02=_0x52ae02||0x1f4;return function(_0x7706b9){logger[_0x2f62('0x2b')](_0x7706b9[_0x2f62('0x2c')]);if(_0x7706b9['name']){delete _0x7706b9[_0x2f62('0x2d')];}_0xa20a80[_0x2f62('0x1e')](_0x52ae02)[_0x2f62('0x2e')](_0x7706b9);};}exports[_0x2f62('0x2f')]=function(_0x5c5cf8,_0x3d9ad7){if(_0x5c5cf8['body']['id']){delete _0x5c5cf8[_0x2f62('0x30')]['id'];}return db[_0x2f62('0x31')][_0x2f62('0x32')]({'where':{'id':_0x5c5cf8[_0x2f62('0x33')]['id']}})[_0x2f62('0x28')](handleEntityNotFound(_0x3d9ad7,null))[_0x2f62('0x28')](saveUpdates(_0x5c5cf8[_0x2f62('0x30')],null))[_0x2f62('0x28')](respondWithResult(_0x3d9ad7,null))[_0x2f62('0x34')](handleError(_0x3d9ad7,null));};exports[_0x2f62('0x29')]=function(_0x4daae7,_0xa5fb67){return db[_0x2f62('0x31')][_0x2f62('0x32')]({'where':{'id':_0x4daae7['params']['id']}})[_0x2f62('0x28')](handleEntityNotFound(_0xa5fb67,null))['then'](removeEntity(_0xa5fb67,null))[_0x2f62('0x34')](handleError(_0xa5fb67,null));};
\ No newline at end of file
+var _0x3193=['body','find','params','catch','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send'];(function(_0x55ebbc,_0x1cdbe3){var _0x1d93d4=function(_0x590c1a){while(--_0x590c1a){_0x55ebbc['push'](_0x55ebbc['shift']());}};_0x1d93d4(++_0x1cdbe3);}(_0x3193,0xc5));var _0x3319=function(_0x2a924b,_0x4253c8){_0x2a924b=_0x2a924b-0x0;var _0x585f69=_0x3193[_0x2a924b];return _0x585f69;};'use strict';var emlformat=require(_0x3319('0x0'));var rimraf=require(_0x3319('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3319('0x2'));var rp=require(_0x3319('0x3'));var moment=require(_0x3319('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3319('0x5'));var util=require(_0x3319('0x6'));var path=require(_0x3319('0x7'));var sox=require(_0x3319('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3319('0x9'));var squel=require(_0x3319('0xa'));var crypto=require(_0x3319('0xb'));var jsforce=require(_0x3319('0xc'));var deskjs=require(_0x3319('0xd'));var toCsv=require(_0x3319('0xe'));var querystring=require(_0x3319('0xf'));var Papa=require(_0x3319('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3319('0x11'));var as=require(_0x3319('0x12'));var hardwareService=require(_0x3319('0x13'));var logger=require(_0x3319('0x14'))(_0x3319('0x15'));var utils=require(_0x3319('0x16'));var config=require(_0x3319('0x17'));var licenseUtil=require(_0x3319('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7c50d6,_0x59b6c9){_0x59b6c9=_0x59b6c9||0xcc;return function(_0x190a8c){if(_0x190a8c){return _0x7c50d6['sendStatus'](_0x59b6c9);}return _0x7c50d6[_0x3319('0x19')](_0x59b6c9)[_0x3319('0x1a')]();};}function respondWithResult(_0x5b32a4,_0x2640d6){_0x2640d6=_0x2640d6||0xc8;return function(_0x4089c2){if(_0x4089c2){return _0x5b32a4['status'](_0x2640d6)['json'](_0x4089c2);}};}function respondWithFilteredResult(_0x17551b,_0xf8bde1){return function(_0x453e94){if(_0x453e94){var _0x1124d4=typeof _0xf8bde1['offset']===_0x3319('0x1b')&&typeof _0xf8bde1['limit']==='undefined';var _0x58eafd=_0x453e94[_0x3319('0x1c')];var _0x554f92=_0x1124d4?0x0:_0xf8bde1[_0x3319('0x1d')];var _0x41949c=_0x1124d4?_0x453e94['count']:_0xf8bde1[_0x3319('0x1d')]+_0xf8bde1[_0x3319('0x1e')];var _0x5e7c4c;if(_0x41949c>=_0x58eafd){_0x41949c=_0x58eafd;_0x5e7c4c=0xc8;}else{_0x5e7c4c=0xce;}_0x17551b[_0x3319('0x19')](_0x5e7c4c);return _0x17551b[_0x3319('0x1f')](_0x3319('0x20'),_0x554f92+'-'+_0x41949c+'/'+_0x58eafd)[_0x3319('0x21')](_0x453e94);}return null;};}function patchUpdates(_0x1e58fd){return function(_0x28ee19){try{jsonpatch[_0x3319('0x22')](_0x28ee19,_0x1e58fd,!![]);}catch(_0x227011){return BPromise[_0x3319('0x23')](_0x227011);}return _0x28ee19[_0x3319('0x24')]();};}function saveUpdates(_0x447582,_0x8658b9){return function(_0x110919){if(_0x110919){return _0x110919[_0x3319('0x25')](_0x447582)[_0x3319('0x26')](function(_0x181dff){return _0x181dff;});}return null;};}function removeEntity(_0xdc6ea4,_0x29d6ad){return function(_0x2ce55f){if(_0x2ce55f){return _0x2ce55f['destroy']()[_0x3319('0x26')](function(){_0xdc6ea4[_0x3319('0x19')](0xcc)[_0x3319('0x1a')]();});}};}function handleEntityNotFound(_0x342a3f,_0x2775b3){return function(_0x261892){if(!_0x261892){_0x342a3f[_0x3319('0x27')](0x194);}return _0x261892;};}function handleError(_0x224e8a,_0x2fc9dd){_0x2fc9dd=_0x2fc9dd||0x1f4;return function(_0x425e9e){logger['error'](_0x425e9e[_0x3319('0x28')]);if(_0x425e9e[_0x3319('0x29')]){delete _0x425e9e[_0x3319('0x29')];}_0x224e8a[_0x3319('0x19')](_0x2fc9dd)[_0x3319('0x2a')](_0x425e9e);};}exports['update']=function(_0x203ecd,_0x4aaf06){if(_0x203ecd[_0x3319('0x2b')]['id']){delete _0x203ecd[_0x3319('0x2b')]['id'];}return db['Action'][_0x3319('0x2c')]({'where':{'id':_0x203ecd[_0x3319('0x2d')]['id']}})[_0x3319('0x26')](handleEntityNotFound(_0x4aaf06,null))[_0x3319('0x26')](saveUpdates(_0x203ecd[_0x3319('0x2b')],null))[_0x3319('0x26')](respondWithResult(_0x4aaf06,null))[_0x3319('0x2e')](handleError(_0x4aaf06,null));};exports[_0x3319('0x2f')]=function(_0x44340e,_0x237134){return db['Action']['find']({'where':{'id':_0x44340e['params']['id']}})['then'](handleEntityNotFound(_0x237134,null))[_0x3319('0x26')](removeEntity(_0x237134,null))['catch'](handleError(_0x237134,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index b91a172..c4763b7 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 _0x18b1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions'];(function(_0x253f2a,_0x2c51f2){var _0x1c15f5=function(_0x446493){while(--_0x446493){_0x253f2a['push'](_0x253f2a['shift']());}};_0x1c15f5(++_0x2c51f2);}(_0x18b1,0x9a));var _0x118b=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x18b1[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x118b('0x0'));var util=require(_0x118b('0x1'));var logger=require(_0x118b('0x2'))(_0x118b('0x3'));var moment=require(_0x118b('0x4'));var BPromise=require(_0x118b('0x5'));var rp=require(_0x118b('0x6'));var fs=require('fs');var path=require(_0x118b('0x7'));var rimraf=require(_0x118b('0x8'));var config=require(_0x118b('0x9'));var attributes=require(_0x118b('0xa'));module[_0x118b('0xb')]=function(_0x5f5084,_0x3d63ef){return _0x5f5084[_0x118b('0xc')]('Action',attributes,{'tableName':_0x118b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66d6=['exports','Action','tools_actions','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./action.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x66d6,0xf5));var _0x666d=function(_0x5a452e,_0x355a90){_0x5a452e=_0x5a452e-0x0;var _0x2c4c43=_0x66d6[_0x5a452e];return _0x2c4c43;};'use strict';var _=require(_0x666d('0x0'));var util=require(_0x666d('0x1'));var logger=require(_0x666d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x666d('0x3'));var rp=require(_0x666d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x666d('0x5'));var config=require(_0x666d('0x6'));var attributes=require(_0x666d('0x7'));module[_0x666d('0x8')]=function(_0x324c9a,_0x1764c2){return _0x324c9a['define'](_0x666d('0x9'),attributes,{'tableName':_0x666d('0xa'),'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 0e4822e..b59e46d 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x52f934,_0x424005){var _0x41dcad=function(_0x31d98c){while(--_0x31d98c){_0x52f934['push'](_0x52f934['shift']());}};_0x41dcad(++_0x424005);}(_0x5fc3,0xa8));var _0x35fc=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x5fc3[_0x136a0d];return _0x212ea5;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x118da3,_0x2b8050){var _0x2b9916=function(_0xaad730){while(--_0xaad730){_0x118da3['push'](_0x118da3['shift']());}};_0x2b9916(++_0x2b8050);}(_0xe14b,0x93));var _0xbe14=function(_0x5ea538,_0x37bdb5){_0x5ea538=_0x5ea538-0x0;var _0x37ff5e=_0xe14b[_0x5ea538];return _0x37ff5e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 42810ce..10b21c1 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 _0xbb18=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','exports','util','path'];(function(_0x2ad7fb,_0x457a39){var _0x4e63d1=function(_0x45fd63){while(--_0x45fd63){_0x2ad7fb['push'](_0x2ad7fb['shift']());}};_0x4e63d1(++_0x457a39);}(_0xbb18,0x16a));var _0x8bb1=function(_0x4f96b4,_0x22cc57){_0x4f96b4=_0x4f96b4-0x0;var _0x67821b=_0xbb18[_0x4f96b4];return _0x67821b;};'use strict';var multer=require('multer');var util=require(_0x8bb1('0x0'));var path=require(_0x8bb1('0x1'));var timeout=require('connect-timeout');var express=require(_0x8bb1('0x2'));var router=express['Router']();var fs_extra=require(_0x8bb1('0x3'));var auth=require(_0x8bb1('0x4'));var interaction=require(_0x8bb1('0x5'));var config=require(_0x8bb1('0x6'));var controller=require(_0x8bb1('0x7'));router[_0x8bb1('0x8')](_0x8bb1('0x9'),auth[_0x8bb1('0xa')](),controller[_0x8bb1('0xb')]);router['delete'](_0x8bb1('0x9'),auth[_0x8bb1('0xa')](),controller['destroy']);module[_0x8bb1('0xc')]=router;
\ No newline at end of file
+var _0x4857=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x4857,0x16a));var _0x7485=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x4857[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x7485('0x0'));var util=require(_0x7485('0x1'));var path=require(_0x7485('0x2'));var timeout=require('connect-timeout');var express=require(_0x7485('0x3'));var router=express[_0x7485('0x4')]();var fs_extra=require(_0x7485('0x5'));var auth=require(_0x7485('0x6'));var interaction=require(_0x7485('0x7'));var config=require(_0x7485('0x8'));var controller=require(_0x7485('0x9'));router['put'](_0x7485('0xa'),auth[_0x7485('0xb')](),controller[_0x7485('0xc')]);router[_0x7485('0xd')](_0x7485('0xa'),auth['isAuthenticated'](),controller[_0x7485('0xe')]);module[_0x7485('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 0a6dc68..29f7319 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 _0x4819=['TEXT','exports','STRING'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x4819,0xcd));var _0x9481=function(_0x344e99,_0x530098){_0x344e99=_0x344e99-0x0;var _0x172d28=_0x4819[_0x344e99];return _0x172d28;};'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
+var _0xee14=['STRING','TEXT'];(function(_0x8c1cbb,_0x329764){var _0x2ce944=function(_0x3cfe33){while(--_0x3cfe33){_0x8c1cbb['push'](_0x8c1cbb['shift']());}};_0x2ce944(++_0x329764);}(_0xee14,0x13a));var _0x4ee1=function(_0x5c699e,_0x35ca34){_0x5c699e=_0x5c699e-0x0;var _0x253361=_0xee14[_0x5c699e];return _0x253361;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index fb4bb28..8f20e0a 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 _0xeae6=['sequelize','SELECT','join','cross_join','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','Sequelize','from','MetricId','output','web','%s-%s.%s','randomstring','generate','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','ROUND(%s)','keyBy','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','left_join','right_join','SUM(%s)','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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xeae6,0xc3));var _0x6eae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeae6[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x6eae('0x0'));var rimraf=require(_0x6eae('0x1'));var zipdir=require(_0x6eae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6eae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6eae('0x4'));var util=require(_0x6eae('0x5'));var path=require(_0x6eae('0x6'));var sox=require(_0x6eae('0x7'));var csv=require(_0x6eae('0x8'));var ejs=require(_0x6eae('0x9'));var fs=require('fs');var fs_extra=require(_0x6eae('0xa'));var _=require(_0x6eae('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6eae('0xc'));var deskjs=require(_0x6eae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6eae('0xe'));var Papa=require(_0x6eae('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6eae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6eae('0x11'));var utils=require(_0x6eae('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6eae('0x13'));var db=require(_0x6eae('0x14'))['db'];var dbH=require(_0x6eae('0x14'))[_0x6eae('0x15')];function respondWithStatusCode(_0x118bc0,_0x1d86ac){_0x1d86ac=_0x1d86ac||0xcc;return function(_0x18f2ee){if(_0x18f2ee){return _0x118bc0['sendStatus'](_0x1d86ac);}return _0x118bc0[_0x6eae('0x16')](_0x1d86ac)[_0x6eae('0x17')]();};}function respondWithResult(_0x147b90,_0x275024){_0x275024=_0x275024||0xc8;return function(_0x18c008){if(_0x18c008){return _0x147b90[_0x6eae('0x16')](_0x275024)[_0x6eae('0x18')](_0x18c008);}};}function respondWithFilteredResult(_0x350393,_0x1157c1){return function(_0x18cb2d){if(_0x18cb2d){var _0x36b0fd=typeof _0x1157c1[_0x6eae('0x19')]===_0x6eae('0x1a')&&typeof _0x1157c1[_0x6eae('0x1b')]===_0x6eae('0x1a');var _0x455a62=_0x18cb2d[_0x6eae('0x1c')];var _0x220e49=_0x36b0fd?0x0:_0x1157c1[_0x6eae('0x19')];var _0x227e4d=_0x36b0fd?_0x18cb2d[_0x6eae('0x1c')]:_0x1157c1[_0x6eae('0x19')]+_0x1157c1[_0x6eae('0x1b')];var _0x1834b8;if(_0x227e4d>=_0x455a62){_0x227e4d=_0x455a62;_0x1834b8=0xc8;}else{_0x1834b8=0xce;}_0x350393[_0x6eae('0x16')](_0x1834b8);return _0x350393[_0x6eae('0x1d')](_0x6eae('0x1e'),_0x220e49+'-'+_0x227e4d+'/'+_0x455a62)[_0x6eae('0x18')](_0x18cb2d);}return null;};}function patchUpdates(_0x4ecd58){return function(_0x2ca50c){try{jsonpatch[_0x6eae('0x1f')](_0x2ca50c,_0x4ecd58,!![]);}catch(_0xbf38cc){return BPromise[_0x6eae('0x20')](_0xbf38cc);}return _0x2ca50c[_0x6eae('0x21')]();};}function saveUpdates(_0x1b3061,_0x5a43c1){return function(_0x1d89c4){if(_0x1d89c4){return _0x1d89c4[_0x6eae('0x22')](_0x1b3061)[_0x6eae('0x23')](function(_0x15adf2){return _0x15adf2;});}return null;};}function removeEntity(_0x39e6d0,_0x4468db){return function(_0x4367eb){if(_0x4367eb){return _0x4367eb[_0x6eae('0x24')]()[_0x6eae('0x23')](function(){var _0x34b2b8=_0x4367eb['get']({'plain':!![]});var _0x15628e=_0x6eae('0x25');return db['UserProfileResource'][_0x6eae('0x24')]({'where':{'type':_0x15628e,'resourceId':_0x34b2b8['id']}})['then'](function(){return _0x4367eb;});})[_0x6eae('0x23')](function(){_0x39e6d0['status'](0xcc)[_0x6eae('0x17')]();});}};}function handleEntityNotFound(_0x3242b1,_0x152cb3){return function(_0x399b1e){if(!_0x399b1e){_0x3242b1[_0x6eae('0x26')](0x194);}return _0x399b1e;};}function handleError(_0x18e50b,_0x501143){_0x501143=_0x501143||0x1f4;return function(_0x4d1253){logger[_0x6eae('0x27')](_0x4d1253['stack']);if(_0x4d1253['name']){delete _0x4d1253[_0x6eae('0x28')];}_0x18e50b['status'](_0x501143)[_0x6eae('0x29')](_0x4d1253);};}exports[_0x6eae('0x2a')]=function(_0x4b3bb6,_0x5931fc){var _0x433c13={},_0x510800={},_0x3421a7={'count':0x0,'rows':[]};var _0x32a0ea=_[_0x6eae('0x2b')](db[_0x6eae('0x2c')][_0x6eae('0x2d')],function(_0x33bd3a){return{'name':_0x33bd3a[_0x6eae('0x2e')],'type':_0x33bd3a['type'][_0x6eae('0x2f')]};});_0x510800[_0x6eae('0x30')]=_[_0x6eae('0x2b')](_0x32a0ea,_0x6eae('0x28'));_0x510800[_0x6eae('0x31')]=_[_0x6eae('0x32')](_0x4b3bb6[_0x6eae('0x31')]);_0x510800['filters']=_[_0x6eae('0x33')](_0x510800[_0x6eae('0x30')],_0x510800[_0x6eae('0x31')]);_0x433c13['attributes']=_['intersection'](_0x510800[_0x6eae('0x30')],qs[_0x6eae('0x34')](_0x4b3bb6['query'][_0x6eae('0x34')]));_0x433c13[_0x6eae('0x35')]=_0x433c13[_0x6eae('0x35')]['length']?_0x433c13[_0x6eae('0x35')]:_0x510800[_0x6eae('0x30')];if(!_0x4b3bb6[_0x6eae('0x31')]['hasOwnProperty']('nolimit')){_0x433c13['limit']=qs['limit'](_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x1b')]);_0x433c13[_0x6eae('0x19')]=qs[_0x6eae('0x19')](_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x19')]);}_0x433c13[_0x6eae('0x36')]=qs['sort'](_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x37')]);_0x433c13[_0x6eae('0x38')]=qs[_0x6eae('0x39')](_[_0x6eae('0x3a')](_0x4b3bb6['query'],_0x510800['filters']),_0x32a0ea);if(_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x3b')]){_0x433c13[_0x6eae('0x38')]=_[_0x6eae('0x3c')](_0x433c13[_0x6eae('0x38')],{'$or':_[_0x6eae('0x2b')](_0x32a0ea,function(_0x17a4a6){if(_0x17a4a6[_0x6eae('0x3d')]!==_0x6eae('0x3e')){var _0x36eb46={};_0x36eb46[_0x17a4a6[_0x6eae('0x28')]]={'$like':'%'+_0x4b3bb6['query'][_0x6eae('0x3b')]+'%'};return _0x36eb46;}})});}_0x433c13=_[_0x6eae('0x3c')]({},_0x433c13,_0x4b3bb6['options']);var _0x38b269={'where':_0x433c13['where']};return db[_0x6eae('0x2c')][_0x6eae('0x1c')](_0x38b269)['then'](function(_0x5b53eb){_0x3421a7[_0x6eae('0x1c')]=_0x5b53eb;if(_0x4b3bb6[_0x6eae('0x31')][_0x6eae('0x3f')]){_0x433c13[_0x6eae('0x40')]=[{'all':!![]}];}return db[_0x6eae('0x2c')][_0x6eae('0x41')](_0x433c13);})[_0x6eae('0x23')](function(_0x579b68){_0x3421a7[_0x6eae('0x42')]=_0x579b68;return _0x3421a7;})[_0x6eae('0x23')](respondWithFilteredResult(_0x5931fc,_0x433c13))[_0x6eae('0x43')](handleError(_0x5931fc,null));};exports[_0x6eae('0x44')]=function(_0xf7c81f,_0x3fa6e6){var _0x4ab749={'raw':![],'where':{'id':_0xf7c81f['params']['id']}},_0x268632={};_0x268632[_0x6eae('0x30')]=_[_0x6eae('0x32')](db[_0x6eae('0x2c')][_0x6eae('0x2d')]);_0x268632[_0x6eae('0x31')]=_['keys'](_0xf7c81f[_0x6eae('0x31')]);_0x268632[_0x6eae('0x39')]=_['intersection'](_0x268632[_0x6eae('0x30')],_0x268632['query']);_0x4ab749[_0x6eae('0x35')]=_['intersection'](_0x268632['model'],qs[_0x6eae('0x34')](_0xf7c81f[_0x6eae('0x31')][_0x6eae('0x34')]));_0x4ab749['attributes']=_0x4ab749[_0x6eae('0x35')][_0x6eae('0x45')]?_0x4ab749['attributes']:_0x268632[_0x6eae('0x30')];if(_0xf7c81f[_0x6eae('0x31')]['includeAll']){_0x4ab749[_0x6eae('0x40')]=[{'all':!![]}];}_0x4ab749=_[_0x6eae('0x3c')]({},_0x4ab749,_0xf7c81f[_0x6eae('0x46')]);return db[_0x6eae('0x2c')]['find'](_0x4ab749)[_0x6eae('0x23')](handleEntityNotFound(_0x3fa6e6,null))[_0x6eae('0x23')](respondWithResult(_0x3fa6e6,null))['catch'](handleError(_0x3fa6e6,null));};exports['create']=function(_0x2ff08e,_0x2adfcd){return db[_0x6eae('0x2c')][_0x6eae('0x47')](_0x2ff08e[_0x6eae('0x48')],{})['then'](function(_0x3644a0){var _0x1fb293=_0x2ff08e[_0x6eae('0x49')][_0x6eae('0x4a')]({'plain':!![]});if(!_0x1fb293)throw new Error(_0x6eae('0x4b'));if(_0x1fb293['role']===_0x6eae('0x49')){var _0xd6d447=_0x3644a0[_0x6eae('0x4a')]({'plain':!![]});var _0x4dfbca=_0x6eae('0x4c');return db['UserProfileSection'][_0x6eae('0x4d')]({'where':{'name':_0x4dfbca,'userProfileId':_0x1fb293[_0x6eae('0x4e')]},'raw':!![]})[_0x6eae('0x23')](function(_0x570ea3){if(_0x570ea3&&_0x570ea3[_0x6eae('0x4f')]===0x0){return db[_0x6eae('0x50')]['create']({'name':_0xd6d447['name'],'resourceId':_0xd6d447['id'],'type':_0x6eae('0x25'),'sectionId':_0x570ea3['id']},{})[_0x6eae('0x23')](function(){return _0x3644a0;});}else{return _0x3644a0;}})[_0x6eae('0x43')](function(_0x22cce2){logger[_0x6eae('0x27')](_0x6eae('0x51'),_0x22cce2);throw _0x22cce2;});}return _0x3644a0;})['then'](respondWithResult(_0x2adfcd,0xc9))['catch'](handleError(_0x2adfcd,null));};exports[_0x6eae('0x22')]=function(_0x3cdc31,_0x4358d7){if(_0x3cdc31[_0x6eae('0x48')]['id']){delete _0x3cdc31[_0x6eae('0x48')]['id'];}return db[_0x6eae('0x2c')][_0x6eae('0x4d')]({'where':{'id':_0x3cdc31[_0x6eae('0x52')]['id']}})[_0x6eae('0x23')](handleEntityNotFound(_0x4358d7,null))[_0x6eae('0x23')](saveUpdates(_0x3cdc31[_0x6eae('0x48')],null))[_0x6eae('0x23')](respondWithResult(_0x4358d7,null))['catch'](handleError(_0x4358d7,null));};exports[_0x6eae('0x24')]=function(_0x45922a,_0x435c89){return db['AnalyticCustomReport'][_0x6eae('0x4d')]({'where':{'id':_0x45922a['params']['id']}})[_0x6eae('0x23')](handleEntityNotFound(_0x435c89,null))[_0x6eae('0x23')](removeEntity(_0x435c89,null))[_0x6eae('0x43')](handleError(_0x435c89,null));};exports['preview']=function(_0x16d57a,_0x315f29){var _0xe312bd=0xa;var _0x45a9e6=['join',_0x6eae('0x53'),_0x6eae('0x54'),'cross_join'];var _0x4fca10={'SUM':_0x6eae('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6eae('0x56'),'MAX':_0x6eae('0x57'),'MIN':_0x6eae('0x58'),'AVG':_0x6eae('0x59'),'GROUP_CONCAT':_0x6eae('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6eae('0x5b')};var _0x4568b4={'SEC_TO_TIME':_0x6eae('0x5c'),'DATE':'DATE(%s)','HOUR':_0x6eae('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6eae('0x5e')};var _0x30a4a=function(_0x3af90c){return!_[_0x6eae('0x5f')]([_0x6eae('0x60'),_0x6eae('0x61'),_0x6eae('0x62'),'IS\x20NOT\x20EMPTY'],_0x3af90c);};var _0xb9f0a1=function(_0x1e97ad){if(!_0x1e97ad||!_0x1e97ad['rules'][_0x6eae('0x45')]){return'';}for(var _0x6af0ba='(',_0x33086e=0x0;_0x33086e<_0x1e97ad['rules'][_0x6eae('0x45')];_0x33086e+=0x1){_0x33086e>0x0&&(_0x6af0ba+='\x20'+_0x1e97ad[_0x6eae('0x63')]+'\x20');_0x6af0ba+=_0x1e97ad[_0x6eae('0x64')][_0x33086e][_0x6eae('0x65')]?_0xb9f0a1(_0x1e97ad[_0x6eae('0x64')][_0x33086e]['group']):_0x1e97ad[_0x6eae('0x64')][_0x33086e][_0x6eae('0x66')]+'\x20'+_0x1e97ad[_0x6eae('0x64')][_0x33086e][_0x6eae('0x67')]+(_0x30a4a(_0x1e97ad[_0x6eae('0x64')][_0x33086e]['condition'])?'\x20'+_0x1e97ad[_0x6eae('0x64')][_0x33086e]['value']:'');}return _0x6af0ba+')';};var _0x27b20d={'where':{'id':_0x16d57a[_0x6eae('0x52')]['id']}},_0x5356ab,_0x532118,_0x285b58,_0x3e8d10,_0xa895f8;_0x27b20d=_[_0x6eae('0x3c')]({},_0x27b20d,_0x16d57a[_0x6eae('0x46')]);return db[_0x6eae('0x2c')][_0x6eae('0x4d')](_0x27b20d)['then'](function(_0x4f94ab){if(_0x4f94ab){_0x5356ab=_0x4f94ab;return _0x4f94ab[_0x6eae('0x68')]();}return null;})[_0x6eae('0x23')](function(_0x4adfaa){if(_0x4adfaa){if(!_0x4adfaa[_0x6eae('0x45')]){throw new db['Sequelize'][(_0x6eae('0x69'))](_0x6eae('0x6a'),0x193);}_0x532118=_0x4adfaa;return db[_0x6eae('0x6b')][_0x6eae('0x41')]({'raw':!![]});}return null;})[_0x6eae('0x23')](function(_0xdb991c){if(_0xdb991c){_0x285b58=_['keyBy'](_0xdb991c,'id');var _0xe741e0;var _0xa42ac7=squel[_0x6eae('0x6c')]();_0xa42ac7['from'](_0x5356ab['table']);for(var _0x422ac1=0x0;_0x422ac1<_0x532118[_0x6eae('0x45')];_0x422ac1+=0x1){_0xe741e0=_0x532118[_0x422ac1]['MetricId']?_0x285b58[_0x532118[_0x422ac1]['MetricId']][_0x6eae('0x6d')]:_0x532118[_0x422ac1][_0x6eae('0x66')];_0xe741e0=_0x532118[_0x422ac1][_0x6eae('0x6e')]?_[_0x6eae('0x6f')](_0x4fca10[_0x532118[_0x422ac1]['function']],'%s',_0xe741e0):_0xe741e0;_0xe741e0=_0x532118[_0x422ac1][_0x6eae('0x70')]?_[_0x6eae('0x6f')](_0x4568b4[_0x532118[_0x422ac1]['format']],'%s',_0xe741e0):_0xe741e0;if(_0x532118[_0x422ac1][_0x6eae('0x71')]){_0xa42ac7[_0x6eae('0x65')](_0xe741e0);}_0x532118[_0x422ac1][_0x6eae('0x72')]&&_0xa42ac7[_0x6eae('0x36')](_0xe741e0,_0x532118[_0x422ac1][_0x6eae('0x72')]===_0x6eae('0x73')?![]:!![]);_0xa42ac7[_0x6eae('0x66')](_0xe741e0,_0x532118[_0x422ac1][_0x6eae('0x74')]||_0xe741e0);}if(_0x5356ab[_0x6eae('0x75')]){_0x5356ab[_0x6eae('0x75')]=JSON[_0x6eae('0x76')](_0x5356ab[_0x6eae('0x75')]);for(var _0x162ae7=0x0;_0x162ae7<_0x5356ab[_0x6eae('0x75')][_0x6eae('0x45')];_0x162ae7+=0x1){if(_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x3d')]&&_['includes'](_0x45a9e6,_0x5356ab[_0x6eae('0x75')][_0x162ae7]['type'])&&_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x77')]&&_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x78')]&&_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x79')]){_0xa42ac7[_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x3d')]](_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x78')],null,util[_0x6eae('0x70')](_0x6eae('0x7a'),_0x5356ab[_0x6eae('0x7b')],_0x5356ab[_0x6eae('0x75')][_0x162ae7]['parentKey'],_0x5356ab[_0x6eae('0x75')][_0x162ae7]['foreignTable'],_0x5356ab[_0x6eae('0x75')][_0x162ae7][_0x6eae('0x79')]));}}}if(_0x5356ab[_0x6eae('0x7c')]){_0x5356ab[_0x6eae('0x7c')]=JSON[_0x6eae('0x76')](_0x5356ab[_0x6eae('0x7c')]);_0xa42ac7[_0x6eae('0x38')](_0xb9f0a1(_0x5356ab[_0x6eae('0x7c')][_0x6eae('0x65')]));}_0xa895f8=_0xa42ac7[_0x6eae('0x7d')]();_0xa42ac7[_0x6eae('0x1b')](_0xe312bd);_0xa42ac7[_0x6eae('0x19')](0x0);logger[_0x6eae('0x7e')](_0x6eae('0x7f'),_0xa42ac7[_0x6eae('0x80')]());return dbH[_0x6eae('0x81')][_0x6eae('0x31')](_0xa42ac7[_0x6eae('0x80')](),{'type':dbH['sequelize']['QueryTypes'][_0x6eae('0x82')]});}})['then'](respondWithResult(_0x315f29,null))[_0x6eae('0x43')](handleError(_0x315f29,null));};function runReport(_0x189e05,_0x486b4c,_0x1b7f76){var _0x2d7bde=_0x486b4c['name'];var _0x4b1992=0xa;var _0x2eeee4=[_0x6eae('0x83'),'left_join',_0x6eae('0x54'),_0x6eae('0x84')];var _0x341ddd={'SUM':_0x6eae('0x55'),'COUNT':_0x6eae('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6eae('0x57'),'MIN':_0x6eae('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6eae('0x5a'),'GROUP_CONCAT ASC':_0x6eae('0x86'),'GROUP_CONCAT DESC':_0x6eae('0x5b')};var _0x5f3fa6={'SEC_TO_TIME':_0x6eae('0x5c'),'DATE':_0x6eae('0x87'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6eae('0x5e')};var _0x588184=function(_0x53fac3){return!_[_0x6eae('0x5f')]([_0x6eae('0x60'),_0x6eae('0x61'),_0x6eae('0x62'),'IS\x20NOT\x20EMPTY'],_0x53fac3);};var _0x4323d7=function(_0x5158a2){if(!_0x5158a2||!_0x5158a2[_0x6eae('0x64')][_0x6eae('0x45')]){return'';}for(var _0x335b54='(',_0x527999=0x0;_0x527999<_0x5158a2['rules'][_0x6eae('0x45')];_0x527999+=0x1){_0x527999>0x0&&(_0x335b54+='\x20'+_0x5158a2[_0x6eae('0x63')]+'\x20');_0x335b54+=_0x5158a2[_0x6eae('0x64')][_0x527999]['group']?_0x4323d7(_0x5158a2['rules'][_0x527999][_0x6eae('0x65')]):_0x5158a2[_0x6eae('0x64')][_0x527999][_0x6eae('0x66')]+'\x20'+_0x5158a2[_0x6eae('0x64')][_0x527999][_0x6eae('0x67')]+(_0x588184(_0x5158a2['rules'][_0x527999][_0x6eae('0x67')])?'\x20'+_0x5158a2['rules'][_0x527999]['value']:'');}return _0x335b54+')';};var _0x2689d4={'where':{'id':_0x189e05['id']}},_0x486145,_0x224a01,_0x23eba8,_0x708638,_0x4107f0;_0x2689d4=_[_0x6eae('0x3c')]({},_0x2689d4,_0x1b7f76);return db[_0x6eae('0x2c')]['find'](_0x2689d4)[_0x6eae('0x23')](function(_0x196133){if(_0x196133){_0x486145=_0x196133;return _0x196133[_0x6eae('0x68')]();}return null;})[_0x6eae('0x23')](function(_0x4bc4de){if(_0x4bc4de){if(!_0x4bc4de[_0x6eae('0x45')]){throw new db[(_0x6eae('0x88'))][(_0x6eae('0x69'))](_0x6eae('0x6a'),0x193);}_0x224a01=_0x4bc4de;return db[_0x6eae('0x6b')][_0x6eae('0x41')]({'raw':!![]});}return null;})[_0x6eae('0x23')](function(_0x1568b3){if(_0x1568b3){_0x23eba8=_['keyBy'](_0x1568b3,'id');var _0x1dff82;var _0x5e4ed0=squel[_0x6eae('0x6c')]();_0x5e4ed0[_0x6eae('0x89')](_0x486145[_0x6eae('0x7b')]);for(var _0x525b25=0x0;_0x525b25<_0x224a01[_0x6eae('0x45')];_0x525b25+=0x1){_0x1dff82=_0x224a01[_0x525b25]['MetricId']?_0x23eba8[_0x224a01[_0x525b25][_0x6eae('0x8a')]][_0x6eae('0x6d')]:_0x224a01[_0x525b25][_0x6eae('0x66')];_0x1dff82=_0x224a01[_0x525b25]['function']?_[_0x6eae('0x6f')](_0x341ddd[_0x224a01[_0x525b25]['function']],'%s',_0x1dff82):_0x1dff82;_0x1dff82=_0x224a01[_0x525b25][_0x6eae('0x70')]?_[_0x6eae('0x6f')](_0x5f3fa6[_0x224a01[_0x525b25][_0x6eae('0x70')]],'%s',_0x1dff82):_0x1dff82;if(_0x224a01[_0x525b25][_0x6eae('0x71')]){_0x5e4ed0[_0x6eae('0x65')](_0x1dff82);}_0x224a01[_0x525b25][_0x6eae('0x72')]&&_0x5e4ed0[_0x6eae('0x36')](_0x1dff82,_0x224a01[_0x525b25]['orderBy']===_0x6eae('0x73')?![]:!![]);_0x5e4ed0['field'](_0x1dff82,_0x224a01[_0x525b25][_0x6eae('0x74')]||_0x1dff82);}if(_0x486145['joins']){_0x486145[_0x6eae('0x75')]=JSON['parse'](_0x486145[_0x6eae('0x75')]);for(var _0x507c62=0x0;_0x507c62<_0x486145[_0x6eae('0x75')][_0x6eae('0x45')];_0x507c62+=0x1){if(_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x3d')]&&_['includes'](_0x2eeee4,_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x3d')])&&_0x486145[_0x6eae('0x75')][_0x507c62]['parentKey']&&_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x78')]&&_0x486145[_0x6eae('0x75')][_0x507c62]['foreignKey']){_0x5e4ed0[_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x3d')]](_0x486145['joins'][_0x507c62][_0x6eae('0x78')],null,util[_0x6eae('0x70')](_0x6eae('0x7a'),_0x486145[_0x6eae('0x7b')],_0x486145['joins'][_0x507c62][_0x6eae('0x77')],_0x486145[_0x6eae('0x75')][_0x507c62][_0x6eae('0x78')],_0x486145[_0x6eae('0x75')][_0x507c62]['foreignKey']));}}}if(_0x486145[_0x6eae('0x7c')]){_0x486145[_0x6eae('0x7c')]=JSON[_0x6eae('0x76')](_0x486145[_0x6eae('0x7c')]);_0x5e4ed0['where'](_0x4323d7(_0x486145[_0x6eae('0x7c')]['group']));}_0x4107f0=_0x5e4ed0[_0x6eae('0x7d')]();_0x5e4ed0['limit'](_0x4b1992);_0x5e4ed0[_0x6eae('0x19')](0x0);return;}})['then'](function(){if(_0x486b4c[_0x6eae('0x8b')]===_0x6eae('0x8c')){return null;}var _0x3d9412=_['merge'](_0x486b4c,{'name':_0x486b4c['fullPath']||_0x486b4c[_0x6eae('0x28')]||_0x486145['name'],'basename':_0x2d7bde,'savename':util[_0x6eae('0x70')](_0x6eae('0x8d'),_0x486b4c['name']||_0x486145['name'],require(_0x6eae('0x8e'))[_0x6eae('0x8f')](0x4),_0x486b4c[_0x6eae('0x8b')]||'csv'),'reportId':_0x486145['id'],'reportType':'custom'});return db[_0x6eae('0x90')][_0x6eae('0x47')](_0x3d9412,{'raw':!![]});})['then'](function(_0x1d639f){if(_0x486145[_0x6eae('0x7b')]===_0x6eae('0x91')){_0x4107f0[_0x6eae('0x38')](_0x486145[_0x6eae('0x7b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x486b4c[_0x6eae('0x92')],_0x486b4c[_0x6eae('0x93')]);}else{_0x4107f0[_0x6eae('0x38')](_0x486145[_0x6eae('0x7b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x486b4c[_0x6eae('0x92')],_0x486b4c[_0x6eae('0x93')]);}if(_0x1d639f){logger[_0x6eae('0x94')](_0x6eae('0x95'),_0x4107f0[_0x6eae('0x80')]());require(_0x6eae('0x96'))[_0x6eae('0x97')](path[_0x6eae('0x83')](__dirname,_0x6eae('0x98'),_0x1d639f['output']),[_0x1d639f['id'],_0x4107f0['toString'](),path[_0x6eae('0x83')](__dirname,_0x6eae('0x99'),_0x1d639f[_0x6eae('0x9a')]),_0x2d7bde]);return _0x1d639f;}else{var _0x20c13c=squel[_0x6eae('0x6c')]();_0x20c13c[_0x6eae('0x89')]('('+_0x4107f0[_0x6eae('0x80')]()+')',_0x6eae('0x9b'));_0x20c13c[_0x6eae('0x66')](_0x6eae('0x9c'),_0x6eae('0x1c'));_0x4107f0['limit'](_0x486b4c[_0x6eae('0x1b')]||_0x4b1992);_0x4107f0[_0x6eae('0x19')](_0x486b4c[_0x6eae('0x19')]||0x0);return dbH[_0x6eae('0x81')][_0x6eae('0x31')](_0x20c13c[_0x6eae('0x80')](),{'type':dbH[_0x6eae('0x81')]['QueryTypes'][_0x6eae('0x82')]})[_0x6eae('0x23')](function(_0x5644f9){if(!_0x5644f9[_0x6eae('0x45')]){_0x708638=0x0;}else{_0x708638=_0x5644f9[0x0][_0x6eae('0x1c')]||0x0;}return dbH[_0x6eae('0x81')]['query'](_0x4107f0[_0x6eae('0x80')](),{'type':dbH[_0x6eae('0x81')][_0x6eae('0x9d')]['SELECT']});})[_0x6eae('0x23')](function(_0x136f3){return{'rows':_0x136f3||[],'count':_0x708638};});}});}exports[_0x6eae('0x9e')]=function(_0x101e3d,_0x2f6a0b){return runReport(_0x101e3d[_0x6eae('0x52')],_0x101e3d[_0x6eae('0x31')],_0x101e3d['options'])[_0x6eae('0x23')](respondWithResult(_0x2f6a0b,null))[_0x6eae('0x43')](handleError(_0x2f6a0b,null));};exports[_0x6eae('0x9f')]=runReport;exports['query']=function(_0x11ff36,_0x33e1ae){var _0xd61c4d=0xa;var _0x1c062d=[_0x6eae('0x83'),_0x6eae('0x53'),_0x6eae('0x54'),'cross_join'];var _0x241c69={'SUM':_0x6eae('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6eae('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x6eae('0x59'),'GROUP_CONCAT':_0x6eae('0x5a'),'GROUP_CONCAT ASC':_0x6eae('0x86'),'GROUP_CONCAT DESC':_0x6eae('0x5b')};var _0x52aea1={'SEC_TO_TIME':_0x6eae('0x5c'),'DATE':_0x6eae('0x87'),'HOUR':'HOUR(%s)','ROUND':_0x6eae('0xa0'),'UNIX_TIMESTAMP':_0x6eae('0x5e')};var _0x5613e1=function(_0x5cd75c){return!_[_0x6eae('0x5f')]([_0x6eae('0x60'),_0x6eae('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x5cd75c);};var _0x2483f8=function(_0x2b62d4){if(!_0x2b62d4||!_0x2b62d4[_0x6eae('0x64')][_0x6eae('0x45')]){return'';}for(var _0x4c3a6e='(',_0xd41514=0x0;_0xd41514<_0x2b62d4[_0x6eae('0x64')][_0x6eae('0x45')];_0xd41514+=0x1){_0xd41514>0x0&&(_0x4c3a6e+='\x20'+_0x2b62d4[_0x6eae('0x63')]+'\x20');_0x4c3a6e+=_0x2b62d4[_0x6eae('0x64')][_0xd41514][_0x6eae('0x65')]?_0x2483f8(_0x2b62d4[_0x6eae('0x64')][_0xd41514][_0x6eae('0x65')]):_0x2b62d4[_0x6eae('0x64')][_0xd41514]['field']+'\x20'+_0x2b62d4[_0x6eae('0x64')][_0xd41514][_0x6eae('0x67')]+(_0x5613e1(_0x2b62d4[_0x6eae('0x64')][_0xd41514]['condition'])?'\x20'+_0x2b62d4[_0x6eae('0x64')][_0xd41514]['value']:'');}return _0x4c3a6e+')';};var _0x536252={'where':{'id':_0x11ff36[_0x6eae('0x52')]['id']}},_0x5216e9,_0x456c00,_0xfb2b5a,_0x5ca9d9,_0x127f08;_0x536252=_[_0x6eae('0x3c')]({},_0x536252,_0x11ff36[_0x6eae('0x46')]);return db[_0x6eae('0x2c')][_0x6eae('0x4d')](_0x536252)[_0x6eae('0x23')](function(_0x1df945){if(_0x1df945){_0x5216e9=_0x1df945;return _0x1df945[_0x6eae('0x68')]();}return null;})[_0x6eae('0x23')](function(_0x19097b){if(_0x19097b){if(!_0x19097b[_0x6eae('0x45')]){throw new db[(_0x6eae('0x88'))][(_0x6eae('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x456c00=_0x19097b;return db[_0x6eae('0x6b')][_0x6eae('0x41')]({'raw':!![]});}return null;})[_0x6eae('0x23')](function(_0x45fb75){if(_0x45fb75){_0xfb2b5a=_[_0x6eae('0xa1')](_0x45fb75,'id');var _0x55664e;var _0x249e30=squel[_0x6eae('0x6c')]();_0x249e30[_0x6eae('0x89')](_0x5216e9[_0x6eae('0x7b')]);for(var _0x409207=0x0;_0x409207<_0x456c00[_0x6eae('0x45')];_0x409207+=0x1){_0x55664e=_0x456c00[_0x409207][_0x6eae('0x8a')]?_0xfb2b5a[_0x456c00[_0x409207][_0x6eae('0x8a')]][_0x6eae('0x6d')]:_0x456c00[_0x409207][_0x6eae('0x66')];_0x55664e=_0x456c00[_0x409207][_0x6eae('0x6e')]?_[_0x6eae('0x6f')](_0x241c69[_0x456c00[_0x409207]['function']],'%s',_0x55664e):_0x55664e;_0x55664e=_0x456c00[_0x409207][_0x6eae('0x70')]?_[_0x6eae('0x6f')](_0x52aea1[_0x456c00[_0x409207][_0x6eae('0x70')]],'%s',_0x55664e):_0x55664e;if(_0x456c00[_0x409207][_0x6eae('0x71')]){_0x249e30[_0x6eae('0x65')](_0x55664e);}_0x456c00[_0x409207][_0x6eae('0x72')]&&_0x249e30[_0x6eae('0x36')](_0x55664e,_0x456c00[_0x409207][_0x6eae('0x72')]==='DESC'?![]:!![]);_0x249e30[_0x6eae('0x66')](_0x55664e,_0x456c00[_0x409207][_0x6eae('0x74')]||_0x55664e);}if(_0x5216e9['joins']){_0x5216e9['joins']=JSON[_0x6eae('0x76')](_0x5216e9['joins']);for(var _0x3f7919=0x0;_0x3f7919<_0x5216e9['joins']['length'];_0x3f7919+=0x1){if(_0x5216e9[_0x6eae('0x75')][_0x3f7919]['type']&&_[_0x6eae('0x5f')](_0x1c062d,_0x5216e9[_0x6eae('0x75')][_0x3f7919]['type'])&&_0x5216e9['joins'][_0x3f7919][_0x6eae('0x77')]&&_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x78')]&&_0x5216e9['joins'][_0x3f7919][_0x6eae('0x79')]){_0x249e30[_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x3d')]](_0x5216e9['joins'][_0x3f7919]['foreignTable'],null,util[_0x6eae('0x70')](_0x6eae('0x7a'),_0x5216e9[_0x6eae('0x7b')],_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x77')],_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x78')],_0x5216e9[_0x6eae('0x75')][_0x3f7919][_0x6eae('0x79')]));}}}if(_0x5216e9['conditions']){_0x5216e9[_0x6eae('0x7c')]=JSON[_0x6eae('0x76')](_0x5216e9[_0x6eae('0x7c')]);_0x249e30['where'](_0x2483f8(_0x5216e9[_0x6eae('0x7c')][_0x6eae('0x65')]));}_0x127f08=_0x249e30[_0x6eae('0x7d')]();_0x249e30[_0x6eae('0x1b')](_0xd61c4d);_0x249e30[_0x6eae('0x19')](0x0);logger[_0x6eae('0x7e')](_0x6eae('0x7f'),_0x249e30[_0x6eae('0x80')]());return dbH[_0x6eae('0x81')][_0x6eae('0x31')](_0x249e30['toString'](),{'type':dbH[_0x6eae('0x81')][_0x6eae('0x9d')][_0x6eae('0x82')]});}})['then'](function(){return{'sql':_0x127f08[_0x6eae('0x80')]()};})[_0x6eae('0x23')](respondWithResult(_0x33e1ae,null))[_0x6eae('0x43')](handleError(_0x33e1ae,null));};
\ No newline at end of file
+var _0x1d28=['IS\x20NOT\x20NULL','condition','getFields','from','alias','output','web','fullPath','randomstring','generate','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','cross_join','AVG(%s)','Limited\x20Query:','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','dbH','sendStatus','status','json','offset','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','end','error','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','fields','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','field','replace','function','format','groupBy','orderBy','DESC','parse','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)'];(function(_0x3b4af6,_0x1072a7){var _0x3ddbbc=function(_0x2bbd9f){while(--_0x2bbd9f){_0x3b4af6['push'](_0x3b4af6['shift']());}};_0x3ddbbc(++_0x1072a7);}(_0x1d28,0x164));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x81d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x81d2('0x1'));var rp=require(_0x81d2('0x2'));var moment=require(_0x81d2('0x3'));var BPromise=require(_0x81d2('0x4'));var Mustache=require(_0x81d2('0x5'));var util=require(_0x81d2('0x6'));var path=require(_0x81d2('0x7'));var sox=require(_0x81d2('0x8'));var csv=require('to-csv');var ejs=require(_0x81d2('0x9'));var fs=require('fs');var fs_extra=require(_0x81d2('0xa'));var _=require(_0x81d2('0xb'));var squel=require(_0x81d2('0xc'));var crypto=require(_0x81d2('0xd'));var jsforce=require(_0x81d2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x81d2('0xf'));var querystring=require(_0x81d2('0x10'));var Papa=require(_0x81d2('0x11'));var Redis=require(_0x81d2('0x12'));var authService=require(_0x81d2('0x13'));var qs=require(_0x81d2('0x14'));var as=require(_0x81d2('0x15'));var hardwareService=require(_0x81d2('0x16'));var logger=require(_0x81d2('0x17'))(_0x81d2('0x18'));var utils=require(_0x81d2('0x19'));var config=require(_0x81d2('0x1a'));var licenseUtil=require(_0x81d2('0x1b'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x81d2('0x1c')];function respondWithStatusCode(_0x2b2116,_0x578ced){_0x578ced=_0x578ced||0xcc;return function(_0x2b41a7){if(_0x2b41a7){return _0x2b2116[_0x81d2('0x1d')](_0x578ced);}return _0x2b2116[_0x81d2('0x1e')](_0x578ced)['end']();};}function respondWithResult(_0x203893,_0x1da13f){_0x1da13f=_0x1da13f||0xc8;return function(_0x1b4c19){if(_0x1b4c19){return _0x203893[_0x81d2('0x1e')](_0x1da13f)[_0x81d2('0x1f')](_0x1b4c19);}};}function respondWithFilteredResult(_0xe362d2,_0x57b507){return function(_0x2429fe){if(_0x2429fe){var _0x9123a3=typeof _0x57b507[_0x81d2('0x20')]==='undefined'&&typeof _0x57b507['limit']==='undefined';var _0x40b23f=_0x2429fe[_0x81d2('0x21')];var _0x376ae2=_0x9123a3?0x0:_0x57b507['offset'];var _0x33bdb3=_0x9123a3?_0x2429fe[_0x81d2('0x21')]:_0x57b507[_0x81d2('0x20')]+_0x57b507['limit'];var _0x4a0816;if(_0x33bdb3>=_0x40b23f){_0x33bdb3=_0x40b23f;_0x4a0816=0xc8;}else{_0x4a0816=0xce;}_0xe362d2[_0x81d2('0x1e')](_0x4a0816);return _0xe362d2[_0x81d2('0x22')](_0x81d2('0x23'),_0x376ae2+'-'+_0x33bdb3+'/'+_0x40b23f)['json'](_0x2429fe);}return null;};}function patchUpdates(_0x271853){return function(_0x3f4ac8){try{jsonpatch[_0x81d2('0x24')](_0x3f4ac8,_0x271853,!![]);}catch(_0x54395f){return BPromise[_0x81d2('0x25')](_0x54395f);}return _0x3f4ac8[_0x81d2('0x26')]();};}function saveUpdates(_0x2634c8,_0x1f77d2){return function(_0x39cabc){if(_0x39cabc){return _0x39cabc['update'](_0x2634c8)[_0x81d2('0x27')](function(_0x18cf0c){return _0x18cf0c;});}return null;};}function removeEntity(_0x58e64b,_0x144077){return function(_0x3be692){if(_0x3be692){return _0x3be692[_0x81d2('0x28')]()[_0x81d2('0x27')](function(){var _0x110d24=_0x3be692[_0x81d2('0x29')]({'plain':!![]});var _0x3ac6d2=_0x81d2('0x2a');return db[_0x81d2('0x2b')][_0x81d2('0x28')]({'where':{'type':_0x3ac6d2,'resourceId':_0x110d24['id']}})[_0x81d2('0x27')](function(){return _0x3be692;});})[_0x81d2('0x27')](function(){_0x58e64b[_0x81d2('0x1e')](0xcc)[_0x81d2('0x2c')]();});}};}function handleEntityNotFound(_0x45a614,_0x1b10ce){return function(_0x312371){if(!_0x312371){_0x45a614[_0x81d2('0x1d')](0x194);}return _0x312371;};}function handleError(_0x1032ad,_0x822fc6){_0x822fc6=_0x822fc6||0x1f4;return function(_0x2a187a){logger[_0x81d2('0x2d')](_0x2a187a['stack']);if(_0x2a187a[_0x81d2('0x2e')]){delete _0x2a187a[_0x81d2('0x2e')];}_0x1032ad[_0x81d2('0x1e')](_0x822fc6)[_0x81d2('0x2f')](_0x2a187a);};}exports['index']=function(_0x5bcb8a,_0x377afd){var _0x4bdcbb={},_0x29bf46={},_0x5d6bb1={'count':0x0,'rows':[]};var _0x26cdf6=_[_0x81d2('0x30')](db['AnalyticCustomReport'][_0x81d2('0x31')],function(_0x27a247){return{'name':_0x27a247['fieldName'],'type':_0x27a247[_0x81d2('0x32')][_0x81d2('0x33')]};});_0x29bf46[_0x81d2('0x34')]=_[_0x81d2('0x30')](_0x26cdf6,'name');_0x29bf46[_0x81d2('0x35')]=_[_0x81d2('0x36')](_0x5bcb8a[_0x81d2('0x35')]);_0x29bf46[_0x81d2('0x37')]=_[_0x81d2('0x38')](_0x29bf46['model'],_0x29bf46[_0x81d2('0x35')]);_0x4bdcbb[_0x81d2('0x39')]=_[_0x81d2('0x38')](_0x29bf46[_0x81d2('0x34')],qs['fields'](_0x5bcb8a[_0x81d2('0x35')]['fields']));_0x4bdcbb['attributes']=_0x4bdcbb['attributes']['length']?_0x4bdcbb[_0x81d2('0x39')]:_0x29bf46['model'];if(!_0x5bcb8a[_0x81d2('0x35')][_0x81d2('0x3a')](_0x81d2('0x3b'))){_0x4bdcbb[_0x81d2('0x3c')]=qs['limit'](_0x5bcb8a[_0x81d2('0x35')][_0x81d2('0x3c')]);_0x4bdcbb['offset']=qs['offset'](_0x5bcb8a['query'][_0x81d2('0x20')]);}_0x4bdcbb[_0x81d2('0x3d')]=qs[_0x81d2('0x3e')](_0x5bcb8a[_0x81d2('0x35')][_0x81d2('0x3e')]);_0x4bdcbb[_0x81d2('0x3f')]=qs['filters'](_[_0x81d2('0x40')](_0x5bcb8a[_0x81d2('0x35')],_0x29bf46[_0x81d2('0x37')]),_0x26cdf6);if(_0x5bcb8a['query']['filter']){_0x4bdcbb[_0x81d2('0x3f')]=_[_0x81d2('0x41')](_0x4bdcbb[_0x81d2('0x3f')],{'$or':_[_0x81d2('0x30')](_0x26cdf6,function(_0x86c4d){if(_0x86c4d[_0x81d2('0x32')]!=='VIRTUAL'){var _0x406963={};_0x406963[_0x86c4d[_0x81d2('0x2e')]]={'$like':'%'+_0x5bcb8a[_0x81d2('0x35')][_0x81d2('0x42')]+'%'};return _0x406963;}})});}_0x4bdcbb=_[_0x81d2('0x41')]({},_0x4bdcbb,_0x5bcb8a[_0x81d2('0x43')]);var _0x3b9f76={'where':_0x4bdcbb[_0x81d2('0x3f')]};return db[_0x81d2('0x44')][_0x81d2('0x21')](_0x3b9f76)['then'](function(_0x13996d){_0x5d6bb1[_0x81d2('0x21')]=_0x13996d;if(_0x5bcb8a['query'][_0x81d2('0x45')]){_0x4bdcbb[_0x81d2('0x46')]=[{'all':!![]}];}return db[_0x81d2('0x44')][_0x81d2('0x47')](_0x4bdcbb);})[_0x81d2('0x27')](function(_0x594c47){_0x5d6bb1[_0x81d2('0x48')]=_0x594c47;return _0x5d6bb1;})[_0x81d2('0x27')](respondWithFilteredResult(_0x377afd,_0x4bdcbb))[_0x81d2('0x49')](handleError(_0x377afd,null));};exports[_0x81d2('0x4a')]=function(_0x5bb195,_0x2896d0){var _0x1c858a={'raw':![],'where':{'id':_0x5bb195[_0x81d2('0x4b')]['id']}},_0x466c11={};_0x466c11['model']=_[_0x81d2('0x36')](db[_0x81d2('0x44')][_0x81d2('0x31')]);_0x466c11[_0x81d2('0x35')]=_[_0x81d2('0x36')](_0x5bb195[_0x81d2('0x35')]);_0x466c11[_0x81d2('0x37')]=_[_0x81d2('0x38')](_0x466c11[_0x81d2('0x34')],_0x466c11['query']);_0x1c858a[_0x81d2('0x39')]=_[_0x81d2('0x38')](_0x466c11[_0x81d2('0x34')],qs['fields'](_0x5bb195['query'][_0x81d2('0x4c')]));_0x1c858a['attributes']=_0x1c858a[_0x81d2('0x39')][_0x81d2('0x4d')]?_0x1c858a[_0x81d2('0x39')]:_0x466c11[_0x81d2('0x34')];if(_0x5bb195[_0x81d2('0x35')]['includeAll']){_0x1c858a[_0x81d2('0x46')]=[{'all':!![]}];}_0x1c858a=_[_0x81d2('0x41')]({},_0x1c858a,_0x5bb195[_0x81d2('0x43')]);return db['AnalyticCustomReport'][_0x81d2('0x4e')](_0x1c858a)[_0x81d2('0x27')](handleEntityNotFound(_0x2896d0,null))[_0x81d2('0x27')](respondWithResult(_0x2896d0,null))['catch'](handleError(_0x2896d0,null));};exports['create']=function(_0xa294b2,_0x5cdf10){return db[_0x81d2('0x44')]['create'](_0xa294b2[_0x81d2('0x4f')],{})[_0x81d2('0x27')](function(_0x3b2228){var _0x26a06c=_0xa294b2['user'][_0x81d2('0x29')]({'plain':!![]});if(!_0x26a06c)throw new Error(_0x81d2('0x50'));if(_0x26a06c[_0x81d2('0x51')]==='user'){var _0x5b2ad0=_0x3b2228['get']({'plain':!![]});var _0x29cc0b=_0x81d2('0x52');return db[_0x81d2('0x53')][_0x81d2('0x4e')]({'where':{'name':_0x29cc0b,'userProfileId':_0x26a06c['userProfileId']},'raw':!![]})[_0x81d2('0x27')](function(_0x30aef7){if(_0x30aef7&&_0x30aef7['autoAssociation']===0x0){return db[_0x81d2('0x2b')][_0x81d2('0x54')]({'name':_0x5b2ad0[_0x81d2('0x2e')],'resourceId':_0x5b2ad0['id'],'type':'CustomReports','sectionId':_0x30aef7['id']},{})[_0x81d2('0x27')](function(){return _0x3b2228;});}else{return _0x3b2228;}})[_0x81d2('0x49')](function(_0xa0bc4a){logger[_0x81d2('0x2d')](_0x81d2('0x55'),_0xa0bc4a);throw _0xa0bc4a;});}return _0x3b2228;})[_0x81d2('0x27')](respondWithResult(_0x5cdf10,0xc9))[_0x81d2('0x49')](handleError(_0x5cdf10,null));};exports[_0x81d2('0x56')]=function(_0x342489,_0x572e9b){if(_0x342489[_0x81d2('0x4f')]['id']){delete _0x342489['body']['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x342489[_0x81d2('0x4b')]['id']}})[_0x81d2('0x27')](handleEntityNotFound(_0x572e9b,null))[_0x81d2('0x27')](saveUpdates(_0x342489['body'],null))[_0x81d2('0x27')](respondWithResult(_0x572e9b,null))[_0x81d2('0x49')](handleError(_0x572e9b,null));};exports[_0x81d2('0x28')]=function(_0x3b626c,_0xcb25b){return db[_0x81d2('0x44')][_0x81d2('0x4e')]({'where':{'id':_0x3b626c[_0x81d2('0x4b')]['id']}})[_0x81d2('0x27')](handleEntityNotFound(_0xcb25b,null))[_0x81d2('0x27')](removeEntity(_0xcb25b,null))[_0x81d2('0x49')](handleError(_0xcb25b,null));};exports['preview']=function(_0x552ef2,_0x2bd249){var _0x422a26=0xa;var _0x2322de=[_0x81d2('0x57'),'left_join',_0x81d2('0x58'),'cross_join'];var _0x587790={'SUM':_0x81d2('0x59'),'COUNT':_0x81d2('0x5a'),'COUNT DISTINCT':_0x81d2('0x5b'),'MAX':_0x81d2('0x5c'),'MIN':_0x81d2('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x81d2('0x5e'),'GROUP_CONCAT ASC':_0x81d2('0x5f'),'GROUP_CONCAT DESC':_0x81d2('0x60')};var _0x27d6ee={'SEC_TO_TIME':_0x81d2('0x61'),'DATE':_0x81d2('0x62'),'HOUR':'HOUR(%s)','ROUND':_0x81d2('0x63'),'UNIX_TIMESTAMP':_0x81d2('0x64')};var _0x2856a7=function(_0x21a7dc){return!_[_0x81d2('0x65')]([_0x81d2('0x66'),'IS\x20NOT\x20NULL',_0x81d2('0x67'),_0x81d2('0x68')],_0x21a7dc);};var _0x5598b1=function(_0x1a9f10){if(!_0x1a9f10||!_0x1a9f10[_0x81d2('0x69')]['length']){return'';}for(var _0x257a7b='(',_0x36ca00=0x0;_0x36ca00<_0x1a9f10[_0x81d2('0x69')][_0x81d2('0x4d')];_0x36ca00+=0x1){_0x36ca00>0x0&&(_0x257a7b+='\x20'+_0x1a9f10[_0x81d2('0x6a')]+'\x20');_0x257a7b+=_0x1a9f10[_0x81d2('0x69')][_0x36ca00][_0x81d2('0x6b')]?_0x5598b1(_0x1a9f10[_0x81d2('0x69')][_0x36ca00][_0x81d2('0x6b')]):_0x1a9f10[_0x81d2('0x69')][_0x36ca00]['field']+'\x20'+_0x1a9f10[_0x81d2('0x69')][_0x36ca00]['condition']+(_0x2856a7(_0x1a9f10[_0x81d2('0x69')][_0x36ca00]['condition'])?'\x20'+_0x1a9f10[_0x81d2('0x69')][_0x36ca00][_0x81d2('0x6c')]:'');}return _0x257a7b+')';};var _0x17f778={'where':{'id':_0x552ef2[_0x81d2('0x4b')]['id']}},_0x399e4a,_0x473178,_0x4ceba6,_0x56bc32,_0x47b660;_0x17f778=_[_0x81d2('0x41')]({},_0x17f778,_0x552ef2[_0x81d2('0x43')]);return db[_0x81d2('0x44')][_0x81d2('0x4e')](_0x17f778)['then'](function(_0x27c8a2){if(_0x27c8a2){_0x399e4a=_0x27c8a2;return _0x27c8a2['getFields']();}return null;})['then'](function(_0x46426f){if(_0x46426f){if(!_0x46426f[_0x81d2('0x4d')]){throw new db[(_0x81d2('0x6d'))][(_0x81d2('0x6e'))](_0x81d2('0x6f'),0x193);}_0x473178=_0x46426f;return db[_0x81d2('0x70')][_0x81d2('0x47')]({'raw':!![]});}return null;})['then'](function(_0x202d67){if(_0x202d67){_0x4ceba6=_[_0x81d2('0x71')](_0x202d67,'id');var _0x5ef9a6;var _0x39f6b0=squel[_0x81d2('0x72')]();_0x39f6b0['from'](_0x399e4a['table']);for(var _0x3375b9=0x0;_0x3375b9<_0x473178[_0x81d2('0x4d')];_0x3375b9+=0x1){_0x5ef9a6=_0x473178[_0x3375b9][_0x81d2('0x73')]?_0x4ceba6[_0x473178[_0x3375b9]['MetricId']][_0x81d2('0x74')]:_0x473178[_0x3375b9][_0x81d2('0x75')];_0x5ef9a6=_0x473178[_0x3375b9]['function']?_[_0x81d2('0x76')](_0x587790[_0x473178[_0x3375b9][_0x81d2('0x77')]],'%s',_0x5ef9a6):_0x5ef9a6;_0x5ef9a6=_0x473178[_0x3375b9][_0x81d2('0x78')]?_[_0x81d2('0x76')](_0x27d6ee[_0x473178[_0x3375b9][_0x81d2('0x78')]],'%s',_0x5ef9a6):_0x5ef9a6;if(_0x473178[_0x3375b9][_0x81d2('0x79')]){_0x39f6b0[_0x81d2('0x6b')](_0x5ef9a6);}_0x473178[_0x3375b9][_0x81d2('0x7a')]&&_0x39f6b0['order'](_0x5ef9a6,_0x473178[_0x3375b9][_0x81d2('0x7a')]===_0x81d2('0x7b')?![]:!![]);_0x39f6b0['field'](_0x5ef9a6,_0x473178[_0x3375b9]['alias']||_0x5ef9a6);}if(_0x399e4a['joins']){_0x399e4a['joins']=JSON[_0x81d2('0x7c')](_0x399e4a['joins']);for(var _0x14e906=0x0;_0x14e906<_0x399e4a[_0x81d2('0x7d')][_0x81d2('0x4d')];_0x14e906+=0x1){if(_0x399e4a[_0x81d2('0x7d')][_0x14e906][_0x81d2('0x32')]&&_['includes'](_0x2322de,_0x399e4a[_0x81d2('0x7d')][_0x14e906]['type'])&&_0x399e4a[_0x81d2('0x7d')][_0x14e906][_0x81d2('0x7e')]&&_0x399e4a['joins'][_0x14e906][_0x81d2('0x7f')]&&_0x399e4a[_0x81d2('0x7d')][_0x14e906]['foreignKey']){_0x39f6b0[_0x399e4a[_0x81d2('0x7d')][_0x14e906]['type']](_0x399e4a[_0x81d2('0x7d')][_0x14e906]['foreignTable'],null,util[_0x81d2('0x78')](_0x81d2('0x80'),_0x399e4a[_0x81d2('0x81')],_0x399e4a[_0x81d2('0x7d')][_0x14e906]['parentKey'],_0x399e4a[_0x81d2('0x7d')][_0x14e906][_0x81d2('0x7f')],_0x399e4a['joins'][_0x14e906][_0x81d2('0x82')]));}}}if(_0x399e4a['conditions']){_0x399e4a[_0x81d2('0x83')]=JSON[_0x81d2('0x7c')](_0x399e4a[_0x81d2('0x83')]);_0x39f6b0[_0x81d2('0x3f')](_0x5598b1(_0x399e4a[_0x81d2('0x83')][_0x81d2('0x6b')]));}_0x47b660=_0x39f6b0['clone']();_0x39f6b0[_0x81d2('0x3c')](_0x422a26);_0x39f6b0[_0x81d2('0x20')](0x0);logger[_0x81d2('0x84')]('Limited\x20Query:',_0x39f6b0[_0x81d2('0x85')]());return dbH[_0x81d2('0x86')][_0x81d2('0x35')](_0x39f6b0[_0x81d2('0x85')](),{'type':dbH[_0x81d2('0x86')][_0x81d2('0x87')][_0x81d2('0x88')]});}})[_0x81d2('0x27')](respondWithResult(_0x2bd249,null))[_0x81d2('0x49')](handleError(_0x2bd249,null));};function runReport(_0x5689fe,_0x6a80ae,_0x59b42d){var _0x4b2573=_0x6a80ae[_0x81d2('0x2e')];var _0x397b35=0xa;var _0x3ea460=[_0x81d2('0x57'),_0x81d2('0x89'),'right_join','cross_join'];var _0x4c01da={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x81d2('0x5b'),'MAX':_0x81d2('0x5c'),'MIN':_0x81d2('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x81d2('0x5e'),'GROUP_CONCAT ASC':_0x81d2('0x5f'),'GROUP_CONCAT DESC':_0x81d2('0x60')};var _0x9ceb51={'SEC_TO_TIME':_0x81d2('0x61'),'DATE':'DATE(%s)','HOUR':_0x81d2('0x8a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x81d2('0x64')};var _0x3aea4b=function(_0x122e5b){return!_[_0x81d2('0x65')]([_0x81d2('0x66'),_0x81d2('0x8b'),_0x81d2('0x67'),_0x81d2('0x68')],_0x122e5b);};var _0xfea347=function(_0x293838){if(!_0x293838||!_0x293838[_0x81d2('0x69')][_0x81d2('0x4d')]){return'';}for(var _0x37a740='(',_0x475fdb=0x0;_0x475fdb<_0x293838['rules'][_0x81d2('0x4d')];_0x475fdb+=0x1){_0x475fdb>0x0&&(_0x37a740+='\x20'+_0x293838[_0x81d2('0x6a')]+'\x20');_0x37a740+=_0x293838[_0x81d2('0x69')][_0x475fdb][_0x81d2('0x6b')]?_0xfea347(_0x293838['rules'][_0x475fdb][_0x81d2('0x6b')]):_0x293838[_0x81d2('0x69')][_0x475fdb][_0x81d2('0x75')]+'\x20'+_0x293838['rules'][_0x475fdb][_0x81d2('0x8c')]+(_0x3aea4b(_0x293838[_0x81d2('0x69')][_0x475fdb][_0x81d2('0x8c')])?'\x20'+_0x293838[_0x81d2('0x69')][_0x475fdb]['value']:'');}return _0x37a740+')';};var _0x314f23={'where':{'id':_0x5689fe['id']}},_0x3b4e4a,_0x2820af,_0xaf2d0f,_0x8203ae,_0xd72e0c;_0x314f23=_[_0x81d2('0x41')]({},_0x314f23,_0x59b42d);return db[_0x81d2('0x44')][_0x81d2('0x4e')](_0x314f23)['then'](function(_0x2a7309){if(_0x2a7309){_0x3b4e4a=_0x2a7309;return _0x2a7309[_0x81d2('0x8d')]();}return null;})[_0x81d2('0x27')](function(_0x4fc13e){if(_0x4fc13e){if(!_0x4fc13e[_0x81d2('0x4d')]){throw new db[(_0x81d2('0x6d'))][(_0x81d2('0x6e'))](_0x81d2('0x6f'),0x193);}_0x2820af=_0x4fc13e;return db[_0x81d2('0x70')][_0x81d2('0x47')]({'raw':!![]});}return null;})[_0x81d2('0x27')](function(_0x1b2705){if(_0x1b2705){_0xaf2d0f=_['keyBy'](_0x1b2705,'id');var _0x471a34;var _0x4f6ab6=squel['select']();_0x4f6ab6[_0x81d2('0x8e')](_0x3b4e4a['table']);for(var _0x1c90b4=0x0;_0x1c90b4<_0x2820af[_0x81d2('0x4d')];_0x1c90b4+=0x1){_0x471a34=_0x2820af[_0x1c90b4]['MetricId']?_0xaf2d0f[_0x2820af[_0x1c90b4][_0x81d2('0x73')]][_0x81d2('0x74')]:_0x2820af[_0x1c90b4]['field'];_0x471a34=_0x2820af[_0x1c90b4][_0x81d2('0x77')]?_[_0x81d2('0x76')](_0x4c01da[_0x2820af[_0x1c90b4]['function']],'%s',_0x471a34):_0x471a34;_0x471a34=_0x2820af[_0x1c90b4][_0x81d2('0x78')]?_[_0x81d2('0x76')](_0x9ceb51[_0x2820af[_0x1c90b4]['format']],'%s',_0x471a34):_0x471a34;if(_0x2820af[_0x1c90b4][_0x81d2('0x79')]){_0x4f6ab6[_0x81d2('0x6b')](_0x471a34);}_0x2820af[_0x1c90b4][_0x81d2('0x7a')]&&_0x4f6ab6[_0x81d2('0x3d')](_0x471a34,_0x2820af[_0x1c90b4]['orderBy']==='DESC'?![]:!![]);_0x4f6ab6['field'](_0x471a34,_0x2820af[_0x1c90b4][_0x81d2('0x8f')]||_0x471a34);}if(_0x3b4e4a[_0x81d2('0x7d')]){_0x3b4e4a['joins']=JSON[_0x81d2('0x7c')](_0x3b4e4a[_0x81d2('0x7d')]);for(var _0x3e37e3=0x0;_0x3e37e3<_0x3b4e4a[_0x81d2('0x7d')][_0x81d2('0x4d')];_0x3e37e3+=0x1){if(_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3]['type']&&_[_0x81d2('0x65')](_0x3ea460,_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3]['type'])&&_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x7e')]&&_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x7f')]&&_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x82')]){_0x4f6ab6[_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x32')]](_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x7f')],null,util[_0x81d2('0x78')](_0x81d2('0x80'),_0x3b4e4a[_0x81d2('0x81')],_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x7e')],_0x3b4e4a['joins'][_0x3e37e3][_0x81d2('0x7f')],_0x3b4e4a[_0x81d2('0x7d')][_0x3e37e3][_0x81d2('0x82')]));}}}if(_0x3b4e4a[_0x81d2('0x83')]){_0x3b4e4a[_0x81d2('0x83')]=JSON['parse'](_0x3b4e4a[_0x81d2('0x83')]);_0x4f6ab6['where'](_0xfea347(_0x3b4e4a[_0x81d2('0x83')]['group']));}_0xd72e0c=_0x4f6ab6['clone']();_0x4f6ab6[_0x81d2('0x3c')](_0x397b35);_0x4f6ab6[_0x81d2('0x20')](0x0);return;}})[_0x81d2('0x27')](function(){if(_0x6a80ae[_0x81d2('0x90')]===_0x81d2('0x91')){return null;}var _0x172b3c=_['merge'](_0x6a80ae,{'name':_0x6a80ae[_0x81d2('0x92')]||_0x6a80ae[_0x81d2('0x2e')]||_0x3b4e4a[_0x81d2('0x2e')],'basename':_0x4b2573,'savename':util['format']('%s-%s.%s',_0x6a80ae[_0x81d2('0x2e')]||_0x3b4e4a['name'],require(_0x81d2('0x93'))[_0x81d2('0x94')](0x4),_0x6a80ae[_0x81d2('0x90')]||'csv'),'reportId':_0x3b4e4a['id'],'reportType':'custom'});return db[_0x81d2('0x95')][_0x81d2('0x54')](_0x172b3c,{'raw':!![]});})[_0x81d2('0x27')](function(_0x2a5402){if(_0x3b4e4a['table']===_0x81d2('0x96')){_0xd72e0c[_0x81d2('0x3f')](_0x3b4e4a[_0x81d2('0x81')]+_0x81d2('0x97'),_0x6a80ae[_0x81d2('0x98')],_0x6a80ae[_0x81d2('0x99')]);}else{_0xd72e0c['where'](_0x3b4e4a['table']+_0x81d2('0x9a'),_0x6a80ae[_0x81d2('0x98')],_0x6a80ae[_0x81d2('0x99')]);}if(_0x2a5402){logger[_0x81d2('0x9b')]('Run\x20Query:',_0xd72e0c['toString']());require(_0x81d2('0x9c'))[_0x81d2('0x9d')](path[_0x81d2('0x57')](__dirname,_0x81d2('0x9e'),_0x2a5402[_0x81d2('0x90')]),[_0x2a5402['id'],_0xd72e0c[_0x81d2('0x85')](),path['join'](__dirname,'../../files/reports',_0x2a5402[_0x81d2('0x9f')]),_0x4b2573]);return _0x2a5402;}else{var _0x7b3448=squel[_0x81d2('0x72')]();_0x7b3448[_0x81d2('0x8e')]('('+_0xd72e0c[_0x81d2('0x85')]()+')',_0x81d2('0xa0'));_0x7b3448['field'](_0x81d2('0xa1'),_0x81d2('0x21'));_0xd72e0c['limit'](_0x6a80ae[_0x81d2('0x3c')]||_0x397b35);_0xd72e0c[_0x81d2('0x20')](_0x6a80ae[_0x81d2('0x20')]||0x0);return dbH['sequelize'][_0x81d2('0x35')](_0x7b3448[_0x81d2('0x85')](),{'type':dbH[_0x81d2('0x86')]['QueryTypes']['SELECT']})[_0x81d2('0x27')](function(_0x1dca58){if(!_0x1dca58[_0x81d2('0x4d')]){_0x8203ae=0x0;}else{_0x8203ae=_0x1dca58[0x0]['count']||0x0;}return dbH[_0x81d2('0x86')][_0x81d2('0x35')](_0xd72e0c['toString'](),{'type':dbH[_0x81d2('0x86')]['QueryTypes'][_0x81d2('0x88')]});})[_0x81d2('0x27')](function(_0x4dd243){return{'rows':_0x4dd243||[],'count':_0x8203ae};});}});}exports['run']=function(_0x48dd96,_0x3594b4){return runReport(_0x48dd96['params'],_0x48dd96[_0x81d2('0x35')],_0x48dd96[_0x81d2('0x43')])[_0x81d2('0x27')](respondWithResult(_0x3594b4,null))['catch'](handleError(_0x3594b4,null));};exports['runReport']=runReport;exports[_0x81d2('0x35')]=function(_0x26123d,_0x2fd2bf){var _0x446228=0xa;var _0x47bc65=[_0x81d2('0x57'),'left_join',_0x81d2('0x58'),_0x81d2('0xa2')];var _0x4a2c48={'SUM':_0x81d2('0x59'),'COUNT':_0x81d2('0x5a'),'COUNT DISTINCT':_0x81d2('0x5b'),'MAX':_0x81d2('0x5c'),'MIN':_0x81d2('0x5d'),'AVG':_0x81d2('0xa3'),'GROUP_CONCAT':_0x81d2('0x5e'),'GROUP_CONCAT ASC':_0x81d2('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4235a8={'SEC_TO_TIME':_0x81d2('0x61'),'DATE':_0x81d2('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x81d2('0x64')};var _0x149ec6=function(_0xd96412){return!_[_0x81d2('0x65')]([_0x81d2('0x66'),_0x81d2('0x8b'),_0x81d2('0x67'),_0x81d2('0x68')],_0xd96412);};var _0x5788d2=function(_0x268b53){if(!_0x268b53||!_0x268b53['rules'][_0x81d2('0x4d')]){return'';}for(var _0x545d1a='(',_0xb074c8=0x0;_0xb074c8<_0x268b53['rules'][_0x81d2('0x4d')];_0xb074c8+=0x1){_0xb074c8>0x0&&(_0x545d1a+='\x20'+_0x268b53[_0x81d2('0x6a')]+'\x20');_0x545d1a+=_0x268b53[_0x81d2('0x69')][_0xb074c8][_0x81d2('0x6b')]?_0x5788d2(_0x268b53['rules'][_0xb074c8]['group']):_0x268b53[_0x81d2('0x69')][_0xb074c8][_0x81d2('0x75')]+'\x20'+_0x268b53[_0x81d2('0x69')][_0xb074c8]['condition']+(_0x149ec6(_0x268b53[_0x81d2('0x69')][_0xb074c8][_0x81d2('0x8c')])?'\x20'+_0x268b53['rules'][_0xb074c8]['value']:'');}return _0x545d1a+')';};var _0xb0ed13={'where':{'id':_0x26123d[_0x81d2('0x4b')]['id']}},_0x451704,_0x30f059,_0x4598df,_0x28ecfe,_0x1282ba;_0xb0ed13=_[_0x81d2('0x41')]({},_0xb0ed13,_0x26123d[_0x81d2('0x43')]);return db[_0x81d2('0x44')]['find'](_0xb0ed13)[_0x81d2('0x27')](function(_0x4808c1){if(_0x4808c1){_0x451704=_0x4808c1;return _0x4808c1[_0x81d2('0x8d')]();}return null;})[_0x81d2('0x27')](function(_0x77b719){if(_0x77b719){if(!_0x77b719[_0x81d2('0x4d')]){throw new db[(_0x81d2('0x6d'))]['ValidationErrorItem'](_0x81d2('0x6f'),0x193);}_0x30f059=_0x77b719;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x81d2('0x27')](function(_0x28ea5b){if(_0x28ea5b){_0x4598df=_['keyBy'](_0x28ea5b,'id');var _0x3d3b3d;var _0x267853=squel[_0x81d2('0x72')]();_0x267853[_0x81d2('0x8e')](_0x451704[_0x81d2('0x81')]);for(var _0x5b7601=0x0;_0x5b7601<_0x30f059[_0x81d2('0x4d')];_0x5b7601+=0x1){_0x3d3b3d=_0x30f059[_0x5b7601][_0x81d2('0x73')]?_0x4598df[_0x30f059[_0x5b7601][_0x81d2('0x73')]][_0x81d2('0x74')]:_0x30f059[_0x5b7601][_0x81d2('0x75')];_0x3d3b3d=_0x30f059[_0x5b7601][_0x81d2('0x77')]?_[_0x81d2('0x76')](_0x4a2c48[_0x30f059[_0x5b7601][_0x81d2('0x77')]],'%s',_0x3d3b3d):_0x3d3b3d;_0x3d3b3d=_0x30f059[_0x5b7601][_0x81d2('0x78')]?_[_0x81d2('0x76')](_0x4235a8[_0x30f059[_0x5b7601][_0x81d2('0x78')]],'%s',_0x3d3b3d):_0x3d3b3d;if(_0x30f059[_0x5b7601][_0x81d2('0x79')]){_0x267853[_0x81d2('0x6b')](_0x3d3b3d);}_0x30f059[_0x5b7601]['orderBy']&&_0x267853['order'](_0x3d3b3d,_0x30f059[_0x5b7601]['orderBy']===_0x81d2('0x7b')?![]:!![]);_0x267853[_0x81d2('0x75')](_0x3d3b3d,_0x30f059[_0x5b7601][_0x81d2('0x8f')]||_0x3d3b3d);}if(_0x451704[_0x81d2('0x7d')]){_0x451704[_0x81d2('0x7d')]=JSON['parse'](_0x451704[_0x81d2('0x7d')]);for(var _0x5ec9f3=0x0;_0x5ec9f3<_0x451704[_0x81d2('0x7d')][_0x81d2('0x4d')];_0x5ec9f3+=0x1){if(_0x451704['joins'][_0x5ec9f3][_0x81d2('0x32')]&&_[_0x81d2('0x65')](_0x47bc65,_0x451704['joins'][_0x5ec9f3][_0x81d2('0x32')])&&_0x451704['joins'][_0x5ec9f3][_0x81d2('0x7e')]&&_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x7f')]&&_0x451704['joins'][_0x5ec9f3][_0x81d2('0x82')]){_0x267853[_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x32')]](_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x7f')],null,util[_0x81d2('0x78')](_0x81d2('0x80'),_0x451704['table'],_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x7e')],_0x451704['joins'][_0x5ec9f3]['foreignTable'],_0x451704[_0x81d2('0x7d')][_0x5ec9f3][_0x81d2('0x82')]));}}}if(_0x451704[_0x81d2('0x83')]){_0x451704[_0x81d2('0x83')]=JSON[_0x81d2('0x7c')](_0x451704[_0x81d2('0x83')]);_0x267853['where'](_0x5788d2(_0x451704['conditions'][_0x81d2('0x6b')]));}_0x1282ba=_0x267853['clone']();_0x267853[_0x81d2('0x3c')](_0x446228);_0x267853[_0x81d2('0x20')](0x0);logger[_0x81d2('0x84')](_0x81d2('0xa4'),_0x267853['toString']());return dbH[_0x81d2('0x86')][_0x81d2('0x35')](_0x267853['toString'](),{'type':dbH[_0x81d2('0x86')][_0x81d2('0x87')][_0x81d2('0x88')]});}})[_0x81d2('0x27')](function(){return{'sql':_0x1282ba[_0x81d2('0x85')]()};})[_0x81d2('0x27')](respondWithResult(_0x2fd2bf,null))[_0x81d2('0x49')](handleError(_0x2fd2bf,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 6f1da1a..a87b178 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 _0x7e58=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x168dfe,_0x300f07){var _0x2e00c9=function(_0x30fc67){while(--_0x30fc67){_0x168dfe['push'](_0x168dfe['shift']());}};_0x2e00c9(++_0x300f07);}(_0x7e58,0x1f2));var _0x87e5=function(_0x403314,_0x18c1d3){_0x403314=_0x403314-0x0;var _0x48731c=_0x7e58[_0x403314];return _0x48731c;};'use strict';var _=require('lodash');var util=require(_0x87e5('0x0'));var logger=require(_0x87e5('0x1'))(_0x87e5('0x2'));var moment=require('moment');var BPromise=require(_0x87e5('0x3'));var rp=require(_0x87e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87e5('0x5'));var config=require(_0x87e5('0x6'));var attributes=require(_0x87e5('0x7'));module[_0x87e5('0x8')]=function(_0x5a8621,_0x3df93a){return _0x5a8621[_0x87e5('0x9')](_0x87e5('0xa'),attributes,{'tableName':_0x87e5('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d2c=['bluebird','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4d2c,0x1d3));var _0xc4d2=function(_0xecb387,_0x1d5fc3){_0xecb387=_0xecb387-0x0;var _0x416301=_0x4d2c[_0xecb387];return _0x416301;};'use strict';var _=require(_0xc4d2('0x0'));var util=require('util');var logger=require(_0xc4d2('0x1'))('api');var moment=require(_0xc4d2('0x2'));var BPromise=require(_0xc4d2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc4d2('0x4'));var attributes=require(_0xc4d2('0x5'));module[_0xc4d2('0x6')]=function(_0x32c48c,_0x2a8a8f){return _0x32c48c[_0xc4d2('0x7')](_0xc4d2('0x8'),attributes,{'tableName':_0xc4d2('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 3e2c543..a50bb8c 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 _0xf887=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf887,0x73));var _0x7f88=function(_0x4c1c5a,_0xcf5444){_0x4c1c5a=_0x4c1c5a-0x0;var _0x2896f0=_0xf887[_0x4c1c5a];return _0x2896f0;};'use strict';var _=require(_0x7f88('0x0'));var util=require(_0x7f88('0x1'));var moment=require(_0x7f88('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f88('0x3'));var fs=require('fs');var Redis=require(_0x7f88('0x4'));var db=require(_0x7f88('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f88('0x6'))(_0x7f88('0x7'));var config=require(_0x7f88('0x8'));var jayson=require(_0x7f88('0x9'));var client=jayson[_0x7f88('0xa')][_0x7f88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x231bb1,_0x3b0be3,_0x214e3a){return new BPromise(function(_0x21f261,_0x5e0dd6){return client[_0x7f88('0xc')](_0x231bb1,_0x214e3a)[_0x7f88('0xd')](function(_0x5cdb35){logger['info'](_0x7f88('0xe'),_0x3b0be3,_0x7f88('0xf'));logger[_0x7f88('0x10')](_0x7f88('0x11'),_0x3b0be3,_0x7f88('0xf'),JSON['stringify'](_0x5cdb35));if(_0x5cdb35[_0x7f88('0x12')]){if(_0x5cdb35[_0x7f88('0x12')][_0x7f88('0x13')]===0x1f4){logger[_0x7f88('0x12')](_0x7f88('0xe'),_0x3b0be3,_0x5cdb35[_0x7f88('0x12')][_0x7f88('0x14')]);return _0x5e0dd6(_0x5cdb35[_0x7f88('0x12')][_0x7f88('0x14')]);}logger['error'](_0x7f88('0xe'),_0x3b0be3,_0x5cdb35[_0x7f88('0x12')]['message']);return _0x21f261(_0x5cdb35['error']['message']);}else{logger[_0x7f88('0x15')](_0x7f88('0xe'),_0x3b0be3,_0x7f88('0xf'));_0x21f261(_0x5cdb35[_0x7f88('0x16')][_0x7f88('0x14')]);}})[_0x7f88('0x17')](function(_0x59dc37){logger[_0x7f88('0x12')](_0x7f88('0xe'),_0x3b0be3,_0x59dc37);_0x5e0dd6(_0x59dc37);});});}
\ No newline at end of file
+var _0xcd81=['code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xcd81,0x163));var _0x1cd8=function(_0x2bd3f7,_0x3a05d6){_0x2bd3f7=_0x2bd3f7-0x0;var _0x3d9751=_0xcd81[_0x2bd3f7];return _0x3d9751;};'use strict';var _=require('lodash');var util=require(_0x1cd8('0x0'));var moment=require(_0x1cd8('0x1'));var BPromise=require(_0x1cd8('0x2'));var rs=require(_0x1cd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cd8('0x4'))['db'];var utils=require(_0x1cd8('0x5'));var logger=require(_0x1cd8('0x6'))(_0x1cd8('0x7'));var config=require(_0x1cd8('0x8'));var jayson=require(_0x1cd8('0x9'));var client=jayson[_0x1cd8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39db7f,_0x7d6af6,_0x344ec8){return new BPromise(function(_0x3dbb18,_0x1de2e0){return client[_0x1cd8('0xb')](_0x39db7f,_0x344ec8)[_0x1cd8('0xc')](function(_0x37e70e){logger[_0x1cd8('0xd')](_0x1cd8('0xe'),_0x7d6af6,_0x1cd8('0xf'));logger[_0x1cd8('0x10')](_0x1cd8('0x11'),_0x7d6af6,_0x1cd8('0xf'),JSON['stringify'](_0x37e70e));if(_0x37e70e[_0x1cd8('0x12')]){if(_0x37e70e['error'][_0x1cd8('0x13')]===0x1f4){logger[_0x1cd8('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x7d6af6,_0x37e70e[_0x1cd8('0x12')][_0x1cd8('0x14')]);return _0x1de2e0(_0x37e70e['error'][_0x1cd8('0x14')]);}logger[_0x1cd8('0x12')](_0x1cd8('0xe'),_0x7d6af6,_0x37e70e[_0x1cd8('0x12')]['message']);return _0x3dbb18(_0x37e70e['error'][_0x1cd8('0x14')]);}else{logger[_0x1cd8('0xd')](_0x1cd8('0xe'),_0x7d6af6,'request\x20sent');_0x3dbb18(_0x37e70e['result'][_0x1cd8('0x14')]);}})[_0x1cd8('0x15')](function(_0x23a6c7){logger[_0x1cd8('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x7d6af6,_0x23a6c7);_0x1de2e0(_0x23a6c7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index f963ca0..f84b940 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 _0x1a3c=['/:id/run','/:id/query','query','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id/preview','preview'];(function(_0x285d8f,_0x3c464e){var _0x2a3a2d=function(_0x57b7c0){while(--_0x57b7c0){_0x285d8f['push'](_0x285d8f['shift']());}};_0x2a3a2d(++_0x3c464e);}(_0x1a3c,0x69));var _0xc1a3=function(_0x2c8783,_0x50955d){_0x2c8783=_0x2c8783-0x0;var _0x129d02=_0x1a3c[_0x2c8783];return _0x129d02;};'use strict';var multer=require('multer');var util=require(_0xc1a3('0x0'));var path=require('path');var timeout=require(_0xc1a3('0x1'));var express=require('express');var router=express[_0xc1a3('0x2')]();var fs_extra=require(_0xc1a3('0x3'));var auth=require(_0xc1a3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xc1a3('0x5')]('/',auth[_0xc1a3('0x6')](),controller['index']);router[_0xc1a3('0x5')]('/:id',auth[_0xc1a3('0x6')](),controller['show']);router[_0xc1a3('0x5')](_0xc1a3('0x7'),auth['isAuthenticated'](),controller[_0xc1a3('0x8')]);router[_0xc1a3('0x5')](_0xc1a3('0x9'),auth[_0xc1a3('0x6')](),controller['run']);router[_0xc1a3('0x5')](_0xc1a3('0xa'),auth[_0xc1a3('0x6')](),controller[_0xc1a3('0xb')]);router['post']('/',auth[_0xc1a3('0x6')](),controller[_0xc1a3('0xc')]);router[_0xc1a3('0xd')](_0xc1a3('0xe'),auth[_0xc1a3('0x6')](),controller[_0xc1a3('0xf')]);router[_0xc1a3('0x10')](_0xc1a3('0xe'),auth[_0xc1a3('0x6')](),controller[_0xc1a3('0x11')]);module[_0xc1a3('0x12')]=router;
\ No newline at end of file
+var _0xb8f2=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','/:id/query','create','put','update'];(function(_0x5b94e4,_0x3997cc){var _0x569446=function(_0x10c701){while(--_0x10c701){_0x5b94e4['push'](_0x5b94e4['shift']());}};_0x569446(++_0x3997cc);}(_0xb8f2,0xbb));var _0x2b8f=function(_0x5811d5,_0x420ad8){_0x5811d5=_0x5811d5-0x0;var _0x8e3a88=_0xb8f2[_0x5811d5];return _0x8e3a88;};'use strict';var multer=require(_0x2b8f('0x0'));var util=require(_0x2b8f('0x1'));var path=require(_0x2b8f('0x2'));var timeout=require('connect-timeout');var express=require(_0x2b8f('0x3'));var router=express[_0x2b8f('0x4')]();var fs_extra=require(_0x2b8f('0x5'));var auth=require(_0x2b8f('0x6'));var interaction=require(_0x2b8f('0x7'));var config=require('../../config/environment');var controller=require(_0x2b8f('0x8'));router['get']('/',auth[_0x2b8f('0x9')](),controller[_0x2b8f('0xa')]);router[_0x2b8f('0xb')](_0x2b8f('0xc'),auth[_0x2b8f('0x9')](),controller['show']);router['get'](_0x2b8f('0xd'),auth[_0x2b8f('0x9')](),controller[_0x2b8f('0xe')]);router[_0x2b8f('0xb')](_0x2b8f('0xf'),auth[_0x2b8f('0x9')](),controller['run']);router[_0x2b8f('0xb')](_0x2b8f('0x10'),auth[_0x2b8f('0x9')](),controller['query']);router['post']('/',auth[_0x2b8f('0x9')](),controller[_0x2b8f('0x11')]);router[_0x2b8f('0x12')](_0x2b8f('0xc'),auth[_0x2b8f('0x9')](),controller[_0x2b8f('0x13')]);router[_0x2b8f('0x14')]('/:id',auth[_0x2b8f('0x9')](),controller[_0x2b8f('0x15')]);module[_0x2b8f('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 0957ef1..b1d3077 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 _0x24ca=['sequelize','STRING','TEXT'];(function(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0x24ca[_0x4843f9];return _0x193c6a;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
+var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x1cb60e,_0x19a170){var _0x1fc03d=function(_0x24f7ce){while(--_0x24f7ce){_0x1cb60e['push'](_0x1cb60e['shift']());}};_0x1fc03d(++_0x19a170);}(_0xd8fb,0x99));var _0xbd8f=function(_0x32ea5c,_0x2d910c){_0x32ea5c=_0x32ea5c-0x0;var _0x54f42c=_0xd8fb[_0x32ea5c];return _0x54f42c;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index c717167..53e2c03 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xabce[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
+var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x4a0c1f,_0x4eab1d){var _0x5f4f57=function(_0x1b07fb){while(--_0x1b07fb){_0x4a0c1f['push'](_0x4a0c1f['shift']());}};_0x5f4f57(++_0x4eab1d);}(_0x31f0,0xb7));var _0x031f=function(_0x52ade5,_0x158a01){_0x52ade5=_0x52ade5-0x0;var _0x14db7f=_0x31f0[_0x52ade5];return _0x14db7f;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 992b273..5078342 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 _0x69b4=['../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x255850,_0x5511dd){var _0x5ceacf=function(_0x260ecf){while(--_0x260ecf){_0x255850['push'](_0x255850['shift']());}};_0x5ceacf(++_0x5511dd);}(_0x69b4,0xd5));var _0x469b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x69b4[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x469b('0x0'));var util=require(_0x469b('0x1'));var logger=require(_0x469b('0x2'))(_0x469b('0x3'));var moment=require('moment');var BPromise=require(_0x469b('0x4'));var rp=require(_0x469b('0x5'));var fs=require('fs');var path=require(_0x469b('0x6'));var rimraf=require('rimraf');var config=require(_0x469b('0x7'));var attributes=require(_0x469b('0x8'));module['exports']=function(_0x4be5ca,_0x509527){return _0x4be5ca['define'](_0x469b('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xffd4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x5935f8,_0x2dbca4){var _0x39b19a=function(_0x2c8dc9){while(--_0x2c8dc9){_0x5935f8['push'](_0x5935f8['shift']());}};_0x39b19a(++_0x2dbca4);}(_0xffd4,0xf8));var _0x4ffd=function(_0x474628,_0x34a081){_0x474628=_0x474628-0x0;var _0x1e7717=_0xffd4[_0x474628];return _0x1e7717;};'use strict';var _=require(_0x4ffd('0x0'));var util=require(_0x4ffd('0x1'));var logger=require(_0x4ffd('0x2'))(_0x4ffd('0x3'));var moment=require(_0x4ffd('0x4'));var BPromise=require(_0x4ffd('0x5'));var rp=require(_0x4ffd('0x6'));var fs=require('fs');var path=require(_0x4ffd('0x7'));var rimraf=require(_0x4ffd('0x8'));var config=require(_0x4ffd('0x9'));var attributes=require(_0x4ffd('0xa'));module[_0x4ffd('0xb')]=function(_0x3744a5,_0x1f9b13){return _0x3744a5['define'](_0x4ffd('0xc'),attributes,{'tableName':_0x4ffd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index ca5ce20..f5a99b5 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 _0x262b=['jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x262b,0x91));var _0xb262=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x262b[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xb262('0x0'));var moment=require(_0xb262('0x1'));var BPromise=require(_0xb262('0x2'));var rs=require(_0xb262('0x3'));var fs=require('fs');var Redis=require(_0xb262('0x4'));var db=require(_0xb262('0x5'))['db'];var utils=require(_0xb262('0x6'));var logger=require(_0xb262('0x7'))('rpc');var config=require(_0xb262('0x8'));var jayson=require(_0xb262('0x9'));var client=jayson[_0xb262('0xa')][_0xb262('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa5e3e0,_0x3a2d14,_0x3ff761){return new BPromise(function(_0x209fd3,_0x3e738f){return client['request'](_0xa5e3e0,_0x3ff761)[_0xb262('0xc')](function(_0x599903){logger[_0xb262('0xd')](_0xb262('0xe'),_0x3a2d14,_0xb262('0xf'));logger[_0xb262('0x10')](_0xb262('0x11'),_0x3a2d14,'request\x20sent',JSON[_0xb262('0x12')](_0x599903));if(_0x599903[_0xb262('0x13')]){if(_0x599903[_0xb262('0x13')]['code']===0x1f4){logger[_0xb262('0x13')](_0xb262('0xe'),_0x3a2d14,_0x599903[_0xb262('0x13')][_0xb262('0x14')]);return _0x3e738f(_0x599903[_0xb262('0x13')][_0xb262('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a2d14,_0x599903[_0xb262('0x13')]['message']);return _0x209fd3(_0x599903[_0xb262('0x13')]['message']);}else{logger[_0xb262('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a2d14,'request\x20sent');_0x209fd3(_0x599903[_0xb262('0x15')][_0xb262('0x14')]);}})['catch'](function(_0x353bf6){logger['error'](_0xb262('0xe'),_0x3a2d14,_0x353bf6);_0x3e738f(_0x353bf6);});});}
\ No newline at end of file
+var _0x0f89=['info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x34f545,_0x4c7765){var _0x2c2a68=function(_0x4c20cc){while(--_0x4c20cc){_0x34f545['push'](_0x34f545['shift']());}};_0x2c2a68(++_0x4c7765);}(_0x0f89,0x1e5));var _0x90f8=function(_0xa0d7ba,_0x303316){_0xa0d7ba=_0xa0d7ba-0x0;var _0x58fa94=_0x0f89[_0xa0d7ba];return _0x58fa94;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var moment=require('moment');var BPromise=require(_0x90f8('0x2'));var rs=require(_0x90f8('0x3'));var fs=require('fs');var Redis=require(_0x90f8('0x4'));var db=require(_0x90f8('0x5'))['db'];var utils=require(_0x90f8('0x6'));var logger=require(_0x90f8('0x7'))(_0x90f8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x90f8('0x9')][_0x90f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b332b,_0x373008,_0x37c045){return new BPromise(function(_0xbf46a3,_0x1d6be8){return client[_0x90f8('0xb')](_0x3b332b,_0x37c045)[_0x90f8('0xc')](function(_0x424da4){logger['info'](_0x90f8('0xd'),_0x373008,_0x90f8('0xe'));logger['debug'](_0x90f8('0xf'),_0x373008,_0x90f8('0xe'),JSON['stringify'](_0x424da4));if(_0x424da4[_0x90f8('0x10')]){if(_0x424da4[_0x90f8('0x10')][_0x90f8('0x11')]===0x1f4){logger[_0x90f8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x373008,_0x424da4[_0x90f8('0x10')]['message']);return _0x1d6be8(_0x424da4[_0x90f8('0x10')][_0x90f8('0x12')]);}logger[_0x90f8('0x10')](_0x90f8('0xd'),_0x373008,_0x424da4[_0x90f8('0x10')][_0x90f8('0x12')]);return _0xbf46a3(_0x424da4[_0x90f8('0x10')]['message']);}else{logger[_0x90f8('0x13')](_0x90f8('0xd'),_0x373008,_0x90f8('0xe'));_0xbf46a3(_0x424da4[_0x90f8('0x14')][_0x90f8('0x12')]);}})['catch'](function(_0x24e0ac){logger[_0x90f8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x373008,_0x24e0ac);_0x1d6be8(_0x24e0ac);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index ec4da07..fb00889 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 _0xf11e=['put','update','destroy','multer','path','connect-timeout','express','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','create'];(function(_0x43dec6,_0x39ef22){var _0x5b9e47=function(_0xfb75a4){while(--_0xfb75a4){_0x43dec6['push'](_0x43dec6['shift']());}};_0x5b9e47(++_0x39ef22);}(_0xf11e,0x11b));var _0xef11=function(_0x5d375c,_0x3ccb1e){_0x5d375c=_0x5d375c-0x0;var _0x1fd6ed=_0xf11e[_0x5d375c];return _0x1fd6ed;};'use strict';var multer=require(_0xef11('0x0'));var util=require('util');var path=require(_0xef11('0x1'));var timeout=require(_0xef11('0x2'));var express=require(_0xef11('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xef11('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef11('0x5'));router[_0xef11('0x6')]('/',auth[_0xef11('0x7')](),controller[_0xef11('0x8')]);router[_0xef11('0x6')](_0xef11('0x9'),auth[_0xef11('0x7')](),controller['show']);router[_0xef11('0x6')](_0xef11('0xa'),auth[_0xef11('0x7')](),controller[_0xef11('0xb')]);router[_0xef11('0x6')](_0xef11('0xc'),auth['isAuthenticated'](),controller['run']);router[_0xef11('0x6')](_0xef11('0xd'),auth['isAuthenticated'](),controller[_0xef11('0xe')]);router[_0xef11('0xf')]('/',auth['isAuthenticated'](),controller[_0xef11('0x10')]);router[_0xef11('0x11')](_0xef11('0x9'),auth[_0xef11('0x7')](),controller[_0xef11('0x12')]);router['delete'](_0xef11('0x9'),auth['isAuthenticated'](),controller[_0xef11('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x8926=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','show','preview','/:id/run','run','/:id/query','query','post'];(function(_0x2fb732,_0x1aa142){var _0x477de3=function(_0x1299fa){while(--_0x1299fa){_0x2fb732['push'](_0x2fb732['shift']());}};_0x477de3(++_0x1aa142);}(_0x8926,0x18d));var _0x6892=function(_0x2a7e6f,_0x3418c5){_0x2a7e6f=_0x2a7e6f-0x0;var _0x4e4167=_0x8926[_0x2a7e6f];return _0x4e4167;};'use strict';var multer=require(_0x6892('0x0'));var util=require(_0x6892('0x1'));var path=require(_0x6892('0x2'));var timeout=require(_0x6892('0x3'));var express=require(_0x6892('0x4'));var router=express[_0x6892('0x5')]();var fs_extra=require(_0x6892('0x6'));var auth=require(_0x6892('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6892('0x8'));router[_0x6892('0x9')]('/',auth[_0x6892('0xa')](),controller[_0x6892('0xb')]);router[_0x6892('0x9')]('/:id',auth[_0x6892('0xa')](),controller[_0x6892('0xc')]);router[_0x6892('0x9')]('/:id/preview',auth[_0x6892('0xa')](),controller[_0x6892('0xd')]);router[_0x6892('0x9')](_0x6892('0xe'),auth[_0x6892('0xa')](),controller[_0x6892('0xf')]);router[_0x6892('0x9')](_0x6892('0x10'),auth[_0x6892('0xa')](),controller[_0x6892('0x11')]);router[_0x6892('0x12')]('/',auth[_0x6892('0xa')](),controller[_0x6892('0x13')]);router[_0x6892('0x14')](_0x6892('0x15'),auth['isAuthenticated'](),controller[_0x6892('0x16')]);router[_0x6892('0x17')](_0x6892('0x15'),auth['isAuthenticated'](),controller[_0x6892('0x18')]);module[_0x6892('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 892f952..47c2ad1 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 _0x3f1c=['csv','pdf','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','STRING','ENUM'];(function(_0x53eff4,_0x55b2c0){var _0x1fa828=function(_0x50da64){while(--_0x50da64){_0x53eff4['push'](_0x53eff4['shift']());}};_0x1fa828(++_0x55b2c0);}(_0x3f1c,0x6c));var _0xc3f1=function(_0x595b93,_0x1c35e9){_0x595b93=_0x595b93-0x0;var _0x12133a=_0x3f1c[_0x595b93];return _0x12133a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc3f1('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0xc3f1('0x1')](_0xc3f1('0x2'),_0xc3f1('0x3'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xc3f1('0x4')]},'endDate':{'type':Sequelize[_0xc3f1('0x4')]},'status':{'type':Sequelize[_0xc3f1('0x0')],'defaultValue':_0xc3f1('0x5')},'type':{'type':Sequelize[_0xc3f1('0x1')](_0xc3f1('0x6'),_0xc3f1('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xc3f1('0x8')](0xb)[_0xc3f1('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa64b=['ENUM','manual','moment','STRING','csv','DATE','Loading'];(function(_0x1f502b,_0x489686){var _0x1a93e8=function(_0x10f433){while(--_0x10f433){_0x1f502b['push'](_0x1f502b['shift']());}};_0x1a93e8(++_0x489686);}(_0xa64b,0x175));var _0xba64=function(_0x43ec80,_0x463baa){_0x43ec80=_0x43ec80-0x0;var _0x3713bc=_0xa64b[_0x43ec80];return _0x3713bc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xba64('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xba64('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0xba64('0x2')},'savename':{'type':Sequelize[_0xba64('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xba64('0x3')]},'endDate':{'type':Sequelize[_0xba64('0x3')]},'status':{'type':Sequelize[_0xba64('0x1')],'defaultValue':_0xba64('0x4')},'type':{'type':Sequelize[_0xba64('0x5')](_0xba64('0x6'),'scheduled'),'allowNull':![],'defaultValue':_0xba64('0x6')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7af405b..3396801 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 _0xee13=['ValidationError','exists','root','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','ExtractedReports','end','stack','name','send','index','map','AnalyticExtractedReport','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','get','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync','join','server/files/reports'];(function(_0x425051,_0x3c1854){var _0x126b92=function(_0x3d3702){while(--_0x3d3702){_0x425051['push'](_0x425051['shift']());}};_0x126b92(++_0x3c1854);}(_0xee13,0x1e5));var _0x3ee1=function(_0xe9ca7c,_0x45f2d3){_0xe9ca7c=_0xe9ca7c-0x0;var _0x17775e=_0xee13[_0xe9ca7c];return _0x17775e;};'use strict';var emlformat=require(_0x3ee1('0x0'));var rimraf=require(_0x3ee1('0x1'));var zipdir=require(_0x3ee1('0x2'));var jsonpatch=require(_0x3ee1('0x3'));var rp=require(_0x3ee1('0x4'));var moment=require(_0x3ee1('0x5'));var BPromise=require(_0x3ee1('0x6'));var Mustache=require(_0x3ee1('0x7'));var util=require(_0x3ee1('0x8'));var path=require(_0x3ee1('0x9'));var sox=require(_0x3ee1('0xa'));var csv=require(_0x3ee1('0xb'));var ejs=require(_0x3ee1('0xc'));var fs=require('fs');var fs_extra=require(_0x3ee1('0xd'));var _=require(_0x3ee1('0xe'));var squel=require(_0x3ee1('0xf'));var crypto=require(_0x3ee1('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3ee1('0x11'));var toCsv=require(_0x3ee1('0xb'));var querystring=require('querystring');var Papa=require(_0x3ee1('0x12'));var Redis=require(_0x3ee1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3ee1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ee1('0x15'))(_0x3ee1('0x16'));var utils=require(_0x3ee1('0x17'));var config=require(_0x3ee1('0x18'));var licenseUtil=require(_0x3ee1('0x19'));var db=require(_0x3ee1('0x1a'))['db'];function respondWithStatusCode(_0x1a035f,_0x572a58){_0x572a58=_0x572a58||0xcc;return function(_0x18c304){if(_0x18c304){return _0x1a035f[_0x3ee1('0x1b')](_0x572a58);}return _0x1a035f[_0x3ee1('0x1c')](_0x572a58)['end']();};}function respondWithResult(_0x1eb87c,_0x4b92fc){_0x4b92fc=_0x4b92fc||0xc8;return function(_0x4f63f3){if(_0x4f63f3){return _0x1eb87c[_0x3ee1('0x1c')](_0x4b92fc)[_0x3ee1('0x1d')](_0x4f63f3);}};}function respondWithFilteredResult(_0x526ddc,_0x31a7d2){return function(_0x326c14){if(_0x326c14){var _0x39328e=typeof _0x31a7d2[_0x3ee1('0x1e')]===_0x3ee1('0x1f')&&typeof _0x31a7d2['limit']===_0x3ee1('0x1f');var _0x2849a0=_0x326c14[_0x3ee1('0x20')];var _0x3fea7a=_0x39328e?0x0:_0x31a7d2['offset'];var _0x34a5c5=_0x39328e?_0x326c14['count']:_0x31a7d2[_0x3ee1('0x1e')]+_0x31a7d2[_0x3ee1('0x21')];var _0x20e39f;if(_0x34a5c5>=_0x2849a0){_0x34a5c5=_0x2849a0;_0x20e39f=0xc8;}else{_0x20e39f=0xce;}_0x526ddc[_0x3ee1('0x1c')](_0x20e39f);return _0x526ddc[_0x3ee1('0x22')](_0x3ee1('0x23'),_0x3fea7a+'-'+_0x34a5c5+'/'+_0x2849a0)[_0x3ee1('0x1d')](_0x326c14);}return null;};}function patchUpdates(_0x383599){return function(_0x1480d6){try{jsonpatch[_0x3ee1('0x24')](_0x1480d6,_0x383599,!![]);}catch(_0x501ada){return BPromise['reject'](_0x501ada);}return _0x1480d6[_0x3ee1('0x25')]();};}function saveUpdates(_0x3fc493,_0x5ddd9a){return function(_0x157940){if(_0x157940){return _0x157940['update'](_0x3fc493)[_0x3ee1('0x26')](function(_0x32890c){return _0x32890c;});}return null;};}function removeEntity(_0x58e419,_0x268813){return function(_0x30714f){if(_0x30714f){return _0x30714f[_0x3ee1('0x27')]()['then'](function(){var _0x5c51ae=_0x30714f['get']({'plain':!![]});var _0x2d3cd0=_0x3ee1('0x28');return db['UserProfileResource'][_0x3ee1('0x27')]({'where':{'type':_0x2d3cd0,'resourceId':_0x5c51ae['id']}})[_0x3ee1('0x26')](function(){return _0x30714f;});})[_0x3ee1('0x26')](function(){_0x58e419[_0x3ee1('0x1c')](0xcc)[_0x3ee1('0x29')]();});}};}function handleEntityNotFound(_0x1b84b0,_0x5a9b5b){return function(_0x532abd){if(!_0x532abd){_0x1b84b0[_0x3ee1('0x1b')](0x194);}return _0x532abd;};}function handleError(_0xfa06a2,_0x2c18a7){_0x2c18a7=_0x2c18a7||0x1f4;return function(_0x329d08){logger['error'](_0x329d08[_0x3ee1('0x2a')]);if(_0x329d08[_0x3ee1('0x2b')]){delete _0x329d08[_0x3ee1('0x2b')];}_0xfa06a2[_0x3ee1('0x1c')](_0x2c18a7)[_0x3ee1('0x2c')](_0x329d08);};}exports[_0x3ee1('0x2d')]=function(_0x30ded3,_0x156998){var _0x3fe690={},_0x5d235a={},_0x55ced1={'count':0x0,'rows':[]};var _0x3bbbb3=_[_0x3ee1('0x2e')](db[_0x3ee1('0x2f')]['rawAttributes'],function(_0x4f674c){return{'name':_0x4f674c['fieldName'],'type':_0x4f674c[_0x3ee1('0x30')][_0x3ee1('0x31')]};});_0x5d235a[_0x3ee1('0x32')]=_[_0x3ee1('0x2e')](_0x3bbbb3,'name');_0x5d235a[_0x3ee1('0x33')]=_[_0x3ee1('0x34')](_0x30ded3['query']);_0x5d235a['filters']=_[_0x3ee1('0x35')](_0x5d235a[_0x3ee1('0x32')],_0x5d235a['query']);_0x3fe690['attributes']=_[_0x3ee1('0x35')](_0x5d235a['model'],qs[_0x3ee1('0x36')](_0x30ded3[_0x3ee1('0x33')]['fields']));_0x3fe690[_0x3ee1('0x37')]=_0x3fe690[_0x3ee1('0x37')][_0x3ee1('0x38')]?_0x3fe690[_0x3ee1('0x37')]:_0x5d235a[_0x3ee1('0x32')];if(!_0x30ded3['query']['hasOwnProperty'](_0x3ee1('0x39'))){_0x3fe690['limit']=qs['limit'](_0x30ded3[_0x3ee1('0x33')]['limit']);_0x3fe690[_0x3ee1('0x1e')]=qs[_0x3ee1('0x1e')](_0x30ded3[_0x3ee1('0x33')]['offset']);}_0x3fe690['order']=qs[_0x3ee1('0x3a')](_0x30ded3['query'][_0x3ee1('0x3a')]);_0x3fe690['where']=qs[_0x3ee1('0x3b')](_[_0x3ee1('0x3c')](_0x30ded3['query'],_0x5d235a['filters']),_0x3bbbb3);if(_0x30ded3['query'][_0x3ee1('0x3d')]){_0x3fe690['where']=_[_0x3ee1('0x3e')](_0x3fe690[_0x3ee1('0x3f')],{'$or':_[_0x3ee1('0x2e')](_0x3bbbb3,function(_0x66c8d1){if(_0x66c8d1['type']!==_0x3ee1('0x40')){var _0x32d482={};_0x32d482[_0x66c8d1['name']]={'$like':'%'+_0x30ded3[_0x3ee1('0x33')][_0x3ee1('0x3d')]+'%'};return _0x32d482;}})});}_0x3fe690=_[_0x3ee1('0x3e')]({},_0x3fe690,_0x30ded3[_0x3ee1('0x41')]);var _0x4f8923={'where':_0x3fe690['where']};return db[_0x3ee1('0x2f')][_0x3ee1('0x20')](_0x4f8923)[_0x3ee1('0x26')](function(_0x165ab0){_0x55ced1[_0x3ee1('0x20')]=_0x165ab0;if(_0x30ded3['query'][_0x3ee1('0x42')]){_0x3fe690['include']=[{'all':!![]}];}return db[_0x3ee1('0x2f')][_0x3ee1('0x43')](_0x3fe690);})[_0x3ee1('0x26')](function(_0x19c9f9){_0x55ced1[_0x3ee1('0x44')]=_0x19c9f9;return _0x55ced1;})[_0x3ee1('0x26')](respondWithFilteredResult(_0x156998,_0x3fe690))[_0x3ee1('0x45')](handleError(_0x156998,null));};exports['show']=function(_0x4fb825,_0x2c2760){var _0x3d2d41={'raw':!![],'where':{'id':_0x4fb825[_0x3ee1('0x46')]['id']}},_0x10996d={};_0x10996d['model']=_[_0x3ee1('0x34')](db[_0x3ee1('0x2f')][_0x3ee1('0x47')]);_0x10996d[_0x3ee1('0x33')]=_['keys'](_0x4fb825[_0x3ee1('0x33')]);_0x10996d[_0x3ee1('0x3b')]=_['intersection'](_0x10996d[_0x3ee1('0x32')],_0x10996d[_0x3ee1('0x33')]);_0x3d2d41[_0x3ee1('0x37')]=_['intersection'](_0x10996d[_0x3ee1('0x32')],qs[_0x3ee1('0x36')](_0x4fb825[_0x3ee1('0x33')][_0x3ee1('0x36')]));_0x3d2d41['attributes']=_0x3d2d41[_0x3ee1('0x37')][_0x3ee1('0x38')]?_0x3d2d41[_0x3ee1('0x37')]:_0x10996d[_0x3ee1('0x32')];if(_0x4fb825[_0x3ee1('0x33')][_0x3ee1('0x42')]){_0x3d2d41[_0x3ee1('0x48')]=[{'all':!![]}];}_0x3d2d41=_[_0x3ee1('0x3e')]({},_0x3d2d41,_0x4fb825[_0x3ee1('0x41')]);return db['AnalyticExtractedReport'][_0x3ee1('0x49')](_0x3d2d41)['then'](handleEntityNotFound(_0x2c2760,null))[_0x3ee1('0x26')](respondWithResult(_0x2c2760,null))['catch'](handleError(_0x2c2760,null));};exports[_0x3ee1('0x4a')]=function(_0x25fda7,_0x2ed3ac){return db[_0x3ee1('0x2f')][_0x3ee1('0x4a')](_0x25fda7[_0x3ee1('0x4b')],{})['then'](function(_0x104d05){var _0x46493e=_0x25fda7[_0x3ee1('0x4c')][_0x3ee1('0x4d')]({'plain':!![]});if(!_0x46493e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46493e['role']===_0x3ee1('0x4c')){var _0x21cbbb=_0x104d05[_0x3ee1('0x4d')]({'plain':!![]});var _0x48997c=_0x3ee1('0x28');return db['UserProfileSection'][_0x3ee1('0x49')]({'where':{'name':_0x48997c,'userProfileId':_0x46493e[_0x3ee1('0x4e')]},'raw':!![]})[_0x3ee1('0x26')](function(_0x4e484c){if(_0x4e484c&&_0x4e484c[_0x3ee1('0x4f')]===0x0){return db[_0x3ee1('0x50')][_0x3ee1('0x4a')]({'name':_0x21cbbb[_0x3ee1('0x2b')],'resourceId':_0x21cbbb['id'],'type':_0x4e484c[_0x3ee1('0x2b')],'sectionId':_0x4e484c['id']},{})[_0x3ee1('0x26')](function(){return _0x104d05;});}else{return _0x104d05;}})[_0x3ee1('0x45')](function(_0xf744b7){logger[_0x3ee1('0x51')](_0x3ee1('0x52'),_0xf744b7);throw _0xf744b7;});}return _0x104d05;})[_0x3ee1('0x26')](respondWithResult(_0x2ed3ac,0xc9))['catch'](handleError(_0x2ed3ac,null));};exports[_0x3ee1('0x53')]=function(_0x40fd7f,_0x1ddb10){if(_0x40fd7f[_0x3ee1('0x4b')]['id']){delete _0x40fd7f[_0x3ee1('0x4b')]['id'];}return db[_0x3ee1('0x2f')]['find']({'where':{'id':_0x40fd7f[_0x3ee1('0x46')]['id']}})[_0x3ee1('0x26')](handleEntityNotFound(_0x1ddb10,null))[_0x3ee1('0x26')](saveUpdates(_0x40fd7f[_0x3ee1('0x4b')],null))[_0x3ee1('0x26')](respondWithResult(_0x1ddb10,null))[_0x3ee1('0x45')](handleError(_0x1ddb10,null));};exports['destroy']=function(_0x18049a,_0x1a0cb5){return db['AnalyticExtractedReport'][_0x3ee1('0x49')]({'where':{'id':_0x18049a[_0x3ee1('0x46')]['id']}})[_0x3ee1('0x26')](handleEntityNotFound(_0x1a0cb5,null))['then'](removeEntity(_0x1a0cb5,null))[_0x3ee1('0x45')](handleError(_0x1a0cb5,null));};exports[_0x3ee1('0x54')]=function(_0x5a936f,_0x31464a,_0xac3d9a){return db[_0x3ee1('0x2f')][_0x3ee1('0x49')]({'where':{'id':_0x5a936f[_0x3ee1('0x46')]['id']},'attributes':[_0x3ee1('0x2b'),_0x3ee1('0x55'),_0x3ee1('0x56'),_0x3ee1('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x31464a,null))[_0x3ee1('0x26')](function(_0x2bc0f0){if(_0x2bc0f0){if(!fs[_0x3ee1('0x58')](path[_0x3ee1('0x59')](config['root'],_0x3ee1('0x5a'),_0x2bc0f0[_0x3ee1('0x56')]))){throw new db['Sequelize'][(_0x3ee1('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5a936f[_0x3ee1('0x33')][_0x3ee1('0x5c')]){return _0x31464a['sendStatus'](0xc8);}return _0x31464a[_0x3ee1('0x54')](path[_0x3ee1('0x59')](config[_0x3ee1('0x5d')],_0x3ee1('0x5a'),_0x2bc0f0['savename']),util[_0x3ee1('0x5e')](_0x3ee1('0x5f'),_0x2bc0f0[_0x3ee1('0x55')]||_0x2bc0f0[_0x3ee1('0x2b')],_0x2bc0f0[_0x3ee1('0x57')]['toLowerCase']()));}})[_0x3ee1('0x45')](handleError(_0x31464a,null));};
\ No newline at end of file
+var _0x7e2d=['save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','AnalyticExtractedReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','download','basename','savename','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','root','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7e2d,0x9b));var _0xd7e2=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x7e2d[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require(_0xd7e2('0x0'));var rimraf=require(_0xd7e2('0x1'));var zipdir=require(_0xd7e2('0x2'));var jsonpatch=require(_0xd7e2('0x3'));var rp=require(_0xd7e2('0x4'));var moment=require(_0xd7e2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd7e2('0x6'));var path=require(_0xd7e2('0x7'));var sox=require(_0xd7e2('0x8'));var csv=require('to-csv');var ejs=require(_0xd7e2('0x9'));var fs=require('fs');var fs_extra=require(_0xd7e2('0xa'));var _=require(_0xd7e2('0xb'));var squel=require(_0xd7e2('0xc'));var crypto=require(_0xd7e2('0xd'));var jsforce=require(_0xd7e2('0xe'));var deskjs=require(_0xd7e2('0xf'));var toCsv=require(_0xd7e2('0x10'));var querystring=require(_0xd7e2('0x11'));var Papa=require(_0xd7e2('0x12'));var Redis=require(_0xd7e2('0x13'));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(_0xd7e2('0x14'))('api');var utils=require(_0xd7e2('0x15'));var config=require(_0xd7e2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7e2('0x17'))['db'];function respondWithStatusCode(_0x285cf1,_0x265461){_0x265461=_0x265461||0xcc;return function(_0x2aa12e){if(_0x2aa12e){return _0x285cf1[_0xd7e2('0x18')](_0x265461);}return _0x285cf1[_0xd7e2('0x19')](_0x265461)[_0xd7e2('0x1a')]();};}function respondWithResult(_0x3f8de4,_0x5ea61c){_0x5ea61c=_0x5ea61c||0xc8;return function(_0x4cd056){if(_0x4cd056){return _0x3f8de4[_0xd7e2('0x19')](_0x5ea61c)['json'](_0x4cd056);}};}function respondWithFilteredResult(_0xe8f604,_0x3a1f52){return function(_0x6b8c2){if(_0x6b8c2){var _0x193c5f=typeof _0x3a1f52[_0xd7e2('0x1b')]==='undefined'&&typeof _0x3a1f52[_0xd7e2('0x1c')]===_0xd7e2('0x1d');var _0x33ee30=_0x6b8c2['count'];var _0x18f47b=_0x193c5f?0x0:_0x3a1f52[_0xd7e2('0x1b')];var _0x1b5de5=_0x193c5f?_0x6b8c2[_0xd7e2('0x1e')]:_0x3a1f52['offset']+_0x3a1f52['limit'];var _0x4fcc6e;if(_0x1b5de5>=_0x33ee30){_0x1b5de5=_0x33ee30;_0x4fcc6e=0xc8;}else{_0x4fcc6e=0xce;}_0xe8f604[_0xd7e2('0x19')](_0x4fcc6e);return _0xe8f604[_0xd7e2('0x1f')](_0xd7e2('0x20'),_0x18f47b+'-'+_0x1b5de5+'/'+_0x33ee30)['json'](_0x6b8c2);}return null;};}function patchUpdates(_0x1207a1){return function(_0x4238bd){try{jsonpatch[_0xd7e2('0x21')](_0x4238bd,_0x1207a1,!![]);}catch(_0x5a6a87){return BPromise[_0xd7e2('0x22')](_0x5a6a87);}return _0x4238bd[_0xd7e2('0x23')]();};}function saveUpdates(_0x44daf3,_0x553401){return function(_0xeca21f){if(_0xeca21f){return _0xeca21f['update'](_0x44daf3)[_0xd7e2('0x24')](function(_0x4a9a0c){return _0x4a9a0c;});}return null;};}function removeEntity(_0x554c1f,_0x479328){return function(_0x3c2925){if(_0x3c2925){return _0x3c2925[_0xd7e2('0x25')]()[_0xd7e2('0x24')](function(){var _0x33db2e=_0x3c2925[_0xd7e2('0x26')]({'plain':!![]});var _0x52d15a=_0xd7e2('0x27');return db[_0xd7e2('0x28')]['destroy']({'where':{'type':_0x52d15a,'resourceId':_0x33db2e['id']}})[_0xd7e2('0x24')](function(){return _0x3c2925;});})[_0xd7e2('0x24')](function(){_0x554c1f[_0xd7e2('0x19')](0xcc)[_0xd7e2('0x1a')]();});}};}function handleEntityNotFound(_0x54d936,_0x737033){return function(_0x49e409){if(!_0x49e409){_0x54d936[_0xd7e2('0x18')](0x194);}return _0x49e409;};}function handleError(_0x5a67c2,_0x2fe540){_0x2fe540=_0x2fe540||0x1f4;return function(_0x210916){logger[_0xd7e2('0x29')](_0x210916[_0xd7e2('0x2a')]);if(_0x210916[_0xd7e2('0x2b')]){delete _0x210916['name'];}_0x5a67c2[_0xd7e2('0x19')](_0x2fe540)['send'](_0x210916);};}exports[_0xd7e2('0x2c')]=function(_0x1c796e,_0xc1623e){var _0x52f0be={},_0x19dc5c={},_0x572793={'count':0x0,'rows':[]};var _0x3f6e1d=_['map'](db[_0xd7e2('0x2d')][_0xd7e2('0x2e')],function(_0x3d412b){return{'name':_0x3d412b['fieldName'],'type':_0x3d412b[_0xd7e2('0x2f')][_0xd7e2('0x30')]};});_0x19dc5c['model']=_[_0xd7e2('0x31')](_0x3f6e1d,_0xd7e2('0x2b'));_0x19dc5c[_0xd7e2('0x32')]=_[_0xd7e2('0x33')](_0x1c796e[_0xd7e2('0x32')]);_0x19dc5c[_0xd7e2('0x34')]=_[_0xd7e2('0x35')](_0x19dc5c[_0xd7e2('0x36')],_0x19dc5c[_0xd7e2('0x32')]);_0x52f0be['attributes']=_[_0xd7e2('0x35')](_0x19dc5c[_0xd7e2('0x36')],qs[_0xd7e2('0x37')](_0x1c796e[_0xd7e2('0x32')][_0xd7e2('0x37')]));_0x52f0be['attributes']=_0x52f0be[_0xd7e2('0x38')][_0xd7e2('0x39')]?_0x52f0be[_0xd7e2('0x38')]:_0x19dc5c[_0xd7e2('0x36')];if(!_0x1c796e[_0xd7e2('0x32')]['hasOwnProperty'](_0xd7e2('0x3a'))){_0x52f0be[_0xd7e2('0x1c')]=qs[_0xd7e2('0x1c')](_0x1c796e[_0xd7e2('0x32')][_0xd7e2('0x1c')]);_0x52f0be['offset']=qs[_0xd7e2('0x1b')](_0x1c796e[_0xd7e2('0x32')][_0xd7e2('0x1b')]);}_0x52f0be[_0xd7e2('0x3b')]=qs[_0xd7e2('0x3c')](_0x1c796e['query'][_0xd7e2('0x3c')]);_0x52f0be[_0xd7e2('0x3d')]=qs[_0xd7e2('0x34')](_[_0xd7e2('0x3e')](_0x1c796e[_0xd7e2('0x32')],_0x19dc5c[_0xd7e2('0x34')]),_0x3f6e1d);if(_0x1c796e['query'][_0xd7e2('0x3f')]){_0x52f0be['where']=_['merge'](_0x52f0be[_0xd7e2('0x3d')],{'$or':_[_0xd7e2('0x31')](_0x3f6e1d,function(_0x5f54b1){if(_0x5f54b1[_0xd7e2('0x2f')]!==_0xd7e2('0x40')){var _0x15bb78={};_0x15bb78[_0x5f54b1[_0xd7e2('0x2b')]]={'$like':'%'+_0x1c796e[_0xd7e2('0x32')]['filter']+'%'};return _0x15bb78;}})});}_0x52f0be=_[_0xd7e2('0x41')]({},_0x52f0be,_0x1c796e[_0xd7e2('0x42')]);var _0x432c9b={'where':_0x52f0be['where']};return db[_0xd7e2('0x2d')][_0xd7e2('0x1e')](_0x432c9b)[_0xd7e2('0x24')](function(_0x30da3d){_0x572793['count']=_0x30da3d;if(_0x1c796e['query'][_0xd7e2('0x43')]){_0x52f0be['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xd7e2('0x44')](_0x52f0be);})[_0xd7e2('0x24')](function(_0x4bf905){_0x572793['rows']=_0x4bf905;return _0x572793;})['then'](respondWithFilteredResult(_0xc1623e,_0x52f0be))['catch'](handleError(_0xc1623e,null));};exports[_0xd7e2('0x45')]=function(_0x52e800,_0x3f4a6a){var _0x4fd2f5={'raw':!![],'where':{'id':_0x52e800[_0xd7e2('0x46')]['id']}},_0x3ae74f={};_0x3ae74f[_0xd7e2('0x36')]=_['keys'](db[_0xd7e2('0x2d')][_0xd7e2('0x2e')]);_0x3ae74f['query']=_[_0xd7e2('0x33')](_0x52e800['query']);_0x3ae74f[_0xd7e2('0x34')]=_[_0xd7e2('0x35')](_0x3ae74f['model'],_0x3ae74f[_0xd7e2('0x32')]);_0x4fd2f5[_0xd7e2('0x38')]=_[_0xd7e2('0x35')](_0x3ae74f[_0xd7e2('0x36')],qs[_0xd7e2('0x37')](_0x52e800[_0xd7e2('0x32')][_0xd7e2('0x37')]));_0x4fd2f5[_0xd7e2('0x38')]=_0x4fd2f5[_0xd7e2('0x38')][_0xd7e2('0x39')]?_0x4fd2f5[_0xd7e2('0x38')]:_0x3ae74f['model'];if(_0x52e800[_0xd7e2('0x32')]['includeAll']){_0x4fd2f5[_0xd7e2('0x47')]=[{'all':!![]}];}_0x4fd2f5=_[_0xd7e2('0x41')]({},_0x4fd2f5,_0x52e800[_0xd7e2('0x42')]);return db['AnalyticExtractedReport'][_0xd7e2('0x48')](_0x4fd2f5)[_0xd7e2('0x24')](handleEntityNotFound(_0x3f4a6a,null))[_0xd7e2('0x24')](respondWithResult(_0x3f4a6a,null))[_0xd7e2('0x49')](handleError(_0x3f4a6a,null));};exports[_0xd7e2('0x4a')]=function(_0x2045f9,_0x2300ee){return db[_0xd7e2('0x2d')][_0xd7e2('0x4a')](_0x2045f9[_0xd7e2('0x4b')],{})[_0xd7e2('0x24')](function(_0x26e039){var _0x4d7210=_0x2045f9[_0xd7e2('0x4c')]['get']({'plain':!![]});if(!_0x4d7210)throw new Error(_0xd7e2('0x4d'));if(_0x4d7210[_0xd7e2('0x4e')]===_0xd7e2('0x4c')){var _0x32b292=_0x26e039[_0xd7e2('0x26')]({'plain':!![]});var _0x927633=_0xd7e2('0x27');return db[_0xd7e2('0x4f')][_0xd7e2('0x48')]({'where':{'name':_0x927633,'userProfileId':_0x4d7210[_0xd7e2('0x50')]},'raw':!![]})['then'](function(_0x5ab4a1){if(_0x5ab4a1&&_0x5ab4a1[_0xd7e2('0x51')]===0x0){return db[_0xd7e2('0x28')][_0xd7e2('0x4a')]({'name':_0x32b292[_0xd7e2('0x2b')],'resourceId':_0x32b292['id'],'type':_0x5ab4a1[_0xd7e2('0x2b')],'sectionId':_0x5ab4a1['id']},{})[_0xd7e2('0x24')](function(){return _0x26e039;});}else{return _0x26e039;}})[_0xd7e2('0x49')](function(_0x4b0090){logger[_0xd7e2('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b0090);throw _0x4b0090;});}return _0x26e039;})['then'](respondWithResult(_0x2300ee,0xc9))[_0xd7e2('0x49')](handleError(_0x2300ee,null));};exports[_0xd7e2('0x52')]=function(_0x3d1542,_0x5c52b8){if(_0x3d1542[_0xd7e2('0x4b')]['id']){delete _0x3d1542['body']['id'];}return db[_0xd7e2('0x2d')]['find']({'where':{'id':_0x3d1542[_0xd7e2('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c52b8,null))[_0xd7e2('0x24')](saveUpdates(_0x3d1542[_0xd7e2('0x4b')],null))['then'](respondWithResult(_0x5c52b8,null))[_0xd7e2('0x49')](handleError(_0x5c52b8,null));};exports[_0xd7e2('0x25')]=function(_0x457bba,_0x3082ab){return db['AnalyticExtractedReport'][_0xd7e2('0x48')]({'where':{'id':_0x457bba[_0xd7e2('0x46')]['id']}})[_0xd7e2('0x24')](handleEntityNotFound(_0x3082ab,null))[_0xd7e2('0x24')](removeEntity(_0x3082ab,null))[_0xd7e2('0x49')](handleError(_0x3082ab,null));};exports[_0xd7e2('0x53')]=function(_0x110bb5,_0x377625,_0x55ea1a){return db[_0xd7e2('0x2d')][_0xd7e2('0x48')]({'where':{'id':_0x110bb5['params']['id']},'attributes':['name',_0xd7e2('0x54'),_0xd7e2('0x55'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x377625,null))[_0xd7e2('0x24')](function(_0x1e43e2){if(_0x1e43e2){if(!fs[_0xd7e2('0x56')](path[_0xd7e2('0x57')](config['root'],_0xd7e2('0x58'),_0x1e43e2[_0xd7e2('0x55')]))){throw new db['Sequelize'][(_0xd7e2('0x59'))](_0xd7e2('0x5a'));}if(_0x110bb5[_0xd7e2('0x32')]['exists']){return _0x377625[_0xd7e2('0x18')](0xc8);}return _0x377625['download'](path[_0xd7e2('0x57')](config[_0xd7e2('0x5b')],_0xd7e2('0x58'),_0x1e43e2[_0xd7e2('0x55')]),util['format'](_0xd7e2('0x5c'),_0x1e43e2[_0xd7e2('0x54')]||_0x1e43e2[_0xd7e2('0x2b')],_0x1e43e2[_0xd7e2('0x5d')][_0xd7e2('0x5e')]()));}})[_0xd7e2('0x49')](handleError(_0x377625,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index bc6d1a3..ee6373d 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 _0x25e9=['../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','api','moment','request-promise','path','rimraf'];(function(_0x25900d,_0x1d3576){var _0x292ad9=function(_0x4a7ccc){while(--_0x4a7ccc){_0x25900d['push'](_0x25900d['shift']());}};_0x292ad9(++_0x1d3576);}(_0x25e9,0xaf));var _0x925e=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x25e9[_0x1147ab];return _0x55cb5a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x925e('0x0'));var moment=require(_0x925e('0x1'));var BPromise=require('bluebird');var rp=require(_0x925e('0x2'));var fs=require('fs');var path=require(_0x925e('0x3'));var rimraf=require(_0x925e('0x4'));var config=require(_0x925e('0x5'));var attributes=require(_0x925e('0x6'));module[_0x925e('0x7')]=function(_0x1049d5,_0x12e5f1){return _0x1049d5[_0x925e('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x925e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3aba=['path','../../config/environment','exports','define','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3103ed,_0x179ff1){var _0x221e31=function(_0x3c8931){while(--_0x3c8931){_0x3103ed['push'](_0x3103ed['shift']());}};_0x221e31(++_0x179ff1);}(_0x3aba,0x1de));var _0xa3ab=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x3aba[_0x3ceb54];return _0x26d8a6;};'use strict';var _=require(_0xa3ab('0x0'));var util=require(_0xa3ab('0x1'));var logger=require('../../config/logger')(_0xa3ab('0x2'));var moment=require(_0xa3ab('0x3'));var BPromise=require(_0xa3ab('0x4'));var rp=require(_0xa3ab('0x5'));var fs=require('fs');var path=require(_0xa3ab('0x6'));var rimraf=require('rimraf');var config=require(_0xa3ab('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xa3ab('0x8')]=function(_0x4ecf6c,_0x548e68){return _0x4ecf6c[_0xa3ab('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xa3ab('0xa'),'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 50d667f..d8146a3 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 _0xa71a=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','lodash'];(function(_0x3873b0,_0x455688){var _0x6fa204=function(_0x560e95){while(--_0x560e95){_0x3873b0['push'](_0x3873b0['shift']());}};_0x6fa204(++_0x455688);}(_0xa71a,0xf1));var _0xaa71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa71a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaa71('0x0'));var util=require(_0xaa71('0x1'));var moment=require(_0xaa71('0x2'));var BPromise=require(_0xaa71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa71('0x4'));var db=require(_0xaa71('0x5'))['db'];var utils=require(_0xaa71('0x6'));var logger=require('../../config/logger')(_0xaa71('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa71('0x8'));var client=jayson[_0xaa71('0x9')][_0xaa71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5893aa,_0x274dce,_0x35b8cf){return new BPromise(function(_0x5a0dca,_0x50ad8f){return client[_0xaa71('0xb')](_0x5893aa,_0x35b8cf)[_0xaa71('0xc')](function(_0xc26148){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x274dce,_0xaa71('0xd'));logger[_0xaa71('0xe')](_0xaa71('0xf'),_0x274dce,_0xaa71('0xd'),JSON[_0xaa71('0x10')](_0xc26148));if(_0xc26148[_0xaa71('0x11')]){if(_0xc26148['error']['code']===0x1f4){logger['error'](_0xaa71('0x12'),_0x274dce,_0xc26148[_0xaa71('0x11')][_0xaa71('0x13')]);return _0x50ad8f(_0xc26148['error'][_0xaa71('0x13')]);}logger[_0xaa71('0x11')](_0xaa71('0x12'),_0x274dce,_0xc26148[_0xaa71('0x11')][_0xaa71('0x13')]);return _0x5a0dca(_0xc26148[_0xaa71('0x11')]['message']);}else{logger[_0xaa71('0x14')](_0xaa71('0x12'),_0x274dce,_0xaa71('0xd'));_0x5a0dca(_0xc26148['result'][_0xaa71('0x13')]);}})[_0xaa71('0x15')](function(_0x25a7ac){logger[_0xaa71('0x11')](_0xaa71('0x12'),_0x274dce,_0x25a7ac);_0x50ad8f(_0x25a7ac);});});}
\ No newline at end of file
+var _0x4f37=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4c4d00,_0x4b1cad){var _0x1a2a84=function(_0x4f6913){while(--_0x4f6913){_0x4c4d00['push'](_0x4c4d00['shift']());}};_0x1a2a84(++_0x4b1cad);}(_0x4f37,0xa4));var _0x74f3=function(_0x328965,_0x1e92ea){_0x328965=_0x328965-0x0;var _0x1b5415=_0x4f37[_0x328965];return _0x1b5415;};'use strict';var _=require(_0x74f3('0x0'));var util=require(_0x74f3('0x1'));var moment=require(_0x74f3('0x2'));var BPromise=require(_0x74f3('0x3'));var rs=require(_0x74f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74f3('0x6'))(_0x74f3('0x7'));var config=require(_0x74f3('0x8'));var jayson=require(_0x74f3('0x9'));var client=jayson['client'][_0x74f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f7004,_0x15c735,_0x1a566a){return new BPromise(function(_0x4c025a,_0x40f01b){return client[_0x74f3('0xb')](_0x1f7004,_0x1a566a)[_0x74f3('0xc')](function(_0x30dc29){logger[_0x74f3('0xd')](_0x74f3('0xe'),_0x15c735,_0x74f3('0xf'));logger[_0x74f3('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x15c735,_0x74f3('0xf'),JSON['stringify'](_0x30dc29));if(_0x30dc29[_0x74f3('0x11')]){if(_0x30dc29['error']['code']===0x1f4){logger[_0x74f3('0x11')](_0x74f3('0xe'),_0x15c735,_0x30dc29['error'][_0x74f3('0x12')]);return _0x40f01b(_0x30dc29[_0x74f3('0x11')][_0x74f3('0x12')]);}logger['error'](_0x74f3('0xe'),_0x15c735,_0x30dc29['error']['message']);return _0x4c025a(_0x30dc29[_0x74f3('0x11')][_0x74f3('0x12')]);}else{logger[_0x74f3('0xd')](_0x74f3('0xe'),_0x15c735,_0x74f3('0xf'));_0x4c025a(_0x30dc29[_0x74f3('0x13')][_0x74f3('0x12')]);}})[_0x74f3('0x14')](function(_0x9553ee){logger['error'](_0x74f3('0xe'),_0x15c735,_0x9553ee);_0x40f01b(_0x9553ee);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 68d5e0a..1718766 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 _0x599f=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x12aa5b,_0x36424a){var _0x34fb62=function(_0x59fa6d){while(--_0x59fa6d){_0x12aa5b['push'](_0x12aa5b['shift']());}};_0x34fb62(++_0x36424a);}(_0x599f,0x167));var _0xf599=function(_0x57f6db,_0x28c6c5){_0x57f6db=_0x57f6db-0x0;var _0x44d061=_0x599f[_0x57f6db];return _0x44d061;};'use strict';var multer=require(_0xf599('0x0'));var util=require(_0xf599('0x1'));var path=require('path');var timeout=require(_0xf599('0x2'));var express=require(_0xf599('0x3'));var router=express[_0xf599('0x4')]();var fs_extra=require(_0xf599('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf599('0x6'));var config=require(_0xf599('0x7'));var controller=require(_0xf599('0x8'));router[_0xf599('0x9')]('/',auth[_0xf599('0xa')](),controller[_0xf599('0xb')]);router['get'](_0xf599('0xc'),auth[_0xf599('0xa')](),controller[_0xf599('0xd')]);router[_0xf599('0x9')](_0xf599('0xe'),auth['isAuthenticated'](),controller[_0xf599('0xf')]);router[_0xf599('0x10')]('/',auth[_0xf599('0xa')](),controller[_0xf599('0x11')]);router[_0xf599('0x12')](_0xf599('0xc'),auth[_0xf599('0xa')](),controller[_0xf599('0x13')]);router[_0xf599('0x14')](_0xf599('0xc'),auth[_0xf599('0xa')](),controller[_0xf599('0x15')]);module[_0xf599('0x16')]=router;
\ No newline at end of file
+var _0x2de3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x32cdda,_0x301ef2){var _0x4db898=function(_0x3f1378){while(--_0x3f1378){_0x32cdda['push'](_0x32cdda['shift']());}};_0x4db898(++_0x301ef2);}(_0x2de3,0x7f));var _0x32de=function(_0x5d2b3d,_0x261350){_0x5d2b3d=_0x5d2b3d-0x0;var _0x58dd7c=_0x2de3[_0x5d2b3d];return _0x58dd7c;};'use strict';var multer=require(_0x32de('0x0'));var util=require(_0x32de('0x1'));var path=require(_0x32de('0x2'));var timeout=require(_0x32de('0x3'));var express=require(_0x32de('0x4'));var router=express[_0x32de('0x5')]();var fs_extra=require(_0x32de('0x6'));var auth=require(_0x32de('0x7'));var interaction=require(_0x32de('0x8'));var config=require(_0x32de('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0x32de('0xa')]('/',auth['isAuthenticated'](),controller[_0x32de('0xb')]);router[_0x32de('0xa')](_0x32de('0xc'),auth[_0x32de('0xd')](),controller[_0x32de('0xe')]);router[_0x32de('0xa')](_0x32de('0xf'),auth[_0x32de('0xd')](),controller['download']);router[_0x32de('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32de('0x11')](_0x32de('0xc'),auth[_0x32de('0xd')](),controller[_0x32de('0x12')]);router[_0x32de('0x13')](_0x32de('0xc'),auth[_0x32de('0xd')](),controller[_0x32de('0x14')]);module[_0x32de('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 900eeb0..a4d79af 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 _0xc582=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0xe84d45,_0x59d7cf){var _0x41d88e=function(_0x270741){while(--_0x270741){_0xe84d45['push'](_0xe84d45['shift']());}};_0x41d88e(++_0x59d7cf);}(_0xc582,0x7d));var _0x2c58=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xc582[_0x725b8e];return _0x43ac45;};'use strict';var Sequelize=require(_0x2c58('0x0'));module[_0x2c58('0x1')]={'field':{'type':Sequelize[_0x2c58('0x2')]},'alias':{'type':Sequelize[_0x2c58('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x2c58('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2c58('0x3')]},'custom':{'type':Sequelize[_0x2c58('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7ba6=['sequelize','STRING','BOOLEAN'];(function(_0x442f5e,_0x702585){var _0xdd19c5=function(_0x3b1d26){while(--_0x3b1d26){_0x442f5e['push'](_0x442f5e['shift']());}};_0xdd19c5(++_0x702585);}(_0x7ba6,0x9f));var _0x67ba=function(_0x138644,_0x429855){_0x138644=_0x138644-0x0;var _0x5c2f82=_0x7ba6[_0x138644];return _0x5c2f82;};'use strict';var Sequelize=require(_0x67ba('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x67ba('0x1')]},'function':{'type':Sequelize[_0x67ba('0x1')]},'format':{'type':Sequelize[_0x67ba('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x67ba('0x1')]},'custom':{'type':Sequelize[_0x67ba('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 7f9387f..57e9f6e 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 _0x1b89=['apply','save','update','destroy','error','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','name','options','where','then','include','findAll','catch','show','params','fields','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count'];(function(_0x3392df,_0x53b20f){var _0x3e5a91=function(_0xb90478){while(--_0xb90478){_0x3392df['push'](_0x3392df['shift']());}};_0x3e5a91(++_0x53b20f);}(_0x1b89,0xd4));var _0x91b8=function(_0x53b78f,_0x397490){_0x53b78f=_0x53b78f-0x0;var _0x2241a9=_0x1b89[_0x53b78f];return _0x2241a9;};'use strict';var emlformat=require(_0x91b8('0x0'));var rimraf=require(_0x91b8('0x1'));var zipdir=require(_0x91b8('0x2'));var jsonpatch=require(_0x91b8('0x3'));var rp=require('request-promise');var moment=require(_0x91b8('0x4'));var BPromise=require(_0x91b8('0x5'));var Mustache=require(_0x91b8('0x6'));var util=require(_0x91b8('0x7'));var path=require(_0x91b8('0x8'));var sox=require(_0x91b8('0x9'));var csv=require(_0x91b8('0xa'));var ejs=require(_0x91b8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x91b8('0xc'));var crypto=require(_0x91b8('0xd'));var jsforce=require(_0x91b8('0xe'));var deskjs=require(_0x91b8('0xf'));var toCsv=require(_0x91b8('0xa'));var querystring=require(_0x91b8('0x10'));var Papa=require(_0x91b8('0x11'));var Redis=require(_0x91b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x91b8('0x13'));var as=require(_0x91b8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x91b8('0x15'));var utils=require(_0x91b8('0x16'));var config=require(_0x91b8('0x17'));var licenseUtil=require(_0x91b8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b095f,_0x2cb198){_0x2cb198=_0x2cb198||0xcc;return function(_0x2d5e0f){if(_0x2d5e0f){return _0x2b095f[_0x91b8('0x19')](_0x2cb198);}return _0x2b095f[_0x91b8('0x1a')](_0x2cb198)[_0x91b8('0x1b')]();};}function respondWithResult(_0x5461e9,_0x291607){_0x291607=_0x291607||0xc8;return function(_0x12c107){if(_0x12c107){return _0x5461e9[_0x91b8('0x1a')](_0x291607)['json'](_0x12c107);}};}function respondWithFilteredResult(_0x4522e6,_0x1f7dff){return function(_0x16a4fb){if(_0x16a4fb){var _0x3b5b7e=typeof _0x1f7dff[_0x91b8('0x1c')]===_0x91b8('0x1d')&&typeof _0x1f7dff['limit']===_0x91b8('0x1d');var _0x34a60a=_0x16a4fb[_0x91b8('0x1e')];var _0x5e7e93=_0x3b5b7e?0x0:_0x1f7dff[_0x91b8('0x1c')];var _0x3f5881=_0x3b5b7e?_0x16a4fb[_0x91b8('0x1e')]:_0x1f7dff['offset']+_0x1f7dff['limit'];var _0x5eb50a;if(_0x3f5881>=_0x34a60a){_0x3f5881=_0x34a60a;_0x5eb50a=0xc8;}else{_0x5eb50a=0xce;}_0x4522e6[_0x91b8('0x1a')](_0x5eb50a);return _0x4522e6['set']('Content-Range',_0x5e7e93+'-'+_0x3f5881+'/'+_0x34a60a)['json'](_0x16a4fb);}return null;};}function patchUpdates(_0x50a20e){return function(_0x3b22b0){try{jsonpatch[_0x91b8('0x1f')](_0x3b22b0,_0x50a20e,!![]);}catch(_0x5c7195){return BPromise['reject'](_0x5c7195);}return _0x3b22b0[_0x91b8('0x20')]();};}function saveUpdates(_0x46f5f8,_0x191dd2){return function(_0x168644){if(_0x168644){return _0x168644[_0x91b8('0x21')](_0x46f5f8)['then'](function(_0x1e9a9f){return _0x1e9a9f;});}return null;};}function removeEntity(_0x1710b4,_0x41d557){return function(_0xe1d4e5){if(_0xe1d4e5){return _0xe1d4e5[_0x91b8('0x22')]()['then'](function(){_0x1710b4[_0x91b8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f2129,_0x505430){return function(_0x14efb2){if(!_0x14efb2){_0x4f2129[_0x91b8('0x19')](0x194);}return _0x14efb2;};}function handleError(_0x5a6d3c,_0x26ff69){_0x26ff69=_0x26ff69||0x1f4;return function(_0x2e2d2d){logger[_0x91b8('0x23')](_0x2e2d2d['stack']);if(_0x2e2d2d['name']){delete _0x2e2d2d['name'];}_0x5a6d3c['status'](_0x26ff69)[_0x91b8('0x24')](_0x2e2d2d);};}exports[_0x91b8('0x25')]=function(_0x4fa69e,_0x3557e9){var _0x4114b2={},_0x3daa35={},_0x2d6570={'count':0x0,'rows':[]};var _0x498832=_[_0x91b8('0x26')](db[_0x91b8('0x27')][_0x91b8('0x28')],function(_0x5d0b8d){return{'name':_0x5d0b8d[_0x91b8('0x29')],'type':_0x5d0b8d[_0x91b8('0x2a')]['key']};});_0x3daa35[_0x91b8('0x2b')]=_[_0x91b8('0x26')](_0x498832,'name');_0x3daa35[_0x91b8('0x2c')]=_[_0x91b8('0x2d')](_0x4fa69e[_0x91b8('0x2c')]);_0x3daa35[_0x91b8('0x2e')]=_[_0x91b8('0x2f')](_0x3daa35[_0x91b8('0x2b')],_0x3daa35[_0x91b8('0x2c')]);_0x4114b2[_0x91b8('0x30')]=_[_0x91b8('0x2f')](_0x3daa35[_0x91b8('0x2b')],qs['fields'](_0x4fa69e[_0x91b8('0x2c')]['fields']));_0x4114b2[_0x91b8('0x30')]=_0x4114b2['attributes'][_0x91b8('0x31')]?_0x4114b2[_0x91b8('0x30')]:_0x3daa35[_0x91b8('0x2b')];if(!_0x4fa69e['query'][_0x91b8('0x32')](_0x91b8('0x33'))){_0x4114b2['limit']=qs[_0x91b8('0x34')](_0x4fa69e[_0x91b8('0x2c')][_0x91b8('0x34')]);_0x4114b2[_0x91b8('0x1c')]=qs[_0x91b8('0x1c')](_0x4fa69e[_0x91b8('0x2c')]['offset']);}_0x4114b2[_0x91b8('0x35')]=qs['sort'](_0x4fa69e['query'][_0x91b8('0x36')]);_0x4114b2['where']=qs[_0x91b8('0x2e')](_[_0x91b8('0x37')](_0x4fa69e['query'],_0x3daa35['filters']),_0x498832);if(_0x4fa69e['query'][_0x91b8('0x38')]){_0x4114b2['where']=_[_0x91b8('0x39')](_0x4114b2['where'],{'$or':_[_0x91b8('0x26')](_0x498832,function(_0x2dafc1){if(_0x2dafc1[_0x91b8('0x2a')]!==_0x91b8('0x3a')){var _0xa1b59e={};_0xa1b59e[_0x2dafc1[_0x91b8('0x3b')]]={'$like':'%'+_0x4fa69e[_0x91b8('0x2c')][_0x91b8('0x38')]+'%'};return _0xa1b59e;}})});}_0x4114b2=_[_0x91b8('0x39')]({},_0x4114b2,_0x4fa69e[_0x91b8('0x3c')]);var _0x162a3e={'where':_0x4114b2[_0x91b8('0x3d')]};return db[_0x91b8('0x27')][_0x91b8('0x1e')](_0x162a3e)[_0x91b8('0x3e')](function(_0x47b1db){_0x2d6570['count']=_0x47b1db;if(_0x4fa69e['query']['includeAll']){_0x4114b2[_0x91b8('0x3f')]=[{'all':!![]}];}return db[_0x91b8('0x27')][_0x91b8('0x40')](_0x4114b2);})[_0x91b8('0x3e')](function(_0x5afcdb){_0x2d6570['rows']=_0x5afcdb;return _0x2d6570;})[_0x91b8('0x3e')](respondWithFilteredResult(_0x3557e9,_0x4114b2))[_0x91b8('0x41')](handleError(_0x3557e9,null));};exports[_0x91b8('0x42')]=function(_0x5b3cfb,_0x2d7671){var _0x206bc6={'raw':![],'where':{'id':_0x5b3cfb[_0x91b8('0x43')]['id']}},_0x407b0e={};_0x407b0e[_0x91b8('0x2b')]=_[_0x91b8('0x2d')](db[_0x91b8('0x27')][_0x91b8('0x28')]);_0x407b0e[_0x91b8('0x2c')]=_[_0x91b8('0x2d')](_0x5b3cfb[_0x91b8('0x2c')]);_0x407b0e['filters']=_['intersection'](_0x407b0e['model'],_0x407b0e[_0x91b8('0x2c')]);_0x206bc6[_0x91b8('0x30')]=_['intersection'](_0x407b0e['model'],qs['fields'](_0x5b3cfb[_0x91b8('0x2c')][_0x91b8('0x44')]));_0x206bc6[_0x91b8('0x30')]=_0x206bc6[_0x91b8('0x30')]['length']?_0x206bc6['attributes']:_0x407b0e[_0x91b8('0x2b')];if(_0x5b3cfb['query'][_0x91b8('0x45')]){_0x206bc6['include']=[{'all':!![]}];}_0x206bc6=_[_0x91b8('0x39')]({},_0x206bc6,_0x5b3cfb[_0x91b8('0x3c')]);return db[_0x91b8('0x27')][_0x91b8('0x46')](_0x206bc6)[_0x91b8('0x3e')](handleEntityNotFound(_0x2d7671,null))[_0x91b8('0x3e')](respondWithResult(_0x2d7671,null))[_0x91b8('0x41')](handleError(_0x2d7671,null));};exports[_0x91b8('0x47')]=function(_0x16db68,_0x1c8e8c){return db[_0x91b8('0x27')][_0x91b8('0x47')](_0x16db68[_0x91b8('0x48')],{})[_0x91b8('0x3e')](respondWithResult(_0x1c8e8c,0xc9))[_0x91b8('0x41')](handleError(_0x1c8e8c,null));};exports[_0x91b8('0x49')]=function(_0x192469,_0x4b1419){return db[_0x91b8('0x27')]['bulkCreate'](_0x192469[_0x91b8('0x48')],{'raw':![],'individualHooks':!![]})[_0x91b8('0x3e')](respondWithResult(_0x4b1419,0xc9))[_0x91b8('0x41')](handleError(_0x4b1419,null));};exports['update']=function(_0x4b957c,_0x7c30e3){if(_0x4b957c['body']['id']){delete _0x4b957c['body']['id'];}return db[_0x91b8('0x27')][_0x91b8('0x46')]({'where':{'id':_0x4b957c[_0x91b8('0x43')]['id']}})[_0x91b8('0x3e')](handleEntityNotFound(_0x7c30e3,null))[_0x91b8('0x3e')](saveUpdates(_0x4b957c[_0x91b8('0x48')],null))['then'](respondWithResult(_0x7c30e3,null))['catch'](handleError(_0x7c30e3,null));};exports['destroy']=function(_0x471827,_0x5989bc){return db[_0x91b8('0x27')]['find']({'where':{'id':_0x471827['params']['id']}})[_0x91b8('0x3e')](handleEntityNotFound(_0x5989bc,null))[_0x91b8('0x3e')](removeEntity(_0x5989bc,null))[_0x91b8('0x41')](handleError(_0x5989bc,null));};exports[_0x91b8('0x4a')]=function(_0x1fe784,_0x1cb0f2){return db[_0x91b8('0x27')][_0x91b8('0x22')]({'where':{'id':_0x1fe784[_0x91b8('0x2c')][_0x91b8('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1cb0f2,0xcc))['catch'](handleError(_0x1cb0f2,null));};exports['addFields']=function(_0x1c5866,_0x7ff183,_0x5a63fc){return db[_0x91b8('0x4c')][_0x91b8('0x4d')]({'where':{'id':_0x1c5866[_0x91b8('0x43')]['id']}})[_0x91b8('0x3e')](handleEntityNotFound(_0x7ff183,null))[_0x91b8('0x3e')](function(_0x3d5272){if(_0x3d5272){return db[_0x91b8('0x4e')][_0x91b8('0x4f')](function(_0x4c24a0){return db[_0x91b8('0x27')][_0x91b8('0x22')]({'where':{'CustomReportId':_0x1c5866[_0x91b8('0x43')]['id']},'transaction':_0x4c24a0})['then'](function(_0x48821b){var _0x180631=_[_0x91b8('0x26')](_0x1c5866['body'],function(_0x400380){delete _0x400380['id'];_0x400380[_0x91b8('0x50')]=_0x1c5866[_0x91b8('0x43')]['id'];return _0x400380;});return db[_0x91b8('0x27')][_0x91b8('0x49')](_0x180631,{'transaction':_0x4c24a0});});})['then'](function(){return db[_0x91b8('0x27')][_0x91b8('0x40')]({'where':{'CustomReportId':_0x1c5866['params']['id']}});});}})[_0x91b8('0x3e')](respondWithResult(_0x7ff183,null))[_0x91b8('0x41')](handleError(_0x7ff183,null));};
\ No newline at end of file
+var _0x05b2=['mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','AnalyticFieldReport','include','findAll','rows','show','params','catch','create','bulkCreate','body','find','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x43612a,_0x1f32e8){var _0x2e8dc3=function(_0x56b916){while(--_0x56b916){_0x43612a['push'](_0x43612a['shift']());}};_0x2e8dc3(++_0x1f32e8);}(_0x05b2,0x9d));var _0x205b=function(_0x3d45c8,_0x48c603){_0x3d45c8=_0x3d45c8-0x0;var _0x3957a1=_0x05b2[_0x3d45c8];return _0x3957a1;};'use strict';var emlformat=require(_0x205b('0x0'));var rimraf=require(_0x205b('0x1'));var zipdir=require(_0x205b('0x2'));var jsonpatch=require(_0x205b('0x3'));var rp=require(_0x205b('0x4'));var moment=require(_0x205b('0x5'));var BPromise=require(_0x205b('0x6'));var Mustache=require(_0x205b('0x7'));var util=require(_0x205b('0x8'));var path=require(_0x205b('0x9'));var sox=require(_0x205b('0xa'));var csv=require('to-csv');var ejs=require(_0x205b('0xb'));var fs=require('fs');var fs_extra=require(_0x205b('0xc'));var _=require('lodash');var squel=require(_0x205b('0xd'));var crypto=require('crypto');var jsforce=require(_0x205b('0xe'));var deskjs=require(_0x205b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x205b('0x10'));var Papa=require(_0x205b('0x11'));var Redis=require(_0x205b('0x12'));var authService=require(_0x205b('0x13'));var qs=require(_0x205b('0x14'));var as=require(_0x205b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x205b('0x16'))('api');var utils=require(_0x205b('0x17'));var config=require(_0x205b('0x18'));var licenseUtil=require(_0x205b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102f7a,_0x580658){_0x580658=_0x580658||0xcc;return function(_0x3913e4){if(_0x3913e4){return _0x102f7a[_0x205b('0x1a')](_0x580658);}return _0x102f7a['status'](_0x580658)[_0x205b('0x1b')]();};}function respondWithResult(_0x3d03be,_0x359a6a){_0x359a6a=_0x359a6a||0xc8;return function(_0xa3fbac){if(_0xa3fbac){return _0x3d03be[_0x205b('0x1c')](_0x359a6a)['json'](_0xa3fbac);}};}function respondWithFilteredResult(_0x2cba03,_0x1ef505){return function(_0xb6843d){if(_0xb6843d){var _0x373fe1=typeof _0x1ef505[_0x205b('0x1d')]===_0x205b('0x1e')&&typeof _0x1ef505[_0x205b('0x1f')]===_0x205b('0x1e');var _0x1ae54d=_0xb6843d[_0x205b('0x20')];var _0x12c923=_0x373fe1?0x0:_0x1ef505[_0x205b('0x1d')];var _0x5cb262=_0x373fe1?_0xb6843d[_0x205b('0x20')]:_0x1ef505[_0x205b('0x1d')]+_0x1ef505[_0x205b('0x1f')];var _0x655763;if(_0x5cb262>=_0x1ae54d){_0x5cb262=_0x1ae54d;_0x655763=0xc8;}else{_0x655763=0xce;}_0x2cba03[_0x205b('0x1c')](_0x655763);return _0x2cba03[_0x205b('0x21')](_0x205b('0x22'),_0x12c923+'-'+_0x5cb262+'/'+_0x1ae54d)[_0x205b('0x23')](_0xb6843d);}return null;};}function patchUpdates(_0x41ad31){return function(_0x232ef9){try{jsonpatch[_0x205b('0x24')](_0x232ef9,_0x41ad31,!![]);}catch(_0x3d80f9){return BPromise[_0x205b('0x25')](_0x3d80f9);}return _0x232ef9[_0x205b('0x26')]();};}function saveUpdates(_0x41532a,_0x1fbb99){return function(_0x2e07e1){if(_0x2e07e1){return _0x2e07e1[_0x205b('0x27')](_0x41532a)['then'](function(_0x5ed6ff){return _0x5ed6ff;});}return null;};}function removeEntity(_0x2cb125,_0xffafc5){return function(_0xe973e0){if(_0xe973e0){return _0xe973e0[_0x205b('0x28')]()[_0x205b('0x29')](function(){_0x2cb125[_0x205b('0x1c')](0xcc)[_0x205b('0x1b')]();});}};}function handleEntityNotFound(_0x4c7be8,_0x3e3bf4){return function(_0x413804){if(!_0x413804){_0x4c7be8[_0x205b('0x1a')](0x194);}return _0x413804;};}function handleError(_0xc358d,_0x2c0533){_0x2c0533=_0x2c0533||0x1f4;return function(_0x3c3627){logger[_0x205b('0x2a')](_0x3c3627[_0x205b('0x2b')]);if(_0x3c3627[_0x205b('0x2c')]){delete _0x3c3627[_0x205b('0x2c')];}_0xc358d[_0x205b('0x1c')](_0x2c0533)[_0x205b('0x2d')](_0x3c3627);};}exports[_0x205b('0x2e')]=function(_0x235f15,_0x43f598){var _0x33fbaa={},_0x415f94={},_0x398afd={'count':0x0,'rows':[]};var _0x347324=_[_0x205b('0x2f')](db['AnalyticFieldReport']['rawAttributes'],function(_0x3d1a95){return{'name':_0x3d1a95[_0x205b('0x30')],'type':_0x3d1a95[_0x205b('0x31')][_0x205b('0x32')]};});_0x415f94['model']=_[_0x205b('0x2f')](_0x347324,'name');_0x415f94['query']=_[_0x205b('0x33')](_0x235f15[_0x205b('0x34')]);_0x415f94[_0x205b('0x35')]=_[_0x205b('0x36')](_0x415f94[_0x205b('0x37')],_0x415f94[_0x205b('0x34')]);_0x33fbaa[_0x205b('0x38')]=_[_0x205b('0x36')](_0x415f94[_0x205b('0x37')],qs[_0x205b('0x39')](_0x235f15[_0x205b('0x34')]['fields']));_0x33fbaa['attributes']=_0x33fbaa[_0x205b('0x38')][_0x205b('0x3a')]?_0x33fbaa[_0x205b('0x38')]:_0x415f94[_0x205b('0x37')];if(!_0x235f15[_0x205b('0x34')][_0x205b('0x3b')]('nolimit')){_0x33fbaa[_0x205b('0x1f')]=qs[_0x205b('0x1f')](_0x235f15['query'][_0x205b('0x1f')]);_0x33fbaa[_0x205b('0x1d')]=qs[_0x205b('0x1d')](_0x235f15['query'][_0x205b('0x1d')]);}_0x33fbaa[_0x205b('0x3c')]=qs[_0x205b('0x3d')](_0x235f15[_0x205b('0x34')][_0x205b('0x3d')]);_0x33fbaa[_0x205b('0x3e')]=qs[_0x205b('0x35')](_[_0x205b('0x3f')](_0x235f15['query'],_0x415f94[_0x205b('0x35')]),_0x347324);if(_0x235f15[_0x205b('0x34')][_0x205b('0x40')]){_0x33fbaa[_0x205b('0x3e')]=_[_0x205b('0x41')](_0x33fbaa[_0x205b('0x3e')],{'$or':_['map'](_0x347324,function(_0x1210e5){if(_0x1210e5['type']!=='VIRTUAL'){var _0x34231d={};_0x34231d[_0x1210e5['name']]={'$like':'%'+_0x235f15[_0x205b('0x34')][_0x205b('0x40')]+'%'};return _0x34231d;}})});}_0x33fbaa=_[_0x205b('0x41')]({},_0x33fbaa,_0x235f15[_0x205b('0x42')]);var _0x9755c7={'where':_0x33fbaa[_0x205b('0x3e')]};return db[_0x205b('0x43')][_0x205b('0x20')](_0x9755c7)['then'](function(_0x336f04){_0x398afd[_0x205b('0x20')]=_0x336f04;if(_0x235f15[_0x205b('0x34')]['includeAll']){_0x33fbaa[_0x205b('0x44')]=[{'all':!![]}];}return db[_0x205b('0x43')][_0x205b('0x45')](_0x33fbaa);})[_0x205b('0x29')](function(_0x429076){_0x398afd[_0x205b('0x46')]=_0x429076;return _0x398afd;})[_0x205b('0x29')](respondWithFilteredResult(_0x43f598,_0x33fbaa))['catch'](handleError(_0x43f598,null));};exports[_0x205b('0x47')]=function(_0x2dda47,_0x4e631e){var _0x2834f2={'raw':![],'where':{'id':_0x2dda47[_0x205b('0x48')]['id']}},_0x271583={};_0x271583['model']=_[_0x205b('0x33')](db['AnalyticFieldReport']['rawAttributes']);_0x271583[_0x205b('0x34')]=_[_0x205b('0x33')](_0x2dda47[_0x205b('0x34')]);_0x271583[_0x205b('0x35')]=_['intersection'](_0x271583['model'],_0x271583[_0x205b('0x34')]);_0x2834f2[_0x205b('0x38')]=_['intersection'](_0x271583[_0x205b('0x37')],qs[_0x205b('0x39')](_0x2dda47['query']['fields']));_0x2834f2[_0x205b('0x38')]=_0x2834f2[_0x205b('0x38')]['length']?_0x2834f2['attributes']:_0x271583[_0x205b('0x37')];if(_0x2dda47['query']['includeAll']){_0x2834f2[_0x205b('0x44')]=[{'all':!![]}];}_0x2834f2=_['merge']({},_0x2834f2,_0x2dda47[_0x205b('0x42')]);return db[_0x205b('0x43')]['find'](_0x2834f2)[_0x205b('0x29')](handleEntityNotFound(_0x4e631e,null))[_0x205b('0x29')](respondWithResult(_0x4e631e,null))[_0x205b('0x49')](handleError(_0x4e631e,null));};exports[_0x205b('0x4a')]=function(_0x197633,_0x37433d){return db[_0x205b('0x43')][_0x205b('0x4a')](_0x197633['body'],{})[_0x205b('0x29')](respondWithResult(_0x37433d,0xc9))['catch'](handleError(_0x37433d,null));};exports[_0x205b('0x4b')]=function(_0x2686c5,_0x269faf){return db['AnalyticFieldReport'][_0x205b('0x4b')](_0x2686c5[_0x205b('0x4c')],{'raw':![],'individualHooks':!![]})[_0x205b('0x29')](respondWithResult(_0x269faf,0xc9))['catch'](handleError(_0x269faf,null));};exports[_0x205b('0x27')]=function(_0x56445b,_0x1b455c){if(_0x56445b['body']['id']){delete _0x56445b[_0x205b('0x4c')]['id'];}return db['AnalyticFieldReport'][_0x205b('0x4d')]({'where':{'id':_0x56445b[_0x205b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b455c,null))[_0x205b('0x29')](saveUpdates(_0x56445b[_0x205b('0x4c')],null))[_0x205b('0x29')](respondWithResult(_0x1b455c,null))['catch'](handleError(_0x1b455c,null));};exports[_0x205b('0x28')]=function(_0x1d0a42,_0x36c67d){return db[_0x205b('0x43')][_0x205b('0x4d')]({'where':{'id':_0x1d0a42[_0x205b('0x48')]['id']}})[_0x205b('0x29')](handleEntityNotFound(_0x36c67d,null))[_0x205b('0x29')](removeEntity(_0x36c67d,null))[_0x205b('0x49')](handleError(_0x36c67d,null));};exports['bulkDestroy']=function(_0x39e515,_0x49babb){return db['AnalyticFieldReport'][_0x205b('0x28')]({'where':{'id':_0x39e515[_0x205b('0x34')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x49babb,0xcc))[_0x205b('0x49')](handleError(_0x49babb,null));};exports[_0x205b('0x4e')]=function(_0x8b0045,_0x33151c,_0x4ba454){return db[_0x205b('0x4f')][_0x205b('0x50')]({'where':{'id':_0x8b0045[_0x205b('0x48')]['id']}})[_0x205b('0x29')](handleEntityNotFound(_0x33151c,null))[_0x205b('0x29')](function(_0x1c1a1f){if(_0x1c1a1f){return db[_0x205b('0x51')]['transaction'](function(_0x39b869){return db[_0x205b('0x43')][_0x205b('0x28')]({'where':{'CustomReportId':_0x8b0045[_0x205b('0x48')]['id']},'transaction':_0x39b869})[_0x205b('0x29')](function(_0x314c48){var _0x3db47a=_[_0x205b('0x2f')](_0x8b0045[_0x205b('0x4c')],function(_0x15facc){delete _0x15facc['id'];_0x15facc['CustomReportId']=_0x8b0045['params']['id'];return _0x15facc;});return db[_0x205b('0x43')][_0x205b('0x4b')](_0x3db47a,{'transaction':_0x39b869});});})['then'](function(){return db[_0x205b('0x43')][_0x205b('0x45')]({'where':{'CustomReportId':_0x8b0045[_0x205b('0x48')]['id']}});});}})[_0x205b('0x29')](respondWithResult(_0x33151c,null))['catch'](handleError(_0x33151c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index c5181e0..348855f 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 _0x8ae4=['exports','define','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8ae4,0x199));var _0x48ae=function(_0x519040,_0x297eeb){_0x519040=_0x519040-0x0;var _0x4a107b=_0x8ae4[_0x519040];return _0x4a107b;};'use strict';var _=require('lodash');var util=require(_0x48ae('0x0'));var logger=require(_0x48ae('0x1'))(_0x48ae('0x2'));var moment=require(_0x48ae('0x3'));var BPromise=require('bluebird');var rp=require(_0x48ae('0x4'));var fs=require('fs');var path=require(_0x48ae('0x5'));var rimraf=require(_0x48ae('0x6'));var config=require(_0x48ae('0x7'));var attributes=require(_0x48ae('0x8'));module[_0x48ae('0x9')]=function(_0x46037a,_0x5c5b6f){return _0x46037a[_0x48ae('0xa')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8351=['exports','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x3d9b04,_0x1e851a){var _0x557936=function(_0x3bf3ae){while(--_0x3bf3ae){_0x3d9b04['push'](_0x3d9b04['shift']());}};_0x557936(++_0x1e851a);}(_0x8351,0x15f));var _0x1835=function(_0x171da3,_0x5d50c5){_0x171da3=_0x171da3-0x0;var _0x3e0fb7=_0x8351[_0x171da3];return _0x3e0fb7;};'use strict';var _=require('lodash');var util=require(_0x1835('0x0'));var logger=require(_0x1835('0x1'))(_0x1835('0x2'));var moment=require(_0x1835('0x3'));var BPromise=require(_0x1835('0x4'));var rp=require(_0x1835('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1835('0x6'));var config=require(_0x1835('0x7'));var attributes=require(_0x1835('0x8'));module[_0x1835('0x9')]=function(_0x51dd95,_0x4d2e25){return _0x51dd95['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 1f1909b..e31210a 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 _0x9f39=['rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','AnalyticFieldReport,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xa5302,_0x356b3c){var _0x45dc96=function(_0x390c6d){while(--_0x390c6d){_0xa5302['push'](_0xa5302['shift']());}};_0x45dc96(++_0x356b3c);}(_0x9f39,0x181));var _0x99f3=function(_0x20cfe8,_0x2c0b5b){_0x20cfe8=_0x20cfe8-0x0;var _0x3c4d66=_0x9f39[_0x20cfe8];return _0x3c4d66;};'use strict';var _=require(_0x99f3('0x0'));var util=require(_0x99f3('0x1'));var moment=require(_0x99f3('0x2'));var BPromise=require('bluebird');var rs=require(_0x99f3('0x3'));var fs=require('fs');var Redis=require(_0x99f3('0x4'));var db=require(_0x99f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x99f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x99f3('0x7'));var client=jayson[_0x99f3('0x8')][_0x99f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12ab8e,_0x143a47,_0x2f77e5){return new BPromise(function(_0x3244d0,_0x1e601a){return client[_0x99f3('0xa')](_0x12ab8e,_0x2f77e5)[_0x99f3('0xb')](function(_0x29ea88){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x143a47,_0x99f3('0xc'));logger[_0x99f3('0xd')](_0x99f3('0xe'),_0x143a47,_0x99f3('0xc'),JSON[_0x99f3('0xf')](_0x29ea88));if(_0x29ea88['error']){if(_0x29ea88['error'][_0x99f3('0x10')]===0x1f4){logger[_0x99f3('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x143a47,_0x29ea88['error'][_0x99f3('0x12')]);return _0x1e601a(_0x29ea88[_0x99f3('0x11')]['message']);}logger[_0x99f3('0x11')](_0x99f3('0x13'),_0x143a47,_0x29ea88['error'][_0x99f3('0x12')]);return _0x3244d0(_0x29ea88['error'][_0x99f3('0x12')]);}else{logger[_0x99f3('0x14')](_0x99f3('0x13'),_0x143a47,'request\x20sent');_0x3244d0(_0x29ea88[_0x99f3('0x15')][_0x99f3('0x12')]);}})[_0x99f3('0x16')](function(_0x3d3df8){logger['error'](_0x99f3('0x13'),_0x143a47,_0x3d3df8);_0x1e601a(_0x3d3df8);});});}
\ No newline at end of file
+var _0x27f3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x27f3,0x11e));var _0x327f=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x27f3[_0x2cfb48];return _0xc4594f;};'use strict';var _=require(_0x327f('0x0'));var util=require(_0x327f('0x1'));var moment=require(_0x327f('0x2'));var BPromise=require(_0x327f('0x3'));var rs=require(_0x327f('0x4'));var fs=require('fs');var Redis=require(_0x327f('0x5'));var db=require(_0x327f('0x6'))['db'];var utils=require(_0x327f('0x7'));var logger=require(_0x327f('0x8'))(_0x327f('0x9'));var config=require(_0x327f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x327f('0xb')][_0x327f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11c911,_0x52837d,_0x550b49){return new BPromise(function(_0x3a3b6a,_0x5b1ff2){return client[_0x327f('0xd')](_0x11c911,_0x550b49)[_0x327f('0xe')](function(_0x2cc6a9){logger['info'](_0x327f('0xf'),_0x52837d,_0x327f('0x10'));logger[_0x327f('0x11')](_0x327f('0x12'),_0x52837d,_0x327f('0x10'),JSON[_0x327f('0x13')](_0x2cc6a9));if(_0x2cc6a9[_0x327f('0x14')]){if(_0x2cc6a9[_0x327f('0x14')][_0x327f('0x15')]===0x1f4){logger[_0x327f('0x14')](_0x327f('0xf'),_0x52837d,_0x2cc6a9[_0x327f('0x14')][_0x327f('0x16')]);return _0x5b1ff2(_0x2cc6a9['error']['message']);}logger[_0x327f('0x14')](_0x327f('0xf'),_0x52837d,_0x2cc6a9[_0x327f('0x14')][_0x327f('0x16')]);return _0x3a3b6a(_0x2cc6a9['error'][_0x327f('0x16')]);}else{logger[_0x327f('0x17')](_0x327f('0xf'),_0x52837d,_0x327f('0x10'));_0x3a3b6a(_0x2cc6a9[_0x327f('0x18')][_0x327f('0x16')]);}})[_0x327f('0x19')](function(_0xbf4e96){logger['error'](_0x327f('0xf'),_0x52837d,_0xbf4e96);_0x5b1ff2(_0xbf4e96);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 7db6517..8195ed1 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(_0x50c11b,_0x848d6f){var _0x46d2d0=function(_0x18061c){while(--_0x18061c){_0x50c11b['push'](_0x50c11b['shift']());}};_0x46d2d0(++_0x848d6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x161365,_0x5cf127){var _0x2aa8ee=function(_0x21b41d){while(--_0x21b41d){_0x161365['push'](_0x161365['shift']());}};_0x2aa8ee(++_0x5cf127);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 aeab067..92e080c 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 _0xd136=['TEXT','exports','STRING'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd136,0x94));var _0x6d13=function(_0xc3cd30,_0x49fce6){_0xc3cd30=_0xc3cd30-0x0;var _0x87cfdb=_0xd136[_0xc3cd30];return _0x87cfdb;};'use strict';var Sequelize=require('sequelize');module[_0x6d13('0x0')]={'name':{'type':Sequelize[_0x6d13('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x6d13('0x1')]},'metric':{'type':Sequelize[_0x6d13('0x2')]},'description':{'type':Sequelize[_0x6d13('0x1')]}};
\ No newline at end of file
+var _0xe0dd=['sequelize','exports','name','STRING','TEXT'];(function(_0x30aa4d,_0x2b360f){var _0x16fc87=function(_0x5c8565){while(--_0x5c8565){_0x30aa4d['push'](_0x30aa4d['shift']());}};_0x16fc87(++_0x2b360f);}(_0xe0dd,0x163));var _0xde0d=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0xe0dd[_0x4191af];return _0x27bebf;};'use strict';var Sequelize=require(_0xde0d('0x0'));module[_0xde0d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde0d('0x2')},'table':{'type':Sequelize[_0xde0d('0x3')]},'metric':{'type':Sequelize[_0xde0d('0x4')]},'description':{'type':Sequelize[_0xde0d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index bfcbdd8..9f1e9b2 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 _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x27fdcc,_0x421cb5){var _0x17c2de=function(_0x2fa372){while(--_0x2fa372){_0x27fdcc['push'](_0x27fdcc['shift']());}};_0x17c2de(++_0x421cb5);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5833aa,_0x2cc4b1){_0x5833aa=_0x5833aa-0x0;var _0x3a76cd=_0x8d0e[_0x5833aa];return _0x3a76cd;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
+var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x37d58b,_0x3d5801){var _0x34376d=function(_0x127847){while(--_0x127847){_0x37d58b['push'](_0x37d58b['shift']());}};_0x34376d(++_0x3d5801);}(_0xdc97,0x13b));var _0x7dc9=function(_0x191b27,_0x8dde7){_0x191b27=_0x191b27-0x0;var _0x3f2793=_0xdc97[_0x191b27];return _0x3f2793;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index da61479..0cd12d0 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 _0xc029=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x5d370a,_0x55fa3f){var _0x3777a0=function(_0x9c9467){while(--_0x9c9467){_0x5d370a['push'](_0x5d370a['shift']());}};_0x3777a0(++_0x55fa3f);}(_0xc029,0x1df));var _0x9c02=function(_0x242d17,_0x30a922){_0x242d17=_0x242d17-0x0;var _0x501a6d=_0xc029[_0x242d17];return _0x501a6d;};'use strict';var _=require(_0x9c02('0x0'));var util=require(_0x9c02('0x1'));var logger=require(_0x9c02('0x2'))(_0x9c02('0x3'));var moment=require(_0x9c02('0x4'));var BPromise=require(_0x9c02('0x5'));var rp=require(_0x9c02('0x6'));var fs=require('fs');var path=require(_0x9c02('0x7'));var rimraf=require(_0x9c02('0x8'));var config=require(_0x9c02('0x9'));var attributes=require(_0x9c02('0xa'));module[_0x9c02('0xb')]=function(_0x18792d,_0x14c7f8){return _0x18792d[_0x9c02('0xc')](_0x9c02('0xd'),attributes,{'tableName':_0x9c02('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x51f2=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x51f2,0xeb));var _0x251f=function(_0x140229,_0x1d3313){_0x140229=_0x140229-0x0;var _0x1d61b4=_0x51f2[_0x140229];return _0x1d61b4;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var logger=require(_0x251f('0x2'))(_0x251f('0x3'));var moment=require(_0x251f('0x4'));var BPromise=require(_0x251f('0x5'));var rp=require(_0x251f('0x6'));var fs=require('fs');var path=require(_0x251f('0x7'));var rimraf=require(_0x251f('0x8'));var config=require('../../config/environment');var attributes=require(_0x251f('0x9'));module[_0x251f('0xa')]=function(_0x145630,_0xd9d8e1){return _0x145630[_0x251f('0xb')]('AnalyticMetric',attributes,{'tableName':_0x251f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 0128c58..82410d8 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 _0xf762=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x43daa8,_0x2b964e){var _0x42a182=function(_0x16a94b){while(--_0x16a94b){_0x43daa8['push'](_0x43daa8['shift']());}};_0x42a182(++_0x2b964e);}(_0xf762,0xc4));var _0x2f76=function(_0x5d1ab5,_0x10d200){_0x5d1ab5=_0x5d1ab5-0x0;var _0x5a8844=_0xf762[_0x5d1ab5];return _0x5a8844;};'use strict';var _=require(_0x2f76('0x0'));var util=require(_0x2f76('0x1'));var moment=require(_0x2f76('0x2'));var BPromise=require(_0x2f76('0x3'));var rs=require(_0x2f76('0x4'));var fs=require('fs');var Redis=require(_0x2f76('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f76('0x6'));var logger=require(_0x2f76('0x7'))(_0x2f76('0x8'));var config=require(_0x2f76('0x9'));var jayson=require(_0x2f76('0xa'));var client=jayson['client'][_0x2f76('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xacff24,_0x27dcd2,_0x54fce7){return new BPromise(function(_0x5327c6,_0x32ee8d){return client[_0x2f76('0xc')](_0xacff24,_0x54fce7)[_0x2f76('0xd')](function(_0x54dc6a){logger[_0x2f76('0xe')](_0x2f76('0xf'),_0x27dcd2,_0x2f76('0x10'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x27dcd2,_0x2f76('0x10'),JSON[_0x2f76('0x11')](_0x54dc6a));if(_0x54dc6a[_0x2f76('0x12')]){if(_0x54dc6a[_0x2f76('0x12')][_0x2f76('0x13')]===0x1f4){logger['error'](_0x2f76('0xf'),_0x27dcd2,_0x54dc6a[_0x2f76('0x12')][_0x2f76('0x14')]);return _0x32ee8d(_0x54dc6a[_0x2f76('0x12')]['message']);}logger[_0x2f76('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x27dcd2,_0x54dc6a[_0x2f76('0x12')]['message']);return _0x5327c6(_0x54dc6a[_0x2f76('0x12')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x27dcd2,'request\x20sent');_0x5327c6(_0x54dc6a['result']['message']);}})[_0x2f76('0x15')](function(_0x804a23){logger[_0x2f76('0x12')](_0x2f76('0xf'),_0x27dcd2,_0x804a23);_0x32ee8d(_0x804a23);});});}
\ No newline at end of file
+var _0x3a91=['client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x3a91,0x109));var _0x13a9=function(_0x4353cd,_0x45e37e){_0x4353cd=_0x4353cd-0x0;var _0xa3479e=_0x3a91[_0x4353cd];return _0xa3479e;};'use strict';var _=require(_0x13a9('0x0'));var util=require(_0x13a9('0x1'));var moment=require(_0x13a9('0x2'));var BPromise=require(_0x13a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13a9('0x4'));var db=require(_0x13a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13a9('0x6'));var config=require('../../config/environment');var jayson=require(_0x13a9('0x7'));var client=jayson[_0x13a9('0x8')][_0x13a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x645573,_0x48a2c1,_0x4a589f){return new BPromise(function(_0x4fedc0,_0x3b3912){return client[_0x13a9('0xa')](_0x645573,_0x4a589f)[_0x13a9('0xb')](function(_0x30d65e){logger[_0x13a9('0xc')](_0x13a9('0xd'),_0x48a2c1,_0x13a9('0xe'));logger[_0x13a9('0xf')](_0x13a9('0x10'),_0x48a2c1,_0x13a9('0xe'),JSON[_0x13a9('0x11')](_0x30d65e));if(_0x30d65e[_0x13a9('0x12')]){if(_0x30d65e[_0x13a9('0x12')]['code']===0x1f4){logger[_0x13a9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x48a2c1,_0x30d65e[_0x13a9('0x12')][_0x13a9('0x13')]);return _0x3b3912(_0x30d65e[_0x13a9('0x12')][_0x13a9('0x13')]);}logger[_0x13a9('0x12')](_0x13a9('0xd'),_0x48a2c1,_0x30d65e[_0x13a9('0x12')][_0x13a9('0x13')]);return _0x4fedc0(_0x30d65e[_0x13a9('0x12')][_0x13a9('0x13')]);}else{logger[_0x13a9('0xc')](_0x13a9('0xd'),_0x48a2c1,_0x13a9('0xe'));_0x4fedc0(_0x30d65e[_0x13a9('0x14')][_0x13a9('0x13')]);}})['catch'](function(_0x225489){logger[_0x13a9('0x12')](_0x13a9('0xd'),_0x48a2c1,_0x225489);_0x3b3912(_0x225489);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index e8b55d2..ad0d5d3 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 _0x8ba0=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x545df9,_0x316006){var _0x1e9330=function(_0x3643a5){while(--_0x3643a5){_0x545df9['push'](_0x545df9['shift']());}};_0x1e9330(++_0x316006);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x3e8455,_0x401fa1){_0x3e8455=_0x3e8455-0x0;var _0x5537bf=_0x8ba0[_0x3e8455];return _0x5537bf;};'use strict';var multer=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var path=require(_0x08ba('0x2'));var timeout=require(_0x08ba('0x3'));var express=require(_0x08ba('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x08ba('0x5'));var interaction=require(_0x08ba('0x6'));var config=require(_0x08ba('0x7'));var controller=require(_0x08ba('0x8'));router[_0x08ba('0x9')]('/',auth[_0x08ba('0xa')](),controller['index']);router[_0x08ba('0x9')](_0x08ba('0xb'),auth[_0x08ba('0xa')](),controller[_0x08ba('0xc')]);router[_0x08ba('0xd')]('/',auth['isAuthenticated'](),controller[_0x08ba('0xe')]);router['put'](_0x08ba('0xb'),auth['isAuthenticated'](),controller[_0x08ba('0xf')]);router[_0x08ba('0x10')](_0x08ba('0xb'),auth[_0x08ba('0xa')](),controller[_0x08ba('0x11')]);module[_0x08ba('0x12')]=router;
\ No newline at end of file
+var _0xf3ff=['../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','show','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0xf3ff,0xae));var _0xff3f=function(_0x47d662,_0x4f328d){_0x47d662=_0x47d662-0x0;var _0x348d6e=_0xf3ff[_0x47d662];return _0x348d6e;};'use strict';var multer=require(_0xff3f('0x0'));var util=require('util');var path=require(_0xff3f('0x1'));var timeout=require(_0xff3f('0x2'));var express=require(_0xff3f('0x3'));var router=express[_0xff3f('0x4')]();var fs_extra=require(_0xff3f('0x5'));var auth=require(_0xff3f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff3f('0x7'));var controller=require(_0xff3f('0x8'));router[_0xff3f('0x9')]('/',auth['isAuthenticated'](),controller[_0xff3f('0xa')]);router[_0xff3f('0x9')]('/:id',auth[_0xff3f('0xb')](),controller[_0xff3f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xff3f('0xd')]('/:id',auth[_0xff3f('0xb')](),controller['update']);router[_0xff3f('0xe')](_0xff3f('0xf'),auth[_0xff3f('0xb')](),controller[_0xff3f('0x10')]);module[_0xff3f('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 0710458..73b7003 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 _0x056e=['exports'];(function(_0x55b7f5,_0x156133){var _0x16e474=function(_0x5951ad){while(--_0x5951ad){_0x55b7f5['push'](_0x55b7f5['shift']());}};_0x16e474(++_0x156133);}(_0x056e,0xb9));var _0xe056=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x056e[_0x243217];return _0x478029;};'use strict';var Sequelize=require('sequelize');module[_0xe056('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x9a6c=['exports','TEXT','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9a6c,0xb0));var _0xc9a6=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9a6c[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0xc9a6('0x0'));module[_0xc9a6('0x1')]={'tree':{'type':Sequelize[_0xc9a6('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 a4a1d4a..2c0ae59 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 _0x2920=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','index','map','AnalyticTreeReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x462805,_0x330178){var _0x13a39e=function(_0xbbaaa7){while(--_0xbbaaa7){_0x462805['push'](_0x462805['shift']());}};_0x13a39e(++_0x330178);}(_0x2920,0x11f));var _0x0292=function(_0x5896bb,_0x6e6003){_0x5896bb=_0x5896bb-0x0;var _0xebb9d1=_0x2920[_0x5896bb];return _0xebb9d1;};'use strict';var emlformat=require(_0x0292('0x0'));var rimraf=require(_0x0292('0x1'));var zipdir=require(_0x0292('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0292('0x3'));var moment=require(_0x0292('0x4'));var BPromise=require(_0x0292('0x5'));var Mustache=require(_0x0292('0x6'));var util=require('util');var path=require(_0x0292('0x7'));var sox=require(_0x0292('0x8'));var csv=require(_0x0292('0x9'));var ejs=require(_0x0292('0xa'));var fs=require('fs');var fs_extra=require(_0x0292('0xb'));var _=require(_0x0292('0xc'));var squel=require(_0x0292('0xd'));var crypto=require('crypto');var jsforce=require(_0x0292('0xe'));var deskjs=require(_0x0292('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0292('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0292('0x11'));var hardwareService=require(_0x0292('0x12'));var logger=require(_0x0292('0x13'))(_0x0292('0x14'));var utils=require(_0x0292('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0292('0x16'));var db=require(_0x0292('0x17'))['db'];function respondWithStatusCode(_0x3596e7,_0x1b00f9){_0x1b00f9=_0x1b00f9||0xcc;return function(_0x52cb0d){if(_0x52cb0d){return _0x3596e7[_0x0292('0x18')](_0x1b00f9);}return _0x3596e7['status'](_0x1b00f9)[_0x0292('0x19')]();};}function respondWithResult(_0x331bff,_0x4a6713){_0x4a6713=_0x4a6713||0xc8;return function(_0x8e9fb2){if(_0x8e9fb2){return _0x331bff[_0x0292('0x1a')](_0x4a6713)[_0x0292('0x1b')](_0x8e9fb2);}};}function respondWithFilteredResult(_0x64a46b,_0x12f046){return function(_0x45aff3){if(_0x45aff3){var _0x3d46f6=typeof _0x12f046[_0x0292('0x1c')]===_0x0292('0x1d')&&typeof _0x12f046[_0x0292('0x1e')]==='undefined';var _0x235f97=_0x45aff3[_0x0292('0x1f')];var _0x322aab=_0x3d46f6?0x0:_0x12f046[_0x0292('0x1c')];var _0x12ce10=_0x3d46f6?_0x45aff3[_0x0292('0x1f')]:_0x12f046[_0x0292('0x1c')]+_0x12f046[_0x0292('0x1e')];var _0x294834;if(_0x12ce10>=_0x235f97){_0x12ce10=_0x235f97;_0x294834=0xc8;}else{_0x294834=0xce;}_0x64a46b[_0x0292('0x1a')](_0x294834);return _0x64a46b[_0x0292('0x20')](_0x0292('0x21'),_0x322aab+'-'+_0x12ce10+'/'+_0x235f97)['json'](_0x45aff3);}return null;};}function patchUpdates(_0x198652){return function(_0x1a682c){try{jsonpatch['apply'](_0x1a682c,_0x198652,!![]);}catch(_0x6e494c){return BPromise[_0x0292('0x22')](_0x6e494c);}return _0x1a682c[_0x0292('0x23')]();};}function saveUpdates(_0x5872fb,_0x280644){return function(_0x12e420){if(_0x12e420){return _0x12e420[_0x0292('0x24')](_0x5872fb)[_0x0292('0x25')](function(_0x5dc40e){return _0x5dc40e;});}return null;};}function removeEntity(_0x135d84,_0x2af1bc){return function(_0x2972e9){if(_0x2972e9){return _0x2972e9[_0x0292('0x26')]()[_0x0292('0x25')](function(){_0x135d84[_0x0292('0x1a')](0xcc)[_0x0292('0x19')]();});}};}function handleEntityNotFound(_0x3600d4,_0x77cf35){return function(_0xc6236f){if(!_0xc6236f){_0x3600d4[_0x0292('0x18')](0x194);}return _0xc6236f;};}function handleError(_0x274bb0,_0x2d598e){_0x2d598e=_0x2d598e||0x1f4;return function(_0x1e1a6e){logger['error'](_0x1e1a6e[_0x0292('0x27')]);if(_0x1e1a6e[_0x0292('0x28')]){delete _0x1e1a6e[_0x0292('0x28')];}_0x274bb0[_0x0292('0x1a')](_0x2d598e)['send'](_0x1e1a6e);};}exports[_0x0292('0x29')]=function(_0x55175a,_0xbd676a){var _0x199bb1={},_0x2d398e={},_0x4c0dd0={'count':0x0,'rows':[]};var _0x4fab88=_[_0x0292('0x2a')](db[_0x0292('0x2b')]['rawAttributes'],function(_0x6b94a9){return{'name':_0x6b94a9[_0x0292('0x2c')],'type':_0x6b94a9[_0x0292('0x2d')][_0x0292('0x2e')]};});_0x2d398e[_0x0292('0x2f')]=_['map'](_0x4fab88,_0x0292('0x28'));_0x2d398e['query']=_[_0x0292('0x30')](_0x55175a[_0x0292('0x31')]);_0x2d398e[_0x0292('0x32')]=_[_0x0292('0x33')](_0x2d398e[_0x0292('0x2f')],_0x2d398e['query']);_0x199bb1[_0x0292('0x34')]=_[_0x0292('0x33')](_0x2d398e['model'],qs[_0x0292('0x35')](_0x55175a[_0x0292('0x31')][_0x0292('0x35')]));_0x199bb1['attributes']=_0x199bb1[_0x0292('0x34')]['length']?_0x199bb1[_0x0292('0x34')]:_0x2d398e[_0x0292('0x2f')];if(!_0x55175a[_0x0292('0x31')][_0x0292('0x36')](_0x0292('0x37'))){_0x199bb1[_0x0292('0x1e')]=qs[_0x0292('0x1e')](_0x55175a[_0x0292('0x31')]['limit']);_0x199bb1[_0x0292('0x1c')]=qs[_0x0292('0x1c')](_0x55175a[_0x0292('0x31')][_0x0292('0x1c')]);}_0x199bb1['order']=qs[_0x0292('0x38')](_0x55175a[_0x0292('0x31')]['sort']);_0x199bb1[_0x0292('0x39')]=qs[_0x0292('0x32')](_[_0x0292('0x3a')](_0x55175a['query'],_0x2d398e[_0x0292('0x32')]),_0x4fab88);if(_0x55175a['query'][_0x0292('0x3b')]){_0x199bb1[_0x0292('0x39')]=_['merge'](_0x199bb1[_0x0292('0x39')],{'$or':_['map'](_0x4fab88,function(_0x1d18af){if(_0x1d18af[_0x0292('0x2d')]!==_0x0292('0x3c')){var _0x20e6bf={};_0x20e6bf[_0x1d18af[_0x0292('0x28')]]={'$like':'%'+_0x55175a['query'][_0x0292('0x3b')]+'%'};return _0x20e6bf;}})});}_0x199bb1=_[_0x0292('0x3d')]({},_0x199bb1,_0x55175a[_0x0292('0x3e')]);var _0x3c700c={'where':_0x199bb1[_0x0292('0x39')]};return db[_0x0292('0x2b')]['count'](_0x3c700c)[_0x0292('0x25')](function(_0x49fcd1){_0x4c0dd0[_0x0292('0x1f')]=_0x49fcd1;if(_0x55175a['query'][_0x0292('0x3f')]){_0x199bb1[_0x0292('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0292('0x41')](_0x199bb1);})['then'](function(_0x4eec88){_0x4c0dd0[_0x0292('0x42')]=_0x4eec88;return _0x4c0dd0;})[_0x0292('0x25')](respondWithFilteredResult(_0xbd676a,_0x199bb1))[_0x0292('0x43')](handleError(_0xbd676a,null));};exports[_0x0292('0x44')]=function(_0x5174aa,_0x22f98){var _0x403067={'raw':!![],'where':{'id':_0x5174aa[_0x0292('0x45')]['id']}},_0x54aaf1={};_0x54aaf1[_0x0292('0x2f')]=_[_0x0292('0x30')](db[_0x0292('0x2b')]['rawAttributes']);_0x54aaf1[_0x0292('0x31')]=_['keys'](_0x5174aa['query']);_0x54aaf1[_0x0292('0x32')]=_[_0x0292('0x33')](_0x54aaf1[_0x0292('0x2f')],_0x54aaf1[_0x0292('0x31')]);_0x403067[_0x0292('0x34')]=_[_0x0292('0x33')](_0x54aaf1[_0x0292('0x2f')],qs[_0x0292('0x35')](_0x5174aa[_0x0292('0x31')][_0x0292('0x35')]));_0x403067[_0x0292('0x34')]=_0x403067[_0x0292('0x34')][_0x0292('0x46')]?_0x403067[_0x0292('0x34')]:_0x54aaf1[_0x0292('0x2f')];if(_0x5174aa['query']['includeAll']){_0x403067[_0x0292('0x40')]=[{'all':!![]}];}_0x403067=_['merge']({},_0x403067,_0x5174aa[_0x0292('0x3e')]);return db[_0x0292('0x2b')][_0x0292('0x47')](_0x403067)[_0x0292('0x25')](handleEntityNotFound(_0x22f98,null))['then'](respondWithResult(_0x22f98,null))[_0x0292('0x43')](handleError(_0x22f98,null));};exports[_0x0292('0x48')]=function(_0xa46447,_0x4bb355){return db[_0x0292('0x2b')][_0x0292('0x48')](_0xa46447[_0x0292('0x49')],{})['then'](respondWithResult(_0x4bb355,0xc9))[_0x0292('0x43')](handleError(_0x4bb355,null));};exports['update']=function(_0x3dab1c,_0x18d2d4){if(_0x3dab1c[_0x0292('0x49')]['id']){delete _0x3dab1c[_0x0292('0x49')]['id'];}return db[_0x0292('0x2b')][_0x0292('0x47')]({'where':{'id':_0x3dab1c[_0x0292('0x45')]['id']}})['then'](handleEntityNotFound(_0x18d2d4,null))[_0x0292('0x25')](saveUpdates(_0x3dab1c[_0x0292('0x49')],null))['then'](respondWithResult(_0x18d2d4,null))[_0x0292('0x43')](handleError(_0x18d2d4,null));};exports[_0x0292('0x26')]=function(_0x509125,_0x4869f6){return db['AnalyticTreeReport']['find']({'where':{'id':_0x509125[_0x0292('0x45')]['id']}})[_0x0292('0x25')](handleEntityNotFound(_0x4869f6,null))[_0x0292('0x25')](removeEntity(_0x4869f6,null))[_0x0292('0x43')](handleError(_0x4869f6,null));};
\ No newline at end of file
+var _0x582d=['create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','then','destroy','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','order','sort','filter','where','merge','options','findAll','rows','catch','params','keys','rawAttributes','includeAll','include','find'];(function(_0x56b95c,_0x18564c){var _0x2552a8=function(_0xc144d5){while(--_0xc144d5){_0x56b95c['push'](_0x56b95c['shift']());}};_0x2552a8(++_0x18564c);}(_0x582d,0x95));var _0xd582=function(_0x50e33c,_0xa63b2e){_0x50e33c=_0x50e33c-0x0;var _0x5f0498=_0x582d[_0x50e33c];return _0x5f0498;};'use strict';var emlformat=require(_0xd582('0x0'));var rimraf=require(_0xd582('0x1'));var zipdir=require(_0xd582('0x2'));var jsonpatch=require(_0xd582('0x3'));var rp=require('request-promise');var moment=require(_0xd582('0x4'));var BPromise=require(_0xd582('0x5'));var Mustache=require(_0xd582('0x6'));var util=require(_0xd582('0x7'));var path=require(_0xd582('0x8'));var sox=require(_0xd582('0x9'));var csv=require(_0xd582('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd582('0xb'));var _=require(_0xd582('0xc'));var squel=require(_0xd582('0xd'));var crypto=require('crypto');var jsforce=require(_0xd582('0xe'));var deskjs=require(_0xd582('0xf'));var toCsv=require(_0xd582('0xa'));var querystring=require(_0xd582('0x10'));var Papa=require(_0xd582('0x11'));var Redis=require(_0xd582('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd582('0x13'));var as=require(_0xd582('0x14'));var hardwareService=require(_0xd582('0x15'));var logger=require(_0xd582('0x16'))(_0xd582('0x17'));var utils=require(_0xd582('0x18'));var config=require(_0xd582('0x19'));var licenseUtil=require(_0xd582('0x1a'));var db=require(_0xd582('0x1b'))['db'];function respondWithStatusCode(_0x2be23b,_0x592915){_0x592915=_0x592915||0xcc;return function(_0xc7018a){if(_0xc7018a){return _0x2be23b['sendStatus'](_0x592915);}return _0x2be23b[_0xd582('0x1c')](_0x592915)[_0xd582('0x1d')]();};}function respondWithResult(_0x2a7a2c,_0x215e64){_0x215e64=_0x215e64||0xc8;return function(_0x1716db){if(_0x1716db){return _0x2a7a2c[_0xd582('0x1c')](_0x215e64)['json'](_0x1716db);}};}function respondWithFilteredResult(_0x2c4d04,_0x572c34){return function(_0x2f9479){if(_0x2f9479){var _0x1e0be3=typeof _0x572c34[_0xd582('0x1e')]===_0xd582('0x1f')&&typeof _0x572c34['limit']==='undefined';var _0x90245f=_0x2f9479[_0xd582('0x20')];var _0x5d446e=_0x1e0be3?0x0:_0x572c34[_0xd582('0x1e')];var _0x3e0ff9=_0x1e0be3?_0x2f9479[_0xd582('0x20')]:_0x572c34[_0xd582('0x1e')]+_0x572c34[_0xd582('0x21')];var _0x414b29;if(_0x3e0ff9>=_0x90245f){_0x3e0ff9=_0x90245f;_0x414b29=0xc8;}else{_0x414b29=0xce;}_0x2c4d04['status'](_0x414b29);return _0x2c4d04[_0xd582('0x22')](_0xd582('0x23'),_0x5d446e+'-'+_0x3e0ff9+'/'+_0x90245f)[_0xd582('0x24')](_0x2f9479);}return null;};}function patchUpdates(_0x207048){return function(_0x43359c){try{jsonpatch['apply'](_0x43359c,_0x207048,!![]);}catch(_0x292dea){return BPromise[_0xd582('0x25')](_0x292dea);}return _0x43359c['save']();};}function saveUpdates(_0x209780,_0x1154a4){return function(_0x2c9f55){if(_0x2c9f55){return _0x2c9f55['update'](_0x209780)[_0xd582('0x26')](function(_0x22d53a){return _0x22d53a;});}return null;};}function removeEntity(_0x2a93d9,_0x4070b4){return function(_0x3d56d4){if(_0x3d56d4){return _0x3d56d4[_0xd582('0x27')]()[_0xd582('0x26')](function(){_0x2a93d9[_0xd582('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49559f,_0x1d43e5){return function(_0x518457){if(!_0x518457){_0x49559f['sendStatus'](0x194);}return _0x518457;};}function handleError(_0x137446,_0x4784ea){_0x4784ea=_0x4784ea||0x1f4;return function(_0x8d67d5){logger['error'](_0x8d67d5['stack']);if(_0x8d67d5[_0xd582('0x28')]){delete _0x8d67d5[_0xd582('0x28')];}_0x137446['status'](_0x4784ea)[_0xd582('0x29')](_0x8d67d5);};}exports[_0xd582('0x2a')]=function(_0x20ff3c,_0x50c0d9){var _0x49c197={},_0x1d955e={},_0x3128ea={'count':0x0,'rows':[]};var _0x4809c0=_[_0xd582('0x2b')](db[_0xd582('0x2c')]['rawAttributes'],function(_0x4fbe63){return{'name':_0x4fbe63[_0xd582('0x2d')],'type':_0x4fbe63[_0xd582('0x2e')][_0xd582('0x2f')]};});_0x1d955e[_0xd582('0x30')]=_['map'](_0x4809c0,_0xd582('0x28'));_0x1d955e['query']=_['keys'](_0x20ff3c['query']);_0x1d955e[_0xd582('0x31')]=_[_0xd582('0x32')](_0x1d955e[_0xd582('0x30')],_0x1d955e[_0xd582('0x33')]);_0x49c197['attributes']=_[_0xd582('0x32')](_0x1d955e[_0xd582('0x30')],qs[_0xd582('0x34')](_0x20ff3c['query'][_0xd582('0x34')]));_0x49c197[_0xd582('0x35')]=_0x49c197[_0xd582('0x35')][_0xd582('0x36')]?_0x49c197[_0xd582('0x35')]:_0x1d955e[_0xd582('0x30')];if(!_0x20ff3c[_0xd582('0x33')]['hasOwnProperty']('nolimit')){_0x49c197['limit']=qs[_0xd582('0x21')](_0x20ff3c[_0xd582('0x33')][_0xd582('0x21')]);_0x49c197[_0xd582('0x1e')]=qs[_0xd582('0x1e')](_0x20ff3c[_0xd582('0x33')][_0xd582('0x1e')]);}_0x49c197[_0xd582('0x37')]=qs['sort'](_0x20ff3c[_0xd582('0x33')][_0xd582('0x38')]);_0x49c197['where']=qs[_0xd582('0x31')](_['pick'](_0x20ff3c['query'],_0x1d955e[_0xd582('0x31')]),_0x4809c0);if(_0x20ff3c[_0xd582('0x33')][_0xd582('0x39')]){_0x49c197[_0xd582('0x3a')]=_[_0xd582('0x3b')](_0x49c197[_0xd582('0x3a')],{'$or':_[_0xd582('0x2b')](_0x4809c0,function(_0x16bf73){if(_0x16bf73[_0xd582('0x2e')]!=='VIRTUAL'){var _0x216b77={};_0x216b77[_0x16bf73[_0xd582('0x28')]]={'$like':'%'+_0x20ff3c[_0xd582('0x33')]['filter']+'%'};return _0x216b77;}})});}_0x49c197=_[_0xd582('0x3b')]({},_0x49c197,_0x20ff3c[_0xd582('0x3c')]);var _0xf67078={'where':_0x49c197[_0xd582('0x3a')]};return db['AnalyticTreeReport'][_0xd582('0x20')](_0xf67078)[_0xd582('0x26')](function(_0x2178f1){_0x3128ea[_0xd582('0x20')]=_0x2178f1;if(_0x20ff3c[_0xd582('0x33')]['includeAll']){_0x49c197['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xd582('0x3d')](_0x49c197);})['then'](function(_0x5ad195){_0x3128ea[_0xd582('0x3e')]=_0x5ad195;return _0x3128ea;})[_0xd582('0x26')](respondWithFilteredResult(_0x50c0d9,_0x49c197))[_0xd582('0x3f')](handleError(_0x50c0d9,null));};exports['show']=function(_0x4a1f19,_0x4aff98){var _0x5f511b={'raw':!![],'where':{'id':_0x4a1f19[_0xd582('0x40')]['id']}},_0x5c075c={};_0x5c075c[_0xd582('0x30')]=_[_0xd582('0x41')](db['AnalyticTreeReport'][_0xd582('0x42')]);_0x5c075c[_0xd582('0x33')]=_[_0xd582('0x41')](_0x4a1f19[_0xd582('0x33')]);_0x5c075c[_0xd582('0x31')]=_[_0xd582('0x32')](_0x5c075c['model'],_0x5c075c[_0xd582('0x33')]);_0x5f511b[_0xd582('0x35')]=_[_0xd582('0x32')](_0x5c075c[_0xd582('0x30')],qs[_0xd582('0x34')](_0x4a1f19['query'][_0xd582('0x34')]));_0x5f511b['attributes']=_0x5f511b[_0xd582('0x35')]['length']?_0x5f511b[_0xd582('0x35')]:_0x5c075c[_0xd582('0x30')];if(_0x4a1f19[_0xd582('0x33')][_0xd582('0x43')]){_0x5f511b[_0xd582('0x44')]=[{'all':!![]}];}_0x5f511b=_[_0xd582('0x3b')]({},_0x5f511b,_0x4a1f19[_0xd582('0x3c')]);return db[_0xd582('0x2c')][_0xd582('0x45')](_0x5f511b)[_0xd582('0x26')](handleEntityNotFound(_0x4aff98,null))['then'](respondWithResult(_0x4aff98,null))['catch'](handleError(_0x4aff98,null));};exports[_0xd582('0x46')]=function(_0x357d99,_0x28dc6e){return db[_0xd582('0x2c')][_0xd582('0x46')](_0x357d99[_0xd582('0x47')],{})['then'](respondWithResult(_0x28dc6e,0xc9))['catch'](handleError(_0x28dc6e,null));};exports[_0xd582('0x48')]=function(_0xaaa9e3,_0x1713d3){if(_0xaaa9e3[_0xd582('0x47')]['id']){delete _0xaaa9e3[_0xd582('0x47')]['id'];}return db[_0xd582('0x2c')]['find']({'where':{'id':_0xaaa9e3[_0xd582('0x40')]['id']}})['then'](handleEntityNotFound(_0x1713d3,null))[_0xd582('0x26')](saveUpdates(_0xaaa9e3[_0xd582('0x47')],null))[_0xd582('0x26')](respondWithResult(_0x1713d3,null))[_0xd582('0x3f')](handleError(_0x1713d3,null));};exports['destroy']=function(_0x1fc77a,_0x51425e){return db[_0xd582('0x2c')][_0xd582('0x45')]({'where':{'id':_0x1fc77a[_0xd582('0x40')]['id']}})[_0xd582('0x26')](handleEntityNotFound(_0x51425e,null))[_0xd582('0x26')](removeEntity(_0x51425e,null))['catch'](handleError(_0x51425e,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 09bebeb..d1b4c2b 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 _0xf8eb=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf8eb,0x167));var _0xbf8e=function(_0x4f926d,_0x10b231){_0x4f926d=_0x4f926d-0x0;var _0x4982a0=_0xf8eb[_0x4f926d];return _0x4982a0;};'use strict';var _=require(_0xbf8e('0x0'));var util=require('util');var logger=require(_0xbf8e('0x1'))(_0xbf8e('0x2'));var moment=require(_0xbf8e('0x3'));var BPromise=require(_0xbf8e('0x4'));var rp=require(_0xbf8e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf8e('0x6'));var config=require(_0xbf8e('0x7'));var attributes=require(_0xbf8e('0x8'));module[_0xbf8e('0x9')]=function(_0x6edd01,_0x277aef){return _0x6edd01[_0xbf8e('0xa')](_0xbf8e('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2fb6=['util','moment','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x148f4b,_0xf90d3e){var _0x53f206=function(_0x6d2eed){while(--_0x6d2eed){_0x148f4b['push'](_0x148f4b['shift']());}};_0x53f206(++_0xf90d3e);}(_0x2fb6,0x78));var _0x62fb=function(_0x3182fc,_0x2f3cd9){_0x3182fc=_0x3182fc-0x0;var _0x4ca431=_0x2fb6[_0x3182fc];return _0x4ca431;};'use strict';var _=require(_0x62fb('0x0'));var util=require(_0x62fb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x62fb('0x2'));var BPromise=require('bluebird');var rp=require(_0x62fb('0x3'));var fs=require('fs');var path=require(_0x62fb('0x4'));var rimraf=require(_0x62fb('0x5'));var config=require('../../config/environment');var attributes=require(_0x62fb('0x6'));module[_0x62fb('0x7')]=function(_0x51cb30,_0x2a471e){return _0x51cb30[_0x62fb('0x8')](_0x62fb('0x9'),attributes,{'tableName':_0x62fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 334a53a..f7ee851 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x40bc19,_0x51be0c){var _0x5b575a=function(_0x12d7a1){while(--_0x12d7a1){_0x40bc19['push'](_0x40bc19['shift']());}};_0x5b575a(++_0x51be0c);}(_0x1261,0x144));var _0x1126=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0x1261[_0x15fa77];return _0x1385ff;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2a8972,_0x249cdf){var _0x48a94d=function(_0x1f52e6){while(--_0x1f52e6){_0x2a8972['push'](_0x2a8972['shift']());}};_0x48a94d(++_0x249cdf);}(_0x1261,0x144));var _0x1126=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x1261[_0x117f4c];return _0x2b24e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 1fd6409..3d0d793 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 _0xc87b=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc87b,0x1a0));var _0xbc87=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc87b[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xbc87('0x0'));var util=require('util');var path=require(_0xbc87('0x1'));var timeout=require(_0xbc87('0x2'));var express=require('express');var router=express[_0xbc87('0x3')]();var fs_extra=require(_0xbc87('0x4'));var auth=require(_0xbc87('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xbc87('0x6')]('/',auth[_0xbc87('0x7')](),controller[_0xbc87('0x8')]);router[_0xbc87('0x6')]('/:id',auth[_0xbc87('0x7')](),controller[_0xbc87('0x9')]);router[_0xbc87('0xa')]('/',auth[_0xbc87('0x7')](),controller[_0xbc87('0xb')]);router[_0xbc87('0xc')](_0xbc87('0xd'),auth['isAuthenticated'](),controller[_0xbc87('0xe')]);router[_0xbc87('0xf')](_0xbc87('0xd'),auth['isAuthenticated'](),controller[_0xbc87('0x10')]);module[_0xbc87('0x11')]=router;
\ No newline at end of file
+var _0x5ecc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4d05fe,_0x3fbdff){var _0x4251e4=function(_0x49aa2b){while(--_0x49aa2b){_0x4d05fe['push'](_0x4d05fe['shift']());}};_0x4251e4(++_0x3fbdff);}(_0x5ecc,0x1c8));var _0xc5ec=function(_0x2e24e0,_0x541639){_0x2e24e0=_0x2e24e0-0x0;var _0x25849f=_0x5ecc[_0x2e24e0];return _0x25849f;};'use strict';var multer=require('multer');var util=require(_0xc5ec('0x0'));var path=require(_0xc5ec('0x1'));var timeout=require(_0xc5ec('0x2'));var express=require(_0xc5ec('0x3'));var router=express[_0xc5ec('0x4')]();var fs_extra=require(_0xc5ec('0x5'));var auth=require(_0xc5ec('0x6'));var interaction=require(_0xc5ec('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0x9')]);router[_0xc5ec('0xa')](_0xc5ec('0xb'),auth[_0xc5ec('0x8')](),controller[_0xc5ec('0xc')]);router[_0xc5ec('0xd')]('/',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0xe')]);router[_0xc5ec('0xf')]('/:id',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0x10')]);router[_0xc5ec('0x11')](_0xc5ec('0xb'),auth[_0xc5ec('0x8')](),controller[_0xc5ec('0x12')]);module[_0xc5ec('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 5a52716..57d7893 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 _0x0487=['exports','STRING','sequelize'];(function(_0x5d21d1,_0x18196d){var _0x5dbb7a=function(_0x3c993d){while(--_0x3c993d){_0x5d21d1['push'](_0x5d21d1['shift']());}};_0x5dbb7a(++_0x18196d);}(_0x0487,0x14f));var _0x7048=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0487[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7048('0x0'));module[_0x7048('0x1')]={'name':{'type':Sequelize[_0x7048('0x2')]},'basename':{'type':Sequelize[_0x7048('0x2')]},'type':{'type':Sequelize[_0x7048('0x2')]}};
\ No newline at end of file
+var _0x0e9f=['exports','STRING','sequelize'];(function(_0x1e97f0,_0x23e4c1){var _0x5b09e1=function(_0x1597fe){while(--_0x1597fe){_0x1e97f0['push'](_0x1e97f0['shift']());}};_0x5b09e1(++_0x23e4c1);}(_0x0e9f,0x116));var _0xf0e9=function(_0x3c626a,_0xa3bc94){_0x3c626a=_0x3c626a-0x0;var _0x336d75=_0x0e9f[_0x3c626a];return _0x336d75;};'use strict';var Sequelize=require(_0xf0e9('0x0'));module[_0xf0e9('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf0e9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 1d9219d..3cfc488 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 _0x7ed1=['includeAll','include','findAll','show','length','find','catch','clone','get','createdAt','updatedAt','omit','body','create','update','params','file','originalname','basename','filename','mimetype','download','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Attachment'];(function(_0xda1099,_0x53d61c){var _0x23661e=function(_0x198d25){while(--_0x198d25){_0xda1099['push'](_0xda1099['shift']());}};_0x23661e(++_0x53d61c);}(_0x7ed1,0x75));var _0x17ed=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x7ed1[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0x17ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x17ed('0x1'));var jsonpatch=require(_0x17ed('0x2'));var rp=require(_0x17ed('0x3'));var moment=require(_0x17ed('0x4'));var BPromise=require(_0x17ed('0x5'));var Mustache=require(_0x17ed('0x6'));var util=require('util');var path=require(_0x17ed('0x7'));var sox=require(_0x17ed('0x8'));var csv=require(_0x17ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17ed('0xa'));var squel=require(_0x17ed('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x17ed('0xc'));var toCsv=require(_0x17ed('0x9'));var querystring=require(_0x17ed('0xd'));var Papa=require('papaparse');var Redis=require(_0x17ed('0xe'));var authService=require(_0x17ed('0xf'));var qs=require(_0x17ed('0x10'));var as=require(_0x17ed('0x11'));var hardwareService=require(_0x17ed('0x12'));var logger=require(_0x17ed('0x13'))(_0x17ed('0x14'));var utils=require('../../config/utils');var config=require(_0x17ed('0x15'));var licenseUtil=require(_0x17ed('0x16'));var db=require(_0x17ed('0x17'))['db'];function respondWithStatusCode(_0x4d12d5,_0x397d6d){_0x397d6d=_0x397d6d||0xcc;return function(_0x100c96){if(_0x100c96){return _0x4d12d5['sendStatus'](_0x397d6d);}return _0x4d12d5[_0x17ed('0x18')](_0x397d6d)['end']();};}function respondWithResult(_0x2de563,_0x3ee7f5){_0x3ee7f5=_0x3ee7f5||0xc8;return function(_0x51719e){if(_0x51719e){return _0x2de563[_0x17ed('0x18')](_0x3ee7f5)[_0x17ed('0x19')](_0x51719e);}};}function respondWithFilteredResult(_0x4fb02f,_0x4f3d62){return function(_0xf6bc9e){if(_0xf6bc9e){var _0x16c84a=typeof _0x4f3d62['offset']==='undefined'&&typeof _0x4f3d62[_0x17ed('0x1a')]===_0x17ed('0x1b');var _0x514a42=_0xf6bc9e['count'];var _0x1a32f3=_0x16c84a?0x0:_0x4f3d62[_0x17ed('0x1c')];var _0x2b788d=_0x16c84a?_0xf6bc9e[_0x17ed('0x1d')]:_0x4f3d62['offset']+_0x4f3d62[_0x17ed('0x1a')];var _0x391c21;if(_0x2b788d>=_0x514a42){_0x2b788d=_0x514a42;_0x391c21=0xc8;}else{_0x391c21=0xce;}_0x4fb02f['status'](_0x391c21);return _0x4fb02f[_0x17ed('0x1e')](_0x17ed('0x1f'),_0x1a32f3+'-'+_0x2b788d+'/'+_0x514a42)[_0x17ed('0x19')](_0xf6bc9e);}return null;};}function patchUpdates(_0xec308f){return function(_0x35e692){try{jsonpatch[_0x17ed('0x20')](_0x35e692,_0xec308f,!![]);}catch(_0x14f0c8){return BPromise[_0x17ed('0x21')](_0x14f0c8);}return _0x35e692[_0x17ed('0x22')]();};}function saveUpdates(_0x1ee76c,_0x5c9b6c){return function(_0x3d6cfe){if(_0x3d6cfe){return _0x3d6cfe['update'](_0x1ee76c)[_0x17ed('0x23')](function(_0x358c4e){return _0x358c4e;});}return null;};}function removeEntity(_0x2f0460,_0xf332cf){return function(_0x20c38b){if(_0x20c38b){return _0x20c38b[_0x17ed('0x24')]()[_0x17ed('0x23')](function(){_0x2f0460[_0x17ed('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x218b1d,_0x297dac){return function(_0x2baa56){if(!_0x2baa56){_0x218b1d[_0x17ed('0x25')](0x194);}return _0x2baa56;};}function handleError(_0x58b5eb,_0x7f2ca4){_0x7f2ca4=_0x7f2ca4||0x1f4;return function(_0x2260f8){logger[_0x17ed('0x26')](_0x2260f8[_0x17ed('0x27')]);if(_0x2260f8['name']){delete _0x2260f8[_0x17ed('0x28')];}_0x58b5eb['status'](_0x7f2ca4)[_0x17ed('0x29')](_0x2260f8);};}exports[_0x17ed('0x2a')]=function(_0x128c53,_0x26f616){var _0x2652b5={},_0x113b17={},_0x28acc6={'count':0x0,'rows':[]};var _0x34a5a4=_[_0x17ed('0x2b')](db['Attachment'][_0x17ed('0x2c')],function(_0x46e521){return{'name':_0x46e521['fieldName'],'type':_0x46e521[_0x17ed('0x2d')][_0x17ed('0x2e')]};});_0x113b17[_0x17ed('0x2f')]=_['map'](_0x34a5a4,_0x17ed('0x28'));_0x113b17[_0x17ed('0x30')]=_[_0x17ed('0x31')](_0x128c53[_0x17ed('0x30')]);_0x113b17[_0x17ed('0x32')]=_[_0x17ed('0x33')](_0x113b17['model'],_0x113b17[_0x17ed('0x30')]);_0x2652b5['attributes']=_[_0x17ed('0x33')](_0x113b17['model'],qs[_0x17ed('0x34')](_0x128c53[_0x17ed('0x30')]['fields']));_0x2652b5['attributes']=_0x2652b5[_0x17ed('0x35')]['length']?_0x2652b5[_0x17ed('0x35')]:_0x113b17[_0x17ed('0x2f')];if(!_0x128c53['query'][_0x17ed('0x36')](_0x17ed('0x37'))){_0x2652b5[_0x17ed('0x1a')]=qs[_0x17ed('0x1a')](_0x128c53[_0x17ed('0x30')][_0x17ed('0x1a')]);_0x2652b5[_0x17ed('0x1c')]=qs[_0x17ed('0x1c')](_0x128c53[_0x17ed('0x30')]['offset']);}_0x2652b5[_0x17ed('0x38')]=qs[_0x17ed('0x39')](_0x128c53[_0x17ed('0x30')][_0x17ed('0x39')]);_0x2652b5[_0x17ed('0x3a')]=qs[_0x17ed('0x32')](_[_0x17ed('0x3b')](_0x128c53[_0x17ed('0x30')],_0x113b17['filters']),_0x34a5a4);if(_0x128c53[_0x17ed('0x30')][_0x17ed('0x3c')]){_0x2652b5[_0x17ed('0x3a')]=_['merge'](_0x2652b5[_0x17ed('0x3a')],{'$or':_['map'](_0x34a5a4,function(_0x3a28b9){if(_0x3a28b9[_0x17ed('0x2d')]!==_0x17ed('0x3d')){var _0x359373={};_0x359373[_0x3a28b9['name']]={'$like':'%'+_0x128c53[_0x17ed('0x30')][_0x17ed('0x3c')]+'%'};return _0x359373;}})});}_0x2652b5=_[_0x17ed('0x3e')]({},_0x2652b5,_0x128c53[_0x17ed('0x3f')]);var _0x35e53c={'where':_0x2652b5[_0x17ed('0x3a')]};return db[_0x17ed('0x40')]['count'](_0x35e53c)['then'](function(_0x4fdce3){_0x28acc6[_0x17ed('0x1d')]=_0x4fdce3;if(_0x128c53['query'][_0x17ed('0x41')]){_0x2652b5[_0x17ed('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x17ed('0x43')](_0x2652b5);})[_0x17ed('0x23')](function(_0x318d1d){_0x28acc6['rows']=_0x318d1d;return _0x28acc6;})[_0x17ed('0x23')](respondWithFilteredResult(_0x26f616,_0x2652b5))['catch'](handleError(_0x26f616,null));};exports[_0x17ed('0x44')]=function(_0x4edc7a,_0x4843f3){var _0x5b6e00={'raw':!![],'where':{'id':_0x4edc7a['params']['id']}},_0x55fbf2={};_0x55fbf2[_0x17ed('0x2f')]=_['keys'](db[_0x17ed('0x40')][_0x17ed('0x2c')]);_0x55fbf2[_0x17ed('0x30')]=_[_0x17ed('0x31')](_0x4edc7a[_0x17ed('0x30')]);_0x55fbf2[_0x17ed('0x32')]=_['intersection'](_0x55fbf2[_0x17ed('0x2f')],_0x55fbf2[_0x17ed('0x30')]);_0x5b6e00[_0x17ed('0x35')]=_['intersection'](_0x55fbf2[_0x17ed('0x2f')],qs[_0x17ed('0x34')](_0x4edc7a[_0x17ed('0x30')][_0x17ed('0x34')]));_0x5b6e00[_0x17ed('0x35')]=_0x5b6e00[_0x17ed('0x35')][_0x17ed('0x45')]?_0x5b6e00['attributes']:_0x55fbf2[_0x17ed('0x2f')];if(_0x4edc7a[_0x17ed('0x30')][_0x17ed('0x41')]){_0x5b6e00[_0x17ed('0x42')]=[{'all':!![]}];}_0x5b6e00=_['merge']({},_0x5b6e00,_0x4edc7a[_0x17ed('0x3f')]);return db[_0x17ed('0x40')][_0x17ed('0x46')](_0x5b6e00)[_0x17ed('0x23')](handleEntityNotFound(_0x4843f3,null))[_0x17ed('0x23')](respondWithResult(_0x4843f3,null))[_0x17ed('0x47')](handleError(_0x4843f3,null));};exports[_0x17ed('0x48')]=function(_0x5ef02f,_0x47df27){var _0xa1a40d={'where':{'id':_0x5ef02f['params']['id']}},_0x2dcb71={};_0x2dcb71['model']=_[_0x17ed('0x31')](db[_0x17ed('0x40')][_0x17ed('0x2c')]);_0xa1a40d[_0x17ed('0x35')]=_[_0x17ed('0x33')](_0x2dcb71[_0x17ed('0x2f')],qs[_0x17ed('0x34')](_0x5ef02f[_0x17ed('0x30')]['fields']));_0xa1a40d[_0x17ed('0x35')]=_0xa1a40d[_0x17ed('0x35')][_0x17ed('0x45')]?_0xa1a40d['attributes']:_0x2dcb71[_0x17ed('0x2f')];if(_0x5ef02f[_0x17ed('0x30')][_0x17ed('0x41')]){_0xa1a40d[_0x17ed('0x42')]=[{'all':!![]}];}_0xa1a40d=_[_0x17ed('0x3e')]({},_0xa1a40d,_0x5ef02f[_0x17ed('0x3f')]);return db['Attachment'][_0x17ed('0x46')](_0xa1a40d)[_0x17ed('0x23')](handleEntityNotFound(_0x47df27,null))[_0x17ed('0x23')](function(_0x2bae98){if(_0x2bae98){var _0x564ca7=_0x2bae98[_0x17ed('0x49')]({'plain':!![]});_0x564ca7=qs['omit'](_0x564ca7,['id',_0x17ed('0x4a'),_0x17ed('0x4b')]);_0x5ef02f['body']=_[_0x17ed('0x4c')](_0x5ef02f[_0x17ed('0x4d')],['id',_0x17ed('0x4a'),_0x17ed('0x4b')]);return db['Attachment'][_0x17ed('0x4e')](_[_0x17ed('0x3e')](_0x564ca7,_0x5ef02f[_0x17ed('0x4d')]),{'include':_0x5ef02f['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x17ed('0x23')](respondWithResult(_0x47df27,0xc9))[_0x17ed('0x47')](handleError(_0x47df27,null));};exports[_0x17ed('0x4f')]=function(_0x5d68c8,_0x376580){if(_0x5d68c8[_0x17ed('0x4d')]['id']){delete _0x5d68c8['body']['id'];}return db[_0x17ed('0x40')][_0x17ed('0x46')]({'where':{'id':_0x5d68c8[_0x17ed('0x50')]['id']}})['then'](handleEntityNotFound(_0x376580,null))[_0x17ed('0x23')](saveUpdates(_0x5d68c8[_0x17ed('0x4d')],null))[_0x17ed('0x23')](respondWithResult(_0x376580,null))['catch'](handleError(_0x376580,null));};exports[_0x17ed('0x24')]=function(_0x3af35d,_0x4c8d0a){return db[_0x17ed('0x40')]['find']({'where':{'id':_0x3af35d['params']['id']}})[_0x17ed('0x23')](handleEntityNotFound(_0x4c8d0a,null))[_0x17ed('0x23')](removeEntity(_0x4c8d0a,null))[_0x17ed('0x47')](handleError(_0x4c8d0a,null));};exports[_0x17ed('0x4e')]=function(_0x26d374,_0x37c50c,_0x488539){_0x26d374[_0x17ed('0x4d')][_0x17ed('0x28')]=_0x26d374[_0x17ed('0x51')][_0x17ed('0x52')];_0x26d374[_0x17ed('0x4d')][_0x17ed('0x53')]=_0x26d374['file'][_0x17ed('0x54')];_0x26d374[_0x17ed('0x4d')]['type']=_0x26d374[_0x17ed('0x51')][_0x17ed('0x55')];return db[_0x17ed('0x40')][_0x17ed('0x4e')](_0x26d374[_0x17ed('0x4d')])[_0x17ed('0x23')](respondWithResult(_0x37c50c,0xc9))[_0x17ed('0x47')](handleError(_0x37c50c,null));};exports[_0x17ed('0x56')]=function(_0x26b826,_0x3b7882,_0x18d900){return db[_0x17ed('0x40')]['findOne']({'where':{'id':_0x26b826['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3b7882,null))[_0x17ed('0x23')](function(_0x18c23b){if(_0x18c23b){var _0x296af6=_0x18c23b['ChatOfflineMessageId']!==null;var _0x40c64c=path[_0x17ed('0x57')](config[_0x17ed('0x58')],_0x17ed('0x59'));if(_0x296af6){_0x40c64c=path['join'](_0x40c64c,_0x17ed('0x5a'));}var _0x309ea0=path[_0x17ed('0x57')](_0x40c64c,_0x18c23b[_0x17ed('0x53')]);return _0x3b7882[_0x17ed('0x56')](_0x309ea0);}})[_0x17ed('0x47')](handleError(_0x3b7882,null));};
\ No newline at end of file
+var _0xb247=['filter','merge','options','Attachment','includeAll','findAll','rows','catch','params','include','find','get','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL'];(function(_0x4d5f9e,_0x183a41){var _0x2fc732=function(_0x3efa39){while(--_0x3efa39){_0x4d5f9e['push'](_0x4d5f9e['shift']());}};_0x2fc732(++_0x183a41);}(_0xb247,0x72));var _0x7b24=function(_0x42676f,_0x4c3299){_0x42676f=_0x42676f-0x0;var _0x2b884e=_0xb247[_0x42676f];return _0x2b884e;};'use strict';var emlformat=require(_0x7b24('0x0'));var rimraf=require(_0x7b24('0x1'));var zipdir=require(_0x7b24('0x2'));var jsonpatch=require(_0x7b24('0x3'));var rp=require(_0x7b24('0x4'));var moment=require(_0x7b24('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7b24('0x6'));var util=require('util');var path=require(_0x7b24('0x7'));var sox=require(_0x7b24('0x8'));var csv=require(_0x7b24('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b24('0xa'));var _=require('lodash');var squel=require(_0x7b24('0xb'));var crypto=require(_0x7b24('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7b24('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b24('0xe'));var Redis=require(_0x7b24('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7b24('0x10'));var as=require(_0x7b24('0x11'));var hardwareService=require(_0x7b24('0x12'));var logger=require(_0x7b24('0x13'))('api');var utils=require(_0x7b24('0x14'));var config=require(_0x7b24('0x15'));var licenseUtil=require(_0x7b24('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33f6b4,_0x59f9ab){_0x59f9ab=_0x59f9ab||0xcc;return function(_0x160273){if(_0x160273){return _0x33f6b4[_0x7b24('0x17')](_0x59f9ab);}return _0x33f6b4[_0x7b24('0x18')](_0x59f9ab)[_0x7b24('0x19')]();};}function respondWithResult(_0x72617d,_0x2b0941){_0x2b0941=_0x2b0941||0xc8;return function(_0x1ebecd){if(_0x1ebecd){return _0x72617d['status'](_0x2b0941)[_0x7b24('0x1a')](_0x1ebecd);}};}function respondWithFilteredResult(_0x36124c,_0x46fa43){return function(_0x3db620){if(_0x3db620){var _0x5bb73f=typeof _0x46fa43[_0x7b24('0x1b')]===_0x7b24('0x1c')&&typeof _0x46fa43[_0x7b24('0x1d')]==='undefined';var _0x39b348=_0x3db620['count'];var _0x45573f=_0x5bb73f?0x0:_0x46fa43['offset'];var _0x5516e3=_0x5bb73f?_0x3db620[_0x7b24('0x1e')]:_0x46fa43[_0x7b24('0x1b')]+_0x46fa43['limit'];var _0x476d53;if(_0x5516e3>=_0x39b348){_0x5516e3=_0x39b348;_0x476d53=0xc8;}else{_0x476d53=0xce;}_0x36124c[_0x7b24('0x18')](_0x476d53);return _0x36124c[_0x7b24('0x1f')](_0x7b24('0x20'),_0x45573f+'-'+_0x5516e3+'/'+_0x39b348)['json'](_0x3db620);}return null;};}function patchUpdates(_0x2a6e88){return function(_0x5042f2){try{jsonpatch['apply'](_0x5042f2,_0x2a6e88,!![]);}catch(_0x325fe7){return BPromise[_0x7b24('0x21')](_0x325fe7);}return _0x5042f2[_0x7b24('0x22')]();};}function saveUpdates(_0x31f424,_0x1a3b3e){return function(_0x236672){if(_0x236672){return _0x236672['update'](_0x31f424)[_0x7b24('0x23')](function(_0x330630){return _0x330630;});}return null;};}function removeEntity(_0xaf41d5,_0x21bc19){return function(_0x1d262c){if(_0x1d262c){return _0x1d262c[_0x7b24('0x24')]()[_0x7b24('0x23')](function(){_0xaf41d5[_0x7b24('0x18')](0xcc)[_0x7b24('0x19')]();});}};}function handleEntityNotFound(_0x266c1c,_0x148358){return function(_0x57e384){if(!_0x57e384){_0x266c1c[_0x7b24('0x17')](0x194);}return _0x57e384;};}function handleError(_0x507dbe,_0x53d75f){_0x53d75f=_0x53d75f||0x1f4;return function(_0xfe23af){logger[_0x7b24('0x25')](_0xfe23af[_0x7b24('0x26')]);if(_0xfe23af[_0x7b24('0x27')]){delete _0xfe23af[_0x7b24('0x27')];}_0x507dbe['status'](_0x53d75f)['send'](_0xfe23af);};}exports[_0x7b24('0x28')]=function(_0x27831d,_0x42a2c4){var _0x27b0c7={},_0x443cc3={},_0x43f909={'count':0x0,'rows':[]};var _0x4888a5=_[_0x7b24('0x29')](db['Attachment'][_0x7b24('0x2a')],function(_0x2b2d04){return{'name':_0x2b2d04[_0x7b24('0x2b')],'type':_0x2b2d04[_0x7b24('0x2c')]['key']};});_0x443cc3[_0x7b24('0x2d')]=_[_0x7b24('0x29')](_0x4888a5,_0x7b24('0x27'));_0x443cc3[_0x7b24('0x2e')]=_[_0x7b24('0x2f')](_0x27831d[_0x7b24('0x2e')]);_0x443cc3[_0x7b24('0x30')]=_[_0x7b24('0x31')](_0x443cc3[_0x7b24('0x2d')],_0x443cc3['query']);_0x27b0c7['attributes']=_['intersection'](_0x443cc3[_0x7b24('0x2d')],qs['fields'](_0x27831d['query'][_0x7b24('0x32')]));_0x27b0c7[_0x7b24('0x33')]=_0x27b0c7[_0x7b24('0x33')][_0x7b24('0x34')]?_0x27b0c7['attributes']:_0x443cc3[_0x7b24('0x2d')];if(!_0x27831d[_0x7b24('0x2e')][_0x7b24('0x35')]('nolimit')){_0x27b0c7[_0x7b24('0x1d')]=qs[_0x7b24('0x1d')](_0x27831d[_0x7b24('0x2e')][_0x7b24('0x1d')]);_0x27b0c7['offset']=qs[_0x7b24('0x1b')](_0x27831d['query'][_0x7b24('0x1b')]);}_0x27b0c7[_0x7b24('0x36')]=qs['sort'](_0x27831d['query'][_0x7b24('0x37')]);_0x27b0c7[_0x7b24('0x38')]=qs[_0x7b24('0x30')](_['pick'](_0x27831d[_0x7b24('0x2e')],_0x443cc3[_0x7b24('0x30')]),_0x4888a5);if(_0x27831d['query']['filter']){_0x27b0c7[_0x7b24('0x38')]=_['merge'](_0x27b0c7[_0x7b24('0x38')],{'$or':_[_0x7b24('0x29')](_0x4888a5,function(_0x2c18d4){if(_0x2c18d4['type']!==_0x7b24('0x39')){var _0x5db6f5={};_0x5db6f5[_0x2c18d4[_0x7b24('0x27')]]={'$like':'%'+_0x27831d[_0x7b24('0x2e')][_0x7b24('0x3a')]+'%'};return _0x5db6f5;}})});}_0x27b0c7=_[_0x7b24('0x3b')]({},_0x27b0c7,_0x27831d[_0x7b24('0x3c')]);var _0x138995={'where':_0x27b0c7[_0x7b24('0x38')]};return db[_0x7b24('0x3d')][_0x7b24('0x1e')](_0x138995)['then'](function(_0x125683){_0x43f909[_0x7b24('0x1e')]=_0x125683;if(_0x27831d[_0x7b24('0x2e')][_0x7b24('0x3e')]){_0x27b0c7['include']=[{'all':!![]}];}return db[_0x7b24('0x3d')][_0x7b24('0x3f')](_0x27b0c7);})[_0x7b24('0x23')](function(_0x59a828){_0x43f909[_0x7b24('0x40')]=_0x59a828;return _0x43f909;})[_0x7b24('0x23')](respondWithFilteredResult(_0x42a2c4,_0x27b0c7))[_0x7b24('0x41')](handleError(_0x42a2c4,null));};exports['show']=function(_0x73bc13,_0x39154d){var _0x29f20f={'raw':!![],'where':{'id':_0x73bc13[_0x7b24('0x42')]['id']}},_0x121e13={};_0x121e13[_0x7b24('0x2d')]=_[_0x7b24('0x2f')](db['Attachment'][_0x7b24('0x2a')]);_0x121e13['query']=_[_0x7b24('0x2f')](_0x73bc13[_0x7b24('0x2e')]);_0x121e13[_0x7b24('0x30')]=_[_0x7b24('0x31')](_0x121e13['model'],_0x121e13[_0x7b24('0x2e')]);_0x29f20f['attributes']=_[_0x7b24('0x31')](_0x121e13[_0x7b24('0x2d')],qs[_0x7b24('0x32')](_0x73bc13['query'][_0x7b24('0x32')]));_0x29f20f[_0x7b24('0x33')]=_0x29f20f[_0x7b24('0x33')]['length']?_0x29f20f[_0x7b24('0x33')]:_0x121e13[_0x7b24('0x2d')];if(_0x73bc13[_0x7b24('0x2e')][_0x7b24('0x3e')]){_0x29f20f[_0x7b24('0x43')]=[{'all':!![]}];}_0x29f20f=_[_0x7b24('0x3b')]({},_0x29f20f,_0x73bc13[_0x7b24('0x3c')]);return db[_0x7b24('0x3d')][_0x7b24('0x44')](_0x29f20f)[_0x7b24('0x23')](handleEntityNotFound(_0x39154d,null))[_0x7b24('0x23')](respondWithResult(_0x39154d,null))['catch'](handleError(_0x39154d,null));};exports['clone']=function(_0x1b28ff,_0x27d45a){var _0x25dea2={'where':{'id':_0x1b28ff['params']['id']}},_0x14ef9f={};_0x14ef9f[_0x7b24('0x2d')]=_[_0x7b24('0x2f')](db[_0x7b24('0x3d')][_0x7b24('0x2a')]);_0x25dea2[_0x7b24('0x33')]=_[_0x7b24('0x31')](_0x14ef9f[_0x7b24('0x2d')],qs['fields'](_0x1b28ff[_0x7b24('0x2e')][_0x7b24('0x32')]));_0x25dea2[_0x7b24('0x33')]=_0x25dea2[_0x7b24('0x33')][_0x7b24('0x34')]?_0x25dea2[_0x7b24('0x33')]:_0x14ef9f['model'];if(_0x1b28ff[_0x7b24('0x2e')][_0x7b24('0x3e')]){_0x25dea2[_0x7b24('0x43')]=[{'all':!![]}];}_0x25dea2=_[_0x7b24('0x3b')]({},_0x25dea2,_0x1b28ff[_0x7b24('0x3c')]);return db[_0x7b24('0x3d')][_0x7b24('0x44')](_0x25dea2)[_0x7b24('0x23')](handleEntityNotFound(_0x27d45a,null))['then'](function(_0x34f282){if(_0x34f282){var _0x6cbf4f=_0x34f282[_0x7b24('0x45')]({'plain':!![]});_0x6cbf4f=qs[_0x7b24('0x46')](_0x6cbf4f,['id',_0x7b24('0x47'),_0x7b24('0x48')]);_0x1b28ff[_0x7b24('0x49')]=_[_0x7b24('0x46')](_0x1b28ff[_0x7b24('0x49')],['id','createdAt',_0x7b24('0x48')]);return db[_0x7b24('0x3d')]['create'](_['merge'](_0x6cbf4f,_0x1b28ff[_0x7b24('0x49')]),{'include':_0x1b28ff['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x7b24('0x23')](respondWithResult(_0x27d45a,0xc9))['catch'](handleError(_0x27d45a,null));};exports[_0x7b24('0x4a')]=function(_0x2c723c,_0x307ef2){if(_0x2c723c[_0x7b24('0x49')]['id']){delete _0x2c723c[_0x7b24('0x49')]['id'];}return db[_0x7b24('0x3d')][_0x7b24('0x44')]({'where':{'id':_0x2c723c[_0x7b24('0x42')]['id']}})[_0x7b24('0x23')](handleEntityNotFound(_0x307ef2,null))['then'](saveUpdates(_0x2c723c[_0x7b24('0x49')],null))['then'](respondWithResult(_0x307ef2,null))['catch'](handleError(_0x307ef2,null));};exports['destroy']=function(_0x4f0f23,_0x475da7){return db[_0x7b24('0x3d')][_0x7b24('0x44')]({'where':{'id':_0x4f0f23['params']['id']}})[_0x7b24('0x23')](handleEntityNotFound(_0x475da7,null))[_0x7b24('0x23')](removeEntity(_0x475da7,null))[_0x7b24('0x41')](handleError(_0x475da7,null));};exports[_0x7b24('0x4b')]=function(_0x46ebe3,_0x1ca9a1,_0x584c87){_0x46ebe3[_0x7b24('0x49')]['name']=_0x46ebe3[_0x7b24('0x4c')][_0x7b24('0x4d')];_0x46ebe3[_0x7b24('0x49')][_0x7b24('0x4e')]=_0x46ebe3[_0x7b24('0x4c')][_0x7b24('0x4f')];_0x46ebe3[_0x7b24('0x49')][_0x7b24('0x2c')]=_0x46ebe3[_0x7b24('0x4c')][_0x7b24('0x50')];return db[_0x7b24('0x3d')][_0x7b24('0x4b')](_0x46ebe3['body'])[_0x7b24('0x23')](respondWithResult(_0x1ca9a1,0xc9))[_0x7b24('0x41')](handleError(_0x1ca9a1,null));};exports[_0x7b24('0x51')]=function(_0x3ce286,_0x3192be,_0x5b011d){return db[_0x7b24('0x3d')][_0x7b24('0x52')]({'where':{'id':_0x3ce286[_0x7b24('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3192be,null))['then'](function(_0x3d27a4){if(_0x3d27a4){var _0x724716=_0x3d27a4['ChatOfflineMessageId']!==null;var _0x1d4050=path[_0x7b24('0x53')](config[_0x7b24('0x54')],_0x7b24('0x55'));if(_0x724716){_0x1d4050=path[_0x7b24('0x53')](_0x1d4050,'offline-chat/');}var _0x4c0b24=path[_0x7b24('0x53')](_0x1d4050,_0x3d27a4[_0x7b24('0x4e')]);return _0x3192be[_0x7b24('0x51')](_0x4c0b24);}})[_0x7b24('0x41')](handleError(_0x3192be,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 644fce2..193f36f 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 _0xb911=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','../../config/environment'];(function(_0x122c2e,_0x4a0110){var _0x560a4e=function(_0x55fb16){while(--_0x55fb16){_0x122c2e['push'](_0x122c2e['shift']());}};_0x560a4e(++_0x4a0110);}(_0xb911,0x79));var _0x1b91=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xb911[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x1b91('0x0'));var util=require(_0x1b91('0x1'));var logger=require(_0x1b91('0x2'))(_0x1b91('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b91('0x4'));var attributes=require('./attachment.attributes');module[_0x1b91('0x5')]=function(_0x11c6d0,_0x5a79bf){return _0x11c6d0[_0x1b91('0x6')](_0x1b91('0x7'),attributes,{'tableName':_0x1b91('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8a9=['define','Attachment','attachments','lodash','util','../../config/logger','request-promise','path','../../config/environment','./attachment.attributes','exports'];(function(_0x5930b3,_0x2e9b5c){var _0x5a0700=function(_0x143cd1){while(--_0x143cd1){_0x5930b3['push'](_0x5930b3['shift']());}};_0x5a0700(++_0x2e9b5c);}(_0xc8a9,0x18f));var _0x9c8a=function(_0x239c21,_0x56729d){_0x239c21=_0x239c21-0x0;var _0x433cbc=_0xc8a9[_0x239c21];return _0x433cbc;};'use strict';var _=require(_0x9c8a('0x0'));var util=require(_0x9c8a('0x1'));var logger=require(_0x9c8a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c8a('0x3'));var fs=require('fs');var path=require(_0x9c8a('0x4'));var rimraf=require('rimraf');var config=require(_0x9c8a('0x5'));var attributes=require(_0x9c8a('0x6'));module[_0x9c8a('0x7')]=function(_0x2b9fa7,_0x1c0b53){return _0x2b9fa7[_0x9c8a('0x8')](_0x9c8a('0x9'),attributes,{'tableName':_0x9c8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 7670291..2ff5373 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 _0xc964=['request\x20sent','stringify','error','Attachment,\x20%s,\x20%s','message','result','Attachment','create','body','options','raw','then','catch','CreateAttachment','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x5b101b,_0xfc548d){var _0xa1eae7=function(_0x15e59){while(--_0x15e59){_0x5b101b['push'](_0x5b101b['shift']());}};_0xa1eae7(++_0xfc548d);}(_0xc964,0x7e));var _0x4c96=function(_0x32f4d5,_0x3f4ed6){_0x32f4d5=_0x32f4d5-0x0;var _0x79f05c=_0xc964[_0x32f4d5];return _0x79f05c;};'use strict';var _=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var moment=require('moment');var BPromise=require(_0x4c96('0x2'));var rs=require(_0x4c96('0x3'));var fs=require('fs');var Redis=require(_0x4c96('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c96('0x5'));var logger=require('../../config/logger')(_0x4c96('0x6'));var config=require(_0x4c96('0x7'));var jayson=require(_0x4c96('0x8'));var client=jayson[_0x4c96('0x9')][_0x4c96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fa8a0,_0x4070a5,_0x493618){return new BPromise(function(_0x19ed76,_0xaa3f20){return client[_0x4c96('0xb')](_0x1fa8a0,_0x493618)['then'](function(_0x208911){logger[_0x4c96('0xc')]('Attachment,\x20%s,\x20%s',_0x4070a5,'request\x20sent');logger['debug'](_0x4c96('0xd'),_0x4070a5,_0x4c96('0xe'),JSON[_0x4c96('0xf')](_0x208911));if(_0x208911['error']){if(_0x208911[_0x4c96('0x10')]['code']===0x1f4){logger['error'](_0x4c96('0x11'),_0x4070a5,_0x208911[_0x4c96('0x10')][_0x4c96('0x12')]);return _0xaa3f20(_0x208911['error']['message']);}logger[_0x4c96('0x10')](_0x4c96('0x11'),_0x4070a5,_0x208911[_0x4c96('0x10')]['message']);return _0x19ed76(_0x208911[_0x4c96('0x10')][_0x4c96('0x12')]);}else{logger[_0x4c96('0xc')](_0x4c96('0x11'),_0x4070a5,_0x4c96('0xe'));_0x19ed76(_0x208911[_0x4c96('0x13')][_0x4c96('0x12')]);}})['catch'](function(_0x388237){logger['error'](_0x4c96('0x11'),_0x4070a5,_0x388237);_0xaa3f20(_0x388237);});});}exports['CreateAttachment']=function(_0x2453e0){var _0x494a26=this;return new Promise(function(_0x17891b,_0x1807b6){return db[_0x4c96('0x14')][_0x4c96('0x15')](_0x2453e0[_0x4c96('0x16')],{'raw':_0x2453e0[_0x4c96('0x17')]?_0x2453e0[_0x4c96('0x17')][_0x4c96('0x18')]===undefined?!![]:![]:!![]})[_0x4c96('0x19')](function(_0x9546c5){logger[_0x4c96('0xc')]('CreateAttachment',_0x2453e0);logger['debug']('CreateAttachment',_0x2453e0,JSON[_0x4c96('0xf')](_0x9546c5));_0x17891b(_0x9546c5);})[_0x4c96('0x1a')](function(_0x29f3a3){logger[_0x4c96('0x10')](_0x4c96('0x1b'),_0x29f3a3[_0x4c96('0x12')],_0x2453e0);_0x1807b6(_0x494a26['error'](0x1f4,_0x29f3a3[_0x4c96('0x12')]));});});};
\ No newline at end of file
+var _0x8b7c=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','options','raw'];(function(_0x2558ee,_0x2a2574){var _0x431306=function(_0x32cb67){while(--_0x32cb67){_0x2558ee['push'](_0x2558ee['shift']());}};_0x431306(++_0x2a2574);}(_0x8b7c,0x119));var _0xc8b7=function(_0x5e6c33,_0x4f157a){_0x5e6c33=_0x5e6c33-0x0;var _0x142bc9=_0x8b7c[_0x5e6c33];return _0x142bc9;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var moment=require(_0xc8b7('0x2'));var BPromise=require(_0xc8b7('0x3'));var rs=require(_0xc8b7('0x4'));var fs=require('fs');var Redis=require(_0xc8b7('0x5'));var db=require(_0xc8b7('0x6'))['db'];var utils=require(_0xc8b7('0x7'));var logger=require('../../config/logger')(_0xc8b7('0x8'));var config=require(_0xc8b7('0x9'));var jayson=require(_0xc8b7('0xa'));var client=jayson['client'][_0xc8b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x90cb38,_0x42d65e,_0x2c7807){return new BPromise(function(_0x9e4763,_0x2f149d){return client['request'](_0x90cb38,_0x2c7807)[_0xc8b7('0xc')](function(_0x504550){logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,_0xc8b7('0xf'));logger[_0xc8b7('0x10')](_0xc8b7('0x11'),_0x42d65e,'request\x20sent',JSON['stringify'](_0x504550));if(_0x504550['error']){if(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x13')]===0x1f4){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error']['message']);return _0x2f149d(_0x504550['error'][_0xc8b7('0x14')]);}logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error'][_0xc8b7('0x14')]);return _0x9e4763(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x14')]);}else{logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,'request\x20sent');_0x9e4763(_0x504550[_0xc8b7('0x15')][_0xc8b7('0x14')]);}})[_0xc8b7('0x16')](function(_0x3323de){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x3323de);_0x2f149d(_0x3323de);});});}exports[_0xc8b7('0x17')]=function(_0x485415){var _0x5ae36a=this;return new Promise(function(_0x1cf47c,_0x403659){return db[_0xc8b7('0x18')]['create'](_0x485415['body'],{'raw':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x462cce){logger[_0xc8b7('0xd')]('CreateAttachment',_0x485415);logger[_0xc8b7('0x10')]('CreateAttachment',_0x485415,JSON[_0xc8b7('0x1b')](_0x462cce));_0x1cf47c(_0x462cce);})[_0xc8b7('0x16')](function(_0x456eea){logger['error'](_0xc8b7('0x17'),_0x456eea[_0xc8b7('0x14')],_0x485415);_0x403659(_0x5ae36a[_0xc8b7('0x12')](0x1f4,_0x456eea['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a929d2b..23f20db 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x1058bc,_0x42c035){var _0x3b50b4=function(_0x51aa51){while(--_0x51aa51){_0x1058bc['push'](_0x1058bc['shift']());}};_0x3b50b4(++_0x42c035);}(_0xb10b,0x12a));var _0xbb10=function(_0x15c068,_0x441624){_0x15c068=_0x15c068-0x0;var _0x369daf=_0xb10b[_0x15c068];return _0x369daf;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x0b0e[_0x35fb56];return _0x2fd52c;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index cefc9a4..c9cb634 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc503=['admin','user','agent','domain','blocked','minutes','clearBlockUser','getLicense','status','send','ad-login','role','online','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','undefined','baseDN','url','authenticate','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','disabled','blockedAt'];(function(_0x23fdb2,_0x1e71e9){var _0x353754=function(_0x2f1b63){while(--_0x2f1b63){_0x23fdb2['push'](_0x23fdb2['shift']());}};_0x353754(++_0x1e71e9);}(_0xc503,0x111));var _0x3c50=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0xc503[_0x31e5cb];return _0x4170df;};'use strict';var passport=require(_0x3c50('0x0'));var LocalStrategy=require(_0x3c50('0x1'))['Strategy'];var moment=require(_0x3c50('0x2'));var ActiveDirectory=require(_0x3c50('0x3'));var BPromise=require(_0x3c50('0x4'));var util=require(_0x3c50('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x3c50('0x6'));var utils=require(_0x3c50('0x7'));var config=require('../../config/environment');var logger=require(_0x3c50('0x8'))('api');function isActiveDirectoryConfigured(_0x2bf1a9){var _0x2b76ac=![];if(typeof _0x2bf1a9[_0x3c50('0x9')]!==_0x3c50('0xa')){_0x2b76ac=_0x2bf1a9[_0x3c50('0x9')][_0x3c50('0xb')]&&_0x2bf1a9['activedirectory'][_0x3c50('0xc')]&&_0x2bf1a9[_0x3c50('0x9')]['domain'];}return _0x2b76ac;}function adAuthenticate(_0x201d1b,_0x1d92e1,_0x4cbe21){return new BPromise(function(_0x2a21bd,_0x63d884){try{var _0x1eb63a=new ActiveDirectory(_0x201d1b);_0x1eb63a[_0x3c50('0xd')](_0x1d92e1,_0x4cbe21,function(_0x375805,_0x2c7da9){if(_0x375805){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x1d92e1,util[_0x3c50('0xe')](_0x375805,{'showHidden':![],'depth':null}));_0x63d884('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2c7da9){logger['error'](_0x3c50('0xf'),_0x1d92e1);_0x63d884('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2a21bd(_0x2c7da9);}});}catch(_0x5cff26){_0x63d884(_0x5cff26);}});}function ActiveDirectoryAuthenticate(_0x3ff04d,_0x4f6249,_0x438ba5,_0x5094ff){var _0x542b8a,_0xcad7ec;if(!isActiveDirectoryConfigured(config)){logger[_0x3c50('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x4f6249);return _0x5094ff(null,![],{'message':_0x3c50('0x11')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x3c50('0x12'),_0x3c50('0x13')],'raw':!![]})[_0x3c50('0x14')](function(_0x1631d0){_0x542b8a=_0x1631d0;if(!_0x542b8a[_0x3c50('0x12')]){logger['error'](_0x3c50('0x15'),_0x4f6249);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x3ff04d[_0x3c50('0x16')]({'logging':!![],'attributes':['id',_0x3c50('0x17'),_0x3c50('0x18'),_0x3c50('0x19'),'role',_0x3c50('0x1a'),'blocked',_0x3c50('0x1b'),'online'],'where':{'name':_0x4f6249,'role':{'$or':[_0x3c50('0x1c'),_0x3c50('0x1d'),_0x3c50('0x1e')]},'adSsoEnabled':!![]}});})[_0x3c50('0x14')](function(_0x30fc2b){if(!_0x30fc2b||_0x30fc2b&&_0x30fc2b['name']!==_0x4f6249){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0xcad7ec=_0x30fc2b;var _0x1f0944=_0xcad7ec[_0x3c50('0x17')]+'@'+config[_0x3c50('0x9')][_0x3c50('0x1f')];return adAuthenticate(config[_0x3c50('0x9')],_0x1f0944,_0x438ba5);})[_0x3c50('0x14')](function(_0x50338c){if(_0xcad7ec[_0x3c50('0x1a')]){throw new Error(_0x3c50('0x11'));}if(_0x542b8a['blockDuration']>0x0){if(_0xcad7ec[_0x3c50('0x20')]){if(moment(_0xcad7ec['blockedAt'])['add'](_0x542b8a[_0x3c50('0x13')],_0x3c50('0x21'))>moment()){throw new Error(_0x3c50('0x11'));}return utils[_0x3c50('0x22')](_0xcad7ec,0x0,![],null)[_0x3c50('0x14')](function(){return utils['getLicense'](_0xcad7ec);})['then'](function(){return _0x5094ff(null,_0xcad7ec);});}else{return utils[_0x3c50('0x23')](_0xcad7ec)[_0x3c50('0x14')](function(){return _0x5094ff(null,_0xcad7ec);});}}else{return utils['getLicense'](_0xcad7ec)[_0x3c50('0x14')](function(){return _0x5094ff(null,_0xcad7ec);});}})['catch'](function(_0x449cfa){return _0x5094ff(null,![],_0x449cfa);});}function handleError(_0x3c0b62,_0x8f671d,_0x1dd0bc){return _0x3c0b62[_0x3c50('0x24')](_0x8f671d||0x1f4)[_0x3c50('0x25')]({'message':_0x1dd0bc?_0x1dd0bc['message']||_0x1dd0bc:''});}exports['login']=function(_0x53b3e7,_0x427882,_0x102640){passport['authenticate'](_0x3c50('0x26'),function(_0x224082,_0x411e04,_0x184342){var _0x136e1a=_0x224082||_0x184342;if(_0x136e1a){return handleError(_0x427882,0x191,_0x136e1a);}if(!_0x411e04){return handleError(_0x427882,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2c6878={'payload':{'id':_0x411e04['id'],'role':_0x411e04[_0x3c50('0x27')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2c6878)[_0x3c50('0x14')](function(_0x2268f7){_0x427882['json']({'id':_0x411e04['id'],'token':_0x2268f7,'statusCall':'','isAlreadyLogged':_0x411e04[_0x3c50('0x28')]});});}})(_0x53b3e7,_0x427882,_0x102640);};passport[_0x3c50('0x29')]('ad-login',new LocalStrategy({'usernameField':_0x3c50('0x17'),'passwordField':_0x3c50('0x18')},function(_0x3f4831,_0x2babc9,_0x30e6de){return ActiveDirectoryAuthenticate(db[_0x3c50('0x2a')],_0x3f4831,_0x2babc9,_0x30e6de);}));
\ No newline at end of file
+var _0x02e6=['blocked','online','user','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','json','use','User','passport','Strategy','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled'];(function(_0x97ad61,_0x181ead){var _0x8054be=function(_0x4df205){while(--_0x4df205){_0x97ad61['push'](_0x97ad61['shift']());}};_0x8054be(++_0x181ead);}(_0x02e6,0xa9));var _0x602e=function(_0x2139a0,_0x4346bb){_0x2139a0=_0x2139a0-0x0;var _0x5d51e6=_0x02e6[_0x2139a0];return _0x5d51e6;};'use strict';var passport=require(_0x602e('0x0'));var LocalStrategy=require('passport-local')[_0x602e('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x602e('0x2'));var BPromise=require(_0x602e('0x3'));var util=require(_0x602e('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x602e('0x5'));var utils=require(_0x602e('0x6'));var config=require(_0x602e('0x7'));var logger=require(_0x602e('0x8'))(_0x602e('0x9'));function isActiveDirectoryConfigured(_0x258cc1){var _0x1dd22c=![];if(typeof _0x258cc1[_0x602e('0xa')]!==_0x602e('0xb')){_0x1dd22c=_0x258cc1[_0x602e('0xa')][_0x602e('0xc')]&&_0x258cc1[_0x602e('0xa')][_0x602e('0xd')]&&_0x258cc1[_0x602e('0xa')][_0x602e('0xe')];}return _0x1dd22c;}function adAuthenticate(_0x292cea,_0x5ed6ef,_0x20b142){return new BPromise(function(_0x309e0f,_0x5af72d){try{var _0x18b5b2=new ActiveDirectory(_0x292cea);_0x18b5b2[_0x602e('0xf')](_0x5ed6ef,_0x20b142,function(_0x154563,_0x261ab7){if(_0x154563){logger['error'](_0x602e('0x10'),_0x5ed6ef,util[_0x602e('0x11')](_0x154563,{'showHidden':![],'depth':null}));_0x5af72d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x261ab7){logger[_0x602e('0x12')](_0x602e('0x13'),_0x5ed6ef);_0x5af72d(_0x602e('0x14'));}else{_0x309e0f(_0x261ab7);}});}catch(_0x58c179){_0x5af72d(_0x58c179);}});}function ActiveDirectoryAuthenticate(_0x2766f5,_0x502f08,_0x448eb9,_0xdfc008){var _0x114d37,_0x5c604e;if(!isActiveDirectoryConfigured(config)){logger[_0x602e('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x502f08);return _0xdfc008(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x602e('0x15')][_0x602e('0x16')]({'where':{'id':0x1},'attributes':[_0x602e('0x17'),_0x602e('0x18')],'raw':!![]})[_0x602e('0x19')](function(_0xcda370){_0x114d37=_0xcda370;if(!_0x114d37[_0x602e('0x17')]){logger[_0x602e('0x12')](_0x602e('0x1a'),_0x502f08);throw new Error(_0x602e('0x14'));}return _0x2766f5[_0x602e('0x16')]({'logging':!![],'attributes':['id',_0x602e('0x1b'),_0x602e('0x1c'),'salt',_0x602e('0x1d'),_0x602e('0x1e'),_0x602e('0x1f'),'blockedAt',_0x602e('0x20')],'where':{'name':_0x502f08,'role':{'$or':['admin',_0x602e('0x21'),_0x602e('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x3a1e73){if(!_0x3a1e73||_0x3a1e73&&_0x3a1e73['name']!==_0x502f08){throw new Error(_0x602e('0x14'));}_0x5c604e=_0x3a1e73;var _0x26ce16=_0x5c604e[_0x602e('0x1b')]+'@'+config[_0x602e('0xa')][_0x602e('0xe')];return adAuthenticate(config['activedirectory'],_0x26ce16,_0x448eb9);})[_0x602e('0x19')](function(_0x18d356){if(_0x5c604e[_0x602e('0x1e')]){throw new Error(_0x602e('0x14'));}if(_0x114d37['blockDuration']>0x0){if(_0x5c604e[_0x602e('0x1f')]){if(moment(_0x5c604e[_0x602e('0x23')])[_0x602e('0x24')](_0x114d37['blockDuration'],_0x602e('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x602e('0x26')](_0x5c604e,0x0,![],null)[_0x602e('0x19')](function(){return utils[_0x602e('0x27')](_0x5c604e);})['then'](function(){return _0xdfc008(null,_0x5c604e);});}else{return utils[_0x602e('0x27')](_0x5c604e)[_0x602e('0x19')](function(){return _0xdfc008(null,_0x5c604e);});}}else{return utils[_0x602e('0x27')](_0x5c604e)[_0x602e('0x19')](function(){return _0xdfc008(null,_0x5c604e);});}})[_0x602e('0x28')](function(_0x50a913){return _0xdfc008(null,![],_0x50a913);});}function handleError(_0x12716b,_0x497590,_0x5fcbac){return _0x12716b[_0x602e('0x29')](_0x497590||0x1f4)[_0x602e('0x2a')]({'message':_0x5fcbac?_0x5fcbac[_0x602e('0x2b')]||_0x5fcbac:''});}exports[_0x602e('0x2c')]=function(_0x12b906,_0x19f918,_0x39a0a8){passport['authenticate'](_0x602e('0x2d'),function(_0x4d573f,_0x42c1db,_0x18d4fc){var _0x211567=_0x4d573f||_0x18d4fc;if(_0x211567){return handleError(_0x19f918,0x191,_0x211567);}if(!_0x42c1db){return handleError(_0x19f918,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x26c5a7={'payload':{'id':_0x42c1db['id'],'role':_0x42c1db[_0x602e('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x602e('0x2e')](_0x26c5a7)[_0x602e('0x19')](function(_0x423380){_0x19f918[_0x602e('0x2f')]({'id':_0x42c1db['id'],'token':_0x423380,'statusCall':'','isAlreadyLogged':_0x42c1db[_0x602e('0x20')]});});}})(_0x12b906,_0x19f918,_0x39a0a8);};passport[_0x602e('0x30')](_0x602e('0x2d'),new LocalStrategy({'usernameField':_0x602e('0x1b'),'passwordField':_0x602e('0x1c')},function(_0x531296,_0x500176,_0x13fb73){return ActiveDirectoryAuthenticate(db[_0x602e('0x31')],_0x531296,_0x500176,_0x13fb73);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 95d91d5..254a676 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5f6=['login','exports','express','Router'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0xb5f6,0x96));var _0x6b5f=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xb5f6[_0x149ca0];return _0x56b6b9;};'use strict';var express=require(_0x6b5f('0x0'));var router=express[_0x6b5f('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x6b5f('0x2')]);module[_0x6b5f('0x3')]=router;
\ No newline at end of file
+var _0x2786=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2786,0x1a5));var _0x6278=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2786[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x6278('0x0'));var router=express['Router']();var controller=require(_0x6278('0x1'));router[_0x6278('0x2')]('/',controller[_0x6278('0x3')]);module[_0x6278('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index ffdec93..9f0fc5a 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a54,0x106));var _0x47a5=function(_0x27125b,_0x2ea463){_0x27125b=_0x27125b-0x0;var _0x183f15=_0x7a54[_0x27125b];return _0x183f15;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7a54,0x106));var _0x47a5=function(_0x3ad5be,_0x30c4f7){_0x3ad5be=_0x3ad5be-0x0;var _0x40f25c=_0x7a54[_0x3ad5be];return _0x40f25c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 1a51c4a..6debef1 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 _0x2d48=['login','callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x2f0f22,_0x3f4b8d){var _0x44f705=function(_0x187475){while(--_0x187475){_0x2f0f22['push'](_0x2f0f22['shift']());}};_0x44f705(++_0x3f4b8d);}(_0x2d48,0x143));var _0x82d4=function(_0x14a54a,_0x38a5c0){_0x14a54a=_0x14a54a-0x0;var _0x4d1dbe=_0x2d48[_0x14a54a];return _0x4d1dbe;};'use strict';var express=require(_0x82d4('0x0'));var passport=require(_0x82d4('0x1'));var router=express[_0x82d4('0x2')]();var controller=require(_0x82d4('0x3'));var userController=require(_0x82d4('0x4'));var authService=require(_0x82d4('0x5'));router[_0x82d4('0x6')]('/',controller[_0x82d4('0x7')]);router[_0x82d4('0x6')]('/callback',controller[_0x82d4('0x8')],authService[_0x82d4('0x9')],userController[_0x82d4('0x7')],authService['setTokenCookie']);module[_0x82d4('0xa')]=router;
\ No newline at end of file
+var _0xeccb=['express','./authGoogle.controller','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0xbf7121,_0x847a81){var _0x1eaeba=function(_0x546bc0){while(--_0x546bc0){_0xbf7121['push'](_0xbf7121['shift']());}};_0x1eaeba(++_0x847a81);}(_0xeccb,0x16c));var _0xbecc=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xeccb[_0x4ea69d];return _0x5318e0;};'use strict';var express=require(_0xbecc('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xbecc('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0xbecc('0x2'));router[_0xbecc('0x3')]('/',controller['login']);router[_0xbecc('0x3')](_0xbecc('0x4'),controller[_0xbecc('0x5')],authService[_0xbecc('0x6')],userController['login'],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 3d83522..eab5db0 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 _0xb7d6=['blocked','add','blockDuration','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','email','user','request','error','message','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','https://','headers','host','/reset/','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordToken','use','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','name','role','disabled','blockedAt','loginAttempts','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate'];(function(_0x16f04e,_0x379d5d){var _0x51735a=function(_0x391a14){while(--_0x391a14){_0x16f04e['push'](_0x16f04e['shift']());}};_0x51735a(++_0x379d5d);}(_0xb7d6,0xca));var _0x6b7d=function(_0x1e79d8,_0x3f2aa7){_0x1e79d8=_0x1e79d8-0x0;var _0x3c2e1c=_0xb7d6[_0x1e79d8];return _0x3c2e1c;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')[_0x6b7d('0x0')];var jayson=require(_0x6b7d('0x1'));var _=require(_0x6b7d('0x2'));var rs=require('randomstring');var moment=require(_0x6b7d('0x3'));var db=require(_0x6b7d('0x4'))['db'];var authService=require(_0x6b7d('0x5'));var utils=require(_0x6b7d('0x6'));var client=jayson['client'][_0x6b7d('0x7')]({'port':0x232b});function localAuthenticate(_0x34bd61,_0x2452d3,_0x3aaf9e,_0x36be9d){var _0x10b6df,_0x4c1bce;return db[_0x6b7d('0x8')][_0x6b7d('0x9')]({'where':{'id':0x1},'attributes':[_0x6b7d('0xa'),'blockDuration'],'raw':!![]})['then'](function(_0x5919b3){_0x10b6df=_0x5919b3;return _0x34bd61[_0x6b7d('0x9')]({'attributes':['id',_0x6b7d('0xb'),'password','salt',_0x6b7d('0xc'),_0x6b7d('0xd'),'blocked',_0x6b7d('0xe'),_0x6b7d('0xf')],'where':{'name':_0x2452d3,'role':{'$or':['admin','user',_0x6b7d('0x10')]}}});})[_0x6b7d('0x11')](function(_0x16dd6){if(!_0x16dd6||_0x16dd6&&_0x16dd6[_0x6b7d('0xb')]!==_0x2452d3){throw new Error(_0x6b7d('0x12'));}else{_0x4c1bce=_0x16dd6;return _0x4c1bce;}})[_0x6b7d('0x11')](function(){_0x4c1bce[_0x6b7d('0x13')](_0x3aaf9e,function(_0x3af0cd,_0xc34722){var _0x524d8a=_0x4c1bce[_0x6b7d('0xf')]+0x1;if(_0x3af0cd){return _0x36be9d(_0x3af0cd);}else if(!_0xc34722){if(_0x4c1bce['disabled']){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else if(_0x10b6df[_0x6b7d('0xa')]>0x0){if(_0x4c1bce[_0x6b7d('0x14')]){if(_0x10b6df['blockDuration']>0x0){if(moment(_0x4c1bce[_0x6b7d('0xe')])[_0x6b7d('0x15')](_0x10b6df[_0x6b7d('0x16')],_0x6b7d('0x17'))>moment()){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else{return utils[_0x6b7d('0x18')](_0x4c1bce,_0x524d8a,![],null)[_0x6b7d('0x11')](function(){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});});}}else{return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}}else{if(_0x524d8a>=_0x10b6df[_0x6b7d('0xa')]){return utils[_0x6b7d('0x18')](_0x4c1bce,0x0,!![],moment())[_0x6b7d('0x11')](function(){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});});}else{return utils[_0x6b7d('0x18')](_0x4c1bce,_0x524d8a,![],null)[_0x6b7d('0x11')](function(){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});});}}}else{return _0x36be9d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4c1bce['disabled']){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else if(_0x10b6df['allowedLoginAttempts']>0x0){if(_0x4c1bce[_0x6b7d('0x14')]){if(_0x10b6df[_0x6b7d('0x16')]>0x0){if(moment(_0x4c1bce[_0x6b7d('0xe')])[_0x6b7d('0x15')](_0x10b6df['blockDuration'],_0x6b7d('0x17'))>moment()){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else{return utils[_0x6b7d('0x18')](_0x4c1bce,0x0,![],null)[_0x6b7d('0x11')](function(){return utils[_0x6b7d('0x19')](_0x4c1bce);})[_0x6b7d('0x11')](function(){return _0x36be9d(null,_0x4c1bce);});}}else{return _0x36be9d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x6b7d('0x18')](_0x4c1bce,0x0,![],null)[_0x6b7d('0x11')](function(){return utils[_0x6b7d('0x19')](_0x4c1bce);})['then'](function(){return _0x36be9d(null,_0x4c1bce);})[_0x6b7d('0x1a')](function(_0x2701de){return _0x36be9d(null,![],_0x2701de);});}}else{if(_0x4c1bce[_0x6b7d('0x14')]){return _0x36be9d(null,![],{'message':_0x6b7d('0x12')});}else{return utils[_0x6b7d('0x19')](_0x4c1bce)['then'](function(){return _0x36be9d(null,_0x4c1bce);});}}}});})[_0x6b7d('0x1a')](function(_0x45ade3){return _0x36be9d(null,![],_0x45ade3);});}function sendServiceMail(_0xc2aef){return db[_0x6b7d('0x1b')][_0x6b7d('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x6b7d('0xb'),'email'],'include':[{'model':db[_0x6b7d('0x1d')],'as':_0x6b7d('0x1e'),'include':[{'model':db[_0x6b7d('0x1f')],'as':_0x6b7d('0x1f')}]}]})[_0x6b7d('0x11')](function(_0x55d341){if(!_0x55d341){throw new Error(_0x6b7d('0x20'));}var _0x5056e8=_0x55d341[_0x6b7d('0x21')]();var _0x38130c={'account':_0x5056e8,'message':_['merge']({'from':util[_0x6b7d('0x22')]('\x22%s\x22\x20<%s>',_0x55d341[_0x6b7d('0xb')],_0x55d341[_0x6b7d('0x23')]||_0x55d341[_0x6b7d('0x1e')][_0x6b7d('0x24')])},_0xc2aef)};return client[_0x6b7d('0x25')]('SendMail',_0x38130c);})[_0x6b7d('0x11')](function(_0xd25b2b){if(_0xd25b2b[_0x6b7d('0x26')]){throw new Error(util[_0x6b7d('0x22')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xd25b2b[_0x6b7d('0x26')][_0x6b7d('0x27')]||JSON['stringify'](_0xd25b2b[_0x6b7d('0x26')])));}return!![];});}function handleError(_0x30db81,_0x36fdeb,_0xe54b7e){return _0x30db81['status'](_0x36fdeb||0x1f4)[_0x6b7d('0x28')]({'message':_0xe54b7e?_0xe54b7e[_0x6b7d('0x27')]||_0xe54b7e:''});}exports['login']=function(_0x4f2894,_0x10d6fd,_0x5bb6ee){passport[_0x6b7d('0x13')](_0x6b7d('0x29'),function(_0x4e5e42,_0x337af8,_0x390146){var _0x3ae271=_0x4e5e42||_0x390146;if(_0x3ae271){return handleError(_0x10d6fd,0x191,_0x3ae271);}if(!_0x337af8){return handleError(_0x10d6fd,0x194,{'message':_0x6b7d('0x2a')});}else{var _0x5a71b2={'payload':{'id':_0x337af8['id'],'role':_0x337af8['role']},'options':{'expiresIn':0x15180}};return authService[_0x6b7d('0x2b')](_0x5a71b2)[_0x6b7d('0x11')](function(_0x15b7d7){_0x10d6fd['json']({'id':_0x337af8['id'],'token':_0x15b7d7,'statusCall':'','isAlreadyLogged':_0x337af8[_0x6b7d('0x2c')]});});}})(_0x4f2894,_0x10d6fd,_0x5bb6ee);};exports[_0x6b7d('0x2d')]=function(_0x148a9f,_0x4cefd0){if(!_0x148a9f[_0x6b7d('0x2e')][_0x6b7d('0x23')]){return handleError(_0x4cefd0,0x1f4,{'message':_0x6b7d('0x2f')});}var _0x8bb2ff=rs['generate']();_0x148a9f[_0x6b7d('0x2e')][_0x6b7d('0x23')]=_0x148a9f['body']['email'][_0x6b7d('0x30')]()[_0x6b7d('0x31')]();var _0x38e9e0;return db[_0x6b7d('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x6b7d('0xa'),_0x6b7d('0x16')],'raw':!![]})[_0x6b7d('0x11')](function(_0x10d40c){_0x38e9e0=_0x10d40c;return db[_0x6b7d('0x32')]['find']({'where':{'email':_0x148a9f[_0x6b7d('0x2e')]['email']}});})['then'](function(_0x42e9dd){if(!_0x42e9dd){throw new Error(_0x6b7d('0x33'));}if(_0x42e9dd['disabled']){throw new Error(_0x6b7d('0x34'));}if(_0x42e9dd[_0x6b7d('0x14')]){if(moment(_0x42e9dd[_0x6b7d('0xe')])[_0x6b7d('0x15')](_0x38e9e0[_0x6b7d('0x16')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x42e9dd[_0x6b7d('0x14')]=![];_0x42e9dd[_0x6b7d('0xe')]=null;}}_0x42e9dd['resetPasswordToken']=_0x8bb2ff;_0x42e9dd[_0x6b7d('0x35')]=Date[_0x6b7d('0x36')]()+0x36ee80;return _0x42e9dd[_0x6b7d('0x37')]();})[_0x6b7d('0x11')](function(){return sendServiceMail({'to':_0x148a9f['body'][_0x6b7d('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x6b7d('0x38')+_0x148a9f[_0x6b7d('0x39')][_0x6b7d('0x3a')]+_0x6b7d('0x3b')+_0x8bb2ff+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x6b7d('0x11')](function(){_0x4cefd0[_0x6b7d('0x3c')](0xc8)[_0x6b7d('0x28')]({'message':_0x6b7d('0x3d')});})[_0x6b7d('0x1a')](function(_0x8b5e2e){return handleError(_0x4cefd0,0x1f4,_0x8b5e2e);});};exports[_0x6b7d('0x3e')]=function(_0x3e2751,_0x5793c3){return db[_0x6b7d('0x32')][_0x6b7d('0x1c')]({'where':{'resetPasswordToken':_0x3e2751[_0x6b7d('0x3f')][_0x6b7d('0x40')],'resetPasswordExpires':{'$gt':Date[_0x6b7d('0x36')]()}}})['then'](function(_0x144e8d){if(!_0x144e8d){throw new Error(_0x6b7d('0x41'));}return db[_0x6b7d('0x8')]['findOne']({'attributes':['id',_0x6b7d('0x42'),_0x6b7d('0x43'),'passwordHistoryLimit']})[_0x6b7d('0x11')](function(_0x10c167){if(_0x10c167[_0x6b7d('0x42')])authService[_0x6b7d('0x44')](_0x3e2751[_0x6b7d('0x2e')][_0x6b7d('0x45')]);if(!_0x10c167[_0x6b7d('0x43')]||!_0x144e8d[_0x6b7d('0x46')])return _0x144e8d;authService[_0x6b7d('0x47')](_0x3e2751[_0x6b7d('0x2e')][_0x6b7d('0x45')],_0x144e8d[_0x6b7d('0x46')],_0x10c167['passwordHistoryLimit']);return _0x144e8d;})[_0x6b7d('0x11')](function(){_0x144e8d[_0x6b7d('0x45')]=_0x3e2751['body'][_0x6b7d('0x45')];_0x144e8d[_0x6b7d('0x48')]=null;_0x144e8d['resetPasswordExpires']=null;return _0x144e8d[_0x6b7d('0x37')]();});})[_0x6b7d('0x11')](function(){_0x5793c3[_0x6b7d('0x3c')](0xc8)[_0x6b7d('0x28')]({'message':'Password\x20reset!'});})[_0x6b7d('0x1a')](function(_0x44ff3f){return handleError(_0x5793c3,0x1f4,_0x44ff3f);});};passport[_0x6b7d('0x49')](_0x6b7d('0x29'),new LocalStrategy({'usernameField':_0x6b7d('0xb'),'passwordField':_0x6b7d('0x45')},function(_0x6e765c,_0x53aae2,_0xc95376){return localAuthenticate(db['User'],_0x6e765c,_0x53aae2,_0xc95376);}));
\ No newline at end of file
+var _0xb986=['admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','name','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local-login','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','password','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../config/utils','client','Setting','blockDuration','then','findOne','salt','disabled','blockedAt','loginAttempts'];(function(_0x31dabc,_0x4762d4){var _0x22c853=function(_0x5d81b2){while(--_0x5d81b2){_0x31dabc['push'](_0x31dabc['shift']());}};_0x22c853(++_0x4762d4);}(_0xb986,0x89));var _0x6b98=function(_0x38062,_0x5f2b18){_0x38062=_0x38062-0x0;var _0x166bc6=_0xb986[_0x38062];return _0x166bc6;};'use strict';var util=require(_0x6b98('0x0'));var passport=require(_0x6b98('0x1'));var LocalStrategy=require(_0x6b98('0x2'))[_0x6b98('0x3')];var jayson=require(_0x6b98('0x4'));var _=require(_0x6b98('0x5'));var rs=require('randomstring');var moment=require(_0x6b98('0x6'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x6b98('0x7'));var client=jayson[_0x6b98('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x55fe8a,_0x310090,_0x503ff7,_0xa9a827){var _0x5d391f,_0x4ac3e0;return db[_0x6b98('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6b98('0xa')],'raw':!![]})[_0x6b98('0xb')](function(_0xf78df){_0x5d391f=_0xf78df;return _0x55fe8a[_0x6b98('0xc')]({'attributes':['id','name','password',_0x6b98('0xd'),'role',_0x6b98('0xe'),'blocked',_0x6b98('0xf'),_0x6b98('0x10')],'where':{'name':_0x310090,'role':{'$or':[_0x6b98('0x11'),_0x6b98('0x12'),_0x6b98('0x13')]}}});})[_0x6b98('0xb')](function(_0x294127){if(!_0x294127||_0x294127&&_0x294127['name']!==_0x310090){throw new Error(_0x6b98('0x14'));}else{_0x4ac3e0=_0x294127;return _0x4ac3e0;}})[_0x6b98('0xb')](function(){_0x4ac3e0[_0x6b98('0x15')](_0x503ff7,function(_0x5df258,_0x3a785c){var _0x1a60e7=_0x4ac3e0[_0x6b98('0x10')]+0x1;if(_0x5df258){return _0xa9a827(_0x5df258);}else if(!_0x3a785c){if(_0x4ac3e0[_0x6b98('0xe')]){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}else if(_0x5d391f[_0x6b98('0x16')]>0x0){if(_0x4ac3e0[_0x6b98('0x17')]){if(_0x5d391f[_0x6b98('0xa')]>0x0){if(moment(_0x4ac3e0[_0x6b98('0xf')])[_0x6b98('0x18')](_0x5d391f[_0x6b98('0xa')],_0x6b98('0x19'))>moment()){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}else{return utils[_0x6b98('0x1a')](_0x4ac3e0,_0x1a60e7,![],null)[_0x6b98('0xb')](function(){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});});}}else{return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}}else{if(_0x1a60e7>=_0x5d391f[_0x6b98('0x16')]){return utils['clearBlockUser'](_0x4ac3e0,0x0,!![],moment())[_0x6b98('0xb')](function(){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});});}else{return utils[_0x6b98('0x1a')](_0x4ac3e0,_0x1a60e7,![],null)[_0x6b98('0xb')](function(){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});});}}}else{return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}}else{if(_0x4ac3e0[_0x6b98('0xe')]){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}else if(_0x5d391f['allowedLoginAttempts']>0x0){if(_0x4ac3e0['blocked']){if(_0x5d391f[_0x6b98('0xa')]>0x0){if(moment(_0x4ac3e0['blockedAt'])[_0x6b98('0x18')](_0x5d391f[_0x6b98('0xa')],'minutes')>moment()){return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}else{return utils[_0x6b98('0x1a')](_0x4ac3e0,0x0,![],null)[_0x6b98('0xb')](function(){return utils['getLicense'](_0x4ac3e0);})[_0x6b98('0xb')](function(){return _0xa9a827(null,_0x4ac3e0);});}}else{return _0xa9a827(null,![],{'message':_0x6b98('0x14')});}}else{return utils[_0x6b98('0x1a')](_0x4ac3e0,0x0,![],null)[_0x6b98('0xb')](function(){return utils[_0x6b98('0x1b')](_0x4ac3e0);})[_0x6b98('0xb')](function(){return _0xa9a827(null,_0x4ac3e0);})[_0x6b98('0x1c')](function(_0x1d3955){return _0xa9a827(null,![],_0x1d3955);});}}else{if(_0x4ac3e0[_0x6b98('0x17')]){return _0xa9a827(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x6b98('0x1b')](_0x4ac3e0)[_0x6b98('0xb')](function(){return _0xa9a827(null,_0x4ac3e0);});}}}});})[_0x6b98('0x1c')](function(_0x3aa0e2){return _0xa9a827(null,![],_0x3aa0e2);});}function sendServiceMail(_0x2db890){return db[_0x6b98('0x1d')][_0x6b98('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x6b98('0x1f'),_0x6b98('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x6b98('0x21'),'include':[{'model':db[_0x6b98('0x22')],'as':_0x6b98('0x22')}]}]})['then'](function(_0x40077a){if(!_0x40077a){throw new Error(_0x6b98('0x23'));}var _0x12af06=_0x40077a[_0x6b98('0x24')]();var _0x3b660c={'account':_0x12af06,'message':_['merge']({'from':util['format'](_0x6b98('0x25'),_0x40077a[_0x6b98('0x1f')],_0x40077a[_0x6b98('0x20')]||_0x40077a[_0x6b98('0x21')][_0x6b98('0x12')])},_0x2db890)};return client[_0x6b98('0x26')](_0x6b98('0x27'),_0x3b660c);})['then'](function(_0x305229){if(_0x305229[_0x6b98('0x28')]){throw new Error(util['format'](_0x6b98('0x29'),_0x305229['error'][_0x6b98('0x2a')]||JSON[_0x6b98('0x2b')](_0x305229['error'])));}return!![];});}function handleError(_0x2751c7,_0x564361,_0x1fbd80){return _0x2751c7[_0x6b98('0x2c')](_0x564361||0x1f4)['send']({'message':_0x1fbd80?_0x1fbd80[_0x6b98('0x2a')]||_0x1fbd80:''});}exports[_0x6b98('0x2d')]=function(_0x285164,_0x375eb0,_0x3862a9){passport['authenticate'](_0x6b98('0x2e'),function(_0x39cf36,_0x1cbc81,_0x3fc58b){var _0x208b1a=_0x39cf36||_0x3fc58b;if(_0x208b1a){return handleError(_0x375eb0,0x191,_0x208b1a);}if(!_0x1cbc81){return handleError(_0x375eb0,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x17bcce={'payload':{'id':_0x1cbc81['id'],'role':_0x1cbc81[_0x6b98('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x6b98('0x30')](_0x17bcce)[_0x6b98('0xb')](function(_0x5bcd9d){_0x375eb0[_0x6b98('0x31')]({'id':_0x1cbc81['id'],'token':_0x5bcd9d,'statusCall':'','isAlreadyLogged':_0x1cbc81[_0x6b98('0x32')]});});}})(_0x285164,_0x375eb0,_0x3862a9);};exports[_0x6b98('0x33')]=function(_0x17fbd3,_0x4ff8da){if(!_0x17fbd3[_0x6b98('0x34')][_0x6b98('0x20')]){return handleError(_0x4ff8da,0x1f4,{'message':_0x6b98('0x35')});}var _0x21d042=rs[_0x6b98('0x36')]();_0x17fbd3[_0x6b98('0x34')][_0x6b98('0x20')]=_0x17fbd3[_0x6b98('0x34')][_0x6b98('0x20')][_0x6b98('0x37')]()['toLowerCase']();var _0x1f58fc;return db[_0x6b98('0x9')][_0x6b98('0xc')]({'where':{'id':0x1},'attributes':[_0x6b98('0x16'),_0x6b98('0xa')],'raw':!![]})[_0x6b98('0xb')](function(_0x191a4c){_0x1f58fc=_0x191a4c;return db[_0x6b98('0x38')][_0x6b98('0x1e')]({'where':{'email':_0x17fbd3['body'][_0x6b98('0x20')]}});})['then'](function(_0x243624){if(!_0x243624){throw new Error(_0x6b98('0x39'));}if(_0x243624['disabled']){throw new Error(_0x6b98('0x3a'));}if(_0x243624[_0x6b98('0x17')]){if(moment(_0x243624[_0x6b98('0xf')])[_0x6b98('0x18')](_0x1f58fc[_0x6b98('0xa')],_0x6b98('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x243624[_0x6b98('0x17')]=![];_0x243624['blockedAt']=null;}}_0x243624[_0x6b98('0x3b')]=_0x21d042;_0x243624[_0x6b98('0x3c')]=Date['now']()+0x36ee80;return _0x243624[_0x6b98('0x3d')]();})[_0x6b98('0xb')](function(){return sendServiceMail({'to':_0x17fbd3[_0x6b98('0x34')][_0x6b98('0x20')],'subject':_0x6b98('0x3e'),'text':_0x6b98('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x17fbd3['headers'][_0x6b98('0x40')]+_0x6b98('0x41')+_0x21d042+'\x0a\x0a'+_0x6b98('0x42')});})['then'](function(){_0x4ff8da['status'](0xc8)[_0x6b98('0x43')]({'message':'Reset\x20Email\x20sent!'});})[_0x6b98('0x1c')](function(_0x2bed66){return handleError(_0x4ff8da,0x1f4,_0x2bed66);});};exports[_0x6b98('0x44')]=function(_0x4dbdd4,_0x1c1228){return db['User'][_0x6b98('0x1e')]({'where':{'resetPasswordToken':_0x4dbdd4['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x6b98('0xb')](function(_0x2eeda0){if(!_0x2eeda0){throw new Error(_0x6b98('0x45'));}return db[_0x6b98('0x9')][_0x6b98('0xc')]({'attributes':['id',_0x6b98('0x46'),_0x6b98('0x47'),_0x6b98('0x48')]})[_0x6b98('0xb')](function(_0x25bf0e){if(_0x25bf0e[_0x6b98('0x46')])authService[_0x6b98('0x49')](_0x4dbdd4[_0x6b98('0x34')]['password']);if(!_0x25bf0e[_0x6b98('0x47')]||!_0x2eeda0['previousPasswords'])return _0x2eeda0;authService[_0x6b98('0x4a')](_0x4dbdd4[_0x6b98('0x34')]['password'],_0x2eeda0[_0x6b98('0x4b')],_0x25bf0e[_0x6b98('0x48')]);return _0x2eeda0;})['then'](function(){_0x2eeda0['password']=_0x4dbdd4[_0x6b98('0x34')][_0x6b98('0x4c')];_0x2eeda0[_0x6b98('0x3b')]=null;_0x2eeda0[_0x6b98('0x3c')]=null;return _0x2eeda0[_0x6b98('0x3d')]();});})[_0x6b98('0xb')](function(){_0x1c1228[_0x6b98('0x2c')](0xc8)[_0x6b98('0x43')]({'message':'Password\x20reset!'});})[_0x6b98('0x1c')](function(_0x1ef892){return handleError(_0x1c1228,0x1f4,_0x1ef892);});};passport['use'](_0x6b98('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0x6b98('0x4c')},function(_0x1904fc,_0x23fd1b,_0x5695a3){return localAuthenticate(db[_0x6b98('0x38')],_0x1904fc,_0x23fd1b,_0x5695a3);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 7f22007..20701cb 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 _0x5c2d=['/forgot','/reset/:token','reset','Router','./authLocal.controller','post'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x5c2d,0x135));var _0xd5c2=function(_0x4429aa,_0x72d291){_0x4429aa=_0x4429aa-0x0;var _0x480074=_0x5c2d[_0x4429aa];return _0x480074;};'use strict';var express=require('express');var router=express[_0xd5c2('0x0')]();var controller=require(_0xd5c2('0x1'));router[_0xd5c2('0x2')]('/',controller['login']);router['post'](_0xd5c2('0x3'),controller['forgot']);router[_0xd5c2('0x2')](_0xd5c2('0x4'),controller[_0xd5c2('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x0731=['express','post','login','/forgot','forgot','/reset/:token','exports'];(function(_0x4e3cfa,_0xf8d93e){var _0x36adad=function(_0x991058){while(--_0x991058){_0x4e3cfa['push'](_0x4e3cfa['shift']());}};_0x36adad(++_0xf8d93e);}(_0x0731,0x7e));var _0x1073=function(_0x4814c1,_0x542a95){_0x4814c1=_0x4814c1-0x0;var _0x255b76=_0x0731[_0x4814c1];return _0x255b76;};'use strict';var express=require(_0x1073('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x1073('0x1')]('/',controller[_0x1073('0x2')]);router[_0x1073('0x1')](_0x1073('0x3'),controller[_0x1073('0x4')]);router[_0x1073('0x1')](_0x1073('0x5'),controller['reset']);module[_0x1073('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index da0c608..a3ae11d 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 _0xed20=['STRING','INTEGER','sequelize','exports'];(function(_0x24e952,_0x4850cb){var _0xc8c26d=function(_0x11c8d0){while(--_0x11c8d0){_0x24e952['push'](_0x24e952['shift']());}};_0xc8c26d(++_0x4850cb);}(_0xed20,0x14e));var _0x0ed2=function(_0x1db2f5,_0x42111e){_0x1db2f5=_0x1db2f5-0x0;var _0x5ec281=_0xed20[_0x1db2f5];return _0x5ec281;};'use strict';var Sequelize=require(_0x0ed2('0x0'));module[_0x0ed2('0x1')]={'name':{'type':Sequelize[_0x0ed2('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0ed2('0x2')]},'description':{'type':Sequelize[_0x0ed2('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0ed2('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xe9c8=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe9c8,0x10a));var _0x8e9c=function(_0x1343fe,_0x1b99ab){_0x1343fe=_0x1343fe-0x0;var _0x354bc7=_0xe9c8[_0x1343fe];return _0x354bc7;};'use strict';var Sequelize=require(_0x8e9c('0x0'));module[_0x8e9c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e9c('0x2')]},'status':{'type':Sequelize[_0x8e9c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8e9c('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 7f585d9..3395baf 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 _0x2bf6=['addActions','Action','order','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','addConditions','Condition','omit','ids','findOne','getConditions'];(function(_0x37d90a,_0xd8683e){var _0x365635=function(_0xcbcd2a){while(--_0xcbcd2a){_0x37d90a['push'](_0x37d90a['shift']());}};_0x365635(++_0xd8683e);}(_0x2bf6,0xae));var _0x62bf=function(_0x257951,_0x1e0bcf){_0x257951=_0x257951-0x0;var _0x23a7fa=_0x2bf6[_0x257951];return _0x23a7fa;};'use strict';var emlformat=require(_0x62bf('0x0'));var rimraf=require(_0x62bf('0x1'));var zipdir=require(_0x62bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x62bf('0x3'));var moment=require(_0x62bf('0x4'));var BPromise=require(_0x62bf('0x5'));var Mustache=require('mustache');var util=require(_0x62bf('0x6'));var path=require('path');var sox=require(_0x62bf('0x7'));var csv=require(_0x62bf('0x8'));var ejs=require(_0x62bf('0x9'));var fs=require('fs');var fs_extra=require(_0x62bf('0xa'));var _=require('lodash');var squel=require(_0x62bf('0xb'));var crypto=require('crypto');var jsforce=require(_0x62bf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x62bf('0x8'));var querystring=require(_0x62bf('0xd'));var Papa=require(_0x62bf('0xe'));var Redis=require(_0x62bf('0xf'));var authService=require(_0x62bf('0x10'));var qs=require(_0x62bf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62bf('0x12'));var logger=require(_0x62bf('0x13'))(_0x62bf('0x14'));var utils=require(_0x62bf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x62bf('0x16'));var db=require(_0x62bf('0x17'))['db'];function respondWithStatusCode(_0x34d5da,_0x3ace1d){_0x3ace1d=_0x3ace1d||0xcc;return function(_0xfccae2){if(_0xfccae2){return _0x34d5da[_0x62bf('0x18')](_0x3ace1d);}return _0x34d5da[_0x62bf('0x19')](_0x3ace1d)[_0x62bf('0x1a')]();};}function respondWithResult(_0x2716f3,_0x4e89cb){_0x4e89cb=_0x4e89cb||0xc8;return function(_0x209b95){if(_0x209b95){return _0x2716f3[_0x62bf('0x19')](_0x4e89cb)[_0x62bf('0x1b')](_0x209b95);}};}function respondWithFilteredResult(_0xa27d01,_0x430871){return function(_0x3ecaaf){if(_0x3ecaaf){var _0x1883a1=typeof _0x430871[_0x62bf('0x1c')]===_0x62bf('0x1d')&&typeof _0x430871[_0x62bf('0x1e')]===_0x62bf('0x1d');var _0x2e0e88=_0x3ecaaf[_0x62bf('0x1f')];var _0x1f05c5=_0x1883a1?0x0:_0x430871[_0x62bf('0x1c')];var _0x2c6656=_0x1883a1?_0x3ecaaf[_0x62bf('0x1f')]:_0x430871['offset']+_0x430871[_0x62bf('0x1e')];var _0x51d64d;if(_0x2c6656>=_0x2e0e88){_0x2c6656=_0x2e0e88;_0x51d64d=0xc8;}else{_0x51d64d=0xce;}_0xa27d01[_0x62bf('0x19')](_0x51d64d);return _0xa27d01[_0x62bf('0x20')](_0x62bf('0x21'),_0x1f05c5+'-'+_0x2c6656+'/'+_0x2e0e88)[_0x62bf('0x1b')](_0x3ecaaf);}return null;};}function patchUpdates(_0x4aa49a){return function(_0x3c21c9){try{jsonpatch[_0x62bf('0x22')](_0x3c21c9,_0x4aa49a,!![]);}catch(_0x450c1d){return BPromise[_0x62bf('0x23')](_0x450c1d);}return _0x3c21c9['save']();};}function saveUpdates(_0x16e2e5,_0x141743){return function(_0x1994e3){if(_0x1994e3){return _0x1994e3[_0x62bf('0x24')](_0x16e2e5)['then'](function(_0x12bd62){return _0x12bd62;});}return null;};}function removeEntity(_0x2b9d41,_0xd00e66){return function(_0x4d1c37){if(_0x4d1c37){return _0x4d1c37[_0x62bf('0x25')]()['then'](function(){_0x2b9d41[_0x62bf('0x19')](0xcc)[_0x62bf('0x1a')]();});}};}function handleEntityNotFound(_0x3a8b71,_0x1ec4c9){return function(_0x53f3ee){if(!_0x53f3ee){_0x3a8b71[_0x62bf('0x18')](0x194);}return _0x53f3ee;};}function handleError(_0x4ee477,_0x4682a4){_0x4682a4=_0x4682a4||0x1f4;return function(_0x142ec9){logger['error'](_0x142ec9[_0x62bf('0x26')]);if(_0x142ec9[_0x62bf('0x27')]){delete _0x142ec9[_0x62bf('0x27')];}_0x4ee477[_0x62bf('0x19')](_0x4682a4)[_0x62bf('0x28')](_0x142ec9);};}exports[_0x62bf('0x29')]=function(_0x4ea586,_0x2a295c){var _0x4b3170={},_0x25eeaf={},_0x337643={'count':0x0,'rows':[]};var _0x2e4a7f=_[_0x62bf('0x2a')](db[_0x62bf('0x2b')][_0x62bf('0x2c')],function(_0x689901){return{'name':_0x689901[_0x62bf('0x2d')],'type':_0x689901[_0x62bf('0x2e')][_0x62bf('0x2f')]};});_0x25eeaf[_0x62bf('0x30')]=_[_0x62bf('0x2a')](_0x2e4a7f,'name');_0x25eeaf[_0x62bf('0x31')]=_['keys'](_0x4ea586[_0x62bf('0x31')]);_0x25eeaf[_0x62bf('0x32')]=_[_0x62bf('0x33')](_0x25eeaf[_0x62bf('0x30')],_0x25eeaf['query']);_0x4b3170['attributes']=_[_0x62bf('0x33')](_0x25eeaf['model'],qs[_0x62bf('0x34')](_0x4ea586['query'][_0x62bf('0x34')]));_0x4b3170[_0x62bf('0x35')]=_0x4b3170[_0x62bf('0x35')]['length']?_0x4b3170['attributes']:_0x25eeaf[_0x62bf('0x30')];if(!_0x4ea586[_0x62bf('0x31')][_0x62bf('0x36')](_0x62bf('0x37'))){_0x4b3170['limit']=qs[_0x62bf('0x1e')](_0x4ea586['query']['limit']);_0x4b3170[_0x62bf('0x1c')]=qs['offset'](_0x4ea586['query']['offset']);}_0x4b3170['order']=qs[_0x62bf('0x38')](_0x4ea586['query'][_0x62bf('0x38')]);_0x4b3170[_0x62bf('0x39')]=qs[_0x62bf('0x32')](_[_0x62bf('0x3a')](_0x4ea586['query'],_0x25eeaf[_0x62bf('0x32')]),_0x2e4a7f);if(_0x4ea586[_0x62bf('0x31')][_0x62bf('0x3b')]){_0x4b3170[_0x62bf('0x39')]=_['merge'](_0x4b3170[_0x62bf('0x39')],{'$or':_['map'](_0x2e4a7f,function(_0x291081){if(_0x291081[_0x62bf('0x2e')]!=='VIRTUAL'){var _0x418598={};_0x418598[_0x291081[_0x62bf('0x27')]]={'$like':'%'+_0x4ea586[_0x62bf('0x31')][_0x62bf('0x3b')]+'%'};return _0x418598;}})});}_0x4b3170=_[_0x62bf('0x3c')]({},_0x4b3170,_0x4ea586[_0x62bf('0x3d')]);var _0x477fbd={'where':_0x4b3170[_0x62bf('0x39')]};return db[_0x62bf('0x2b')][_0x62bf('0x1f')](_0x477fbd)[_0x62bf('0x3e')](function(_0x22c2b6){_0x337643[_0x62bf('0x1f')]=_0x22c2b6;if(_0x4ea586[_0x62bf('0x31')][_0x62bf('0x3f')]){_0x4b3170[_0x62bf('0x40')]=[{'all':!![]}];}return db[_0x62bf('0x2b')][_0x62bf('0x41')](_0x4b3170);})['then'](function(_0x258fc2){_0x337643[_0x62bf('0x42')]=_0x258fc2;return _0x337643;})[_0x62bf('0x3e')](respondWithFilteredResult(_0x2a295c,_0x4b3170))[_0x62bf('0x43')](handleError(_0x2a295c,null));};exports[_0x62bf('0x44')]=function(_0x5e5461,_0x1e61ec){var _0x36b15b={'raw':![],'where':{'id':_0x5e5461[_0x62bf('0x45')]['id']}},_0x3176e9={};_0x3176e9[_0x62bf('0x30')]=_['keys'](db[_0x62bf('0x2b')][_0x62bf('0x2c')]);_0x3176e9['query']=_[_0x62bf('0x46')](_0x5e5461[_0x62bf('0x31')]);_0x3176e9[_0x62bf('0x32')]=_[_0x62bf('0x33')](_0x3176e9[_0x62bf('0x30')],_0x3176e9['query']);_0x36b15b['attributes']=_[_0x62bf('0x33')](_0x3176e9[_0x62bf('0x30')],qs[_0x62bf('0x34')](_0x5e5461[_0x62bf('0x31')]['fields']));_0x36b15b[_0x62bf('0x35')]=_0x36b15b[_0x62bf('0x35')][_0x62bf('0x47')]?_0x36b15b['attributes']:_0x3176e9['model'];if(_0x5e5461['query'][_0x62bf('0x3f')]){_0x36b15b[_0x62bf('0x40')]=[{'all':!![]}];}_0x36b15b=_['merge']({},_0x36b15b,_0x5e5461[_0x62bf('0x3d')]);return db['Automation'][_0x62bf('0x48')](_0x36b15b)[_0x62bf('0x3e')](handleEntityNotFound(_0x1e61ec,null))['then'](respondWithResult(_0x1e61ec,null))[_0x62bf('0x43')](handleError(_0x1e61ec,null));};exports[_0x62bf('0x49')]=function(_0x4e92b6,_0x5abce7){return db[_0x62bf('0x2b')][_0x62bf('0x49')](_0x4e92b6[_0x62bf('0x4a')],{})[_0x62bf('0x3e')](respondWithResult(_0x5abce7,0xc9))[_0x62bf('0x43')](handleError(_0x5abce7,null));};exports[_0x62bf('0x24')]=function(_0x4ee924,_0x521648){if(_0x4ee924[_0x62bf('0x4a')]['id']){delete _0x4ee924[_0x62bf('0x4a')]['id'];}return db['Automation'][_0x62bf('0x48')]({'where':{'id':_0x4ee924[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x521648,null))[_0x62bf('0x3e')](saveUpdates(_0x4ee924[_0x62bf('0x4a')],null))[_0x62bf('0x3e')](respondWithResult(_0x521648,null))[_0x62bf('0x43')](handleError(_0x521648,null));};exports[_0x62bf('0x25')]=function(_0x3f71d5,_0x25dc99){return db['Automation']['find']({'where':{'id':_0x3f71d5[_0x62bf('0x45')]['id']}})['then'](handleEntityNotFound(_0x25dc99,null))[_0x62bf('0x3e')](removeEntity(_0x25dc99,null))[_0x62bf('0x43')](handleError(_0x25dc99,null));};exports[_0x62bf('0x4b')]=function(_0x263ab2,_0x5d8217,_0x3bf47c){return db[_0x62bf('0x4c')][_0x62bf('0x48')]({'where':{'id':_0x263ab2[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x5d8217,null))['then'](function(_0x1c3aba){if(_0x1c3aba){return _0x1c3aba[_0x62bf('0x4b')](_0x263ab2[_0x62bf('0x4a')]['ids'],_[_0x62bf('0x4d')](_0x263ab2['body'],[_0x62bf('0x4e'),'id'])||{});}})[_0x62bf('0x3e')](respondWithResult(_0x5d8217,null))[_0x62bf('0x43')](handleError(_0x5d8217,null));};exports['getConditions']=function(_0x5e1add,_0x1d9f49,_0x168a73){var _0x300067={};var _0x2679c4={};var _0x2dcd99;var _0x182566;return db[_0x62bf('0x2b')][_0x62bf('0x4f')]({'where':{'id':_0x5e1add[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x1d9f49,null))[_0x62bf('0x3e')](function(_0x4e1e33){if(_0x4e1e33){_0x2dcd99=_0x4e1e33;_0x2679c4['model']=_[_0x62bf('0x46')](db[_0x62bf('0x4c')][_0x62bf('0x2c')]);_0x2679c4['query']=_[_0x62bf('0x46')](_0x5e1add[_0x62bf('0x31')]);_0x2679c4['filters']=_['intersection'](_0x2679c4['model'],_0x2679c4[_0x62bf('0x31')]);_0x300067[_0x62bf('0x35')]=_['intersection'](_0x2679c4[_0x62bf('0x30')],qs[_0x62bf('0x34')](_0x5e1add[_0x62bf('0x31')]['fields']));_0x300067[_0x62bf('0x35')]=_0x300067['attributes']['length']?_0x300067[_0x62bf('0x35')]:_0x2679c4[_0x62bf('0x30')];_0x300067['order']=qs['sort'](_0x5e1add[_0x62bf('0x31')][_0x62bf('0x38')]);_0x300067[_0x62bf('0x39')]=qs[_0x62bf('0x32')](_[_0x62bf('0x3a')](_0x5e1add[_0x62bf('0x31')],_0x2679c4[_0x62bf('0x32')]));if(_0x5e1add[_0x62bf('0x31')][_0x62bf('0x3b')]){_0x300067[_0x62bf('0x39')]=_[_0x62bf('0x3c')](_0x300067[_0x62bf('0x39')],{'$or':_['map'](_0x300067[_0x62bf('0x35')],function(_0x2bf91b){var _0x3f84ea={};_0x3f84ea[_0x2bf91b]={'$like':'%'+_0x5e1add[_0x62bf('0x31')][_0x62bf('0x3b')]+'%'};return _0x3f84ea;})});}_0x300067=_['merge']({},_0x300067,_0x5e1add[_0x62bf('0x3d')]);return _0x2dcd99[_0x62bf('0x50')](_0x300067);}})['then'](function(_0x36745b){if(_0x36745b){_0x182566=_0x36745b[_0x62bf('0x47')];if(!_0x5e1add['query']['hasOwnProperty']('nolimit')){_0x300067[_0x62bf('0x1e')]=qs[_0x62bf('0x1e')](_0x5e1add[_0x62bf('0x31')][_0x62bf('0x1e')]);_0x300067[_0x62bf('0x1c')]=qs[_0x62bf('0x1c')](_0x5e1add[_0x62bf('0x31')][_0x62bf('0x1c')]);}return _0x2dcd99[_0x62bf('0x50')](_0x300067);}})[_0x62bf('0x3e')](function(_0x2931e4){if(_0x2931e4){return _0x2931e4?{'count':_0x182566,'rows':_0x2931e4}:null;}})[_0x62bf('0x3e')](respondWithResult(_0x1d9f49,null))[_0x62bf('0x43')](handleError(_0x1d9f49,null));};exports[_0x62bf('0x51')]=function(_0x4ba6ec,_0x4a800d,_0x1cb261){return db['Action'][_0x62bf('0x48')]({'where':{'id':_0x4ba6ec[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x4a800d,null))[_0x62bf('0x3e')](function(_0x4ef3c5){if(_0x4ef3c5){return _0x4ef3c5[_0x62bf('0x51')](_0x4ba6ec[_0x62bf('0x4a')][_0x62bf('0x4e')],_[_0x62bf('0x4d')](_0x4ba6ec[_0x62bf('0x4a')],[_0x62bf('0x4e'),'id'])||{});}})[_0x62bf('0x3e')](respondWithResult(_0x4a800d,null))[_0x62bf('0x43')](handleError(_0x4a800d,null));};exports['getActions']=function(_0x1b88b8,_0x48c24a,_0x17a395){var _0xd78c58={};var _0x302894={};var _0x25f8e0;var _0x4d5835;return db[_0x62bf('0x2b')][_0x62bf('0x4f')]({'where':{'id':_0x1b88b8[_0x62bf('0x45')]['id']}})[_0x62bf('0x3e')](handleEntityNotFound(_0x48c24a,null))['then'](function(_0x3fc299){if(_0x3fc299){_0x25f8e0=_0x3fc299;_0x302894[_0x62bf('0x30')]=_[_0x62bf('0x46')](db[_0x62bf('0x52')][_0x62bf('0x2c')]);_0x302894[_0x62bf('0x31')]=_[_0x62bf('0x46')](_0x1b88b8[_0x62bf('0x31')]);_0x302894[_0x62bf('0x32')]=_[_0x62bf('0x33')](_0x302894[_0x62bf('0x30')],_0x302894['query']);_0xd78c58[_0x62bf('0x35')]=_['intersection'](_0x302894['model'],qs[_0x62bf('0x34')](_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x34')]));_0xd78c58[_0x62bf('0x35')]=_0xd78c58[_0x62bf('0x35')][_0x62bf('0x47')]?_0xd78c58[_0x62bf('0x35')]:_0x302894[_0x62bf('0x30')];_0xd78c58[_0x62bf('0x53')]=qs[_0x62bf('0x38')](_0x1b88b8['query'][_0x62bf('0x38')]);_0xd78c58['where']=qs[_0x62bf('0x32')](_[_0x62bf('0x3a')](_0x1b88b8[_0x62bf('0x31')],_0x302894[_0x62bf('0x32')]));if(_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x3b')]){_0xd78c58[_0x62bf('0x39')]=_[_0x62bf('0x3c')](_0xd78c58[_0x62bf('0x39')],{'$or':_['map'](_0xd78c58['attributes'],function(_0x410893){var _0x3a0734={};_0x3a0734[_0x410893]={'$like':'%'+_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x3b')]+'%'};return _0x3a0734;})});}_0xd78c58=_[_0x62bf('0x3c')]({},_0xd78c58,_0x1b88b8[_0x62bf('0x3d')]);return _0x25f8e0[_0x62bf('0x54')](_0xd78c58);}})['then'](function(_0x2eee6a){if(_0x2eee6a){_0x4d5835=_0x2eee6a[_0x62bf('0x47')];if(!_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x36')](_0x62bf('0x37'))){_0xd78c58[_0x62bf('0x1e')]=qs['limit'](_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x1e')]);_0xd78c58[_0x62bf('0x1c')]=qs[_0x62bf('0x1c')](_0x1b88b8[_0x62bf('0x31')][_0x62bf('0x1c')]);}return _0x25f8e0['getActions'](_0xd78c58);}})[_0x62bf('0x3e')](function(_0x3f2db8){if(_0x3f2db8){return _0x3f2db8?{'count':_0x4d5835,'rows':_0x3f2db8}:null;}})[_0x62bf('0x3e')](respondWithResult(_0x48c24a,null))['catch'](handleError(_0x48c24a,null));};
\ No newline at end of file
+var _0x5216=['lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','options','create','body','find','Condition','addConditions','omit','ids','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv'];(function(_0x50bd4d,_0x4177a4){var _0x497e46=function(_0x23be8e){while(--_0x23be8e){_0x50bd4d['push'](_0x50bd4d['shift']());}};_0x497e46(++_0x4177a4);}(_0x5216,0x1c7));var _0x6521=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5216[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x6521('0x0'));var rimraf=require(_0x6521('0x1'));var zipdir=require(_0x6521('0x2'));var jsonpatch=require(_0x6521('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6521('0x4'));var Mustache=require(_0x6521('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6521('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6521('0x7'));var squel=require('squel');var crypto=require(_0x6521('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6521('0x9'));var toCsv=require(_0x6521('0x6'));var querystring=require(_0x6521('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6521('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x6521('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6521('0xd'))(_0x6521('0xe'));var utils=require(_0x6521('0xf'));var config=require(_0x6521('0x10'));var licenseUtil=require(_0x6521('0x11'));var db=require(_0x6521('0x12'))['db'];function respondWithStatusCode(_0x180a5c,_0x2ca936){_0x2ca936=_0x2ca936||0xcc;return function(_0x5f19ae){if(_0x5f19ae){return _0x180a5c['sendStatus'](_0x2ca936);}return _0x180a5c['status'](_0x2ca936)[_0x6521('0x13')]();};}function respondWithResult(_0x3300d6,_0x1bc8ea){_0x1bc8ea=_0x1bc8ea||0xc8;return function(_0x204884){if(_0x204884){return _0x3300d6[_0x6521('0x14')](_0x1bc8ea)['json'](_0x204884);}};}function respondWithFilteredResult(_0x477ea3,_0x4d93c0){return function(_0x32dab0){if(_0x32dab0){var _0x509f20=typeof _0x4d93c0[_0x6521('0x15')]==='undefined'&&typeof _0x4d93c0[_0x6521('0x16')]===_0x6521('0x17');var _0x197307=_0x32dab0['count'];var _0x295d25=_0x509f20?0x0:_0x4d93c0[_0x6521('0x15')];var _0x3457b1=_0x509f20?_0x32dab0[_0x6521('0x18')]:_0x4d93c0[_0x6521('0x15')]+_0x4d93c0['limit'];var _0x366a8a;if(_0x3457b1>=_0x197307){_0x3457b1=_0x197307;_0x366a8a=0xc8;}else{_0x366a8a=0xce;}_0x477ea3[_0x6521('0x14')](_0x366a8a);return _0x477ea3[_0x6521('0x19')](_0x6521('0x1a'),_0x295d25+'-'+_0x3457b1+'/'+_0x197307)[_0x6521('0x1b')](_0x32dab0);}return null;};}function patchUpdates(_0x5eb42b){return function(_0x289671){try{jsonpatch[_0x6521('0x1c')](_0x289671,_0x5eb42b,!![]);}catch(_0x2bfb21){return BPromise['reject'](_0x2bfb21);}return _0x289671['save']();};}function saveUpdates(_0x4a0c76,_0x3a7ed0){return function(_0x526c44){if(_0x526c44){return _0x526c44[_0x6521('0x1d')](_0x4a0c76)[_0x6521('0x1e')](function(_0x490869){return _0x490869;});}return null;};}function removeEntity(_0xe079cd,_0x5a66aa){return function(_0x4a1411){if(_0x4a1411){return _0x4a1411[_0x6521('0x1f')]()[_0x6521('0x1e')](function(){_0xe079cd[_0x6521('0x14')](0xcc)[_0x6521('0x13')]();});}};}function handleEntityNotFound(_0x356e31,_0x458ee9){return function(_0xd4fef5){if(!_0xd4fef5){_0x356e31['sendStatus'](0x194);}return _0xd4fef5;};}function handleError(_0x1bbe9c,_0x2da9eb){_0x2da9eb=_0x2da9eb||0x1f4;return function(_0x21c472){logger[_0x6521('0x20')](_0x21c472['stack']);if(_0x21c472[_0x6521('0x21')]){delete _0x21c472[_0x6521('0x21')];}_0x1bbe9c['status'](_0x2da9eb)[_0x6521('0x22')](_0x21c472);};}exports[_0x6521('0x23')]=function(_0x86164c,_0x296c42){var _0x571716={},_0x878a66={},_0x5f38d0={'count':0x0,'rows':[]};var _0x433176=_[_0x6521('0x24')](db[_0x6521('0x25')]['rawAttributes'],function(_0x46a549){return{'name':_0x46a549[_0x6521('0x26')],'type':_0x46a549[_0x6521('0x27')][_0x6521('0x28')]};});_0x878a66[_0x6521('0x29')]=_[_0x6521('0x24')](_0x433176,_0x6521('0x21'));_0x878a66[_0x6521('0x2a')]=_[_0x6521('0x2b')](_0x86164c[_0x6521('0x2a')]);_0x878a66[_0x6521('0x2c')]=_['intersection'](_0x878a66['model'],_0x878a66[_0x6521('0x2a')]);_0x571716[_0x6521('0x2d')]=_[_0x6521('0x2e')](_0x878a66['model'],qs[_0x6521('0x2f')](_0x86164c[_0x6521('0x2a')]['fields']));_0x571716[_0x6521('0x2d')]=_0x571716[_0x6521('0x2d')][_0x6521('0x30')]?_0x571716[_0x6521('0x2d')]:_0x878a66['model'];if(!_0x86164c[_0x6521('0x2a')]['hasOwnProperty'](_0x6521('0x31'))){_0x571716[_0x6521('0x16')]=qs[_0x6521('0x16')](_0x86164c[_0x6521('0x2a')]['limit']);_0x571716[_0x6521('0x15')]=qs['offset'](_0x86164c[_0x6521('0x2a')][_0x6521('0x15')]);}_0x571716[_0x6521('0x32')]=qs['sort'](_0x86164c['query'][_0x6521('0x33')]);_0x571716[_0x6521('0x34')]=qs['filters'](_[_0x6521('0x35')](_0x86164c[_0x6521('0x2a')],_0x878a66[_0x6521('0x2c')]),_0x433176);if(_0x86164c['query'][_0x6521('0x36')]){_0x571716[_0x6521('0x34')]=_['merge'](_0x571716[_0x6521('0x34')],{'$or':_[_0x6521('0x24')](_0x433176,function(_0x506b76){if(_0x506b76[_0x6521('0x27')]!=='VIRTUAL'){var _0x546cf8={};_0x546cf8[_0x506b76['name']]={'$like':'%'+_0x86164c['query'][_0x6521('0x36')]+'%'};return _0x546cf8;}})});}_0x571716=_['merge']({},_0x571716,_0x86164c['options']);var _0x1a602c={'where':_0x571716[_0x6521('0x34')]};return db['Automation'][_0x6521('0x18')](_0x1a602c)[_0x6521('0x1e')](function(_0x1fa7a4){_0x5f38d0[_0x6521('0x18')]=_0x1fa7a4;if(_0x86164c[_0x6521('0x2a')][_0x6521('0x37')]){_0x571716[_0x6521('0x38')]=[{'all':!![]}];}return db[_0x6521('0x25')][_0x6521('0x39')](_0x571716);})['then'](function(_0xd532b5){_0x5f38d0[_0x6521('0x3a')]=_0xd532b5;return _0x5f38d0;})['then'](respondWithFilteredResult(_0x296c42,_0x571716))[_0x6521('0x3b')](handleError(_0x296c42,null));};exports['show']=function(_0x381a07,_0x41a2f1){var _0x2c6486={'raw':![],'where':{'id':_0x381a07[_0x6521('0x3c')]['id']}},_0x475b58={};_0x475b58['model']=_[_0x6521('0x2b')](db['Automation'][_0x6521('0x3d')]);_0x475b58[_0x6521('0x2a')]=_[_0x6521('0x2b')](_0x381a07[_0x6521('0x2a')]);_0x475b58[_0x6521('0x2c')]=_['intersection'](_0x475b58[_0x6521('0x29')],_0x475b58[_0x6521('0x2a')]);_0x2c6486['attributes']=_['intersection'](_0x475b58[_0x6521('0x29')],qs[_0x6521('0x2f')](_0x381a07[_0x6521('0x2a')][_0x6521('0x2f')]));_0x2c6486[_0x6521('0x2d')]=_0x2c6486[_0x6521('0x2d')][_0x6521('0x30')]?_0x2c6486[_0x6521('0x2d')]:_0x475b58['model'];if(_0x381a07[_0x6521('0x2a')][_0x6521('0x37')]){_0x2c6486[_0x6521('0x38')]=[{'all':!![]}];}_0x2c6486=_[_0x6521('0x3e')]({},_0x2c6486,_0x381a07[_0x6521('0x3f')]);return db['Automation']['find'](_0x2c6486)[_0x6521('0x1e')](handleEntityNotFound(_0x41a2f1,null))[_0x6521('0x1e')](respondWithResult(_0x41a2f1,null))['catch'](handleError(_0x41a2f1,null));};exports['create']=function(_0x32da28,_0x34f367){return db[_0x6521('0x25')][_0x6521('0x40')](_0x32da28['body'],{})['then'](respondWithResult(_0x34f367,0xc9))[_0x6521('0x3b')](handleError(_0x34f367,null));};exports[_0x6521('0x1d')]=function(_0x3f650f,_0x333ff9){if(_0x3f650f['body']['id']){delete _0x3f650f[_0x6521('0x41')]['id'];}return db[_0x6521('0x25')]['find']({'where':{'id':_0x3f650f[_0x6521('0x3c')]['id']}})[_0x6521('0x1e')](handleEntityNotFound(_0x333ff9,null))[_0x6521('0x1e')](saveUpdates(_0x3f650f[_0x6521('0x41')],null))[_0x6521('0x1e')](respondWithResult(_0x333ff9,null))[_0x6521('0x3b')](handleError(_0x333ff9,null));};exports['destroy']=function(_0x1ab4c5,_0x50410a){return db[_0x6521('0x25')][_0x6521('0x42')]({'where':{'id':_0x1ab4c5['params']['id']}})['then'](handleEntityNotFound(_0x50410a,null))['then'](removeEntity(_0x50410a,null))[_0x6521('0x3b')](handleError(_0x50410a,null));};exports['addConditions']=function(_0x21c9ad,_0x139eac,_0x3bb84a){return db[_0x6521('0x43')][_0x6521('0x42')]({'where':{'id':_0x21c9ad['params']['id']}})['then'](handleEntityNotFound(_0x139eac,null))[_0x6521('0x1e')](function(_0x34d189){if(_0x34d189){return _0x34d189[_0x6521('0x44')](_0x21c9ad[_0x6521('0x41')]['ids'],_[_0x6521('0x45')](_0x21c9ad['body'],[_0x6521('0x46'),'id'])||{});}})[_0x6521('0x1e')](respondWithResult(_0x139eac,null))['catch'](handleError(_0x139eac,null));};exports[_0x6521('0x47')]=function(_0xd6e659,_0x31a500,_0x5c83fc){var _0x7dee67={};var _0x27b325={};var _0x165e1c;var _0x46c403;return db[_0x6521('0x25')][_0x6521('0x48')]({'where':{'id':_0xd6e659[_0x6521('0x3c')]['id']}})['then'](handleEntityNotFound(_0x31a500,null))[_0x6521('0x1e')](function(_0xc416af){if(_0xc416af){_0x165e1c=_0xc416af;_0x27b325[_0x6521('0x29')]=_['keys'](db[_0x6521('0x43')][_0x6521('0x3d')]);_0x27b325['query']=_[_0x6521('0x2b')](_0xd6e659[_0x6521('0x2a')]);_0x27b325[_0x6521('0x2c')]=_[_0x6521('0x2e')](_0x27b325['model'],_0x27b325[_0x6521('0x2a')]);_0x7dee67['attributes']=_[_0x6521('0x2e')](_0x27b325[_0x6521('0x29')],qs[_0x6521('0x2f')](_0xd6e659[_0x6521('0x2a')]['fields']));_0x7dee67[_0x6521('0x2d')]=_0x7dee67[_0x6521('0x2d')][_0x6521('0x30')]?_0x7dee67['attributes']:_0x27b325[_0x6521('0x29')];_0x7dee67['order']=qs['sort'](_0xd6e659[_0x6521('0x2a')][_0x6521('0x33')]);_0x7dee67[_0x6521('0x34')]=qs[_0x6521('0x2c')](_[_0x6521('0x35')](_0xd6e659['query'],_0x27b325[_0x6521('0x2c')]));if(_0xd6e659['query']['filter']){_0x7dee67[_0x6521('0x34')]=_[_0x6521('0x3e')](_0x7dee67[_0x6521('0x34')],{'$or':_['map'](_0x7dee67[_0x6521('0x2d')],function(_0x5f22ed){var _0x395002={};_0x395002[_0x5f22ed]={'$like':'%'+_0xd6e659[_0x6521('0x2a')][_0x6521('0x36')]+'%'};return _0x395002;})});}_0x7dee67=_[_0x6521('0x3e')]({},_0x7dee67,_0xd6e659[_0x6521('0x3f')]);return _0x165e1c[_0x6521('0x47')](_0x7dee67);}})[_0x6521('0x1e')](function(_0x4f03de){if(_0x4f03de){_0x46c403=_0x4f03de[_0x6521('0x30')];if(!_0xd6e659[_0x6521('0x2a')][_0x6521('0x49')]('nolimit')){_0x7dee67[_0x6521('0x16')]=qs[_0x6521('0x16')](_0xd6e659[_0x6521('0x2a')][_0x6521('0x16')]);_0x7dee67['offset']=qs[_0x6521('0x15')](_0xd6e659[_0x6521('0x2a')][_0x6521('0x15')]);}return _0x165e1c[_0x6521('0x47')](_0x7dee67);}})[_0x6521('0x1e')](function(_0x2a7470){if(_0x2a7470){return _0x2a7470?{'count':_0x46c403,'rows':_0x2a7470}:null;}})[_0x6521('0x1e')](respondWithResult(_0x31a500,null))[_0x6521('0x3b')](handleError(_0x31a500,null));};exports[_0x6521('0x4a')]=function(_0x3d16e8,_0x12294b,_0x3e6f3e){return db[_0x6521('0x4b')]['find']({'where':{'id':_0x3d16e8['params']['id']}})[_0x6521('0x1e')](handleEntityNotFound(_0x12294b,null))[_0x6521('0x1e')](function(_0x37956a){if(_0x37956a){return _0x37956a[_0x6521('0x4a')](_0x3d16e8['body'][_0x6521('0x46')],_['omit'](_0x3d16e8[_0x6521('0x41')],['ids','id'])||{});}})[_0x6521('0x1e')](respondWithResult(_0x12294b,null))[_0x6521('0x3b')](handleError(_0x12294b,null));};exports[_0x6521('0x4c')]=function(_0x1e3aa3,_0x291779,_0x7919){var _0x131ba7={};var _0x4ac82f={};var _0x184ff8;var _0x5529f7;return db[_0x6521('0x25')]['findOne']({'where':{'id':_0x1e3aa3[_0x6521('0x3c')]['id']}})['then'](handleEntityNotFound(_0x291779,null))[_0x6521('0x1e')](function(_0x56e727){if(_0x56e727){_0x184ff8=_0x56e727;_0x4ac82f['model']=_[_0x6521('0x2b')](db[_0x6521('0x4b')][_0x6521('0x3d')]);_0x4ac82f['query']=_[_0x6521('0x2b')](_0x1e3aa3['query']);_0x4ac82f[_0x6521('0x2c')]=_[_0x6521('0x2e')](_0x4ac82f[_0x6521('0x29')],_0x4ac82f[_0x6521('0x2a')]);_0x131ba7[_0x6521('0x2d')]=_[_0x6521('0x2e')](_0x4ac82f[_0x6521('0x29')],qs[_0x6521('0x2f')](_0x1e3aa3[_0x6521('0x2a')][_0x6521('0x2f')]));_0x131ba7[_0x6521('0x2d')]=_0x131ba7[_0x6521('0x2d')][_0x6521('0x30')]?_0x131ba7[_0x6521('0x2d')]:_0x4ac82f[_0x6521('0x29')];_0x131ba7[_0x6521('0x32')]=qs['sort'](_0x1e3aa3[_0x6521('0x2a')]['sort']);_0x131ba7[_0x6521('0x34')]=qs[_0x6521('0x2c')](_['pick'](_0x1e3aa3[_0x6521('0x2a')],_0x4ac82f[_0x6521('0x2c')]));if(_0x1e3aa3[_0x6521('0x2a')][_0x6521('0x36')]){_0x131ba7[_0x6521('0x34')]=_[_0x6521('0x3e')](_0x131ba7['where'],{'$or':_['map'](_0x131ba7[_0x6521('0x2d')],function(_0x5ee9cd){var _0x203dfc={};_0x203dfc[_0x5ee9cd]={'$like':'%'+_0x1e3aa3['query'][_0x6521('0x36')]+'%'};return _0x203dfc;})});}_0x131ba7=_[_0x6521('0x3e')]({},_0x131ba7,_0x1e3aa3[_0x6521('0x3f')]);return _0x184ff8[_0x6521('0x4c')](_0x131ba7);}})['then'](function(_0x44daf3){if(_0x44daf3){_0x5529f7=_0x44daf3['length'];if(!_0x1e3aa3['query']['hasOwnProperty']('nolimit')){_0x131ba7[_0x6521('0x16')]=qs['limit'](_0x1e3aa3['query'][_0x6521('0x16')]);_0x131ba7['offset']=qs[_0x6521('0x15')](_0x1e3aa3['query'][_0x6521('0x15')]);}return _0x184ff8[_0x6521('0x4c')](_0x131ba7);}})[_0x6521('0x1e')](function(_0x23cffb){if(_0x23cffb){return _0x23cffb?{'count':_0x5529f7,'rows':_0x23cffb}:null;}})['then'](respondWithResult(_0x291779,null))[_0x6521('0x3b')](handleError(_0x291779,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 00894ec..f915382 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 _0x942c=['path','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','../../config/logger','moment','request-promise'];(function(_0x565d65,_0x436914){var _0x3797e1=function(_0x113817){while(--_0x113817){_0x565d65['push'](_0x565d65['shift']());}};_0x3797e1(++_0x436914);}(_0x942c,0x10f));var _0xc942=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x942c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc942('0x0'));var util=require('util');var logger=require(_0xc942('0x1'))('api');var moment=require(_0xc942('0x2'));var BPromise=require('bluebird');var rp=require(_0xc942('0x3'));var fs=require('fs');var path=require(_0xc942('0x4'));var rimraf=require(_0xc942('0x5'));var config=require(_0xc942('0x6'));var attributes=require(_0xc942('0x7'));module[_0xc942('0x8')]=function(_0x2ba0b9,_0x366a15){return _0x2ba0b9[_0xc942('0x9')]('Automation',attributes,{'tableName':_0xc942('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9ff=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation'];(function(_0x52d0bd,_0x8663cc){var _0x43e4d5=function(_0x2f7046){while(--_0x2f7046){_0x52d0bd['push'](_0x52d0bd['shift']());}};_0x43e4d5(++_0x8663cc);}(_0xe9ff,0x1c7));var _0xfe9f=function(_0x35eb7b,_0x35f97b){_0x35eb7b=_0x35eb7b-0x0;var _0x5ae9ff=_0xe9ff[_0x35eb7b];return _0x5ae9ff;};'use strict';var _=require(_0xfe9f('0x0'));var util=require(_0xfe9f('0x1'));var logger=require(_0xfe9f('0x2'))(_0xfe9f('0x3'));var moment=require(_0xfe9f('0x4'));var BPromise=require(_0xfe9f('0x5'));var rp=require(_0xfe9f('0x6'));var fs=require('fs');var path=require(_0xfe9f('0x7'));var rimraf=require(_0xfe9f('0x8'));var config=require(_0xfe9f('0x9'));var attributes=require(_0xfe9f('0xa'));module['exports']=function(_0x184907,_0xac1757){return _0x184907[_0xfe9f('0xb')](_0xfe9f('0xc'),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 d70e1c3..ca83d5a 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 _0x3f72=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x381606,_0x53382c){var _0x31c4ca=function(_0x310493){while(--_0x310493){_0x381606['push'](_0x381606['shift']());}};_0x31c4ca(++_0x53382c);}(_0x3f72,0xaf));var _0x23f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require(_0x23f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23f7('0x3'));var db=require(_0x23f7('0x4'))['db'];var utils=require(_0x23f7('0x5'));var logger=require(_0x23f7('0x6'))(_0x23f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x23f7('0x8'));var client=jayson['client'][_0x23f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cc54a,_0x23e468,_0x2db48b){return new BPromise(function(_0x412d29,_0x258026){return client[_0x23f7('0xa')](_0x5cc54a,_0x2db48b)[_0x23f7('0xb')](function(_0x3a048c){logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));logger['debug'](_0x23f7('0xf'),_0x23e468,_0x23f7('0xe'),JSON[_0x23f7('0x10')](_0x3a048c));if(_0x3a048c['error']){if(_0x3a048c['error'][_0x23f7('0x11')]===0x1f4){logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);return _0x258026(_0x3a048c['error'][_0x23f7('0x13')]);}logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')]['message']);return _0x412d29(_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);}else{logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));_0x412d29(_0x3a048c[_0x23f7('0x14')][_0x23f7('0x13')]);}})['catch'](function(_0x2669ab){logger[_0x23f7('0x12')]('Automation,\x20%s,\x20%s',_0x23e468,_0x2669ab);_0x258026(_0x2669ab);});});}
\ No newline at end of file
+var _0x4639=['client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x22e295,_0xb0c78d){var _0x9575d1=function(_0x458914){while(--_0x458914){_0x22e295['push'](_0x22e295['shift']());}};_0x9575d1(++_0xb0c78d);}(_0x4639,0x115));var _0x9463=function(_0x498d4f,_0x6e928e){_0x498d4f=_0x498d4f-0x0;var _0x1c81a8=_0x4639[_0x498d4f];return _0x1c81a8;};'use strict';var _=require(_0x9463('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9463('0x1'));var rs=require(_0x9463('0x2'));var fs=require('fs');var Redis=require(_0x9463('0x3'));var db=require(_0x9463('0x4'))['db'];var utils=require(_0x9463('0x5'));var logger=require(_0x9463('0x6'))(_0x9463('0x7'));var config=require('../../config/environment');var jayson=require(_0x9463('0x8'));var client=jayson[_0x9463('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494a02,_0x3b5e95,_0x500f5d){return new BPromise(function(_0x58d09c,_0x465758){return client[_0x9463('0xa')](_0x494a02,_0x500f5d)[_0x9463('0xb')](function(_0x49e617){logger[_0x9463('0xc')](_0x9463('0xd'),_0x3b5e95,_0x9463('0xe'));logger[_0x9463('0xf')](_0x9463('0x10'),_0x3b5e95,_0x9463('0xe'),JSON[_0x9463('0x11')](_0x49e617));if(_0x49e617[_0x9463('0x12')]){if(_0x49e617[_0x9463('0x12')][_0x9463('0x13')]===0x1f4){logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x49e617[_0x9463('0x12')][_0x9463('0x14')]);return _0x465758(_0x49e617[_0x9463('0x12')][_0x9463('0x14')]);}logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x49e617[_0x9463('0x12')]['message']);return _0x58d09c(_0x49e617[_0x9463('0x12')]['message']);}else{logger[_0x9463('0xc')](_0x9463('0xd'),_0x3b5e95,_0x9463('0xe'));_0x58d09c(_0x49e617[_0x9463('0x15')][_0x9463('0x14')]);}})['catch'](function(_0x3d5a81){logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x3d5a81);_0x465758(_0x3d5a81);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d56bf2e..0697a3f 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 _0xb0b4=['create','addConditions','addActions','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','post'];(function(_0x80bc0f,_0x2f084a){var _0x29685c=function(_0x377326){while(--_0x377326){_0x80bc0f['push'](_0x80bc0f['shift']());}};_0x29685c(++_0x2f084a);}(_0xb0b4,0xb6));var _0x4b0b=function(_0x2eabb7,_0x57cb12){_0x2eabb7=_0x2eabb7-0x0;var _0x27186f=_0xb0b4[_0x2eabb7];return _0x27186f;};'use strict';var multer=require(_0x4b0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4b0b('0x1'));var express=require(_0x4b0b('0x2'));var router=express['Router']();var fs_extra=require(_0x4b0b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4b0b('0x4'));var config=require(_0x4b0b('0x5'));var controller=require(_0x4b0b('0x6'));router[_0x4b0b('0x7')]('/',auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x9')]);router[_0x4b0b('0x7')](_0x4b0b('0xa'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0xb')]);router[_0x4b0b('0x7')](_0x4b0b('0xc'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0xd')]);router[_0x4b0b('0x7')](_0x4b0b('0xe'),auth[_0x4b0b('0x8')](),controller['getActions']);router[_0x4b0b('0xf')]('/',auth['isAuthenticated'](),controller[_0x4b0b('0x10')]);router[_0x4b0b('0xf')]('/:id/conditions',auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x11')]);router[_0x4b0b('0xf')](_0x4b0b('0xe'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x12')]);router['put'](_0x4b0b('0xa'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x13')]);router[_0x4b0b('0x14')](_0x4b0b('0xa'),auth[_0x4b0b('0x8')](),controller['destroy']);module[_0x4b0b('0x15')]=router;
\ No newline at end of file
+var _0x9009=['addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated','/:id/actions','getActions','post'];(function(_0x8f33c2,_0x475dd9){var _0x2a63b1=function(_0x1a9848){while(--_0x1a9848){_0x8f33c2['push'](_0x8f33c2['shift']());}};_0x2a63b1(++_0x475dd9);}(_0x9009,0x1d4));var _0x9900=function(_0x33b889,_0x29e0d6){_0x33b889=_0x33b889-0x0;var _0x54ccbe=_0x9009[_0x33b889];return _0x54ccbe;};'use strict';var multer=require(_0x9900('0x0'));var util=require('util');var path=require(_0x9900('0x1'));var timeout=require(_0x9900('0x2'));var express=require('express');var router=express[_0x9900('0x3')]();var fs_extra=require(_0x9900('0x4'));var auth=require(_0x9900('0x5'));var interaction=require(_0x9900('0x6'));var config=require('../../config/environment');var controller=require(_0x9900('0x7'));router[_0x9900('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9900('0x8')](_0x9900('0x9'),auth['isAuthenticated'](),controller[_0x9900('0xa')]);router[_0x9900('0x8')](_0x9900('0xb'),auth[_0x9900('0xc')](),controller['getConditions']);router[_0x9900('0x8')](_0x9900('0xd'),auth[_0x9900('0xc')](),controller[_0x9900('0xe')]);router[_0x9900('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9900('0xf')](_0x9900('0xb'),auth['isAuthenticated'](),controller['addConditions']);router[_0x9900('0xf')]('/:id/actions',auth[_0x9900('0xc')](),controller[_0x9900('0x10')]);router[_0x9900('0x11')](_0x9900('0x9'),auth[_0x9900('0xc')](),controller[_0x9900('0x12')]);router[_0x9900('0x13')](_0x9900('0x9'),auth[_0x9900('0xc')](),controller[_0x9900('0x14')]);module[_0x9900('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 6f82fcd..069a743 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 _0xd027=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x144a2e,_0x341bfc){var _0x590814=function(_0x55f82e){while(--_0x55f82e){_0x144a2e['push'](_0x144a2e['shift']());}};_0x590814(++_0x341bfc);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x7d02('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7d02('0x1')](_0x7d02('0x2')),'allowNull':![],'defaultValue':_0x7d02('0x2')},'description':{'type':Sequelize[_0x7d02('0x3')]},'active':{'type':Sequelize[_0x7d02('0x4')],'defaultValue':0x0,'comment':_0x7d02('0x5')},'limitCalls':{'type':Sequelize[_0x7d02('0x6')](0x4)[_0x7d02('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x7d02('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7d02('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d02('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'comment':_0x7d02('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d02('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7d02('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7d02('0x3')],'defaultValue':_0x7d02('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x7d02('0xf'),_0x7d02('0x10'),_0x7d02('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7d02('0x4')],'defaultValue':0x0,'comment':_0x7d02('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7d02('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7d02('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7d02('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7d02('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7d02('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7d02('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7d02('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7d02('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7d02('0x6')](0x9)[_0x7d02('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7d02('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7d02('0x1')](_0x7d02('0x1b'),_0x7d02('0x1c')),'defaultValue':_0x7d02('0x1b')},'dialPrefix':{'type':Sequelize[_0x7d02('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7d02('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d02('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7d02('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d02('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7d02('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d02('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7d02('0x6')](0x5)[_0x7d02('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x4d5f=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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)'];(function(_0x17c216,_0x1eed2a){var _0x2b2b39=function(_0x26a65a){while(--_0x26a65a){_0x17c216['push'](_0x17c216['shift']());}};_0x2b2b39(++_0x1eed2a);}(_0x4d5f,0x82));var _0xf4d5=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x4d5f[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xf4d5('0x0'));module[_0xf4d5('0x1')]={'name':{'type':Sequelize[_0xf4d5('0x2')],'unique':_0xf4d5('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf4d5('0x4')](_0xf4d5('0x5')),'allowNull':![],'defaultValue':_0xf4d5('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf4d5('0x6')],'defaultValue':0x0,'comment':_0xf4d5('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xf4d5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf4d5('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf4d5('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf4d5('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0xd')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'comment':_0xf4d5('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0x11')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf4d5('0x12')},'dialTimezone':{'type':Sequelize[_0xf4d5('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf4d5('0x2')],'defaultValue':_0xf4d5('0x13')},'dialCheckDuplicateType':{'type':Sequelize[_0xf4d5('0x4')](_0xf4d5('0x14'),_0xf4d5('0x15'),_0xf4d5('0x16')),'defaultValue':_0xf4d5('0x14')},'dialAMDActive':{'type':Sequelize[_0xf4d5('0x6')],'defaultValue':0x0,'comment':_0xf4d5('0x17')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4d5('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf4d5('0xa')](0x9)[_0xf4d5('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf4d5('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4d5('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf4d5('0x19')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf4d5('0xa')](0x9)[_0xf4d5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4d5('0x1a')},'dialAMDMinWordLength':{'type':Sequelize[_0xf4d5('0xa')](0x9)[_0xf4d5('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf4d5('0x1b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4d5('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf4d5('0xa')](0x9)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf4d5('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf4d5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf4d5('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4d5('0x1e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf4d5('0x4')](_0xf4d5('0x1f'),_0xf4d5('0x20')),'defaultValue':_0xf4d5('0x1f')},'dialPrefix':{'type':Sequelize[_0xf4d5('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4d5('0x21')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xf4d5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4d5('0x22')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0x23')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf4d5('0xa')](0x3)[_0xf4d5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4d5('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf4d5('0xa')](0x5)[_0xf4d5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4d5('0x28')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 3e38e21..68cb9da 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 _0xd48a=['count','limit','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','error','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','user','role','findOne','CmHopper','hasOwnProperty','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ContactId','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x484060,_0xce9823){var _0x295784=function(_0x312b8a){while(--_0x312b8a){_0x484060['push'](_0x484060['shift']());}};_0x295784(++_0xce9823);}(_0xd48a,0x6b));var _0xad48=function(_0x5617f4,_0x2ef726){_0x5617f4=_0x5617f4-0x0;var _0x1fd7ab=_0xd48a[_0x5617f4];return _0x1fd7ab;};'use strict';var emlformat=require(_0xad48('0x0'));var rimraf=require(_0xad48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad48('0x2'));var rp=require(_0xad48('0x3'));var moment=require(_0xad48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xad48('0x5'));var util=require(_0xad48('0x6'));var path=require(_0xad48('0x7'));var sox=require(_0xad48('0x8'));var csv=require(_0xad48('0x9'));var ejs=require(_0xad48('0xa'));var fs=require('fs');var fs_extra=require(_0xad48('0xb'));var _=require(_0xad48('0xc'));var squel=require('squel');var crypto=require(_0xad48('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xad48('0xe'));var toCsv=require('to-csv');var querystring=require(_0xad48('0xf'));var Papa=require(_0xad48('0x10'));var Redis=require(_0xad48('0x11'));var authService=require(_0xad48('0x12'));var qs=require(_0xad48('0x13'));var as=require(_0xad48('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad48('0x15'))('api');var utils=require(_0xad48('0x16'));var config=require(_0xad48('0x17'));var licenseUtil=require(_0xad48('0x18'));var db=require(_0xad48('0x19'))['db'];function respondWithStatusCode(_0x1675b2,_0x6aae75){_0x6aae75=_0x6aae75||0xcc;return function(_0x2f26c0){if(_0x2f26c0){return _0x1675b2[_0xad48('0x1a')](_0x6aae75);}return _0x1675b2['status'](_0x6aae75)[_0xad48('0x1b')]();};}function respondWithResult(_0x4f0f8f,_0x6636db){_0x6636db=_0x6636db||0xc8;return function(_0x513c5e){if(_0x513c5e){return _0x4f0f8f[_0xad48('0x1c')](_0x6636db)[_0xad48('0x1d')](_0x513c5e);}};}function respondWithFilteredResult(_0x5da27d,_0x37e221){return function(_0x1474bb){if(_0x1474bb){var _0x45087d=typeof _0x37e221[_0xad48('0x1e')]===_0xad48('0x1f')&&typeof _0x37e221['limit']===_0xad48('0x1f');var _0x545eaa=_0x1474bb[_0xad48('0x20')];var _0x4fa318=_0x45087d?0x0:_0x37e221[_0xad48('0x1e')];var _0x22eb94=_0x45087d?_0x1474bb[_0xad48('0x20')]:_0x37e221[_0xad48('0x1e')]+_0x37e221[_0xad48('0x21')];var _0x3109fc;if(_0x22eb94>=_0x545eaa){_0x22eb94=_0x545eaa;_0x3109fc=0xc8;}else{_0x3109fc=0xce;}_0x5da27d['status'](_0x3109fc);return _0x5da27d[_0xad48('0x22')](_0xad48('0x23'),_0x4fa318+'-'+_0x22eb94+'/'+_0x545eaa)[_0xad48('0x1d')](_0x1474bb);}return null;};}function patchUpdates(_0x55e627){return function(_0x3cf2d9){try{jsonpatch['apply'](_0x3cf2d9,_0x55e627,!![]);}catch(_0x5e0e88){return BPromise[_0xad48('0x24')](_0x5e0e88);}return _0x3cf2d9[_0xad48('0x25')]();};}function saveUpdates(_0x4c122b,_0x364a23){return function(_0x18750e){if(_0x18750e){return _0x18750e[_0xad48('0x26')](_0x4c122b)[_0xad48('0x27')](function(_0x25b44c){return _0x25b44c;});}return null;};}function removeEntity(_0x3c800d,_0x5cefa3){return function(_0x573ede){if(_0x573ede){return _0x573ede[_0xad48('0x28')]()['then'](function(){var _0x4bfa73=_0x573ede[_0xad48('0x29')]({'plain':!![]});var _0x1fb0be=_0xad48('0x2a');return db['UserProfileResource'][_0xad48('0x28')]({'where':{'type':_0x1fb0be,'resourceId':_0x4bfa73['id']}})['then'](function(){return _0x573ede;});})[_0xad48('0x27')](function(){_0x3c800d[_0xad48('0x1c')](0xcc)[_0xad48('0x1b')]();});}};}function handleEntityNotFound(_0x19d45c,_0xe83e14){return function(_0x64577d){if(!_0x64577d){_0x19d45c[_0xad48('0x1a')](0x194);}return _0x64577d;};}function handleError(_0x29ef74,_0x56c654){_0x56c654=_0x56c654||0x1f4;return function(_0x36cb14){logger[_0xad48('0x2b')](_0x36cb14['stack']);if(_0x36cb14['name']){delete _0x36cb14[_0xad48('0x2c')];}_0x29ef74[_0xad48('0x1c')](_0x56c654)[_0xad48('0x2d')](_0x36cb14);};}exports[_0xad48('0x2e')]=function(_0x216d8e,_0x209bcc){var _0x434d9d={},_0x36b646={},_0x822b0a={'count':0x0,'rows':[]};var _0x3be64f=_[_0xad48('0x2f')](db[_0xad48('0x30')]['rawAttributes'],function(_0x189d39){return{'name':_0x189d39[_0xad48('0x31')],'type':_0x189d39[_0xad48('0x32')]['key']};});_0x36b646[_0xad48('0x33')]=_[_0xad48('0x2f')](_0x3be64f,_0xad48('0x2c'));_0x36b646[_0xad48('0x34')]=_[_0xad48('0x35')](_0x216d8e['query']);_0x36b646[_0xad48('0x36')]=_['intersection'](_0x36b646['model'],_0x36b646[_0xad48('0x34')]);_0x434d9d[_0xad48('0x37')]=_[_0xad48('0x38')](_0x36b646[_0xad48('0x33')],qs[_0xad48('0x39')](_0x216d8e[_0xad48('0x34')][_0xad48('0x39')]));_0x434d9d[_0xad48('0x37')]=_0x434d9d['attributes'][_0xad48('0x3a')]?_0x434d9d['attributes']:_0x36b646[_0xad48('0x33')];if(!_0x216d8e[_0xad48('0x34')]['hasOwnProperty'](_0xad48('0x3b'))){_0x434d9d[_0xad48('0x21')]=qs[_0xad48('0x21')](_0x216d8e[_0xad48('0x34')][_0xad48('0x21')]);_0x434d9d[_0xad48('0x1e')]=qs['offset'](_0x216d8e[_0xad48('0x34')][_0xad48('0x1e')]);}_0x434d9d[_0xad48('0x3c')]=qs[_0xad48('0x3d')](_0x216d8e[_0xad48('0x34')][_0xad48('0x3d')]);_0x434d9d[_0xad48('0x3e')]=qs[_0xad48('0x36')](_[_0xad48('0x3f')](_0x216d8e[_0xad48('0x34')],_0x36b646[_0xad48('0x36')]),_0x3be64f);if(_0x216d8e[_0xad48('0x34')]['filter']){_0x434d9d[_0xad48('0x3e')]=_['merge'](_0x434d9d[_0xad48('0x3e')],{'$or':_[_0xad48('0x2f')](_0x3be64f,function(_0x39e6c8){if(_0x39e6c8[_0xad48('0x32')]!==_0xad48('0x40')){var _0x37303a={};_0x37303a[_0x39e6c8['name']]={'$like':'%'+_0x216d8e[_0xad48('0x34')][_0xad48('0x41')]+'%'};return _0x37303a;}})});}_0x434d9d=_[_0xad48('0x42')]({},_0x434d9d,_0x216d8e[_0xad48('0x43')]);var _0x281cf1={'where':_0x434d9d[_0xad48('0x3e')]};return db[_0xad48('0x30')][_0xad48('0x20')](_0x281cf1)[_0xad48('0x27')](function(_0x235bba){_0x822b0a['count']=_0x235bba;if(_0x216d8e['query'][_0xad48('0x44')]){_0x434d9d['include']=[{'all':!![]}];}return db['Campaign'][_0xad48('0x45')](_0x434d9d);})[_0xad48('0x27')](function(_0x3926ec){_0x822b0a['rows']=_0x3926ec;return _0x822b0a;})[_0xad48('0x27')](respondWithFilteredResult(_0x209bcc,_0x434d9d))[_0xad48('0x46')](handleError(_0x209bcc,null));};exports[_0xad48('0x47')]=function(_0x517c82,_0xff0554){var _0x19d352={'raw':![],'where':{'id':_0x517c82[_0xad48('0x48')]['id']}},_0x51523e={};_0x51523e[_0xad48('0x33')]=_['keys'](db[_0xad48('0x30')][_0xad48('0x49')]);_0x51523e[_0xad48('0x34')]=_[_0xad48('0x35')](_0x517c82[_0xad48('0x34')]);_0x51523e['filters']=_[_0xad48('0x38')](_0x51523e[_0xad48('0x33')],_0x51523e[_0xad48('0x34')]);_0x19d352[_0xad48('0x37')]=_[_0xad48('0x38')](_0x51523e[_0xad48('0x33')],qs['fields'](_0x517c82['query']['fields']));_0x19d352['attributes']=_0x19d352['attributes'][_0xad48('0x3a')]?_0x19d352[_0xad48('0x37')]:_0x51523e[_0xad48('0x33')];if(_0x517c82['query']['includeAll']){_0x19d352[_0xad48('0x4a')]=[{'all':!![]}];}_0x19d352=_['merge']({},_0x19d352,_0x517c82[_0xad48('0x43')]);return db['Campaign']['find'](_0x19d352)[_0xad48('0x27')](handleEntityNotFound(_0xff0554,null))['then'](respondWithResult(_0xff0554,null))['catch'](handleError(_0xff0554,null));};exports['create']=function(_0x30aab3,_0x43a804){return db[_0xad48('0x30')]['create'](_0x30aab3['body'],{})[_0xad48('0x27')](function(_0x32ab78){var _0x54403f=_0x30aab3['user']['get']({'plain':!![]});if(!_0x54403f)throw new Error(_0xad48('0x4b'));if(_0x54403f['role']==='user'){var _0x4061f8=_0x32ab78[_0xad48('0x29')]({'plain':!![]});var _0xb39084=_0xad48('0x2a');return db[_0xad48('0x4c')][_0xad48('0x4d')]({'where':{'name':_0xb39084,'userProfileId':_0x54403f[_0xad48('0x4e')]},'raw':!![]})['then'](function(_0x2ff50c){if(_0x2ff50c&&_0x2ff50c[_0xad48('0x4f')]===0x0){return db[_0xad48('0x50')][_0xad48('0x51')]({'name':_0x4061f8['name'],'resourceId':_0x4061f8['id'],'type':_0x2ff50c[_0xad48('0x2c')],'sectionId':_0x2ff50c['id']},{})['then'](function(){return _0x32ab78;});}else{return _0x32ab78;}})['catch'](function(_0x21ff2a){logger[_0xad48('0x2b')](_0xad48('0x52'),_0x21ff2a);throw _0x21ff2a;});}return _0x32ab78;})[_0xad48('0x27')](respondWithResult(_0x43a804,0xc9))[_0xad48('0x46')](handleError(_0x43a804,null));};exports[_0xad48('0x53')]=function(_0x5a75e9,_0x31ec70){var _0x2eea17={'where':{'id':_0x5a75e9[_0xad48('0x48')]['id']}},_0x4cc2c5={};_0x4cc2c5[_0xad48('0x33')]=_['keys'](db[_0xad48('0x30')]['rawAttributes']);_0x2eea17[_0xad48('0x37')]=_[_0xad48('0x38')](_0x4cc2c5[_0xad48('0x33')],qs[_0xad48('0x39')](_0x5a75e9[_0xad48('0x34')]['fields']));_0x2eea17[_0xad48('0x37')]=_0x2eea17[_0xad48('0x37')]['length']?_0x2eea17[_0xad48('0x37')]:_0x4cc2c5[_0xad48('0x33')];if(_0x5a75e9[_0xad48('0x34')]['includeAll']){_0x2eea17[_0xad48('0x4a')]=[{'all':!![]}];}_0x2eea17=_[_0xad48('0x42')]({},_0x2eea17,_0x5a75e9[_0xad48('0x43')]);return db[_0xad48('0x30')][_0xad48('0x4d')](_0x2eea17)['then'](handleEntityNotFound(_0x31ec70,null))[_0xad48('0x27')](function(_0x4fefe2){if(_0x4fefe2){var _0x29e03a=_0x4fefe2[_0xad48('0x29')]({'plain':!![]});_0x29e03a=qs[_0xad48('0x54')](_0x29e03a,['id',_0xad48('0x55'),'updatedAt']);_0x5a75e9[_0xad48('0x56')]=_[_0xad48('0x54')](_0x5a75e9[_0xad48('0x56')],['id',_0xad48('0x55'),_0xad48('0x57')]);return db[_0xad48('0x30')]['create'](_[_0xad48('0x42')](_0x29e03a,_0x5a75e9['body']),{'include':_0x5a75e9['query'][_0xad48('0x44')]?[{'all':!![]}]:undefined})[_0xad48('0x27')](function(_0x37e763){var _0x5e1dfa=_0x5a75e9[_0xad48('0x58')][_0xad48('0x29')]({'plain':!![]});if(!_0x5e1dfa)throw new Error(_0xad48('0x4b'));if(_0x5e1dfa[_0xad48('0x59')]===_0xad48('0x58')){var _0x1a9329=_0x37e763['get']({'plain':!![]});var _0x422b92=_0xad48('0x2a');return db[_0xad48('0x4c')][_0xad48('0x4d')]({'where':{'name':_0x422b92,'userProfileId':_0x5e1dfa[_0xad48('0x4e')]},'raw':!![]})['then'](function(_0x4f8cb6){if(_0x4f8cb6&&_0x4f8cb6['autoAssociation']===0x0){return db[_0xad48('0x50')][_0xad48('0x51')]({'name':_0x1a9329[_0xad48('0x2c')],'resourceId':_0x1a9329['id'],'type':_0x4f8cb6['name'],'sectionId':_0x4f8cb6['id']},{})[_0xad48('0x27')](function(){return _0x37e763;});}else{return _0x37e763;}})[_0xad48('0x46')](function(_0x4c509f){logger[_0xad48('0x2b')](_0xad48('0x52'),_0x4c509f);throw _0x4c509f;});}return _0x37e763;});}})[_0xad48('0x27')](respondWithResult(_0x31ec70,0xc9))['catch'](handleError(_0x31ec70,null));};exports['update']=function(_0xf6fe84,_0x241fd3){if(_0xf6fe84['body']['id']){delete _0xf6fe84[_0xad48('0x56')]['id'];}return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0xf6fe84[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x241fd3,null))['then'](saveUpdates(_0xf6fe84['body'],null))[_0xad48('0x27')](respondWithResult(_0x241fd3,null))[_0xad48('0x46')](handleError(_0x241fd3,null));};exports[_0xad48('0x28')]=function(_0x5ccc87,_0x2997ea){return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0x5ccc87[_0xad48('0x48')]['id']}})['then'](handleEntityNotFound(_0x2997ea,null))[_0xad48('0x27')](removeEntity(_0x2997ea,null))[_0xad48('0x46')](handleError(_0x2997ea,null));};exports['getHoppers']=function(_0xa9b7b0,_0x209ea6,_0x44950e){var _0x4eb292={'raw':!![],'where':{}};var _0x1bd650={};var _0xbb643d={'count':0x0,'rows':[]};return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0xa9b7b0[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x209ea6,null))['then'](function(_0x347d63){if(_0x347d63){_0x1bd650[_0xad48('0x33')]=_[_0xad48('0x35')](db[_0xad48('0x5b')]['rawAttributes']);_0x1bd650['query']=_['keys'](_0xa9b7b0[_0xad48('0x34')]);_0x1bd650[_0xad48('0x36')]=_['intersection'](_0x1bd650[_0xad48('0x33')],_0x1bd650[_0xad48('0x34')]);_0x4eb292[_0xad48('0x37')]=_[_0xad48('0x38')](_0x1bd650[_0xad48('0x33')],qs[_0xad48('0x39')](_0xa9b7b0['query'][_0xad48('0x39')]));_0x4eb292['attributes']=_0x4eb292[_0xad48('0x37')][_0xad48('0x3a')]?_0x4eb292[_0xad48('0x37')]:_0x1bd650['model'];if(!_0xa9b7b0[_0xad48('0x34')][_0xad48('0x5c')](_0xad48('0x3b'))){_0x4eb292[_0xad48('0x21')]=qs[_0xad48('0x21')](_0xa9b7b0[_0xad48('0x34')][_0xad48('0x21')]);_0x4eb292[_0xad48('0x1e')]=qs[_0xad48('0x1e')](_0xa9b7b0[_0xad48('0x34')][_0xad48('0x1e')]);}_0x4eb292[_0xad48('0x3c')]=qs['sort'](_0xa9b7b0[_0xad48('0x34')][_0xad48('0x3d')]);_0x4eb292[_0xad48('0x3e')]=qs[_0xad48('0x36')](_[_0xad48('0x3f')](_0xa9b7b0['query'],_0x1bd650[_0xad48('0x36')]));_0x4eb292['where'][_0xad48('0x5d')]=_0x347d63['id'];if(_0xa9b7b0['query'][_0xad48('0x41')]){_0x4eb292[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x4eb292['where'],{'$or':_[_0xad48('0x2f')](_0x4eb292['attributes'],function(_0x40587d){var _0x5d62e9={};_0x5d62e9[_0x40587d]={'$like':'%'+_0xa9b7b0['query'][_0xad48('0x41')]+'%'};return _0x5d62e9;})});}_0x4eb292=_[_0xad48('0x42')]({},_0x4eb292,_0xa9b7b0[_0xad48('0x43')]);return db[_0xad48('0x5b')]['count']({'where':_0x4eb292[_0xad48('0x3e')]})[_0xad48('0x27')](function(_0x16e5b4){_0xbb643d[_0xad48('0x20')]=_0x16e5b4;if(_0xa9b7b0[_0xad48('0x34')][_0xad48('0x44')]){_0x4eb292[_0xad48('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0xad48('0x45')](_0x4eb292);})[_0xad48('0x27')](function(_0x5f471a){_0xbb643d[_0xad48('0x5e')]=_0x5f471a;return _0xbb643d;});}})[_0xad48('0x27')](respondWithFilteredResult(_0x209ea6,_0x4eb292))[_0xad48('0x46')](handleError(_0x209ea6,null));};exports[_0xad48('0x5f')]=function(_0x439294,_0x3580ab,_0x405388){var _0x588fb8={'raw':!![],'where':{}};var _0x27dd1f={};var _0x1a136c={'count':0x0,'rows':[]};return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0x439294['params']['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x3580ab,null))[_0xad48('0x27')](function(_0x1ac4e6){if(_0x1ac4e6){_0x27dd1f[_0xad48('0x33')]=_['keys'](db[_0xad48('0x60')]['rawAttributes']);_0x27dd1f[_0xad48('0x34')]=_[_0xad48('0x35')](_0x439294[_0xad48('0x34')]);_0x27dd1f['filters']=_[_0xad48('0x38')](_0x27dd1f[_0xad48('0x33')],_0x27dd1f['query']);_0x588fb8[_0xad48('0x37')]=_[_0xad48('0x38')](_0x27dd1f['model'],qs[_0xad48('0x39')](_0x439294['query'][_0xad48('0x39')]));_0x588fb8[_0xad48('0x37')]=_0x588fb8[_0xad48('0x37')]['length']?_0x588fb8[_0xad48('0x37')]:_0x27dd1f['model'];if(!_0x439294[_0xad48('0x34')]['hasOwnProperty'](_0xad48('0x3b'))){_0x588fb8[_0xad48('0x21')]=qs[_0xad48('0x21')](_0x439294[_0xad48('0x34')]['limit']);_0x588fb8[_0xad48('0x1e')]=qs[_0xad48('0x1e')](_0x439294['query'][_0xad48('0x1e')]);}_0x588fb8[_0xad48('0x3c')]=qs[_0xad48('0x3d')](_0x439294['query'][_0xad48('0x3d')]);_0x588fb8['where']=qs[_0xad48('0x36')](_['pick'](_0x439294[_0xad48('0x34')],_0x27dd1f[_0xad48('0x36')]));_0x588fb8['where'][_0xad48('0x5d')]=_0x1ac4e6['id'];if(_0x439294[_0xad48('0x34')][_0xad48('0x41')]){_0x588fb8[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x588fb8['where'],{'$or':_[_0xad48('0x2f')](_0x588fb8[_0xad48('0x37')],function(_0x2ee9c1){var _0x37aa36={};_0x37aa36[_0x2ee9c1]={'$like':'%'+_0x439294[_0xad48('0x34')]['filter']+'%'};return _0x37aa36;})});}_0x588fb8=_[_0xad48('0x42')]({},_0x588fb8,_0x439294['options']);return db[_0xad48('0x60')][_0xad48('0x20')]({'where':_0x588fb8[_0xad48('0x3e')]})[_0xad48('0x27')](function(_0x20478e){_0x1a136c[_0xad48('0x20')]=_0x20478e;if(_0x439294[_0xad48('0x34')][_0xad48('0x44')]){_0x588fb8[_0xad48('0x4a')]=[{'all':!![]}];}return db[_0xad48('0x60')][_0xad48('0x45')](_0x588fb8);})['then'](function(_0x28c34d){_0x1a136c[_0xad48('0x5e')]=_0x28c34d;return _0x1a136c;});}})['then'](respondWithFilteredResult(_0x3580ab,_0x588fb8))[_0xad48('0x46')](handleError(_0x3580ab,null));};exports[_0xad48('0x61')]=function(_0x17e623,_0x4dfc9b,_0x40ed2d){var _0x2f29cc={'raw':!![],'where':{}};var _0x41d956={};var _0x34f81c={'count':0x0,'rows':[]};return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0x17e623[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x4dfc9b,null))['then'](function(_0x21c771){if(_0x21c771){_0x41d956[_0xad48('0x33')]=_[_0xad48('0x35')](db[_0xad48('0x62')][_0xad48('0x49')]);_0x41d956['query']=_[_0xad48('0x35')](_0x17e623[_0xad48('0x34')]);_0x41d956[_0xad48('0x36')]=_[_0xad48('0x38')](_0x41d956['model'],_0x41d956[_0xad48('0x34')]);_0x2f29cc[_0xad48('0x37')]=_[_0xad48('0x38')](_0x41d956[_0xad48('0x33')],qs['fields'](_0x17e623['query'][_0xad48('0x39')]));_0x2f29cc[_0xad48('0x37')]=_0x2f29cc[_0xad48('0x37')][_0xad48('0x3a')]?_0x2f29cc[_0xad48('0x37')]:_0x41d956[_0xad48('0x33')];if(!_0x17e623[_0xad48('0x34')][_0xad48('0x5c')]('nolimit')){_0x2f29cc[_0xad48('0x21')]=qs['limit'](_0x17e623[_0xad48('0x34')]['limit']);_0x2f29cc[_0xad48('0x1e')]=qs['offset'](_0x17e623[_0xad48('0x34')][_0xad48('0x1e')]);}_0x2f29cc['order']=qs['sort'](_0x17e623[_0xad48('0x34')][_0xad48('0x3d')]);_0x2f29cc[_0xad48('0x3e')]=qs['filters'](_[_0xad48('0x3f')](_0x17e623[_0xad48('0x34')],_0x41d956[_0xad48('0x36')]));_0x2f29cc[_0xad48('0x3e')]['CampaignId']=_0x21c771['id'];if(_0x17e623[_0xad48('0x34')][_0xad48('0x41')]){_0x2f29cc[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x2f29cc[_0xad48('0x3e')],{'$or':_[_0xad48('0x2f')](_0x2f29cc[_0xad48('0x37')],function(_0x253f26){var _0x145ed0={};_0x145ed0[_0x253f26]={'$like':'%'+_0x17e623[_0xad48('0x34')][_0xad48('0x41')]+'%'};return _0x145ed0;})});}_0x2f29cc=_[_0xad48('0x42')]({},_0x2f29cc,_0x17e623[_0xad48('0x43')]);return db[_0xad48('0x62')][_0xad48('0x20')]({'where':_0x2f29cc['where']})['then'](function(_0x1f52f6){_0x34f81c['count']=_0x1f52f6;if(_0x17e623[_0xad48('0x34')][_0xad48('0x44')]){_0x2f29cc[_0xad48('0x4a')]=[{'all':!![]}];}return db[_0xad48('0x62')][_0xad48('0x45')](_0x2f29cc);})[_0xad48('0x27')](function(_0x387cb5){_0x34f81c['rows']=_0x387cb5;return _0x34f81c;});}})[_0xad48('0x27')](respondWithFilteredResult(_0x4dfc9b,_0x2f29cc))[_0xad48('0x46')](handleError(_0x4dfc9b,null));};exports[_0xad48('0x63')]=function(_0x75e9c8,_0x12c1bc,_0x4c0c6b){var _0x1d8028={'raw':!![],'where':{}};var _0xc6193={};var _0x57651a={'count':0x0,'rows':[]};return db['Campaign'][_0xad48('0x5a')]({'where':{'id':_0x75e9c8[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x12c1bc,null))[_0xad48('0x27')](function(_0x213567){if(_0x213567){_0xc6193[_0xad48('0x33')]=_[_0xad48('0x35')](db[_0xad48('0x64')][_0xad48('0x49')]);_0xc6193['query']=_[_0xad48('0x35')](_0x75e9c8['query']);_0xc6193[_0xad48('0x36')]=_[_0xad48('0x38')](_0xc6193[_0xad48('0x33')],_0xc6193[_0xad48('0x34')]);_0x1d8028[_0xad48('0x37')]=_[_0xad48('0x38')](_0xc6193[_0xad48('0x33')],qs[_0xad48('0x39')](_0x75e9c8[_0xad48('0x34')][_0xad48('0x39')]));_0x1d8028['attributes']=_0x1d8028[_0xad48('0x37')][_0xad48('0x3a')]?_0x1d8028['attributes']:_0xc6193['model'];if(!_0x75e9c8[_0xad48('0x34')][_0xad48('0x5c')](_0xad48('0x3b'))){_0x1d8028[_0xad48('0x21')]=qs['limit'](_0x75e9c8[_0xad48('0x34')][_0xad48('0x21')]);_0x1d8028[_0xad48('0x1e')]=qs[_0xad48('0x1e')](_0x75e9c8['query']['offset']);}_0x1d8028[_0xad48('0x3c')]=qs['sort'](_0x75e9c8[_0xad48('0x34')][_0xad48('0x3d')]);_0x1d8028[_0xad48('0x3e')]=qs[_0xad48('0x36')](_['pick'](_0x75e9c8['query'],_0xc6193['filters']));_0x1d8028['where'][_0xad48('0x5d')]=_0x213567['id'];if(_0x75e9c8[_0xad48('0x34')][_0xad48('0x41')]){_0x1d8028[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x1d8028[_0xad48('0x3e')],{'$or':_[_0xad48('0x2f')](_0x1d8028[_0xad48('0x37')],function(_0x791a22){var _0xe4e7dd={};_0xe4e7dd[_0x791a22]={'$like':'%'+_0x75e9c8[_0xad48('0x34')][_0xad48('0x41')]+'%'};return _0xe4e7dd;})});}_0x1d8028=_['merge']({},_0x1d8028,_0x75e9c8[_0xad48('0x43')]);return db[_0xad48('0x64')][_0xad48('0x20')]({'where':_0x1d8028[_0xad48('0x3e')]})[_0xad48('0x27')](function(_0x1cebe6){_0x57651a[_0xad48('0x20')]=_0x1cebe6;if(_0x75e9c8[_0xad48('0x34')]['includeAll']){_0x1d8028[_0xad48('0x4a')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xad48('0x45')](_0x1d8028);})[_0xad48('0x27')](function(_0x428077){_0x57651a[_0xad48('0x5e')]=_0x428077;return _0x57651a;});}})[_0xad48('0x27')](respondWithFilteredResult(_0x12c1bc,_0x1d8028))[_0xad48('0x46')](handleError(_0x12c1bc,null));};exports[_0xad48('0x65')]=function(_0x374723,_0x343025,_0x473ef0){var _0x5886ff={};var _0xa7764a={};var _0x30cebd;var _0x48f32e;return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0x374723['params']['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x343025,null))[_0xad48('0x27')](function(_0x226690){if(_0x226690){_0x30cebd=_0x226690;_0xa7764a['model']=_[_0xad48('0x35')](db[_0xad48('0x66')][_0xad48('0x49')]);_0xa7764a['query']=_[_0xad48('0x35')](_0x374723[_0xad48('0x34')]);_0xa7764a[_0xad48('0x36')]=_[_0xad48('0x38')](_0xa7764a[_0xad48('0x33')],_0xa7764a[_0xad48('0x34')]);_0x5886ff[_0xad48('0x37')]=_[_0xad48('0x38')](_0xa7764a['model'],qs[_0xad48('0x39')](_0x374723[_0xad48('0x34')]['fields']));_0x5886ff[_0xad48('0x37')]=_0x5886ff[_0xad48('0x37')][_0xad48('0x3a')]?_0x5886ff[_0xad48('0x37')]:_0xa7764a['model'];_0x5886ff['order']=qs['sort'](_0x374723[_0xad48('0x34')]['sort']);_0x5886ff[_0xad48('0x3e')]=qs['filters'](_[_0xad48('0x3f')](_0x374723['query'],_0xa7764a[_0xad48('0x36')]));if(_0x374723[_0xad48('0x34')][_0xad48('0x41')]){_0x5886ff[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x5886ff[_0xad48('0x3e')],{'$or':_['map'](_0x5886ff[_0xad48('0x37')],function(_0x3c43e0){var _0x576320={};_0x576320[_0x3c43e0]={'$like':'%'+_0x374723['query'][_0xad48('0x41')]+'%'};return _0x576320;})});}_0x5886ff=_[_0xad48('0x42')]({},_0x5886ff,_0x374723[_0xad48('0x43')]);return _0x30cebd[_0xad48('0x65')](_0x5886ff);}})[_0xad48('0x27')](function(_0x543492){if(_0x543492){_0x48f32e=_0x543492['length'];if(!_0x374723[_0xad48('0x34')][_0xad48('0x5c')](_0xad48('0x3b'))){_0x5886ff[_0xad48('0x21')]=qs[_0xad48('0x21')](_0x374723[_0xad48('0x34')][_0xad48('0x21')]);_0x5886ff['offset']=qs['offset'](_0x374723['query'][_0xad48('0x1e')]);}return _0x30cebd['getLists'](_0x5886ff);}})[_0xad48('0x27')](function(_0x5025e6){if(_0x5025e6){return _0x5025e6?{'count':_0x48f32e,'rows':_0x5025e6}:null;}})['then'](respondWithResult(_0x343025,null))[_0xad48('0x46')](handleError(_0x343025,null));};exports[_0xad48('0x67')]=function(_0x4145d4,_0x1289c6,_0x544028){var _0x43d7e3,_0x4c4734;return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0x4145d4[_0xad48('0x48')]['id']}})['then'](handleEntityNotFound(_0x1289c6,null))[_0xad48('0x27')](function(_0x1b48b3){if(_0x1b48b3){_0x4c4734=_0x1b48b3;return _0x1b48b3['addLists'](_0x4145d4[_0xad48('0x56')]['ids'],_[_0xad48('0x54')](_0x4145d4[_0xad48('0x56')],[_0xad48('0x68'),'id'])||{});}return null;})[_0xad48('0x69')](function(_0x49b608){var _0x5c4a78;_0x43d7e3=_0x49b608||[];var _0x11de19=[];if(_0x49b608){for(var _0xac3803=0x0;_0xac3803<_0x49b608[_0xad48('0x3a')];_0xac3803+=0x1){var _0x3967d6=_0x49b608[_0xac3803][_0xad48('0x29')]({'plain':!![]});_0x4c4734[_0xad48('0x6a')]=_0x4145d4[_0xad48('0x56')]['dialCheckDuplicateType']?_0x4145d4['body'][_0xad48('0x6a')]:_0x4c4734['dialCheckDuplicateType'];switch(_0x4c4734['dialCheckDuplicateType']){case _0xad48('0x6b'):_0x5c4a78=squel[_0xad48('0x6c')]()['into'](_0xad48('0x6d'))[_0xad48('0x6e')]([_0xad48('0x6f'),_0xad48('0x70'),'ContactId',_0xad48('0x71'),_0xad48('0x5d'),_0xad48('0x55'),_0xad48('0x57')],squel[_0xad48('0x72')]()[_0xad48('0x73')](_0xad48('0x6f'),_0xad48('0x6f'))[_0xad48('0x73')]('NOW()',_0xad48('0x70'))[_0xad48('0x73')]('id','ContactId')['field'](_0x3967d6['CmListId'][_0xad48('0x74')](),_0xad48('0x71'))[_0xad48('0x73')](_0x4145d4['params']['id']['toString'](),'CampaignId')[_0xad48('0x73')]('NOW()','createdAt')['field'](_0xad48('0x75'),_0xad48('0x57'))[_0xad48('0x76')](_0xad48('0x77'))['where'](_0xad48('0x78'))[_0xad48('0x3e')](_0xad48('0x79'),_0x3967d6[_0xad48('0x7a')][_0xad48('0x74')]())[_0xad48('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xad48('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xad48('0x72')]()[_0xad48('0x73')](_0xad48('0x7b'))[_0xad48('0x76')](_0xad48('0x7c'))[_0xad48('0x3e')](_0xad48('0x7d'),_0x4145d4[_0xad48('0x48')]['id'][_0xad48('0x74')]()))[_0xad48('0x3e')](_0xad48('0x7e'),squel['select']()[_0xad48('0x73')](_0xad48('0x7f'))[_0xad48('0x76')](_0xad48('0x6d'))[_0xad48('0x3e')](_0xad48('0x7d'),_0x4145d4[_0xad48('0x48')]['id'][_0xad48('0x74')]())))[_0xad48('0x74')]();break;case _0xad48('0x80'):_0x5c4a78=squel['insert']()[_0xad48('0x81')](_0xad48('0x6d'))[_0xad48('0x6e')]([_0xad48('0x6f'),_0xad48('0x70'),_0xad48('0x82'),_0xad48('0x71'),_0xad48('0x5d'),'createdAt',_0xad48('0x57')],squel[_0xad48('0x72')]()[_0xad48('0x73')]('phone',_0xad48('0x6f'))['field'](_0xad48('0x75'),_0xad48('0x70'))['field']('id',_0xad48('0x82'))['field'](_0x3967d6['CmListId'][_0xad48('0x74')](),'ListId')[_0xad48('0x73')](_0x4145d4[_0xad48('0x48')]['id'][_0xad48('0x74')](),'CampaignId')[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x55'))[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x57'))[_0xad48('0x76')](_0xad48('0x77'))[_0xad48('0x3e')](_0xad48('0x78'))[_0xad48('0x3e')](_0xad48('0x79'),_0x3967d6[_0xad48('0x7a')]['toString']())[_0xad48('0x3e')](_0xad48('0x83'))[_0xad48('0x3e')](_0xad48('0x7e'),squel['select']()[_0xad48('0x73')](_0xad48('0x7f'))[_0xad48('0x76')](_0xad48('0x6d'))[_0xad48('0x3e')](_0xad48('0x7d'),_0x4145d4[_0xad48('0x48')]['id'][_0xad48('0x74')]())))[_0xad48('0x74')]();break;default:_0x5c4a78=squel[_0xad48('0x6c')]()[_0xad48('0x81')]('cm_hopper')[_0xad48('0x6e')](['phone',_0xad48('0x70'),_0xad48('0x82'),'ListId',_0xad48('0x5d'),_0xad48('0x55'),_0xad48('0x57')],squel[_0xad48('0x72')]()[_0xad48('0x73')](_0xad48('0x6f'),_0xad48('0x6f'))[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x70'))[_0xad48('0x73')]('id','ContactId')['field'](_0x3967d6['CmListId']['toString'](),_0xad48('0x71'))[_0xad48('0x73')](_0x4145d4['params']['id'][_0xad48('0x74')](),_0xad48('0x5d'))[_0xad48('0x73')]('NOW()',_0xad48('0x55'))['field'](_0xad48('0x75'),'updatedAt')[_0xad48('0x76')](_0xad48('0x77'))[_0xad48('0x3e')](_0xad48('0x78'))[_0xad48('0x3e')](_0xad48('0x79'),_0x3967d6[_0xad48('0x7a')][_0xad48('0x74')]())[_0xad48('0x3e')](_0xad48('0x83')))[_0xad48('0x74')]();}_0x11de19[_0xad48('0x84')](db[_0xad48('0x85')][_0xad48('0x34')](_0x5c4a78));}return BPromise[_0xad48('0x86')](_0x11de19);}})['then'](function(){return _0x43d7e3;})[_0xad48('0x27')](respondWithResult(_0x1289c6,null))[_0xad48('0x46')](handleError(_0x1289c6,null));};exports[_0xad48('0x87')]=function(_0x4eb165,_0x357ae6,_0x11d576){return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0x4eb165[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x357ae6,null))['then'](function(_0x2daab1){if(_0x2daab1){return _0x2daab1[_0xad48('0x87')](_0x4eb165['query'][_0xad48('0x68')]);}})[_0xad48('0x27')](function(_0x4da66d){if(_0x4da66d){return db[_0xad48('0x5b')][_0xad48('0x28')]({'where':{'ListId':_0x4eb165[_0xad48('0x34')][_0xad48('0x68')],'CampaignId':_0x4eb165['params']['id']}})[_0xad48('0x27')](function(){return _0x4da66d;});}})[_0xad48('0x27')](respondWithStatusCode(_0x357ae6,null))[_0xad48('0x46')](handleError(_0x357ae6,null));};exports[_0xad48('0x88')]=function(_0x189605,_0x2751ad,_0x4ca0b8){var _0x226786={};var _0x11be61={};var _0x5f089a;var _0x29beea;return db[_0xad48('0x30')][_0xad48('0x5a')]({'where':{'id':_0x189605[_0xad48('0x48')]['id']}})[_0xad48('0x27')](handleEntityNotFound(_0x2751ad,null))['then'](function(_0x4f2283){if(_0x4f2283){_0x5f089a=_0x4f2283;_0x11be61[_0xad48('0x33')]=_[_0xad48('0x35')](db[_0xad48('0x66')][_0xad48('0x49')]);_0x11be61[_0xad48('0x34')]=_['keys'](_0x189605[_0xad48('0x34')]);_0x11be61[_0xad48('0x36')]=_[_0xad48('0x38')](_0x11be61['model'],_0x11be61['query']);_0x226786['attributes']=_[_0xad48('0x38')](_0x11be61[_0xad48('0x33')],qs[_0xad48('0x39')](_0x189605[_0xad48('0x34')][_0xad48('0x39')]));_0x226786[_0xad48('0x37')]=_0x226786['attributes'][_0xad48('0x3a')]?_0x226786[_0xad48('0x37')]:_0x11be61['model'];_0x226786['order']=qs[_0xad48('0x3d')](_0x189605[_0xad48('0x34')][_0xad48('0x3d')]);_0x226786['where']=qs['filters'](_[_0xad48('0x3f')](_0x189605['query'],_0x11be61[_0xad48('0x36')]));if(_0x189605[_0xad48('0x34')][_0xad48('0x41')]){_0x226786[_0xad48('0x3e')]=_[_0xad48('0x42')](_0x226786[_0xad48('0x3e')],{'$or':_[_0xad48('0x2f')](_0x226786[_0xad48('0x37')],function(_0x4d144d){var _0x393507={};_0x393507[_0x4d144d]={'$like':'%'+_0x189605[_0xad48('0x34')][_0xad48('0x41')]+'%'};return _0x393507;})});}_0x226786=_[_0xad48('0x42')]({},_0x226786,_0x189605['options']);return _0x5f089a[_0xad48('0x88')](_0x226786);}})[_0xad48('0x27')](function(_0x348621){if(_0x348621){_0x29beea=_0x348621['length'];if(!_0x189605[_0xad48('0x34')]['hasOwnProperty']('nolimit')){_0x226786[_0xad48('0x21')]=qs[_0xad48('0x21')](_0x189605[_0xad48('0x34')][_0xad48('0x21')]);_0x226786[_0xad48('0x1e')]=qs[_0xad48('0x1e')](_0x189605['query'][_0xad48('0x1e')]);}return _0x5f089a[_0xad48('0x88')](_0x226786);}})[_0xad48('0x27')](function(_0xe3955){if(_0xe3955){return _0xe3955?{'count':_0x29beea,'rows':_0xe3955}:null;}})[_0xad48('0x27')](respondWithResult(_0x2751ad,null))[_0xad48('0x46')](handleError(_0x2751ad,null));};exports[_0xad48('0x89')]=function(_0x112501,_0x1b6243,_0x21b9e3){var _0x30dd81,_0xd8ae5;return db['Campaign'][_0xad48('0x4d')]({'where':{'id':_0x112501[_0xad48('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b6243,null))[_0xad48('0x27')](function(_0x3432f9){if(_0x3432f9){_0xd8ae5=_0x3432f9;return _0x3432f9['addBlackLists'](_0x112501[_0xad48('0x56')][_0xad48('0x68')],_[_0xad48('0x54')](_0x112501[_0xad48('0x56')],[_0xad48('0x68'),'id'])||{});}return null;})[_0xad48('0x69')](function(_0x364d0b){var _0x1bf56a;_0x30dd81=_0x364d0b||[];var _0x2f241c=[];if(_0x364d0b){for(var _0x5a8951=0x0;_0x5a8951<_0x364d0b[_0xad48('0x3a')];_0x5a8951+=0x1){var _0x81589d=_0x364d0b[_0x5a8951][_0xad48('0x29')]({'plain':!![]});_0x1bf56a=squel[_0xad48('0x6c')]()[_0xad48('0x81')]('cm_hopper_black')[_0xad48('0x6e')]([_0xad48('0x6f'),_0xad48('0x82'),_0xad48('0x71'),'CampaignId',_0xad48('0x55'),_0xad48('0x57')],squel['select']()[_0xad48('0x73')]('phone','phone')['field']('id',_0xad48('0x82'))['field'](_0x81589d[_0xad48('0x7a')][_0xad48('0x74')](),_0xad48('0x71'))[_0xad48('0x73')](_0x112501[_0xad48('0x48')]['id']['toString'](),_0xad48('0x5d'))[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x55'))[_0xad48('0x73')](_0xad48('0x75'),_0xad48('0x57'))[_0xad48('0x76')](_0xad48('0x77'))[_0xad48('0x3e')]('deletedAt\x20IS\x20NULL')[_0xad48('0x3e')](_0xad48('0x79'),_0x81589d[_0xad48('0x7a')][_0xad48('0x74')]())['where'](_0xad48('0x83')))[_0xad48('0x74')]();_0x2f241c[_0xad48('0x84')](db['sequelize'][_0xad48('0x34')](_0x1bf56a));}return BPromise[_0xad48('0x86')](_0x2f241c);}})[_0xad48('0x27')](function(){return _0x30dd81;})['then'](respondWithResult(_0x1b6243,null))[_0xad48('0x46')](handleError(_0x1b6243,null));};exports[_0xad48('0x8a')]=function(_0x4de900,_0x1d013e,_0x5ab481){return db[_0xad48('0x30')][_0xad48('0x4d')]({'where':{'id':_0x4de900[_0xad48('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d013e,null))[_0xad48('0x27')](function(_0x270546){if(_0x270546){return _0x270546[_0xad48('0x8a')](_0x4de900[_0xad48('0x34')]['ids']);}})[_0xad48('0x27')](function(_0x2e7e49){if(_0x2e7e49){return db[_0xad48('0x64')]['destroy']({'where':{'ListId':_0x4de900['query'][_0xad48('0x68')],'CampaignId':_0x4de900[_0xad48('0x48')]['id']}})[_0xad48('0x27')](function(){return _0x2e7e49;});}})[_0xad48('0x27')](respondWithStatusCode(_0x1d013e,null))['catch'](handleError(_0x1d013e,null));};
\ No newline at end of file
+var _0x84f1=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','findOne','CmHopper','order','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','all','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','Campaign','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId'];(function(_0x2b2714,_0x2231cf){var _0x2dec74=function(_0x5c6311){while(--_0x5c6311){_0x2b2714['push'](_0x2b2714['shift']());}};_0x2dec74(++_0x2231cf);}(_0x84f1,0xbe));var _0x184f=function(_0x3d54b5,_0x4e7b54){_0x3d54b5=_0x3d54b5-0x0;var _0x5cbcaa=_0x84f1[_0x3d54b5];return _0x5cbcaa;};'use strict';var emlformat=require(_0x184f('0x0'));var rimraf=require(_0x184f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x184f('0x2'));var rp=require(_0x184f('0x3'));var moment=require(_0x184f('0x4'));var BPromise=require(_0x184f('0x5'));var Mustache=require(_0x184f('0x6'));var util=require(_0x184f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x184f('0x8'));var ejs=require(_0x184f('0x9'));var fs=require('fs');var fs_extra=require(_0x184f('0xa'));var _=require(_0x184f('0xb'));var squel=require(_0x184f('0xc'));var crypto=require('crypto');var jsforce=require(_0x184f('0xd'));var deskjs=require(_0x184f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x184f('0xf'));var Papa=require(_0x184f('0x10'));var Redis=require('ioredis');var authService=require(_0x184f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x184f('0x12'));var hardwareService=require(_0x184f('0x13'));var logger=require(_0x184f('0x14'))(_0x184f('0x15'));var utils=require(_0x184f('0x16'));var config=require(_0x184f('0x17'));var licenseUtil=require(_0x184f('0x18'));var db=require(_0x184f('0x19'))['db'];function respondWithStatusCode(_0x4bed3d,_0x48230e){_0x48230e=_0x48230e||0xcc;return function(_0x1eb64a){if(_0x1eb64a){return _0x4bed3d[_0x184f('0x1a')](_0x48230e);}return _0x4bed3d[_0x184f('0x1b')](_0x48230e)['end']();};}function respondWithResult(_0x3a78fc,_0x1756d2){_0x1756d2=_0x1756d2||0xc8;return function(_0x5d1af7){if(_0x5d1af7){return _0x3a78fc[_0x184f('0x1b')](_0x1756d2)['json'](_0x5d1af7);}};}function respondWithFilteredResult(_0x44d24c,_0x5b2124){return function(_0x329850){if(_0x329850){var _0x566118=typeof _0x5b2124[_0x184f('0x1c')]===_0x184f('0x1d')&&typeof _0x5b2124[_0x184f('0x1e')]===_0x184f('0x1d');var _0x3580f1=_0x329850[_0x184f('0x1f')];var _0x3aa9af=_0x566118?0x0:_0x5b2124[_0x184f('0x1c')];var _0x37ffa2=_0x566118?_0x329850[_0x184f('0x1f')]:_0x5b2124[_0x184f('0x1c')]+_0x5b2124[_0x184f('0x1e')];var _0x13dd74;if(_0x37ffa2>=_0x3580f1){_0x37ffa2=_0x3580f1;_0x13dd74=0xc8;}else{_0x13dd74=0xce;}_0x44d24c['status'](_0x13dd74);return _0x44d24c[_0x184f('0x20')](_0x184f('0x21'),_0x3aa9af+'-'+_0x37ffa2+'/'+_0x3580f1)['json'](_0x329850);}return null;};}function patchUpdates(_0x57df67){return function(_0x31b842){try{jsonpatch[_0x184f('0x22')](_0x31b842,_0x57df67,!![]);}catch(_0x26eec5){return BPromise[_0x184f('0x23')](_0x26eec5);}return _0x31b842[_0x184f('0x24')]();};}function saveUpdates(_0x1b1433,_0x502d09){return function(_0x4915c1){if(_0x4915c1){return _0x4915c1['update'](_0x1b1433)[_0x184f('0x25')](function(_0x161258){return _0x161258;});}return null;};}function removeEntity(_0x3bf224,_0xd7846d){return function(_0x4cd64c){if(_0x4cd64c){return _0x4cd64c[_0x184f('0x26')]()[_0x184f('0x25')](function(){var _0x45c102=_0x4cd64c[_0x184f('0x27')]({'plain':!![]});var _0x51bc96='IvrCampaigns';return db[_0x184f('0x28')][_0x184f('0x26')]({'where':{'type':_0x51bc96,'resourceId':_0x45c102['id']}})['then'](function(){return _0x4cd64c;});})[_0x184f('0x25')](function(){_0x3bf224[_0x184f('0x1b')](0xcc)[_0x184f('0x29')]();});}};}function handleEntityNotFound(_0x35dbaa,_0x372149){return function(_0xf8302e){if(!_0xf8302e){_0x35dbaa[_0x184f('0x1a')](0x194);}return _0xf8302e;};}function handleError(_0x3ba061,_0x22282e){_0x22282e=_0x22282e||0x1f4;return function(_0x4d1de1){logger[_0x184f('0x2a')](_0x4d1de1[_0x184f('0x2b')]);if(_0x4d1de1[_0x184f('0x2c')]){delete _0x4d1de1[_0x184f('0x2c')];}_0x3ba061[_0x184f('0x1b')](_0x22282e)[_0x184f('0x2d')](_0x4d1de1);};}exports[_0x184f('0x2e')]=function(_0x4346b6,_0x5d23d8){var _0x520679={},_0xe053e4={},_0x4ab3d9={'count':0x0,'rows':[]};var _0x19a8a4=_['map'](db['Campaign'][_0x184f('0x2f')],function(_0x68079f){return{'name':_0x68079f[_0x184f('0x30')],'type':_0x68079f['type']['key']};});_0xe053e4['model']=_[_0x184f('0x31')](_0x19a8a4,_0x184f('0x2c'));_0xe053e4[_0x184f('0x32')]=_[_0x184f('0x33')](_0x4346b6[_0x184f('0x32')]);_0xe053e4[_0x184f('0x34')]=_[_0x184f('0x35')](_0xe053e4['model'],_0xe053e4[_0x184f('0x32')]);_0x520679[_0x184f('0x36')]=_[_0x184f('0x35')](_0xe053e4[_0x184f('0x37')],qs[_0x184f('0x38')](_0x4346b6[_0x184f('0x32')][_0x184f('0x38')]));_0x520679[_0x184f('0x36')]=_0x520679[_0x184f('0x36')][_0x184f('0x39')]?_0x520679['attributes']:_0xe053e4[_0x184f('0x37')];if(!_0x4346b6[_0x184f('0x32')][_0x184f('0x3a')](_0x184f('0x3b'))){_0x520679[_0x184f('0x1e')]=qs['limit'](_0x4346b6[_0x184f('0x32')][_0x184f('0x1e')]);_0x520679[_0x184f('0x1c')]=qs[_0x184f('0x1c')](_0x4346b6['query'][_0x184f('0x1c')]);}_0x520679['order']=qs[_0x184f('0x3c')](_0x4346b6['query']['sort']);_0x520679[_0x184f('0x3d')]=qs[_0x184f('0x34')](_[_0x184f('0x3e')](_0x4346b6['query'],_0xe053e4[_0x184f('0x34')]),_0x19a8a4);if(_0x4346b6[_0x184f('0x32')][_0x184f('0x3f')]){_0x520679[_0x184f('0x3d')]=_['merge'](_0x520679['where'],{'$or':_[_0x184f('0x31')](_0x19a8a4,function(_0x57b741){if(_0x57b741[_0x184f('0x40')]!==_0x184f('0x41')){var _0x275de9={};_0x275de9[_0x57b741[_0x184f('0x2c')]]={'$like':'%'+_0x4346b6['query'][_0x184f('0x3f')]+'%'};return _0x275de9;}})});}_0x520679=_[_0x184f('0x42')]({},_0x520679,_0x4346b6[_0x184f('0x43')]);var _0x13be0b={'where':_0x520679[_0x184f('0x3d')]};return db[_0x184f('0x44')][_0x184f('0x1f')](_0x13be0b)[_0x184f('0x25')](function(_0x3bd57e){_0x4ab3d9[_0x184f('0x1f')]=_0x3bd57e;if(_0x4346b6[_0x184f('0x32')][_0x184f('0x45')]){_0x520679[_0x184f('0x46')]=[{'all':!![]}];}return db[_0x184f('0x44')][_0x184f('0x47')](_0x520679);})[_0x184f('0x25')](function(_0x12dbe2){_0x4ab3d9['rows']=_0x12dbe2;return _0x4ab3d9;})['then'](respondWithFilteredResult(_0x5d23d8,_0x520679))[_0x184f('0x48')](handleError(_0x5d23d8,null));};exports[_0x184f('0x49')]=function(_0x4eb9d2,_0x3d47b1){var _0x7e098c={'raw':![],'where':{'id':_0x4eb9d2[_0x184f('0x4a')]['id']}},_0x305f39={};_0x305f39[_0x184f('0x37')]=_['keys'](db[_0x184f('0x44')][_0x184f('0x2f')]);_0x305f39[_0x184f('0x32')]=_[_0x184f('0x33')](_0x4eb9d2[_0x184f('0x32')]);_0x305f39[_0x184f('0x34')]=_[_0x184f('0x35')](_0x305f39[_0x184f('0x37')],_0x305f39[_0x184f('0x32')]);_0x7e098c[_0x184f('0x36')]=_[_0x184f('0x35')](_0x305f39[_0x184f('0x37')],qs['fields'](_0x4eb9d2[_0x184f('0x32')][_0x184f('0x38')]));_0x7e098c[_0x184f('0x36')]=_0x7e098c[_0x184f('0x36')][_0x184f('0x39')]?_0x7e098c[_0x184f('0x36')]:_0x305f39[_0x184f('0x37')];if(_0x4eb9d2[_0x184f('0x32')][_0x184f('0x45')]){_0x7e098c['include']=[{'all':!![]}];}_0x7e098c=_[_0x184f('0x42')]({},_0x7e098c,_0x4eb9d2[_0x184f('0x43')]);return db[_0x184f('0x44')][_0x184f('0x4b')](_0x7e098c)[_0x184f('0x25')](handleEntityNotFound(_0x3d47b1,null))['then'](respondWithResult(_0x3d47b1,null))[_0x184f('0x48')](handleError(_0x3d47b1,null));};exports[_0x184f('0x4c')]=function(_0x198d58,_0x225516){return db['Campaign'][_0x184f('0x4c')](_0x198d58[_0x184f('0x4d')],{})[_0x184f('0x25')](function(_0x29dc5d){var _0x53dc0f=_0x198d58[_0x184f('0x4e')]['get']({'plain':!![]});if(!_0x53dc0f)throw new Error(_0x184f('0x4f'));if(_0x53dc0f[_0x184f('0x50')]===_0x184f('0x4e')){var _0x2d9dc0=_0x29dc5d[_0x184f('0x27')]({'plain':!![]});var _0x50a244=_0x184f('0x51');return db[_0x184f('0x52')][_0x184f('0x4b')]({'where':{'name':_0x50a244,'userProfileId':_0x53dc0f[_0x184f('0x53')]},'raw':!![]})[_0x184f('0x25')](function(_0x289f6a){if(_0x289f6a&&_0x289f6a[_0x184f('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d9dc0['name'],'resourceId':_0x2d9dc0['id'],'type':_0x289f6a[_0x184f('0x2c')],'sectionId':_0x289f6a['id']},{})['then'](function(){return _0x29dc5d;});}else{return _0x29dc5d;}})[_0x184f('0x48')](function(_0x4b9b69){logger['error'](_0x184f('0x55'),_0x4b9b69);throw _0x4b9b69;});}return _0x29dc5d;})['then'](respondWithResult(_0x225516,0xc9))[_0x184f('0x48')](handleError(_0x225516,null));};exports[_0x184f('0x56')]=function(_0x2bd552,_0x1bf2a4){var _0x21c00b={'where':{'id':_0x2bd552['params']['id']}},_0x1fa8a3={};_0x1fa8a3['model']=_[_0x184f('0x33')](db[_0x184f('0x44')][_0x184f('0x2f')]);_0x21c00b['attributes']=_['intersection'](_0x1fa8a3[_0x184f('0x37')],qs[_0x184f('0x38')](_0x2bd552[_0x184f('0x32')][_0x184f('0x38')]));_0x21c00b[_0x184f('0x36')]=_0x21c00b[_0x184f('0x36')][_0x184f('0x39')]?_0x21c00b[_0x184f('0x36')]:_0x1fa8a3[_0x184f('0x37')];if(_0x2bd552[_0x184f('0x32')][_0x184f('0x45')]){_0x21c00b[_0x184f('0x46')]=[{'all':!![]}];}_0x21c00b=_[_0x184f('0x42')]({},_0x21c00b,_0x2bd552[_0x184f('0x43')]);return db[_0x184f('0x44')]['find'](_0x21c00b)[_0x184f('0x25')](handleEntityNotFound(_0x1bf2a4,null))['then'](function(_0x3db867){if(_0x3db867){var _0x1d5835=_0x3db867['get']({'plain':!![]});_0x1d5835=qs[_0x184f('0x57')](_0x1d5835,['id',_0x184f('0x58'),_0x184f('0x59')]);_0x2bd552[_0x184f('0x4d')]=_[_0x184f('0x57')](_0x2bd552[_0x184f('0x4d')],['id',_0x184f('0x58'),_0x184f('0x59')]);return db[_0x184f('0x44')][_0x184f('0x4c')](_['merge'](_0x1d5835,_0x2bd552[_0x184f('0x4d')]),{'include':_0x2bd552[_0x184f('0x32')][_0x184f('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0xbf3a61){var _0x5ba389=_0x2bd552[_0x184f('0x4e')][_0x184f('0x27')]({'plain':!![]});if(!_0x5ba389)throw new Error(_0x184f('0x4f'));if(_0x5ba389[_0x184f('0x50')]===_0x184f('0x4e')){var _0x221810=_0xbf3a61['get']({'plain':!![]});var _0x511f07='IvrCampaigns';return db[_0x184f('0x52')][_0x184f('0x4b')]({'where':{'name':_0x511f07,'userProfileId':_0x5ba389[_0x184f('0x53')]},'raw':!![]})[_0x184f('0x25')](function(_0x29e14e){if(_0x29e14e&&_0x29e14e[_0x184f('0x54')]===0x0){return db[_0x184f('0x28')][_0x184f('0x4c')]({'name':_0x221810[_0x184f('0x2c')],'resourceId':_0x221810['id'],'type':_0x29e14e['name'],'sectionId':_0x29e14e['id']},{})[_0x184f('0x25')](function(){return _0xbf3a61;});}else{return _0xbf3a61;}})['catch'](function(_0x4c4fd6){logger[_0x184f('0x2a')](_0x184f('0x55'),_0x4c4fd6);throw _0x4c4fd6;});}return _0xbf3a61;});}})[_0x184f('0x25')](respondWithResult(_0x1bf2a4,0xc9))[_0x184f('0x48')](handleError(_0x1bf2a4,null));};exports[_0x184f('0x5a')]=function(_0x47cf48,_0x2a750a){if(_0x47cf48[_0x184f('0x4d')]['id']){delete _0x47cf48[_0x184f('0x4d')]['id'];}return db[_0x184f('0x44')][_0x184f('0x4b')]({'where':{'id':_0x47cf48['params']['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x2a750a,null))[_0x184f('0x25')](saveUpdates(_0x47cf48['body'],null))['then'](respondWithResult(_0x2a750a,null))[_0x184f('0x48')](handleError(_0x2a750a,null));};exports[_0x184f('0x26')]=function(_0x443c46,_0x7c744f){return db['Campaign'][_0x184f('0x4b')]({'where':{'id':_0x443c46[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x7c744f,null))['then'](removeEntity(_0x7c744f,null))[_0x184f('0x48')](handleError(_0x7c744f,null));};exports['getHoppers']=function(_0x5a7481,_0x3c1d43,_0x535741){var _0x1892b2={'raw':!![],'where':{}};var _0x54f15b={};var _0x16d88b={'count':0x0,'rows':[]};return db['Campaign'][_0x184f('0x5b')]({'where':{'id':_0x5a7481[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x3c1d43,null))[_0x184f('0x25')](function(_0x180e74){if(_0x180e74){_0x54f15b[_0x184f('0x37')]=_[_0x184f('0x33')](db[_0x184f('0x5c')]['rawAttributes']);_0x54f15b['query']=_['keys'](_0x5a7481['query']);_0x54f15b[_0x184f('0x34')]=_[_0x184f('0x35')](_0x54f15b[_0x184f('0x37')],_0x54f15b['query']);_0x1892b2[_0x184f('0x36')]=_[_0x184f('0x35')](_0x54f15b['model'],qs[_0x184f('0x38')](_0x5a7481[_0x184f('0x32')]['fields']));_0x1892b2[_0x184f('0x36')]=_0x1892b2[_0x184f('0x36')]['length']?_0x1892b2['attributes']:_0x54f15b[_0x184f('0x37')];if(!_0x5a7481[_0x184f('0x32')]['hasOwnProperty'](_0x184f('0x3b'))){_0x1892b2[_0x184f('0x1e')]=qs['limit'](_0x5a7481[_0x184f('0x32')][_0x184f('0x1e')]);_0x1892b2[_0x184f('0x1c')]=qs[_0x184f('0x1c')](_0x5a7481['query'][_0x184f('0x1c')]);}_0x1892b2[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0x5a7481['query'][_0x184f('0x3c')]);_0x1892b2[_0x184f('0x3d')]=qs[_0x184f('0x34')](_[_0x184f('0x3e')](_0x5a7481[_0x184f('0x32')],_0x54f15b[_0x184f('0x34')]));_0x1892b2[_0x184f('0x3d')][_0x184f('0x5e')]=_0x180e74['id'];if(_0x5a7481[_0x184f('0x32')]['filter']){_0x1892b2[_0x184f('0x3d')]=_['merge'](_0x1892b2[_0x184f('0x3d')],{'$or':_[_0x184f('0x31')](_0x1892b2[_0x184f('0x36')],function(_0x32b265){var _0x526a1e={};_0x526a1e[_0x32b265]={'$like':'%'+_0x5a7481[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x526a1e;})});}_0x1892b2=_[_0x184f('0x42')]({},_0x1892b2,_0x5a7481[_0x184f('0x43')]);return db[_0x184f('0x5c')][_0x184f('0x1f')]({'where':_0x1892b2['where']})[_0x184f('0x25')](function(_0x303b69){_0x16d88b[_0x184f('0x1f')]=_0x303b69;if(_0x5a7481[_0x184f('0x32')][_0x184f('0x45')]){_0x1892b2[_0x184f('0x46')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1892b2);})[_0x184f('0x25')](function(_0x257a1d){_0x16d88b[_0x184f('0x5f')]=_0x257a1d;return _0x16d88b;});}})[_0x184f('0x25')](respondWithFilteredResult(_0x3c1d43,_0x1892b2))[_0x184f('0x48')](handleError(_0x3c1d43,null));};exports[_0x184f('0x60')]=function(_0xadcafd,_0xf30057,_0x585542){var _0x5eb810={'raw':!![],'where':{}};var _0x3892c0={};var _0x2f23c0={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xadcafd[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0xf30057,null))['then'](function(_0xefadb3){if(_0xefadb3){_0x3892c0[_0x184f('0x37')]=_[_0x184f('0x33')](db[_0x184f('0x61')][_0x184f('0x2f')]);_0x3892c0[_0x184f('0x32')]=_[_0x184f('0x33')](_0xadcafd[_0x184f('0x32')]);_0x3892c0[_0x184f('0x34')]=_[_0x184f('0x35')](_0x3892c0[_0x184f('0x37')],_0x3892c0['query']);_0x5eb810[_0x184f('0x36')]=_[_0x184f('0x35')](_0x3892c0[_0x184f('0x37')],qs[_0x184f('0x38')](_0xadcafd[_0x184f('0x32')][_0x184f('0x38')]));_0x5eb810[_0x184f('0x36')]=_0x5eb810['attributes'][_0x184f('0x39')]?_0x5eb810[_0x184f('0x36')]:_0x3892c0[_0x184f('0x37')];if(!_0xadcafd[_0x184f('0x32')][_0x184f('0x3a')](_0x184f('0x3b'))){_0x5eb810[_0x184f('0x1e')]=qs[_0x184f('0x1e')](_0xadcafd[_0x184f('0x32')][_0x184f('0x1e')]);_0x5eb810['offset']=qs[_0x184f('0x1c')](_0xadcafd[_0x184f('0x32')]['offset']);}_0x5eb810[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0xadcafd[_0x184f('0x32')][_0x184f('0x3c')]);_0x5eb810[_0x184f('0x3d')]=qs[_0x184f('0x34')](_[_0x184f('0x3e')](_0xadcafd['query'],_0x3892c0['filters']));_0x5eb810[_0x184f('0x3d')]['CampaignId']=_0xefadb3['id'];if(_0xadcafd[_0x184f('0x32')][_0x184f('0x3f')]){_0x5eb810[_0x184f('0x3d')]=_[_0x184f('0x42')](_0x5eb810[_0x184f('0x3d')],{'$or':_[_0x184f('0x31')](_0x5eb810[_0x184f('0x36')],function(_0x144e90){var _0x494597={};_0x494597[_0x144e90]={'$like':'%'+_0xadcafd[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x494597;})});}_0x5eb810=_[_0x184f('0x42')]({},_0x5eb810,_0xadcafd[_0x184f('0x43')]);return db[_0x184f('0x61')][_0x184f('0x1f')]({'where':_0x5eb810[_0x184f('0x3d')]})[_0x184f('0x25')](function(_0x1b3de8){_0x2f23c0[_0x184f('0x1f')]=_0x1b3de8;if(_0xadcafd['query'][_0x184f('0x45')]){_0x5eb810[_0x184f('0x46')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x184f('0x47')](_0x5eb810);})['then'](function(_0x403166){_0x2f23c0[_0x184f('0x5f')]=_0x403166;return _0x2f23c0;});}})[_0x184f('0x25')](respondWithFilteredResult(_0xf30057,_0x5eb810))['catch'](handleError(_0xf30057,null));};exports[_0x184f('0x62')]=function(_0xdf67ff,_0x78617f,_0x2890c2){var _0x22d888={'raw':!![],'where':{}};var _0x54444e={};var _0x639f90={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xdf67ff[_0x184f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x78617f,null))['then'](function(_0x39e609){if(_0x39e609){_0x54444e[_0x184f('0x37')]=_['keys'](db['CmHopperFinal'][_0x184f('0x2f')]);_0x54444e[_0x184f('0x32')]=_[_0x184f('0x33')](_0xdf67ff[_0x184f('0x32')]);_0x54444e[_0x184f('0x34')]=_[_0x184f('0x35')](_0x54444e[_0x184f('0x37')],_0x54444e['query']);_0x22d888[_0x184f('0x36')]=_[_0x184f('0x35')](_0x54444e[_0x184f('0x37')],qs[_0x184f('0x38')](_0xdf67ff[_0x184f('0x32')][_0x184f('0x38')]));_0x22d888[_0x184f('0x36')]=_0x22d888[_0x184f('0x36')]['length']?_0x22d888[_0x184f('0x36')]:_0x54444e[_0x184f('0x37')];if(!_0xdf67ff[_0x184f('0x32')][_0x184f('0x3a')](_0x184f('0x3b'))){_0x22d888[_0x184f('0x1e')]=qs['limit'](_0xdf67ff['query']['limit']);_0x22d888[_0x184f('0x1c')]=qs['offset'](_0xdf67ff['query'][_0x184f('0x1c')]);}_0x22d888[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0xdf67ff[_0x184f('0x32')]['sort']);_0x22d888[_0x184f('0x3d')]=qs[_0x184f('0x34')](_[_0x184f('0x3e')](_0xdf67ff[_0x184f('0x32')],_0x54444e[_0x184f('0x34')]));_0x22d888[_0x184f('0x3d')][_0x184f('0x5e')]=_0x39e609['id'];if(_0xdf67ff[_0x184f('0x32')][_0x184f('0x3f')]){_0x22d888['where']=_[_0x184f('0x42')](_0x22d888[_0x184f('0x3d')],{'$or':_['map'](_0x22d888['attributes'],function(_0x17860a){var _0x28960f={};_0x28960f[_0x17860a]={'$like':'%'+_0xdf67ff['query'][_0x184f('0x3f')]+'%'};return _0x28960f;})});}_0x22d888=_[_0x184f('0x42')]({},_0x22d888,_0xdf67ff[_0x184f('0x43')]);return db[_0x184f('0x63')][_0x184f('0x1f')]({'where':_0x22d888[_0x184f('0x3d')]})[_0x184f('0x25')](function(_0x403c2d){_0x639f90[_0x184f('0x1f')]=_0x403c2d;if(_0xdf67ff['query'][_0x184f('0x45')]){_0x22d888[_0x184f('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x184f('0x47')](_0x22d888);})[_0x184f('0x25')](function(_0x238287){_0x639f90[_0x184f('0x5f')]=_0x238287;return _0x639f90;});}})[_0x184f('0x25')](respondWithFilteredResult(_0x78617f,_0x22d888))[_0x184f('0x48')](handleError(_0x78617f,null));};exports['getHopperBlacks']=function(_0x63cad5,_0x3f68ee,_0x260a9a){var _0x43b70a={'raw':!![],'where':{}};var _0x291b4f={};var _0x26d1fe={'count':0x0,'rows':[]};return db[_0x184f('0x44')][_0x184f('0x5b')]({'where':{'id':_0x63cad5[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x3f68ee,null))[_0x184f('0x25')](function(_0x20072c){if(_0x20072c){_0x291b4f[_0x184f('0x37')]=_['keys'](db[_0x184f('0x64')][_0x184f('0x2f')]);_0x291b4f[_0x184f('0x32')]=_['keys'](_0x63cad5[_0x184f('0x32')]);_0x291b4f[_0x184f('0x34')]=_[_0x184f('0x35')](_0x291b4f[_0x184f('0x37')],_0x291b4f[_0x184f('0x32')]);_0x43b70a[_0x184f('0x36')]=_[_0x184f('0x35')](_0x291b4f['model'],qs[_0x184f('0x38')](_0x63cad5[_0x184f('0x32')][_0x184f('0x38')]));_0x43b70a[_0x184f('0x36')]=_0x43b70a[_0x184f('0x36')]['length']?_0x43b70a[_0x184f('0x36')]:_0x291b4f[_0x184f('0x37')];if(!_0x63cad5['query'][_0x184f('0x3a')](_0x184f('0x3b'))){_0x43b70a[_0x184f('0x1e')]=qs['limit'](_0x63cad5['query'][_0x184f('0x1e')]);_0x43b70a[_0x184f('0x1c')]=qs[_0x184f('0x1c')](_0x63cad5[_0x184f('0x32')][_0x184f('0x1c')]);}_0x43b70a['order']=qs[_0x184f('0x3c')](_0x63cad5[_0x184f('0x32')]['sort']);_0x43b70a['where']=qs['filters'](_[_0x184f('0x3e')](_0x63cad5[_0x184f('0x32')],_0x291b4f[_0x184f('0x34')]));_0x43b70a[_0x184f('0x3d')][_0x184f('0x5e')]=_0x20072c['id'];if(_0x63cad5[_0x184f('0x32')][_0x184f('0x3f')]){_0x43b70a[_0x184f('0x3d')]=_[_0x184f('0x42')](_0x43b70a[_0x184f('0x3d')],{'$or':_['map'](_0x43b70a[_0x184f('0x36')],function(_0x47340f){var _0x4b47fc={};_0x4b47fc[_0x47340f]={'$like':'%'+_0x63cad5[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x4b47fc;})});}_0x43b70a=_[_0x184f('0x42')]({},_0x43b70a,_0x63cad5[_0x184f('0x43')]);return db[_0x184f('0x64')][_0x184f('0x1f')]({'where':_0x43b70a[_0x184f('0x3d')]})[_0x184f('0x25')](function(_0xf5d341){_0x26d1fe[_0x184f('0x1f')]=_0xf5d341;if(_0x63cad5['query'][_0x184f('0x45')]){_0x43b70a[_0x184f('0x46')]=[{'all':!![]}];}return db[_0x184f('0x64')][_0x184f('0x47')](_0x43b70a);})['then'](function(_0x1cdc50){_0x26d1fe[_0x184f('0x5f')]=_0x1cdc50;return _0x26d1fe;});}})[_0x184f('0x25')](respondWithFilteredResult(_0x3f68ee,_0x43b70a))[_0x184f('0x48')](handleError(_0x3f68ee,null));};exports[_0x184f('0x65')]=function(_0x9a49ad,_0xc6a9a2,_0xec2894){var _0x2ae7a9={};var _0x2af28b={};var _0xd42d9d;var _0x5dc8f1;return db[_0x184f('0x44')][_0x184f('0x5b')]({'where':{'id':_0x9a49ad[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0xc6a9a2,null))[_0x184f('0x25')](function(_0x1d4385){if(_0x1d4385){_0xd42d9d=_0x1d4385;_0x2af28b['model']=_['keys'](db[_0x184f('0x66')]['rawAttributes']);_0x2af28b[_0x184f('0x32')]=_[_0x184f('0x33')](_0x9a49ad[_0x184f('0x32')]);_0x2af28b[_0x184f('0x34')]=_[_0x184f('0x35')](_0x2af28b['model'],_0x2af28b['query']);_0x2ae7a9[_0x184f('0x36')]=_[_0x184f('0x35')](_0x2af28b['model'],qs[_0x184f('0x38')](_0x9a49ad['query'][_0x184f('0x38')]));_0x2ae7a9['attributes']=_0x2ae7a9[_0x184f('0x36')]['length']?_0x2ae7a9['attributes']:_0x2af28b['model'];_0x2ae7a9[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0x9a49ad['query'][_0x184f('0x3c')]);_0x2ae7a9['where']=qs['filters'](_[_0x184f('0x3e')](_0x9a49ad[_0x184f('0x32')],_0x2af28b[_0x184f('0x34')]));if(_0x9a49ad[_0x184f('0x32')][_0x184f('0x3f')]){_0x2ae7a9[_0x184f('0x3d')]=_[_0x184f('0x42')](_0x2ae7a9[_0x184f('0x3d')],{'$or':_['map'](_0x2ae7a9[_0x184f('0x36')],function(_0x312800){var _0x558678={};_0x558678[_0x312800]={'$like':'%'+_0x9a49ad[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x558678;})});}_0x2ae7a9=_[_0x184f('0x42')]({},_0x2ae7a9,_0x9a49ad[_0x184f('0x43')]);return _0xd42d9d[_0x184f('0x65')](_0x2ae7a9);}})[_0x184f('0x25')](function(_0x20230c){if(_0x20230c){_0x5dc8f1=_0x20230c[_0x184f('0x39')];if(!_0x9a49ad[_0x184f('0x32')][_0x184f('0x3a')]('nolimit')){_0x2ae7a9[_0x184f('0x1e')]=qs[_0x184f('0x1e')](_0x9a49ad[_0x184f('0x32')][_0x184f('0x1e')]);_0x2ae7a9[_0x184f('0x1c')]=qs[_0x184f('0x1c')](_0x9a49ad[_0x184f('0x32')][_0x184f('0x1c')]);}return _0xd42d9d[_0x184f('0x65')](_0x2ae7a9);}})[_0x184f('0x25')](function(_0x59b6b0){if(_0x59b6b0){return _0x59b6b0?{'count':_0x5dc8f1,'rows':_0x59b6b0}:null;}})['then'](respondWithResult(_0xc6a9a2,null))['catch'](handleError(_0xc6a9a2,null));};exports['addLists']=function(_0x5adf5e,_0x2fd956,_0x59b8cf){var _0x23227b,_0x20ce77;return db[_0x184f('0x44')][_0x184f('0x4b')]({'where':{'id':_0x5adf5e[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x2fd956,null))[_0x184f('0x25')](function(_0x27f1f7){if(_0x27f1f7){_0x20ce77=_0x27f1f7;return _0x27f1f7[_0x184f('0x67')](_0x5adf5e[_0x184f('0x4d')][_0x184f('0x68')],_[_0x184f('0x57')](_0x5adf5e[_0x184f('0x4d')],[_0x184f('0x68'),'id'])||{});}return null;})[_0x184f('0x69')](function(_0x140cd6){var _0x4587d5;_0x23227b=_0x140cd6||[];var _0xe7ad5b=[];if(_0x140cd6){for(var _0x49f0a1=0x0;_0x49f0a1<_0x140cd6['length'];_0x49f0a1+=0x1){var _0x5baf04=_0x140cd6[_0x49f0a1][_0x184f('0x27')]({'plain':!![]});_0x20ce77['dialCheckDuplicateType']=_0x5adf5e['body'][_0x184f('0x6a')]?_0x5adf5e[_0x184f('0x4d')][_0x184f('0x6a')]:_0x20ce77[_0x184f('0x6a')];switch(_0x20ce77[_0x184f('0x6a')]){case _0x184f('0x6b'):_0x4587d5=squel[_0x184f('0x6c')]()[_0x184f('0x6d')](_0x184f('0x6e'))[_0x184f('0x6f')]([_0x184f('0x70'),_0x184f('0x71'),_0x184f('0x72'),_0x184f('0x73'),'CampaignId',_0x184f('0x58'),_0x184f('0x59')],squel[_0x184f('0x74')]()[_0x184f('0x75')](_0x184f('0x70'),_0x184f('0x70'))[_0x184f('0x75')]('NOW()','scheduledAt')[_0x184f('0x75')]('id',_0x184f('0x72'))[_0x184f('0x75')](_0x5baf04[_0x184f('0x76')][_0x184f('0x77')](),_0x184f('0x73'))[_0x184f('0x75')](_0x5adf5e[_0x184f('0x4a')]['id'][_0x184f('0x77')](),_0x184f('0x5e'))['field'](_0x184f('0x78'),'createdAt')['field'](_0x184f('0x78'),_0x184f('0x59'))[_0x184f('0x79')](_0x184f('0x7a'))[_0x184f('0x3d')]('deletedAt\x20IS\x20NULL')[_0x184f('0x3d')](_0x184f('0x7b'),_0x5baf04[_0x184f('0x76')]['toString']())['where'](_0x184f('0x7c'))[_0x184f('0x3d')](_0x184f('0x7d'),squel[_0x184f('0x74')]()[_0x184f('0x75')](_0x184f('0x7e'))[_0x184f('0x79')](_0x184f('0x7f'))['where'](_0x184f('0x80'),_0x5adf5e[_0x184f('0x4a')]['id'][_0x184f('0x77')]()))[_0x184f('0x3d')](_0x184f('0x7d'),squel[_0x184f('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0x184f('0x79')]('cm_hopper')[_0x184f('0x3d')](_0x184f('0x80'),_0x5adf5e['params']['id'][_0x184f('0x77')]())))[_0x184f('0x77')]();break;case'onlyIfOpen':_0x4587d5=squel['insert']()['into'](_0x184f('0x6e'))[_0x184f('0x6f')]([_0x184f('0x70'),_0x184f('0x71'),'ContactId',_0x184f('0x73'),'CampaignId',_0x184f('0x58'),_0x184f('0x59')],squel[_0x184f('0x74')]()['field'](_0x184f('0x70'),_0x184f('0x70'))[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x71'))[_0x184f('0x75')]('id',_0x184f('0x72'))[_0x184f('0x75')](_0x5baf04[_0x184f('0x76')][_0x184f('0x77')](),_0x184f('0x73'))[_0x184f('0x75')](_0x5adf5e[_0x184f('0x4a')]['id'][_0x184f('0x77')](),_0x184f('0x5e'))[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x58'))[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x59'))[_0x184f('0x79')]('cm_contacts')[_0x184f('0x3d')](_0x184f('0x81'))[_0x184f('0x3d')]('ListId\x20=\x20?',_0x5baf04[_0x184f('0x76')]['toString']())[_0x184f('0x3d')](_0x184f('0x7c'))[_0x184f('0x3d')](_0x184f('0x7d'),squel[_0x184f('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0x184f('0x79')](_0x184f('0x6e'))[_0x184f('0x3d')]('CampaignId\x20=\x20?',_0x5adf5e[_0x184f('0x4a')]['id']['toString']())))['toString']();break;default:_0x4587d5=squel['insert']()[_0x184f('0x6d')]('cm_hopper')[_0x184f('0x6f')]([_0x184f('0x70'),_0x184f('0x71'),_0x184f('0x72'),'ListId',_0x184f('0x5e'),_0x184f('0x58'),_0x184f('0x59')],squel[_0x184f('0x74')]()[_0x184f('0x75')](_0x184f('0x70'),'phone')[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x71'))[_0x184f('0x75')]('id',_0x184f('0x72'))['field'](_0x5baf04[_0x184f('0x76')]['toString'](),_0x184f('0x73'))[_0x184f('0x75')](_0x5adf5e[_0x184f('0x4a')]['id']['toString'](),_0x184f('0x5e'))[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x58'))[_0x184f('0x75')](_0x184f('0x78'),'updatedAt')[_0x184f('0x79')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x184f('0x3d')](_0x184f('0x7b'),_0x5baf04[_0x184f('0x76')][_0x184f('0x77')]())[_0x184f('0x3d')](_0x184f('0x7c')))[_0x184f('0x77')]();}_0xe7ad5b['push'](db['sequelize'][_0x184f('0x32')](_0x4587d5));}return BPromise['all'](_0xe7ad5b);}})[_0x184f('0x25')](function(){return _0x23227b;})[_0x184f('0x25')](respondWithResult(_0x2fd956,null))[_0x184f('0x48')](handleError(_0x2fd956,null));};exports['removeLists']=function(_0x3a46fb,_0x11953a,_0x247f94){return db[_0x184f('0x44')][_0x184f('0x4b')]({'where':{'id':_0x3a46fb[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x11953a,null))[_0x184f('0x25')](function(_0xb792b5){if(_0xb792b5){return _0xb792b5[_0x184f('0x82')](_0x3a46fb[_0x184f('0x32')]['ids']);}})[_0x184f('0x25')](function(_0x1cc8db){if(_0x1cc8db){return db[_0x184f('0x5c')][_0x184f('0x26')]({'where':{'ListId':_0x3a46fb[_0x184f('0x32')]['ids'],'CampaignId':_0x3a46fb[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](function(){return _0x1cc8db;});}})['then'](respondWithStatusCode(_0x11953a,null))[_0x184f('0x48')](handleError(_0x11953a,null));};exports['getBlackLists']=function(_0x2aa293,_0x3d4b41,_0x3ce237){var _0x584caf={};var _0x345098={};var _0x2164d2;var _0x5e834a;return db[_0x184f('0x44')][_0x184f('0x5b')]({'where':{'id':_0x2aa293[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x3d4b41,null))[_0x184f('0x25')](function(_0x5ae188){if(_0x5ae188){_0x2164d2=_0x5ae188;_0x345098['model']=_[_0x184f('0x33')](db[_0x184f('0x66')]['rawAttributes']);_0x345098[_0x184f('0x32')]=_[_0x184f('0x33')](_0x2aa293[_0x184f('0x32')]);_0x345098[_0x184f('0x34')]=_[_0x184f('0x35')](_0x345098['model'],_0x345098[_0x184f('0x32')]);_0x584caf[_0x184f('0x36')]=_[_0x184f('0x35')](_0x345098[_0x184f('0x37')],qs[_0x184f('0x38')](_0x2aa293['query'][_0x184f('0x38')]));_0x584caf[_0x184f('0x36')]=_0x584caf['attributes'][_0x184f('0x39')]?_0x584caf[_0x184f('0x36')]:_0x345098[_0x184f('0x37')];_0x584caf[_0x184f('0x5d')]=qs[_0x184f('0x3c')](_0x2aa293[_0x184f('0x32')][_0x184f('0x3c')]);_0x584caf[_0x184f('0x3d')]=qs[_0x184f('0x34')](_['pick'](_0x2aa293[_0x184f('0x32')],_0x345098[_0x184f('0x34')]));if(_0x2aa293['query'][_0x184f('0x3f')]){_0x584caf['where']=_['merge'](_0x584caf[_0x184f('0x3d')],{'$or':_[_0x184f('0x31')](_0x584caf['attributes'],function(_0x67bf2a){var _0x1a4dfb={};_0x1a4dfb[_0x67bf2a]={'$like':'%'+_0x2aa293[_0x184f('0x32')][_0x184f('0x3f')]+'%'};return _0x1a4dfb;})});}_0x584caf=_['merge']({},_0x584caf,_0x2aa293['options']);return _0x2164d2[_0x184f('0x83')](_0x584caf);}})[_0x184f('0x25')](function(_0x5d8e1f){if(_0x5d8e1f){_0x5e834a=_0x5d8e1f[_0x184f('0x39')];if(!_0x2aa293[_0x184f('0x32')][_0x184f('0x3a')](_0x184f('0x3b'))){_0x584caf[_0x184f('0x1e')]=qs['limit'](_0x2aa293['query'][_0x184f('0x1e')]);_0x584caf['offset']=qs[_0x184f('0x1c')](_0x2aa293[_0x184f('0x32')][_0x184f('0x1c')]);}return _0x2164d2[_0x184f('0x83')](_0x584caf);}})[_0x184f('0x25')](function(_0x13ad88){if(_0x13ad88){return _0x13ad88?{'count':_0x5e834a,'rows':_0x13ad88}:null;}})[_0x184f('0x25')](respondWithResult(_0x3d4b41,null))[_0x184f('0x48')](handleError(_0x3d4b41,null));};exports['addBlackLists']=function(_0x464371,_0x5797da,_0x59baf5){var _0x462814,_0x5d0003;return db['Campaign'][_0x184f('0x4b')]({'where':{'id':_0x464371[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x5797da,null))['then'](function(_0x256785){if(_0x256785){_0x5d0003=_0x256785;return _0x256785[_0x184f('0x84')](_0x464371['body']['ids'],_['omit'](_0x464371[_0x184f('0x4d')],['ids','id'])||{});}return null;})[_0x184f('0x69')](function(_0x52258f){var _0x550943;_0x462814=_0x52258f||[];var _0x4db14b=[];if(_0x52258f){for(var _0x2e24d9=0x0;_0x2e24d9<_0x52258f[_0x184f('0x39')];_0x2e24d9+=0x1){var _0x493bd3=_0x52258f[_0x2e24d9][_0x184f('0x27')]({'plain':!![]});_0x550943=squel[_0x184f('0x6c')]()['into'](_0x184f('0x85'))[_0x184f('0x6f')](['phone','ContactId','ListId',_0x184f('0x5e'),_0x184f('0x58'),_0x184f('0x59')],squel['select']()['field']('phone','phone')[_0x184f('0x75')]('id',_0x184f('0x72'))[_0x184f('0x75')](_0x493bd3[_0x184f('0x76')]['toString'](),_0x184f('0x73'))['field'](_0x464371[_0x184f('0x4a')]['id']['toString'](),'CampaignId')[_0x184f('0x75')](_0x184f('0x78'),'createdAt')[_0x184f('0x75')](_0x184f('0x78'),_0x184f('0x59'))[_0x184f('0x79')]('cm_contacts')[_0x184f('0x3d')](_0x184f('0x81'))[_0x184f('0x3d')](_0x184f('0x7b'),_0x493bd3[_0x184f('0x76')][_0x184f('0x77')]())[_0x184f('0x3d')](_0x184f('0x7c')))[_0x184f('0x77')]();_0x4db14b[_0x184f('0x86')](db['sequelize'][_0x184f('0x32')](_0x550943));}return BPromise[_0x184f('0x87')](_0x4db14b);}})[_0x184f('0x25')](function(){return _0x462814;})[_0x184f('0x25')](respondWithResult(_0x5797da,null))[_0x184f('0x48')](handleError(_0x5797da,null));};exports[_0x184f('0x88')]=function(_0x10714a,_0x21de9e,_0x5b07a2){return db[_0x184f('0x44')][_0x184f('0x4b')]({'where':{'id':_0x10714a[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](handleEntityNotFound(_0x21de9e,null))[_0x184f('0x25')](function(_0x2c4834){if(_0x2c4834){return _0x2c4834[_0x184f('0x88')](_0x10714a[_0x184f('0x32')][_0x184f('0x68')]);}})['then'](function(_0x31a8d4){if(_0x31a8d4){return db[_0x184f('0x64')][_0x184f('0x26')]({'where':{'ListId':_0x10714a[_0x184f('0x32')][_0x184f('0x68')],'CampaignId':_0x10714a[_0x184f('0x4a')]['id']}})[_0x184f('0x25')](function(){return _0x31a8d4;});}})['then'](respondWithStatusCode(_0x21de9e,null))[_0x184f('0x48')](handleError(_0x21de9e,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 1713365..64f6013 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x7371d,_0x5d145a){var _0x238e70=function(_0x46b5e2){while(--_0x46b5e2){_0x7371d['push'](_0x7371d['shift']());}};_0x238e70(++_0x5d145a);}(_0x7a54,0x106));var _0x47a5=function(_0x44c691,_0x15daf2){_0x44c691=_0x44c691-0x0;var _0x4996ff=_0x7a54[_0x44c691];return _0x4996ff;};'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 dc9286b..90c3190 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 _0x0834=['attributes','limit','map','model','include','GetCampaign','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0834,0x18e));var _0x4083=function(_0x2ef8ad,_0x1d81cd){_0x2ef8ad=_0x2ef8ad-0x0;var _0x4fec0a=_0x0834[_0x2ef8ad];return _0x4fec0a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4083('0x0'));var BPromise=require(_0x4083('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4083('0x2'));var logger=require(_0x4083('0x3'))('rpc');var config=require(_0x4083('0x4'));var jayson=require(_0x4083('0x5'));var client=jayson['client'][_0x4083('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a54,_0x31c7ef,_0x26ed53){return new BPromise(function(_0x2c42bb,_0x1d56dd){return client[_0x4083('0x7')](_0x5c5a54,_0x26ed53)[_0x4083('0x8')](function(_0x3cee37){logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));logger[_0x4083('0xc')](_0x4083('0xd'),_0x31c7ef,_0x4083('0xb'),JSON[_0x4083('0xe')](_0x3cee37));if(_0x3cee37[_0x4083('0xf')]){if(_0x3cee37['error']['code']===0x1f4){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x3cee37['error'][_0x4083('0x10')]);return _0x1d56dd(_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x31c7ef,_0x3cee37[_0x4083('0xf')][_0x4083('0x10')]);return _0x2c42bb(_0x3cee37['error'][_0x4083('0x10')]);}else{logger[_0x4083('0x9')](_0x4083('0xa'),_0x31c7ef,_0x4083('0xb'));_0x2c42bb(_0x3cee37[_0x4083('0x11')]['message']);}})[_0x4083('0x12')](function(_0x10cadd){logger[_0x4083('0xf')](_0x4083('0xa'),_0x31c7ef,_0x10cadd);_0x1d56dd(_0x10cadd);});});}exports['GetCampaign']=function(_0x4e7d59){var _0x4d6089=this;return new Promise(function(_0xafda0c,_0x53d525){return db['Campaign'][_0x4083('0x13')]({'raw':_0x4e7d59['options']?_0x4e7d59[_0x4083('0x14')][_0x4083('0x15')]===undefined?!![]:![]:!![],'where':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59[_0x4083('0x14')]['where']||null:null,'attributes':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59['options'][_0x4083('0x16')]||null:null,'limit':_0x4e7d59[_0x4083('0x14')]?_0x4e7d59[_0x4083('0x14')][_0x4083('0x17')]||null:null,'include':_0x4e7d59['options']?_0x4e7d59[_0x4083('0x14')]['include']?_[_0x4083('0x18')](_0x4e7d59[_0x4083('0x14')]['include'],function(_0x52a440){return{'model':db[_0x52a440[_0x4083('0x19')]],'as':_0x52a440['as'],'attributes':_0x52a440['attributes'],'include':_0x52a440['include']?_['map'](_0x52a440[_0x4083('0x1a')],function(_0xb2fbb5){return{'model':db[_0xb2fbb5[_0x4083('0x19')]],'as':_0xb2fbb5['as'],'attributes':_0xb2fbb5['attributes'],'include':_0xb2fbb5[_0x4083('0x1a')]?_[_0x4083('0x18')](_0xb2fbb5[_0x4083('0x1a')],function(_0x552534){return{'model':db[_0x552534[_0x4083('0x19')]],'as':_0x552534['as'],'attributes':_0x552534[_0x4083('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x315458){logger[_0x4083('0x9')](_0x4083('0x1b'),_0x4e7d59);logger[_0x4083('0xc')](_0x4083('0x1b'),_0x4e7d59,JSON[_0x4083('0xe')](_0x315458));_0xafda0c(_0x315458);})[_0x4083('0x12')](function(_0x1534e9){logger[_0x4083('0xf')]('GetCampaign',_0x1534e9['message'],_0x4e7d59);_0x53d525(_0x4d6089[_0x4083('0xf')](0x1f4,_0x1534e9[_0x4083('0x10')]));});});};
\ No newline at end of file
+var _0xee53=['error','code','message','GetCampaign','Campaign','findAll','options','where','include','map','model','attributes','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x316acc,_0x1578dd){var _0x5c4664=function(_0x4eb96b){while(--_0x4eb96b){_0x316acc['push'](_0x316acc['shift']());}};_0x5c4664(++_0x1578dd);}(_0xee53,0xa8));var _0x3ee5=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0xee53[_0x50d84b];return _0x6d4270;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ee5('0x0'));var BPromise=require(_0x3ee5('0x1'));var rs=require(_0x3ee5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ee5('0x3'))['db'];var utils=require(_0x3ee5('0x4'));var logger=require(_0x3ee5('0x5'))(_0x3ee5('0x6'));var config=require(_0x3ee5('0x7'));var jayson=require(_0x3ee5('0x8'));var client=jayson[_0x3ee5('0x9')][_0x3ee5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6ff422,_0x2657de,_0x34ebf4){return new BPromise(function(_0x40b821,_0x14d96d){return client['request'](_0x6ff422,_0x34ebf4)[_0x3ee5('0xb')](function(_0xc344f){logger[_0x3ee5('0xc')](_0x3ee5('0xd'),_0x2657de,'request\x20sent');logger[_0x3ee5('0xe')](_0x3ee5('0xf'),_0x2657de,_0x3ee5('0x10'),JSON[_0x3ee5('0x11')](_0xc344f));if(_0xc344f['error']){if(_0xc344f[_0x3ee5('0x12')][_0x3ee5('0x13')]===0x1f4){logger['error'](_0x3ee5('0xd'),_0x2657de,_0xc344f['error'][_0x3ee5('0x14')]);return _0x14d96d(_0xc344f['error']['message']);}logger[_0x3ee5('0x12')](_0x3ee5('0xd'),_0x2657de,_0xc344f[_0x3ee5('0x12')][_0x3ee5('0x14')]);return _0x40b821(_0xc344f[_0x3ee5('0x12')][_0x3ee5('0x14')]);}else{logger[_0x3ee5('0xc')](_0x3ee5('0xd'),_0x2657de,_0x3ee5('0x10'));_0x40b821(_0xc344f['result'][_0x3ee5('0x14')]);}})['catch'](function(_0xab5013){logger[_0x3ee5('0x12')](_0x3ee5('0xd'),_0x2657de,_0xab5013);_0x14d96d(_0xab5013);});});}exports[_0x3ee5('0x15')]=function(_0x3a7356){var _0x19435e=this;return new Promise(function(_0x6a8b6b,_0x4f1b5f){return db[_0x3ee5('0x16')][_0x3ee5('0x17')]({'raw':_0x3a7356[_0x3ee5('0x18')]?_0x3a7356[_0x3ee5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3a7356[_0x3ee5('0x18')]?_0x3a7356[_0x3ee5('0x18')][_0x3ee5('0x19')]||null:null,'attributes':_0x3a7356[_0x3ee5('0x18')]?_0x3a7356[_0x3ee5('0x18')]['attributes']||null:null,'limit':_0x3a7356[_0x3ee5('0x18')]?_0x3a7356[_0x3ee5('0x18')]['limit']||null:null,'include':_0x3a7356['options']?_0x3a7356[_0x3ee5('0x18')][_0x3ee5('0x1a')]?_[_0x3ee5('0x1b')](_0x3a7356['options'][_0x3ee5('0x1a')],function(_0x4d7114){return{'model':db[_0x4d7114[_0x3ee5('0x1c')]],'as':_0x4d7114['as'],'attributes':_0x4d7114[_0x3ee5('0x1d')],'include':_0x4d7114['include']?_[_0x3ee5('0x1b')](_0x4d7114[_0x3ee5('0x1a')],function(_0x31d980){return{'model':db[_0x31d980[_0x3ee5('0x1c')]],'as':_0x31d980['as'],'attributes':_0x31d980[_0x3ee5('0x1d')],'include':_0x31d980[_0x3ee5('0x1a')]?_[_0x3ee5('0x1b')](_0x31d980[_0x3ee5('0x1a')],function(_0x415f50){return{'model':db[_0x415f50[_0x3ee5('0x1c')]],'as':_0x415f50['as'],'attributes':_0x415f50[_0x3ee5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f6f4f){logger['info'](_0x3ee5('0x15'),_0x3a7356);logger[_0x3ee5('0xe')](_0x3ee5('0x15'),_0x3a7356,JSON['stringify'](_0x2f6f4f));_0x6a8b6b(_0x2f6f4f);})[_0x3ee5('0x1e')](function(_0x10cd45){logger[_0x3ee5('0x12')](_0x3ee5('0x15'),_0x10cd45['message'],_0x3a7356);_0x4f1b5f(_0x19435e[_0x3ee5('0x12')](0x1f4,_0x10cd45[_0x3ee5('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 5d1a891..199c990 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 _0xa93a=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','post','create','clone','/:id/lists','addLists','/:id','delete','removeLists','removeBlackLists'];(function(_0xa1de8d,_0x1399a8){var _0x478b44=function(_0x3c8db7){while(--_0x3c8db7){_0xa1de8d['push'](_0xa1de8d['shift']());}};_0x478b44(++_0x1399a8);}(_0xa93a,0x16c));var _0xaa93=function(_0xc662e0,_0x34bc95){_0xc662e0=_0xc662e0-0x0;var _0x5c7c2c=_0xa93a[_0xc662e0];return _0x5c7c2c;};'use strict';var multer=require(_0xaa93('0x0'));var util=require(_0xaa93('0x1'));var path=require(_0xaa93('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa93('0x3'));var router=express[_0xaa93('0x4')]();var fs_extra=require(_0xaa93('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaa93('0x6'));var config=require(_0xaa93('0x7'));var controller=require(_0xaa93('0x8'));router['get']('/',auth[_0xaa93('0x9')](),controller[_0xaa93('0xa')]);router[_0xaa93('0xb')]('/:id',auth[_0xaa93('0x9')](),controller[_0xaa93('0xc')]);router['get'](_0xaa93('0xd'),auth[_0xaa93('0x9')](),controller[_0xaa93('0xe')]);router['get'](_0xaa93('0xf'),auth['isAuthenticated'](),controller[_0xaa93('0x10')]);router['get'](_0xaa93('0x11'),auth[_0xaa93('0x9')](),controller[_0xaa93('0x12')]);router['get'](_0xaa93('0x13'),auth[_0xaa93('0x9')](),controller['getHopperBlacks']);router[_0xaa93('0xb')]('/:id/lists',auth[_0xaa93('0x9')](),controller[_0xaa93('0x14')]);router[_0xaa93('0xb')](_0xaa93('0x15'),auth[_0xaa93('0x9')](),controller[_0xaa93('0x16')]);router[_0xaa93('0x17')]('/',auth['isAuthenticated'](),controller[_0xaa93('0x18')]);router[_0xaa93('0x17')]('/:id/clone',auth[_0xaa93('0x9')](),controller[_0xaa93('0x19')]);router[_0xaa93('0x17')](_0xaa93('0x1a'),auth[_0xaa93('0x9')](),controller[_0xaa93('0x1b')]);router[_0xaa93('0x17')]('/:id/blacklists',auth[_0xaa93('0x9')](),controller['addBlackLists']);router['put'](_0xaa93('0x1c'),auth[_0xaa93('0x9')](),controller['update']);router[_0xaa93('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xaa93('0x1d')](_0xaa93('0x1a'),auth[_0xaa93('0x9')](),controller[_0xaa93('0x1e')]);router[_0xaa93('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xaa93('0x1f')]);module[_0xaa93('0x20')]=router;
\ No newline at end of file
+var _0x0723=['/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create'];(function(_0x433690,_0x30b411){var _0x11b9a5=function(_0x7fc4ed){while(--_0x7fc4ed){_0x433690['push'](_0x433690['shift']());}};_0x11b9a5(++_0x30b411);}(_0x0723,0x101));var _0x3072=function(_0x2e4fe1,_0x4ea20f){_0x2e4fe1=_0x2e4fe1-0x0;var _0x5de9d3=_0x0723[_0x2e4fe1];return _0x5de9d3;};'use strict';var multer=require(_0x3072('0x0'));var util=require('util');var path=require(_0x3072('0x1'));var timeout=require(_0x3072('0x2'));var express=require(_0x3072('0x3'));var router=express[_0x3072('0x4')]();var fs_extra=require(_0x3072('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3072('0x6'));var controller=require(_0x3072('0x7'));router[_0x3072('0x8')]('/',auth[_0x3072('0x9')](),controller['index']);router['get']('/:id',auth[_0x3072('0x9')](),controller['show']);router[_0x3072('0x8')](_0x3072('0xa'),auth[_0x3072('0x9')](),controller[_0x3072('0xb')]);router[_0x3072('0x8')](_0x3072('0xc'),auth['isAuthenticated'](),controller[_0x3072('0xd')]);router['get'](_0x3072('0xe'),auth[_0x3072('0x9')](),controller[_0x3072('0xf')]);router[_0x3072('0x8')]('/:id/hopper_black',auth[_0x3072('0x9')](),controller[_0x3072('0x10')]);router[_0x3072('0x8')](_0x3072('0x11'),auth[_0x3072('0x9')](),controller['getLists']);router[_0x3072('0x8')](_0x3072('0x12'),auth[_0x3072('0x9')](),controller[_0x3072('0x13')]);router[_0x3072('0x14')]('/',auth[_0x3072('0x9')](),controller[_0x3072('0x15')]);router['post'](_0x3072('0x16'),auth[_0x3072('0x9')](),controller[_0x3072('0x17')]);router[_0x3072('0x14')](_0x3072('0x11'),auth[_0x3072('0x9')](),controller[_0x3072('0x18')]);router['post'](_0x3072('0x12'),auth[_0x3072('0x9')](),controller[_0x3072('0x19')]);router['put']('/:id',auth[_0x3072('0x9')](),controller[_0x3072('0x1a')]);router[_0x3072('0x1b')]('/:id',auth[_0x3072('0x9')](),controller[_0x3072('0x1c')]);router[_0x3072('0x1b')](_0x3072('0x11'),auth['isAuthenticated'](),controller[_0x3072('0x1d')]);router[_0x3072('0x1b')](_0x3072('0x12'),auth[_0x3072('0x9')](),controller['removeBlackLists']);module[_0x3072('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 6db5bd5..6213eef 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 _0xe0f3=['VIRTUAL','key','sequelize','STRING','TEXT'];(function(_0x1df796,_0x4394c1){var _0x5df53f=function(_0x144a68){while(--_0x144a68){_0x1df796['push'](_0x1df796['shift']());}};_0x5df53f(++_0x4394c1);}(_0xe0f3,0x142));var _0x3e0f=function(_0x577b01,_0x3770f0){_0x577b01=_0x577b01-0x0;var _0x380469=_0xe0f3[_0x577b01];return _0x380469;};'use strict';var Sequelize=require(_0x3e0f('0x0'));module['exports']={'key':{'type':Sequelize[_0x3e0f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x3e0f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3e0f('0x1')]},'name':{'type':Sequelize[_0x3e0f('0x3')],'get':function(){return this['getDataValue'](_0x3e0f('0x4'));}}};
\ No newline at end of file
+var _0xe828=['getDataValue','key','exports','STRING','TEXT'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0xe828,0x1e2));var _0x8e82=function(_0x1cce35,_0x4fd31a){_0x1cce35=_0x1cce35-0x0;var _0x172b90=_0xe828[_0x1cce35];return _0x172b90;};'use strict';var Sequelize=require('sequelize');module[_0x8e82('0x0')]={'key':{'type':Sequelize[_0x8e82('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x8e82('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8e82('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8e82('0x3')](_0x8e82('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d1ad8c9..ecc886f 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 _0x246b=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','CannedAnswers','then','error','name','send','index','fieldName','key','model'];(function(_0x3b4c8f,_0xa8bb0c){var _0x4a580f=function(_0x137d62){while(--_0x137d62){_0x3b4c8f['push'](_0x3b4c8f['shift']());}};_0x4a580f(++_0xa8bb0c);}(_0x246b,0x88));var _0xb246=function(_0x1fb3de,_0x175d08){_0x1fb3de=_0x1fb3de-0x0;var _0x2769d9=_0x246b[_0x1fb3de];return _0x2769d9;};'use strict';var emlformat=require(_0xb246('0x0'));var rimraf=require(_0xb246('0x1'));var zipdir=require(_0xb246('0x2'));var jsonpatch=require(_0xb246('0x3'));var rp=require(_0xb246('0x4'));var moment=require('moment');var BPromise=require(_0xb246('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb246('0x6'));var sox=require(_0xb246('0x7'));var csv=require('to-csv');var ejs=require(_0xb246('0x8'));var fs=require('fs');var fs_extra=require(_0xb246('0x9'));var _=require(_0xb246('0xa'));var squel=require(_0xb246('0xb'));var crypto=require(_0xb246('0xc'));var jsforce=require(_0xb246('0xd'));var deskjs=require(_0xb246('0xe'));var toCsv=require(_0xb246('0xf'));var querystring=require(_0xb246('0x10'));var Papa=require(_0xb246('0x11'));var Redis=require(_0xb246('0x12'));var authService=require(_0xb246('0x13'));var qs=require(_0xb246('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb246('0x15'));var logger=require(_0xb246('0x16'))(_0xb246('0x17'));var utils=require(_0xb246('0x18'));var config=require(_0xb246('0x19'));var licenseUtil=require(_0xb246('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cc60a,_0x174e98){_0x174e98=_0x174e98||0xcc;return function(_0x2597f3){if(_0x2597f3){return _0x5cc60a[_0xb246('0x1b')](_0x174e98);}return _0x5cc60a[_0xb246('0x1c')](_0x174e98)[_0xb246('0x1d')]();};}function respondWithResult(_0x26370e,_0x3d0184){_0x3d0184=_0x3d0184||0xc8;return function(_0x18de52){if(_0x18de52){return _0x26370e[_0xb246('0x1c')](_0x3d0184)[_0xb246('0x1e')](_0x18de52);}};}function respondWithFilteredResult(_0x3d865c,_0x32ff18){return function(_0xd7a294){if(_0xd7a294){var _0x479e02=typeof _0x32ff18[_0xb246('0x1f')]===_0xb246('0x20')&&typeof _0x32ff18[_0xb246('0x21')]==='undefined';var _0x31bfc6=_0xd7a294['count'];var _0x44c33d=_0x479e02?0x0:_0x32ff18[_0xb246('0x1f')];var _0x5c8ec8=_0x479e02?_0xd7a294[_0xb246('0x22')]:_0x32ff18['offset']+_0x32ff18[_0xb246('0x21')];var _0x4081a1;if(_0x5c8ec8>=_0x31bfc6){_0x5c8ec8=_0x31bfc6;_0x4081a1=0xc8;}else{_0x4081a1=0xce;}_0x3d865c['status'](_0x4081a1);return _0x3d865c[_0xb246('0x23')](_0xb246('0x24'),_0x44c33d+'-'+_0x5c8ec8+'/'+_0x31bfc6)['json'](_0xd7a294);}return null;};}function patchUpdates(_0x4d392f){return function(_0x507074){try{jsonpatch[_0xb246('0x25')](_0x507074,_0x4d392f,!![]);}catch(_0x1511af){return BPromise[_0xb246('0x26')](_0x1511af);}return _0x507074[_0xb246('0x27')]();};}function saveUpdates(_0x2d73b,_0x401928){return function(_0x280a71){if(_0x280a71){return _0x280a71[_0xb246('0x28')](_0x2d73b)['then'](function(_0x3ef9cb){return _0x3ef9cb;});}return null;};}function removeEntity(_0x442f75,_0x14de86){return function(_0x2d8c15){if(_0x2d8c15){return _0x2d8c15[_0xb246('0x29')]()['then'](function(){var _0x2eb348=_0x2d8c15[_0xb246('0x2a')]({'plain':!![]});var _0x57d96d=_0xb246('0x2b');return db['UserProfileResource'][_0xb246('0x29')]({'where':{'type':_0x57d96d,'resourceId':_0x2eb348['id']}})[_0xb246('0x2c')](function(){return _0x2d8c15;});})[_0xb246('0x2c')](function(){_0x442f75['status'](0xcc)[_0xb246('0x1d')]();});}};}function handleEntityNotFound(_0x5bb0ad,_0x1bee28){return function(_0x5603f5){if(!_0x5603f5){_0x5bb0ad[_0xb246('0x1b')](0x194);}return _0x5603f5;};}function handleError(_0x4d862b,_0x4533be){_0x4533be=_0x4533be||0x1f4;return function(_0x1f3970){logger[_0xb246('0x2d')](_0x1f3970['stack']);if(_0x1f3970[_0xb246('0x2e')]){delete _0x1f3970[_0xb246('0x2e')];}_0x4d862b[_0xb246('0x1c')](_0x4533be)[_0xb246('0x2f')](_0x1f3970);};}exports[_0xb246('0x30')]=function(_0x38fe7b,_0x54ba28){var _0x5666de={},_0x30bffb={},_0x40d1b7={'count':0x0,'rows':[]};var _0x33e030=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x5ddaca){return{'name':_0x5ddaca[_0xb246('0x31')],'type':_0x5ddaca['type'][_0xb246('0x32')]};});_0x30bffb[_0xb246('0x33')]=_['map'](_0x33e030,'name');_0x30bffb[_0xb246('0x34')]=_['keys'](_0x38fe7b['query']);_0x30bffb[_0xb246('0x35')]=_[_0xb246('0x36')](_0x30bffb[_0xb246('0x33')],_0x30bffb['query']);_0x5666de[_0xb246('0x37')]=_[_0xb246('0x36')](_0x30bffb[_0xb246('0x33')],qs['fields'](_0x38fe7b['query'][_0xb246('0x38')]));_0x5666de['attributes']=_0x5666de[_0xb246('0x37')]['length']?_0x5666de['attributes']:_0x30bffb['model'];if(!_0x38fe7b[_0xb246('0x34')][_0xb246('0x39')](_0xb246('0x3a'))){_0x5666de['limit']=qs[_0xb246('0x21')](_0x38fe7b[_0xb246('0x34')][_0xb246('0x21')]);_0x5666de['offset']=qs[_0xb246('0x1f')](_0x38fe7b[_0xb246('0x34')][_0xb246('0x1f')]);}_0x5666de[_0xb246('0x3b')]=qs['sort'](_0x38fe7b[_0xb246('0x34')][_0xb246('0x3c')]);_0x5666de[_0xb246('0x3d')]=qs[_0xb246('0x35')](_[_0xb246('0x3e')](_0x38fe7b[_0xb246('0x34')],_0x30bffb[_0xb246('0x35')]),_0x33e030);if(_0x38fe7b['query'][_0xb246('0x3f')]){_0x5666de[_0xb246('0x3d')]=_[_0xb246('0x40')](_0x5666de[_0xb246('0x3d')],{'$or':[{'key':{'$like':'%'+_0x38fe7b[_0xb246('0x34')][_0xb246('0x3f')]+'%'}},{'value':{'$like':'%'+_0x38fe7b[_0xb246('0x34')][_0xb246('0x3f')]+'%'}}]});}_0x5666de=_[_0xb246('0x40')]({},_0x5666de,_0x38fe7b[_0xb246('0x41')]);var _0x894c27={'where':_0x5666de[_0xb246('0x3d')]};return db[_0xb246('0x42')][_0xb246('0x22')](_0x894c27)[_0xb246('0x2c')](function(_0x53f6f3){_0x40d1b7[_0xb246('0x22')]=_0x53f6f3;if(_0x38fe7b[_0xb246('0x34')][_0xb246('0x43')]){_0x5666de[_0xb246('0x44')]=[{'all':!![]}];}return db[_0xb246('0x42')][_0xb246('0x45')](_0x5666de);})[_0xb246('0x2c')](function(_0x35eb3a){_0x40d1b7[_0xb246('0x46')]=_0x35eb3a;return _0x40d1b7;})[_0xb246('0x2c')](respondWithFilteredResult(_0x54ba28,_0x5666de))[_0xb246('0x47')](handleError(_0x54ba28,null));};exports[_0xb246('0x48')]=function(_0x29fdb0,_0x5bb20b){var _0x225cc4={'raw':!![],'where':{'id':_0x29fdb0['params']['id']}},_0x3d93b5={};_0x3d93b5[_0xb246('0x33')]=_[_0xb246('0x49')](db[_0xb246('0x42')]['rawAttributes']);_0x3d93b5['query']=_[_0xb246('0x49')](_0x29fdb0['query']);_0x3d93b5['filters']=_[_0xb246('0x36')](_0x3d93b5[_0xb246('0x33')],_0x3d93b5[_0xb246('0x34')]);_0x225cc4[_0xb246('0x37')]=_[_0xb246('0x36')](_0x3d93b5['model'],qs[_0xb246('0x38')](_0x29fdb0[_0xb246('0x34')][_0xb246('0x38')]));_0x225cc4['attributes']=_0x225cc4[_0xb246('0x37')][_0xb246('0x4a')]?_0x225cc4[_0xb246('0x37')]:_0x3d93b5[_0xb246('0x33')];if(_0x29fdb0[_0xb246('0x34')][_0xb246('0x43')]){_0x225cc4[_0xb246('0x44')]=[{'all':!![]}];}_0x225cc4=_[_0xb246('0x40')]({},_0x225cc4,_0x29fdb0[_0xb246('0x41')]);return db['CannedAnswer'][_0xb246('0x4b')](_0x225cc4)[_0xb246('0x2c')](handleEntityNotFound(_0x5bb20b,null))[_0xb246('0x2c')](respondWithResult(_0x5bb20b,null))['catch'](handleError(_0x5bb20b,null));};exports[_0xb246('0x28')]=function(_0x4edfe1,_0x2139d0){if(_0x4edfe1[_0xb246('0x4c')]['id']){delete _0x4edfe1['body']['id'];}return db[_0xb246('0x42')][_0xb246('0x4b')]({'where':{'id':_0x4edfe1[_0xb246('0x4d')]['id']}})[_0xb246('0x2c')](handleEntityNotFound(_0x2139d0,null))[_0xb246('0x2c')](saveUpdates(_0x4edfe1[_0xb246('0x4c')],null))[_0xb246('0x2c')](respondWithResult(_0x2139d0,null))[_0xb246('0x47')](handleError(_0x2139d0,null));};exports[_0xb246('0x29')]=function(_0x3727f7,_0x2042ac){return db[_0xb246('0x42')]['find']({'where':{'id':_0x3727f7[_0xb246('0x4d')]['id']}})[_0xb246('0x2c')](handleEntityNotFound(_0x2042ac,null))[_0xb246('0x2c')](removeEntity(_0x2042ac,null))[_0xb246('0x47')](handleError(_0x2042ac,null));};exports[_0xb246('0x4e')]=function(_0x464ffe,_0x452b14){var _0x434a5a={'key':_0x464ffe[_0xb246('0x4c')][_0xb246('0x32')]};if(_0x464ffe[_0xb246('0x4c')][_0xb246('0x4f')]){_0x434a5a[_0xb246('0x4f')]=_0x464ffe[_0xb246('0x4c')][_0xb246('0x4f')];}else if(_0x464ffe[_0xb246('0x4c')][_0xb246('0x50')]){_0x434a5a[_0xb246('0x50')]=_0x464ffe[_0xb246('0x4c')][_0xb246('0x50')];}else if(_0x464ffe[_0xb246('0x4c')][_0xb246('0x51')]){_0x434a5a[_0xb246('0x51')]=_0x464ffe[_0xb246('0x4c')][_0xb246('0x51')];}else if(_0x464ffe[_0xb246('0x4c')][_0xb246('0x52')]){_0x434a5a['ChatWebsiteId']=_0x464ffe[_0xb246('0x4c')][_0xb246('0x52')];}return db[_0xb246('0x42')]['find']({'where':_0x434a5a})[_0xb246('0x2c')](function(_0x4492cb){if(_0x4492cb){throw new db[(_0xb246('0x53'))][(_0xb246('0x54'))](_0xb246('0x55'));}return db[_0xb246('0x42')][_0xb246('0x4e')](_0x464ffe[_0xb246('0x4c')]);})[_0xb246('0x2c')](function(_0x43be5c){var _0x51188c=_0x464ffe[_0xb246('0x56')]['get']({'plain':!![]});if(!_0x51188c)throw new Error(_0xb246('0x57'));if(_0x51188c[_0xb246('0x58')]===_0xb246('0x56')){var _0x43ddc2=_0x43be5c[_0xb246('0x2a')]({'plain':!![]});return db[_0xb246('0x59')][_0xb246('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x51188c[_0xb246('0x5a')]},'raw':!![]})[_0xb246('0x2c')](function(_0x5d67f9){if(_0x5d67f9&&_0x5d67f9[_0xb246('0x5b')]===0x0){return db[_0xb246('0x5c')][_0xb246('0x4e')]({'name':_0x43ddc2['name'],'resourceId':_0x43ddc2['id'],'type':_0x5d67f9[_0xb246('0x2e')],'sectionId':_0x5d67f9['id']},{})[_0xb246('0x2c')](function(){return _0x43be5c;});}else{return _0x43be5c;}})[_0xb246('0x47')](function(_0x533186){logger[_0xb246('0x2d')](_0xb246('0x5d'),_0x533186);throw _0x533186;});}return _0x43be5c;})[_0xb246('0x2c')](respondWithResult(_0x452b14,0xc9))[_0xb246('0x47')](handleError(_0x452b14,null));};
\ No newline at end of file
+var _0xc660=['ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','intersection','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4a0000,_0x114c27){var _0xfb5f62=function(_0x199c06){while(--_0x199c06){_0x4a0000['push'](_0x4a0000['shift']());}};_0xfb5f62(++_0x114c27);}(_0xc660,0xb2));var _0x0c66=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc660[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x0c66('0x0'));var rimraf=require(_0x0c66('0x1'));var zipdir=require(_0x0c66('0x2'));var jsonpatch=require(_0x0c66('0x3'));var rp=require(_0x0c66('0x4'));var moment=require(_0x0c66('0x5'));var BPromise=require(_0x0c66('0x6'));var Mustache=require(_0x0c66('0x7'));var util=require(_0x0c66('0x8'));var path=require(_0x0c66('0x9'));var sox=require(_0x0c66('0xa'));var csv=require(_0x0c66('0xb'));var ejs=require(_0x0c66('0xc'));var fs=require('fs');var fs_extra=require(_0x0c66('0xd'));var _=require('lodash');var squel=require(_0x0c66('0xe'));var crypto=require(_0x0c66('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0c66('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0c66('0x11'));var Papa=require(_0x0c66('0x12'));var Redis=require(_0x0c66('0x13'));var authService=require(_0x0c66('0x14'));var qs=require(_0x0c66('0x15'));var as=require(_0x0c66('0x16'));var hardwareService=require(_0x0c66('0x17'));var logger=require(_0x0c66('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x0c66('0x19'));var licenseUtil=require(_0x0c66('0x1a'));var db=require(_0x0c66('0x1b'))['db'];function respondWithStatusCode(_0x1d2989,_0x1b256a){_0x1b256a=_0x1b256a||0xcc;return function(_0x249c2a){if(_0x249c2a){return _0x1d2989[_0x0c66('0x1c')](_0x1b256a);}return _0x1d2989[_0x0c66('0x1d')](_0x1b256a)[_0x0c66('0x1e')]();};}function respondWithResult(_0x52b66c,_0x5c26ed){_0x5c26ed=_0x5c26ed||0xc8;return function(_0x1b76e6){if(_0x1b76e6){return _0x52b66c[_0x0c66('0x1d')](_0x5c26ed)[_0x0c66('0x1f')](_0x1b76e6);}};}function respondWithFilteredResult(_0x13a6f9,_0x52d08b){return function(_0xe82cf8){if(_0xe82cf8){var _0x307f13=typeof _0x52d08b[_0x0c66('0x20')]===_0x0c66('0x21')&&typeof _0x52d08b[_0x0c66('0x22')]===_0x0c66('0x21');var _0x11ed16=_0xe82cf8[_0x0c66('0x23')];var _0x2d434c=_0x307f13?0x0:_0x52d08b[_0x0c66('0x20')];var _0x1f7491=_0x307f13?_0xe82cf8[_0x0c66('0x23')]:_0x52d08b[_0x0c66('0x20')]+_0x52d08b[_0x0c66('0x22')];var _0x335804;if(_0x1f7491>=_0x11ed16){_0x1f7491=_0x11ed16;_0x335804=0xc8;}else{_0x335804=0xce;}_0x13a6f9[_0x0c66('0x1d')](_0x335804);return _0x13a6f9['set'](_0x0c66('0x24'),_0x2d434c+'-'+_0x1f7491+'/'+_0x11ed16)[_0x0c66('0x1f')](_0xe82cf8);}return null;};}function patchUpdates(_0x10dfb2){return function(_0x16eca2){try{jsonpatch[_0x0c66('0x25')](_0x16eca2,_0x10dfb2,!![]);}catch(_0x5dc3ff){return BPromise[_0x0c66('0x26')](_0x5dc3ff);}return _0x16eca2[_0x0c66('0x27')]();};}function saveUpdates(_0x233677,_0x35fd07){return function(_0x49a8e5){if(_0x49a8e5){return _0x49a8e5[_0x0c66('0x28')](_0x233677)[_0x0c66('0x29')](function(_0x42ca63){return _0x42ca63;});}return null;};}function removeEntity(_0x41c3cc,_0x53fb5c){return function(_0x5effa7){if(_0x5effa7){return _0x5effa7[_0x0c66('0x2a')]()['then'](function(){var _0x3d85b2=_0x5effa7[_0x0c66('0x2b')]({'plain':!![]});var _0x513ddd=_0x0c66('0x2c');return db[_0x0c66('0x2d')]['destroy']({'where':{'type':_0x513ddd,'resourceId':_0x3d85b2['id']}})[_0x0c66('0x29')](function(){return _0x5effa7;});})[_0x0c66('0x29')](function(){_0x41c3cc[_0x0c66('0x1d')](0xcc)[_0x0c66('0x1e')]();});}};}function handleEntityNotFound(_0x29e85e,_0x209483){return function(_0x20824a){if(!_0x20824a){_0x29e85e[_0x0c66('0x1c')](0x194);}return _0x20824a;};}function handleError(_0x5ce68a,_0x4c929c){_0x4c929c=_0x4c929c||0x1f4;return function(_0x9bb927){logger[_0x0c66('0x2e')](_0x9bb927[_0x0c66('0x2f')]);if(_0x9bb927[_0x0c66('0x30')]){delete _0x9bb927['name'];}_0x5ce68a['status'](_0x4c929c)['send'](_0x9bb927);};}exports[_0x0c66('0x31')]=function(_0xb8c40e,_0x39b07e){var _0x33bf93={},_0x5ebb8b={},_0x33fb7a={'count':0x0,'rows':[]};var _0x5ea5a1=_[_0x0c66('0x32')](db['CannedAnswer'][_0x0c66('0x33')],function(_0xa5630a){return{'name':_0xa5630a[_0x0c66('0x34')],'type':_0xa5630a[_0x0c66('0x35')][_0x0c66('0x36')]};});_0x5ebb8b[_0x0c66('0x37')]=_[_0x0c66('0x32')](_0x5ea5a1,'name');_0x5ebb8b[_0x0c66('0x38')]=_[_0x0c66('0x39')](_0xb8c40e[_0x0c66('0x38')]);_0x5ebb8b[_0x0c66('0x3a')]=_['intersection'](_0x5ebb8b['model'],_0x5ebb8b['query']);_0x33bf93[_0x0c66('0x3b')]=_['intersection'](_0x5ebb8b[_0x0c66('0x37')],qs[_0x0c66('0x3c')](_0xb8c40e['query'][_0x0c66('0x3c')]));_0x33bf93[_0x0c66('0x3b')]=_0x33bf93[_0x0c66('0x3b')][_0x0c66('0x3d')]?_0x33bf93[_0x0c66('0x3b')]:_0x5ebb8b['model'];if(!_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x3e')](_0x0c66('0x3f'))){_0x33bf93['limit']=qs[_0x0c66('0x22')](_0xb8c40e['query'][_0x0c66('0x22')]);_0x33bf93[_0x0c66('0x20')]=qs['offset'](_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x20')]);}_0x33bf93[_0x0c66('0x40')]=qs[_0x0c66('0x41')](_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x41')]);_0x33bf93[_0x0c66('0x42')]=qs[_0x0c66('0x3a')](_[_0x0c66('0x43')](_0xb8c40e['query'],_0x5ebb8b[_0x0c66('0x3a')]),_0x5ea5a1);if(_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x44')]){_0x33bf93[_0x0c66('0x42')]=_[_0x0c66('0x45')](_0x33bf93[_0x0c66('0x42')],{'$or':[{'key':{'$like':'%'+_0xb8c40e[_0x0c66('0x38')]['filter']+'%'}},{'value':{'$like':'%'+_0xb8c40e[_0x0c66('0x38')]['filter']+'%'}}]});}_0x33bf93=_['merge']({},_0x33bf93,_0xb8c40e[_0x0c66('0x46')]);var _0x5e8a89={'where':_0x33bf93[_0x0c66('0x42')]};return db[_0x0c66('0x47')][_0x0c66('0x23')](_0x5e8a89)[_0x0c66('0x29')](function(_0x42f0){_0x33fb7a[_0x0c66('0x23')]=_0x42f0;if(_0xb8c40e[_0x0c66('0x38')][_0x0c66('0x48')]){_0x33bf93['include']=[{'all':!![]}];}return db[_0x0c66('0x47')][_0x0c66('0x49')](_0x33bf93);})[_0x0c66('0x29')](function(_0x2361e6){_0x33fb7a[_0x0c66('0x4a')]=_0x2361e6;return _0x33fb7a;})[_0x0c66('0x29')](respondWithFilteredResult(_0x39b07e,_0x33bf93))[_0x0c66('0x4b')](handleError(_0x39b07e,null));};exports[_0x0c66('0x4c')]=function(_0x1b565f,_0x3bbe26){var _0x22d10a={'raw':!![],'where':{'id':_0x1b565f[_0x0c66('0x4d')]['id']}},_0xb30152={};_0xb30152[_0x0c66('0x37')]=_[_0x0c66('0x39')](db[_0x0c66('0x47')][_0x0c66('0x33')]);_0xb30152[_0x0c66('0x38')]=_[_0x0c66('0x39')](_0x1b565f['query']);_0xb30152[_0x0c66('0x3a')]=_[_0x0c66('0x4e')](_0xb30152[_0x0c66('0x37')],_0xb30152[_0x0c66('0x38')]);_0x22d10a[_0x0c66('0x3b')]=_['intersection'](_0xb30152[_0x0c66('0x37')],qs[_0x0c66('0x3c')](_0x1b565f[_0x0c66('0x38')][_0x0c66('0x3c')]));_0x22d10a['attributes']=_0x22d10a['attributes'][_0x0c66('0x3d')]?_0x22d10a[_0x0c66('0x3b')]:_0xb30152['model'];if(_0x1b565f[_0x0c66('0x38')][_0x0c66('0x48')]){_0x22d10a[_0x0c66('0x4f')]=[{'all':!![]}];}_0x22d10a=_['merge']({},_0x22d10a,_0x1b565f['options']);return db['CannedAnswer'][_0x0c66('0x50')](_0x22d10a)[_0x0c66('0x29')](handleEntityNotFound(_0x3bbe26,null))[_0x0c66('0x29')](respondWithResult(_0x3bbe26,null))['catch'](handleError(_0x3bbe26,null));};exports[_0x0c66('0x28')]=function(_0xa80608,_0x6c0301){if(_0xa80608[_0x0c66('0x51')]['id']){delete _0xa80608['body']['id'];}return db[_0x0c66('0x47')]['find']({'where':{'id':_0xa80608[_0x0c66('0x4d')]['id']}})[_0x0c66('0x29')](handleEntityNotFound(_0x6c0301,null))[_0x0c66('0x29')](saveUpdates(_0xa80608[_0x0c66('0x51')],null))[_0x0c66('0x29')](respondWithResult(_0x6c0301,null))[_0x0c66('0x4b')](handleError(_0x6c0301,null));};exports[_0x0c66('0x2a')]=function(_0xb40e4,_0x4406d5){return db[_0x0c66('0x47')][_0x0c66('0x50')]({'where':{'id':_0xb40e4[_0x0c66('0x4d')]['id']}})[_0x0c66('0x29')](handleEntityNotFound(_0x4406d5,null))['then'](removeEntity(_0x4406d5,null))[_0x0c66('0x4b')](handleError(_0x4406d5,null));};exports[_0x0c66('0x52')]=function(_0x33f209,_0x4f5b72){var _0x25085f={'key':_0x33f209['body'][_0x0c66('0x36')]};if(_0x33f209[_0x0c66('0x51')][_0x0c66('0x53')]){_0x25085f[_0x0c66('0x53')]=_0x33f209[_0x0c66('0x51')]['MailAccountId'];}else if(_0x33f209['body']['SmsAccountId']){_0x25085f['SmsAccountId']=_0x33f209[_0x0c66('0x51')][_0x0c66('0x54')];}else if(_0x33f209['body'][_0x0c66('0x55')]){_0x25085f[_0x0c66('0x55')]=_0x33f209[_0x0c66('0x51')]['OpenchannelAccountId'];}else if(_0x33f209[_0x0c66('0x51')][_0x0c66('0x56')]){_0x25085f[_0x0c66('0x56')]=_0x33f209['body']['ChatWebsiteId'];}return db[_0x0c66('0x47')][_0x0c66('0x50')]({'where':_0x25085f})[_0x0c66('0x29')](function(_0xd6f66c){if(_0xd6f66c){throw new db[(_0x0c66('0x57'))][(_0x0c66('0x58'))](_0x0c66('0x59'));}return db[_0x0c66('0x47')][_0x0c66('0x52')](_0x33f209['body']);})['then'](function(_0x13c9ae){var _0x30c339=_0x33f209[_0x0c66('0x5a')][_0x0c66('0x2b')]({'plain':!![]});if(!_0x30c339)throw new Error(_0x0c66('0x5b'));if(_0x30c339['role']===_0x0c66('0x5a')){var _0x4d8ae5=_0x13c9ae[_0x0c66('0x2b')]({'plain':!![]});return db[_0x0c66('0x5c')][_0x0c66('0x50')]({'where':{'name':_0x0c66('0x2c'),'userProfileId':_0x30c339[_0x0c66('0x5d')]},'raw':!![]})[_0x0c66('0x29')](function(_0x1f4d5f){if(_0x1f4d5f&&_0x1f4d5f['autoAssociation']===0x0){return db[_0x0c66('0x2d')][_0x0c66('0x52')]({'name':_0x4d8ae5[_0x0c66('0x30')],'resourceId':_0x4d8ae5['id'],'type':_0x1f4d5f['name'],'sectionId':_0x1f4d5f['id']},{})[_0x0c66('0x29')](function(){return _0x13c9ae;});}else{return _0x13c9ae;}})[_0x0c66('0x4b')](function(_0x32b443){logger[_0x0c66('0x2e')](_0x0c66('0x5e'),_0x32b443);throw _0x32b443;});}return _0x13c9ae;})[_0x0c66('0x29')](respondWithResult(_0x4f5b72,0xc9))[_0x0c66('0x4b')](handleError(_0x4f5b72,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 21b7505..607481a 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 _0x987f=['utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','../../config/environment','define','tools_canned_answers','utf8mb4'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x987f,0x169));var _0xf987=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x987f[_0x3ec122];return _0x4ecf41;};'use strict';var _=require(_0xf987('0x0'));var util=require('util');var logger=require(_0xf987('0x1'))(_0xf987('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf987('0x3'));var fs=require('fs');var path=require(_0xf987('0x4'));var rimraf=require('rimraf');var config=require(_0xf987('0x5'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x4765dd,_0xc48d78){return _0x4765dd[_0xf987('0x6')]('CannedAnswer',attributes,{'tableName':_0xf987('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf987('0x8'),'collate':_0xf987('0x9')});};
\ No newline at end of file
+var _0xebff=['path','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0xd25354,_0x176e9a){var _0x35913b=function(_0x5adcda){while(--_0x5adcda){_0xd25354['push'](_0xd25354['shift']());}};_0x35913b(++_0x176e9a);}(_0xebff,0xf8));var _0xfebf=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xebff[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xfebf('0x0'));var util=require('util');var logger=require(_0xfebf('0x1'))('api');var moment=require(_0xfebf('0x2'));var BPromise=require(_0xfebf('0x3'));var rp=require(_0xfebf('0x4'));var fs=require('fs');var path=require(_0xfebf('0x5'));var rimraf=require('rimraf');var config=require(_0xfebf('0x6'));var attributes=require(_0xfebf('0x7'));module['exports']=function(_0x4a98a9,_0x4c5f06){return _0x4a98a9[_0xfebf('0x8')]('CannedAnswer',attributes,{'tableName':_0xfebf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfebf('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index eee6dd0..4876415 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(_0x2bed02,_0x45ac1a){var _0x471c08=function(_0x5f0fe1){while(--_0x5f0fe1){_0x2bed02['push'](_0x2bed02['shift']());}};_0x471c08(++_0x45ac1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x1df3d9,_0x38ec23){var _0x162ca9=function(_0x523640){while(--_0x523640){_0x1df3d9['push'](_0x1df3d9['shift']());}};_0x162ca9(++_0x38ec23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 7ceca76..8d2f80e 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 _0xa81d=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x44db7c,_0x5d9498){var _0x1dbd04=function(_0x1efecb){while(--_0x1efecb){_0x44db7c['push'](_0x44db7c['shift']());}};_0x1dbd04(++_0x5d9498);}(_0xa81d,0x65));var _0xda81=function(_0x38a162,_0x4396b2){_0x38a162=_0x38a162-0x0;var _0x1f622b=_0xa81d[_0x38a162];return _0x1f622b;};'use strict';var multer=require(_0xda81('0x0'));var util=require(_0xda81('0x1'));var path=require(_0xda81('0x2'));var timeout=require(_0xda81('0x3'));var express=require(_0xda81('0x4'));var router=express['Router']();var fs_extra=require(_0xda81('0x5'));var auth=require(_0xda81('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda81('0x7'));var controller=require(_0xda81('0x8'));router[_0xda81('0x9')]('/',auth[_0xda81('0xa')](),controller[_0xda81('0xb')]);router[_0xda81('0x9')](_0xda81('0xc'),auth[_0xda81('0xa')](),controller[_0xda81('0xd')]);router[_0xda81('0xe')]('/',auth[_0xda81('0xa')](),controller[_0xda81('0xf')]);router['put'](_0xda81('0xc'),auth[_0xda81('0xa')](),controller[_0xda81('0x10')]);router[_0xda81('0x11')](_0xda81('0xc'),auth[_0xda81('0xa')](),controller[_0xda81('0x12')]);module[_0xda81('0x13')]=router;
\ No newline at end of file
+var _0x7a78=['index','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0x7a78,0x13b));var _0x87a7=function(_0x2dfa21,_0x3b4dd8){_0x2dfa21=_0x2dfa21-0x0;var _0x5ac953=_0x7a78[_0x2dfa21];return _0x5ac953;};'use strict';var multer=require('multer');var util=require(_0x87a7('0x0'));var path=require(_0x87a7('0x1'));var timeout=require(_0x87a7('0x2'));var express=require(_0x87a7('0x3'));var router=express['Router']();var fs_extra=require(_0x87a7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x87a7('0x5'));var config=require(_0x87a7('0x6'));var controller=require('./cannedAnswer.controller');router[_0x87a7('0x7')]('/',auth[_0x87a7('0x8')](),controller[_0x87a7('0x9')]);router[_0x87a7('0x7')](_0x87a7('0xa'),auth[_0x87a7('0x8')](),controller[_0x87a7('0xb')]);router[_0x87a7('0xc')]('/',auth[_0x87a7('0x8')](),controller[_0x87a7('0xd')]);router[_0x87a7('0xe')](_0x87a7('0xa'),auth[_0x87a7('0x8')](),controller[_0x87a7('0xf')]);router[_0x87a7('0x10')](_0x87a7('0xa'),auth['isAuthenticated'](),controller[_0x87a7('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 2564466..f800df0 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 _0x3294=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0x52802a,_0x108434){var _0x35f54e=function(_0x17be04){while(--_0x17be04){_0x52802a['push'](_0x52802a['shift']());}};_0x35f54e(++_0x108434);}(_0x3294,0x1db));var _0x4329=function(_0x1ca701,_0x3360ae){_0x1ca701=_0x1ca701-0x0;var _0x1bf070=_0x3294[_0x1ca701];return _0x1bf070;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x4329('0x0')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x4329('0x1')]},'dst':{'type':Sequelize[_0x4329('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4329('0x1')]},'dstchannel':{'type':Sequelize[_0x4329('0x1')]},'lastapp':{'type':Sequelize[_0x4329('0x1')]},'lastdata':{'type':Sequelize[_0x4329('0x1')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x4329('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x4329('0x1')]},'uniqueid':{'type':Sequelize[_0x4329('0x1')]},'linkedid':{'type':Sequelize[_0x4329('0x1')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x4329('0x1')]}};
\ No newline at end of file
+var _0x9efb=['DATE','STRING','INTEGER','exports'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9efb,0x143));var _0xb9ef=function(_0x4ef87a,_0x4854a1){_0x4ef87a=_0x4ef87a-0x0;var _0x254c26=_0x9efb[_0x4ef87a];return _0x254c26;};'use strict';var Sequelize=require('sequelize');module[_0xb9ef('0x0')]={'calldate':{'type':Sequelize[_0xb9ef('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xb9ef('0x2')]},'src':{'type':Sequelize[_0xb9ef('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xb9ef('0x2')]},'channel':{'type':Sequelize[_0xb9ef('0x2')]},'dstchannel':{'type':Sequelize[_0xb9ef('0x2')]},'lastapp':{'type':Sequelize[_0xb9ef('0x2')]},'lastdata':{'type':Sequelize[_0xb9ef('0x2')]},'duration':{'type':Sequelize[_0xb9ef('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb9ef('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb9ef('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xb9ef('0x2')]},'sequence':{'type':Sequelize[_0xb9ef('0x2')]},'peeraccount':{'type':Sequelize[_0xb9ef('0x2')]},'type':{'type':Sequelize[_0xb9ef('0x2')]},'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 b830150..39032d5 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 _0x25fa=['json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','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/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25fa,0x109));var _0xa25f=function(_0x3c5a5a,_0x4b2212){_0x3c5a5a=_0x3c5a5a-0x0;var _0x288b40=_0x25fa[_0x3c5a5a];return _0x288b40;};'use strict';var emlformat=require(_0xa25f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa25f('0x1'));var jsonpatch=require(_0xa25f('0x2'));var rp=require('request-promise');var moment=require(_0xa25f('0x3'));var BPromise=require(_0xa25f('0x4'));var Mustache=require(_0xa25f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa25f('0x6'));var csv=require('to-csv');var ejs=require(_0xa25f('0x7'));var fs=require('fs');var fs_extra=require(_0xa25f('0x8'));var _=require(_0xa25f('0x9'));var squel=require(_0xa25f('0xa'));var crypto=require(_0xa25f('0xb'));var jsforce=require(_0xa25f('0xc'));var deskjs=require(_0xa25f('0xd'));var toCsv=require(_0xa25f('0xe'));var querystring=require(_0xa25f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa25f('0x10'));var authService=require(_0xa25f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa25f('0x12'));var hardwareService=require(_0xa25f('0x13'));var logger=require(_0xa25f('0x14'))(_0xa25f('0x15'));var utils=require('../../config/utils');var config=require(_0xa25f('0x16'));var licenseUtil=require(_0xa25f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e970c,_0x465e41){_0x465e41=_0x465e41||0xcc;return function(_0x50bb78){if(_0x50bb78){return _0x3e970c[_0xa25f('0x18')](_0x465e41);}return _0x3e970c[_0xa25f('0x19')](_0x465e41)[_0xa25f('0x1a')]();};}function respondWithResult(_0x4b3792,_0x199e18){_0x199e18=_0x199e18||0xc8;return function(_0x2a627f){if(_0x2a627f){return _0x4b3792[_0xa25f('0x19')](_0x199e18)[_0xa25f('0x1b')](_0x2a627f);}};}function respondWithFilteredResult(_0x465809,_0x2d2417){return function(_0x1e5836){if(_0x1e5836){var _0x1859ba=typeof _0x2d2417['offset']===_0xa25f('0x1c')&&typeof _0x2d2417[_0xa25f('0x1d')]===_0xa25f('0x1c');var _0x451a6e=_0x1e5836[_0xa25f('0x1e')];var _0x427105=_0x1859ba?0x0:_0x2d2417['offset'];var _0x292171=_0x1859ba?_0x1e5836['count']:_0x2d2417[_0xa25f('0x1f')]+_0x2d2417['limit'];var _0x559c89;if(_0x292171>=_0x451a6e){_0x292171=_0x451a6e;_0x559c89=0xc8;}else{_0x559c89=0xce;}_0x465809[_0xa25f('0x19')](_0x559c89);return _0x465809['set'](_0xa25f('0x20'),_0x427105+'-'+_0x292171+'/'+_0x451a6e)[_0xa25f('0x1b')](_0x1e5836);}return null;};}function patchUpdates(_0x2aaf3a){return function(_0x3c2665){try{jsonpatch[_0xa25f('0x21')](_0x3c2665,_0x2aaf3a,!![]);}catch(_0x504135){return BPromise[_0xa25f('0x22')](_0x504135);}return _0x3c2665[_0xa25f('0x23')]();};}function saveUpdates(_0x371716,_0x14b7f6){return function(_0x5d2803){if(_0x5d2803){return _0x5d2803[_0xa25f('0x24')](_0x371716)[_0xa25f('0x25')](function(_0x248c0c){return _0x248c0c;});}return null;};}function removeEntity(_0x3675b5,_0x4c6f4d){return function(_0x2b710f){if(_0x2b710f){return _0x2b710f[_0xa25f('0x26')]()[_0xa25f('0x25')](function(){_0x3675b5[_0xa25f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2812d7,_0x898446){return function(_0x53f011){if(!_0x53f011){_0x2812d7[_0xa25f('0x18')](0x194);}return _0x53f011;};}function handleError(_0x51dbf8,_0x2df893){_0x2df893=_0x2df893||0x1f4;return function(_0x4eb7b7){logger[_0xa25f('0x27')](_0x4eb7b7[_0xa25f('0x28')]);if(_0x4eb7b7['name']){delete _0x4eb7b7[_0xa25f('0x29')];}_0x51dbf8[_0xa25f('0x19')](_0x2df893)['send'](_0x4eb7b7);};}exports[_0xa25f('0x2a')]=function(_0x5d39c7,_0x1030c4){var _0x41a847={},_0x472114={},_0x208518={'count':0x0,'rows':[]};var _0x334629=_['map'](db[_0xa25f('0x2b')][_0xa25f('0x2c')],function(_0x119ffc){return{'name':_0x119ffc[_0xa25f('0x2d')],'type':_0x119ffc[_0xa25f('0x2e')]['key']};});_0x472114[_0xa25f('0x2f')]=_[_0xa25f('0x30')](_0x334629,_0xa25f('0x29'));_0x472114[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0x5d39c7[_0xa25f('0x31')]);_0x472114[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x472114[_0xa25f('0x2f')],_0x472114['query']);_0x41a847['attributes']=_['intersection'](_0x472114[_0xa25f('0x2f')],qs[_0xa25f('0x35')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x35')]));_0x41a847[_0xa25f('0x36')]=_0x41a847[_0xa25f('0x36')][_0xa25f('0x37')]?_0x41a847[_0xa25f('0x36')]:_0x472114[_0xa25f('0x2f')];if(!_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x38')]('nolimit')){_0x41a847['limit']=qs[_0xa25f('0x1d')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x1d')]);_0x41a847['offset']=qs['offset'](_0x5d39c7['query'][_0xa25f('0x1f')]);}_0x41a847[_0xa25f('0x39')]=qs[_0xa25f('0x3a')](_0x5d39c7['query']['sort']);_0x41a847[_0xa25f('0x3b')]=qs[_0xa25f('0x33')](_['pick'](_0x5d39c7['query'],_0x472114[_0xa25f('0x33')]),_0x334629);if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]){_0x41a847['where']=_[_0xa25f('0x3d')](_0x41a847[_0xa25f('0x3b')],{'$or':_[_0xa25f('0x30')](_0x334629,function(_0x49556e){if(_0x49556e['type']!==_0xa25f('0x3e')){var _0x44c9c8={};_0x44c9c8[_0x49556e[_0xa25f('0x29')]]={'$like':'%'+_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]+'%'};return _0x44c9c8;}})});}_0x41a847=_[_0xa25f('0x3d')]({},_0x41a847,_0x5d39c7[_0xa25f('0x3f')]);var _0x3382f4={'where':_0x41a847['where']};return db[_0xa25f('0x2b')][_0xa25f('0x1e')](_0x3382f4)[_0xa25f('0x25')](function(_0x2e886f){_0x208518[_0xa25f('0x1e')]=_0x2e886f;if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x40')]){_0x41a847[_0xa25f('0x41')]=[{'all':!![]}];}return db[_0xa25f('0x2b')][_0xa25f('0x42')](_0x41a847);})[_0xa25f('0x25')](function(_0x3267a0){_0x208518[_0xa25f('0x43')]=_0x3267a0;return _0x208518;})['then'](respondWithFilteredResult(_0x1030c4,_0x41a847))[_0xa25f('0x44')](handleError(_0x1030c4,null));};exports['show']=function(_0xace015,_0x320119){var _0x36afe4={'raw':!![],'where':{'id':_0xace015[_0xa25f('0x45')]['id']}},_0x559874={};_0x559874[_0xa25f('0x2f')]=_[_0xa25f('0x32')](db[_0xa25f('0x2b')]['rawAttributes']);_0x559874[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0xace015[_0xa25f('0x31')]);_0x559874[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x559874[_0xa25f('0x2f')],_0x559874['query']);_0x36afe4[_0xa25f('0x36')]=_[_0xa25f('0x34')](_0x559874['model'],qs[_0xa25f('0x35')](_0xace015[_0xa25f('0x31')][_0xa25f('0x35')]));_0x36afe4[_0xa25f('0x36')]=_0x36afe4[_0xa25f('0x36')][_0xa25f('0x37')]?_0x36afe4[_0xa25f('0x36')]:_0x559874[_0xa25f('0x2f')];if(_0xace015[_0xa25f('0x31')][_0xa25f('0x40')]){_0x36afe4[_0xa25f('0x41')]=[{'all':!![]}];}_0x36afe4=_[_0xa25f('0x3d')]({},_0x36afe4,_0xace015[_0xa25f('0x3f')]);return db['Cdr'][_0xa25f('0x46')](_0x36afe4)[_0xa25f('0x25')](handleEntityNotFound(_0x320119,null))[_0xa25f('0x25')](respondWithResult(_0x320119,null))[_0xa25f('0x44')](handleError(_0x320119,null));};exports['create']=function(_0x34717c,_0x43888b){return db[_0xa25f('0x2b')]['create'](_0x34717c[_0xa25f('0x47')],{})[_0xa25f('0x25')](respondWithResult(_0x43888b,0xc9))[_0xa25f('0x44')](handleError(_0x43888b,null));};exports[_0xa25f('0x24')]=function(_0x18c9f2,_0x3b6d34){if(_0x18c9f2[_0xa25f('0x47')]['id']){delete _0x18c9f2[_0xa25f('0x47')]['id'];}return db['Cdr'][_0xa25f('0x46')]({'where':{'id':_0x18c9f2[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0x3b6d34,null))[_0xa25f('0x25')](saveUpdates(_0x18c9f2[_0xa25f('0x47')],null))[_0xa25f('0x25')](respondWithResult(_0x3b6d34,null))[_0xa25f('0x44')](handleError(_0x3b6d34,null));};exports[_0xa25f('0x26')]=function(_0x26a096,_0xe04d67){return db[_0xa25f('0x2b')][_0xa25f('0x46')]({'where':{'id':_0x26a096[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0xe04d67,null))[_0xa25f('0x25')](removeEntity(_0xe04d67,null))[_0xa25f('0x44')](handleError(_0xe04d67,null));};exports[_0xa25f('0x48')]=function(_0x2fedba,_0x32f719){return db[_0xa25f('0x2b')][_0xa25f('0x48')]()[_0xa25f('0x25')](respondWithResult(_0x32f719,null))['catch'](handleError(_0x32f719,null));};
\ No newline at end of file
+var _0xb138=['filters','pick','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x592fbd,_0x2b0540){var _0x79fc1b=function(_0x136cb6){while(--_0x136cb6){_0x592fbd['push'](_0x592fbd['shift']());}};_0x79fc1b(++_0x2b0540);}(_0xb138,0x1dd));var _0x8b13=function(_0x396178,_0x5acfb3){_0x396178=_0x396178-0x0;var _0x4229a3=_0xb138[_0x396178];return _0x4229a3;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['map'](_0x35fdca,_0x8b13('0x2b'));_0x2bb51d[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x3475d8[_0x8b13('0x35')]);_0x2bb51d['filters']=_['intersection'](_0x2bb51d[_0x8b13('0x34')],_0x2bb51d['query']);_0x114b01['attributes']=_[_0x8b13('0x37')](_0x2bb51d['model'],qs[_0x8b13('0x38')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x38')]));_0x114b01[_0x8b13('0x39')]=_0x114b01[_0x8b13('0x39')][_0x8b13('0x3a')]?_0x114b01[_0x8b13('0x39')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8[_0x8b13('0x35')][_0x8b13('0x3b')]('nolimit')){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3c')](_0x3475d8['query'][_0x8b13('0x3c')]);_0x114b01[_0x8b13('0x3d')]=qs[_0x8b13('0x3e')](_[_0x8b13('0x3f')](_0x3475d8[_0x8b13('0x35')],_0x2bb51d[_0x8b13('0x3e')]),_0x35fdca);if(_0x3475d8['query']['filter']){_0x114b01[_0x8b13('0x3d')]=_['merge'](_0x114b01[_0x8b13('0x3d')],{'$or':_['map'](_0x35fdca,function(_0x590a23){if(_0x590a23[_0x8b13('0x32')]!==_0x8b13('0x40')){var _0x2bc877={};_0x2bc877[_0x590a23[_0x8b13('0x2b')]]={'$like':'%'+_0x3475d8['query']['filter']+'%'};return _0x2bc877;}})});}_0x114b01=_[_0x8b13('0x41')]({},_0x114b01,_0x3475d8['options']);var _0x6ba2f3={'where':_0x114b01[_0x8b13('0x3d')]};return db['Cdr'][_0x8b13('0x20')](_0x6ba2f3)[_0x8b13('0x26')](function(_0x35c1d6){_0x5ab161[_0x8b13('0x20')]=_0x35c1d6;if(_0x3475d8[_0x8b13('0x35')][_0x8b13('0x42')]){_0x114b01[_0x8b13('0x43')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x114b01);})['then'](function(_0x3eb3c5){_0x5ab161[_0x8b13('0x44')]=_0x3eb3c5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x45')](handleError(_0x1511bf,null));};exports[_0x8b13('0x46')]=function(_0x271507,_0x492f7d){var _0x4342db={'raw':!![],'where':{'id':_0x271507[_0x8b13('0x47')]['id']}},_0x50e535={};_0x50e535['model']=_[_0x8b13('0x36')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x50e535[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x271507[_0x8b13('0x35')]);_0x50e535[_0x8b13('0x3e')]=_['intersection'](_0x50e535['model'],_0x50e535['query']);_0x4342db[_0x8b13('0x39')]=_[_0x8b13('0x37')](_0x50e535[_0x8b13('0x34')],qs[_0x8b13('0x38')](_0x271507['query']['fields']));_0x4342db[_0x8b13('0x39')]=_0x4342db['attributes'][_0x8b13('0x3a')]?_0x4342db[_0x8b13('0x39')]:_0x50e535[_0x8b13('0x34')];if(_0x271507[_0x8b13('0x35')][_0x8b13('0x42')]){_0x4342db['include']=[{'all':!![]}];}_0x4342db=_[_0x8b13('0x41')]({},_0x4342db,_0x271507[_0x8b13('0x48')]);return db[_0x8b13('0x2f')][_0x8b13('0x49')](_0x4342db)[_0x8b13('0x26')](handleEntityNotFound(_0x492f7d,null))[_0x8b13('0x26')](respondWithResult(_0x492f7d,null))[_0x8b13('0x45')](handleError(_0x492f7d,null));};exports[_0x8b13('0x4a')]=function(_0x3e192b,_0x518298){return db[_0x8b13('0x2f')]['create'](_0x3e192b[_0x8b13('0x4b')],{})[_0x8b13('0x26')](respondWithResult(_0x518298,0xc9))[_0x8b13('0x45')](handleError(_0x518298,null));};exports['update']=function(_0x148efb,_0x35f612){if(_0x148efb[_0x8b13('0x4b')]['id']){delete _0x148efb[_0x8b13('0x4b')]['id'];}return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x148efb[_0x8b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x35f612,null))[_0x8b13('0x26')](saveUpdates(_0x148efb['body'],null))[_0x8b13('0x26')](respondWithResult(_0x35f612,null))[_0x8b13('0x45')](handleError(_0x35f612,null));};exports[_0x8b13('0x27')]=function(_0x435867,_0x2be640){return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x435867[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x2be640,null))[_0x8b13('0x26')](removeEntity(_0x2be640,null))[_0x8b13('0x45')](handleError(_0x2be640,null));};exports[_0x8b13('0x4c')]=function(_0xd55f3b,_0x2bdfae){return db[_0x8b13('0x2f')][_0x8b13('0x4c')]()[_0x8b13('0x26')](respondWithResult(_0x2bdfae,null))['catch'](handleError(_0x2bdfae,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index fd5525a..7efe5a0 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(_0x49e762,_0x4593f3){var _0x2bbfaa=function(_0x531645){while(--_0x531645){_0x49e762['push'](_0x49e762['shift']());}};_0x2bbfaa(++_0x4593f3);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x480f34,_0x2f37df){var _0x245d27=function(_0x5e5b9e){while(--_0x5e5b9e){_0x480f34['push'](_0x480f34['shift']());}};_0x245d27(++_0x2f37df);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 7d64ca0..8b93e76 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 _0x1735=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','util','moment'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x1735,0x140));var _0x5173=function(_0x833b9,_0x59368e){_0x833b9=_0x833b9-0x0;var _0x36fd8f=_0x1735[_0x833b9];return _0x36fd8f;};'use strict';var _=require('lodash');var util=require(_0x5173('0x0'));var moment=require(_0x5173('0x1'));var BPromise=require(_0x5173('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5173('0x3'));var db=require(_0x5173('0x4'))['db'];var utils=require(_0x5173('0x5'));var logger=require(_0x5173('0x6'))(_0x5173('0x7'));var config=require(_0x5173('0x8'));var jayson=require(_0x5173('0x9'));var client=jayson[_0x5173('0xa')][_0x5173('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d841b,_0x120f7f,_0x477d03){return new BPromise(function(_0x1d134a,_0x4383ff){return client[_0x5173('0xc')](_0x1d841b,_0x477d03)[_0x5173('0xd')](function(_0x5080d0){logger[_0x5173('0xe')](_0x5173('0xf'),_0x120f7f,_0x5173('0x10'));logger[_0x5173('0x11')](_0x5173('0x12'),_0x120f7f,_0x5173('0x10'),JSON[_0x5173('0x13')](_0x5080d0));if(_0x5080d0['error']){if(_0x5080d0['error'][_0x5173('0x14')]===0x1f4){logger[_0x5173('0x15')]('Cdr,\x20%s,\x20%s',_0x120f7f,_0x5080d0['error'][_0x5173('0x16')]);return _0x4383ff(_0x5080d0[_0x5173('0x15')][_0x5173('0x16')]);}logger[_0x5173('0x15')](_0x5173('0xf'),_0x120f7f,_0x5080d0[_0x5173('0x15')][_0x5173('0x16')]);return _0x1d134a(_0x5080d0[_0x5173('0x15')][_0x5173('0x16')]);}else{logger[_0x5173('0xe')](_0x5173('0xf'),_0x120f7f,_0x5173('0x10'));_0x1d134a(_0x5080d0['result'][_0x5173('0x16')]);}})['catch'](function(_0x43732e){logger['error'](_0x5173('0xf'),_0x120f7f,_0x43732e);_0x4383ff(_0x43732e);});});}
\ No newline at end of file
+var _0x9e71=['info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30bed8,_0x3d7980){var _0x53d3c4=function(_0x4fb52f){while(--_0x4fb52f){_0x30bed8['push'](_0x30bed8['shift']());}};_0x53d3c4(++_0x3d7980);}(_0x9e71,0x1e4));var _0x19e7=function(_0x46f732,_0x5efa6f){_0x46f732=_0x46f732-0x0;var _0x3e3bb8=_0x9e71[_0x46f732];return _0x3e3bb8;};'use strict';var _=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var moment=require('moment');var BPromise=require(_0x19e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19e7('0x3'));var db=require(_0x19e7('0x4'))['db'];var utils=require(_0x19e7('0x5'));var logger=require(_0x19e7('0x6'))(_0x19e7('0x7'));var config=require(_0x19e7('0x8'));var jayson=require(_0x19e7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1eec43,_0x341dc2,_0x2c427b){return new BPromise(function(_0x2ca205,_0x16a40d){return client['request'](_0x1eec43,_0x2c427b)['then'](function(_0x333625){logger[_0x19e7('0xa')](_0x19e7('0xb'),_0x341dc2,'request\x20sent');logger['debug'](_0x19e7('0xc'),_0x341dc2,_0x19e7('0xd'),JSON[_0x19e7('0xe')](_0x333625));if(_0x333625[_0x19e7('0xf')]){if(_0x333625[_0x19e7('0xf')][_0x19e7('0x10')]===0x1f4){logger[_0x19e7('0xf')]('Cdr,\x20%s,\x20%s',_0x341dc2,_0x333625[_0x19e7('0xf')][_0x19e7('0x11')]);return _0x16a40d(_0x333625[_0x19e7('0xf')][_0x19e7('0x11')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x341dc2,_0x333625[_0x19e7('0xf')]['message']);return _0x2ca205(_0x333625['error'][_0x19e7('0x11')]);}else{logger[_0x19e7('0xa')](_0x19e7('0xb'),_0x341dc2,_0x19e7('0xd'));_0x2ca205(_0x333625[_0x19e7('0x12')][_0x19e7('0x11')]);}})['catch'](function(_0x5799f3){logger[_0x19e7('0xf')]('Cdr,\x20%s,\x20%s',_0x341dc2,_0x5799f3);_0x16a40d(_0x5799f3);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 646dec4..52e6e37 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(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xc75e69,_0x19ac94){var _0x447f25=function(_0x25125c){while(--_0x25125c){_0xc75e69['push'](_0xc75e69['shift']());}};_0x447f25(++_0x19ac94);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 0130083..540e682 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 _0x4e9b=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x1cea7e,_0x4e9be8){var _0xdb85fa=function(_0x356113){while(--_0x356113){_0x1cea7e['push'](_0x1cea7e['shift']());}};_0xdb85fa(++_0x4e9be8);}(_0x4e9b,0x11a));var _0xb4e9=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x4e9b[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require(_0xb4e9('0x0'));module[_0xb4e9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb4e9('0x2')],'allowNull':![],'defaultValue':_0xb4e9('0x3')},'appdata':{'type':Sequelize[_0xb4e9('0x4')]()},'description':{'type':Sequelize[_0xb4e9('0x2')]},'interval':{'type':Sequelize[_0xb4e9('0x2')],'defaultValue':_0xb4e9('0x5')}};
\ No newline at end of file
+var _0x1c63=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x58c687,_0x3fec26){var _0x5e9c26=function(_0x25dac7){while(--_0x25dac7){_0x58c687['push'](_0x58c687['shift']());}};_0x5e9c26(++_0x3fec26);}(_0x1c63,0xea));var _0x31c6=function(_0xf37b8d,_0x42ce54){_0xf37b8d=_0xf37b8d-0x0;var _0x3b0b62=_0x1c63[_0xf37b8d];return _0x3b0b62;};'use strict';var Sequelize=require(_0x31c6('0x0'));module[_0x31c6('0x1')]={'priority':{'type':Sequelize[_0x31c6('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x31c6('0x3')},'appdata':{'type':Sequelize[_0x31c6('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x31c6('0x5')],'defaultValue':_0x31c6('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 49c0060..37d18ad 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 _0xb98f=['lodash','crypto','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','query','keys','intersection','model','attributes','fields','includeAll','include','merge','options','ChatApplication','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra'];(function(_0x3ed225,_0x1f57fb){var _0x5f46fa=function(_0x59dd4e){while(--_0x59dd4e){_0x3ed225['push'](_0x3ed225['shift']());}};_0x5f46fa(++_0x1f57fb);}(_0xb98f,0xce));var _0xfb98=function(_0x3e061d,_0xbcdea2){_0x3e061d=_0x3e061d-0x0;var _0x4e8fcd=_0xb98f[_0x3e061d];return _0x4e8fcd;};'use strict';var emlformat=require(_0xfb98('0x0'));var rimraf=require(_0xfb98('0x1'));var zipdir=require(_0xfb98('0x2'));var jsonpatch=require(_0xfb98('0x3'));var rp=require(_0xfb98('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb98('0x5'));var path=require(_0xfb98('0x6'));var sox=require(_0xfb98('0x7'));var csv=require(_0xfb98('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb98('0x9'));var _=require(_0xfb98('0xa'));var squel=require('squel');var crypto=require(_0xfb98('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb98('0xc'));var authService=require(_0xfb98('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb98('0xe'));var logger=require('../../config/logger')(_0xfb98('0xf'));var utils=require(_0xfb98('0x10'));var config=require(_0xfb98('0x11'));var licenseUtil=require(_0xfb98('0x12'));var db=require(_0xfb98('0x13'))['db'];function respondWithStatusCode(_0x3cc48e,_0x77a949){_0x77a949=_0x77a949||0xcc;return function(_0x1c9933){if(_0x1c9933){return _0x3cc48e[_0xfb98('0x14')](_0x77a949);}return _0x3cc48e[_0xfb98('0x15')](_0x77a949)[_0xfb98('0x16')]();};}function respondWithResult(_0x3cdeb9,_0x14c9a3){_0x14c9a3=_0x14c9a3||0xc8;return function(_0x201b04){if(_0x201b04){return _0x3cdeb9['status'](_0x14c9a3)[_0xfb98('0x17')](_0x201b04);}};}function respondWithFilteredResult(_0x515864,_0x3e7e25){return function(_0x2d4efd){if(_0x2d4efd){var _0x3c6ca5=typeof _0x3e7e25[_0xfb98('0x18')]===_0xfb98('0x19')&&typeof _0x3e7e25['limit']===_0xfb98('0x19');var _0x174e4d=_0x2d4efd[_0xfb98('0x1a')];var _0x14b206=_0x3c6ca5?0x0:_0x3e7e25[_0xfb98('0x18')];var _0x15c4fa=_0x3c6ca5?_0x2d4efd[_0xfb98('0x1a')]:_0x3e7e25[_0xfb98('0x18')]+_0x3e7e25[_0xfb98('0x1b')];var _0x15932f;if(_0x15c4fa>=_0x174e4d){_0x15c4fa=_0x174e4d;_0x15932f=0xc8;}else{_0x15932f=0xce;}_0x515864[_0xfb98('0x15')](_0x15932f);return _0x515864[_0xfb98('0x1c')](_0xfb98('0x1d'),_0x14b206+'-'+_0x15c4fa+'/'+_0x174e4d)[_0xfb98('0x17')](_0x2d4efd);}return null;};}function patchUpdates(_0x23bc24){return function(_0x46a120){try{jsonpatch[_0xfb98('0x1e')](_0x46a120,_0x23bc24,!![]);}catch(_0x50c0d6){return BPromise[_0xfb98('0x1f')](_0x50c0d6);}return _0x46a120[_0xfb98('0x20')]();};}function saveUpdates(_0x14eaff,_0x284b59){return function(_0x4c3f10){if(_0x4c3f10){return _0x4c3f10[_0xfb98('0x21')](_0x14eaff)[_0xfb98('0x22')](function(_0xfa10fc){return _0xfa10fc;});}return null;};}function removeEntity(_0x5078aa,_0x568d6c){return function(_0x433fce){if(_0x433fce){return _0x433fce[_0xfb98('0x23')]()['then'](function(){_0x5078aa[_0xfb98('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x383057,_0x3f97fb){return function(_0x5727b4){if(!_0x5727b4){_0x383057['sendStatus'](0x194);}return _0x5727b4;};}function handleError(_0x25480d,_0x18e638){_0x18e638=_0x18e638||0x1f4;return function(_0x5136a3){logger[_0xfb98('0x24')](_0x5136a3['stack']);if(_0x5136a3[_0xfb98('0x25')]){delete _0x5136a3[_0xfb98('0x25')];}_0x25480d[_0xfb98('0x15')](_0x18e638)[_0xfb98('0x26')](_0x5136a3);};}exports['show']=function(_0x239705,_0x106602){var _0x5cdb18={'raw':!![],'where':{'id':_0x239705['params']['id']}},_0x3c6e77={};_0x3c6e77['model']=_['keys'](db['ChatApplication']['rawAttributes']);_0x3c6e77[_0xfb98('0x27')]=_[_0xfb98('0x28')](_0x239705[_0xfb98('0x27')]);_0x3c6e77['filters']=_[_0xfb98('0x29')](_0x3c6e77[_0xfb98('0x2a')],_0x3c6e77['query']);_0x5cdb18[_0xfb98('0x2b')]=_[_0xfb98('0x29')](_0x3c6e77[_0xfb98('0x2a')],qs[_0xfb98('0x2c')](_0x239705['query'][_0xfb98('0x2c')]));_0x5cdb18[_0xfb98('0x2b')]=_0x5cdb18[_0xfb98('0x2b')]['length']?_0x5cdb18['attributes']:_0x3c6e77[_0xfb98('0x2a')];if(_0x239705['query'][_0xfb98('0x2d')]){_0x5cdb18[_0xfb98('0x2e')]=[{'all':!![]}];}_0x5cdb18=_[_0xfb98('0x2f')]({},_0x5cdb18,_0x239705[_0xfb98('0x30')]);return db[_0xfb98('0x31')][_0xfb98('0x32')](_0x5cdb18)[_0xfb98('0x22')](handleEntityNotFound(_0x106602,null))[_0xfb98('0x22')](respondWithResult(_0x106602,null))[_0xfb98('0x33')](handleError(_0x106602,null));};exports[_0xfb98('0x21')]=function(_0x35bbd4,_0x35100d){if(_0x35bbd4[_0xfb98('0x34')]['id']){delete _0x35bbd4['body']['id'];}return db[_0xfb98('0x31')][_0xfb98('0x32')]({'where':{'id':_0x35bbd4[_0xfb98('0x35')]['id']}})[_0xfb98('0x22')](handleEntityNotFound(_0x35100d,null))[_0xfb98('0x22')](saveUpdates(_0x35bbd4[_0xfb98('0x34')],null))['then'](respondWithResult(_0x35100d,null))['catch'](handleError(_0x35100d,null));};exports[_0xfb98('0x23')]=function(_0x5063aa,_0x538782){return db['ChatApplication']['find']({'where':{'id':_0x5063aa[_0xfb98('0x35')]['id']}})[_0xfb98('0x22')](handleEntityNotFound(_0x538782,null))['then'](removeEntity(_0x538782,null))[_0xfb98('0x33')](handleError(_0x538782,null));};
\ No newline at end of file
+var _0x33d2=['fields','length','includeAll','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d2,0x7f));var _0x233d=function(_0x39580c,_0x22425c){_0x39580c=_0x39580c-0x0;var _0x1a4cd8=_0x33d2[_0x39580c];return _0x1a4cd8;};'use strict';var emlformat=require(_0x233d('0x0'));var rimraf=require(_0x233d('0x1'));var zipdir=require(_0x233d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x233d('0x3'));var moment=require(_0x233d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x233d('0x5'));var util=require(_0x233d('0x6'));var path=require(_0x233d('0x7'));var sox=require(_0x233d('0x8'));var csv=require(_0x233d('0x9'));var ejs=require(_0x233d('0xa'));var fs=require('fs');var fs_extra=require(_0x233d('0xb'));var _=require(_0x233d('0xc'));var squel=require('squel');var crypto=require(_0x233d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x233d('0xe'));var toCsv=require(_0x233d('0x9'));var querystring=require(_0x233d('0xf'));var Papa=require('papaparse');var Redis=require(_0x233d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x233d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x233d('0x12'));var logger=require(_0x233d('0x13'))(_0x233d('0x14'));var utils=require('../../config/utils');var config=require(_0x233d('0x15'));var licenseUtil=require(_0x233d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d36d3,_0x19f04c){_0x19f04c=_0x19f04c||0xcc;return function(_0x51c461){if(_0x51c461){return _0x2d36d3[_0x233d('0x17')](_0x19f04c);}return _0x2d36d3[_0x233d('0x18')](_0x19f04c)[_0x233d('0x19')]();};}function respondWithResult(_0x50a166,_0x36627d){_0x36627d=_0x36627d||0xc8;return function(_0x294703){if(_0x294703){return _0x50a166[_0x233d('0x18')](_0x36627d)[_0x233d('0x1a')](_0x294703);}};}function respondWithFilteredResult(_0xda6da2,_0x59b818){return function(_0xd7624c){if(_0xd7624c){var _0x552bbd=typeof _0x59b818[_0x233d('0x1b')]===_0x233d('0x1c')&&typeof _0x59b818[_0x233d('0x1d')]===_0x233d('0x1c');var _0x2b5bb0=_0xd7624c['count'];var _0x4f96c8=_0x552bbd?0x0:_0x59b818[_0x233d('0x1b')];var _0x409637=_0x552bbd?_0xd7624c[_0x233d('0x1e')]:_0x59b818[_0x233d('0x1b')]+_0x59b818[_0x233d('0x1d')];var _0x1b70da;if(_0x409637>=_0x2b5bb0){_0x409637=_0x2b5bb0;_0x1b70da=0xc8;}else{_0x1b70da=0xce;}_0xda6da2[_0x233d('0x18')](_0x1b70da);return _0xda6da2[_0x233d('0x1f')](_0x233d('0x20'),_0x4f96c8+'-'+_0x409637+'/'+_0x2b5bb0)[_0x233d('0x1a')](_0xd7624c);}return null;};}function patchUpdates(_0x3fa180){return function(_0x3ff3e3){try{jsonpatch[_0x233d('0x21')](_0x3ff3e3,_0x3fa180,!![]);}catch(_0x5aa707){return BPromise[_0x233d('0x22')](_0x5aa707);}return _0x3ff3e3[_0x233d('0x23')]();};}function saveUpdates(_0x5dd0e0,_0x12f8e8){return function(_0x19f575){if(_0x19f575){return _0x19f575[_0x233d('0x24')](_0x5dd0e0)[_0x233d('0x25')](function(_0x4f4c2a){return _0x4f4c2a;});}return null;};}function removeEntity(_0xe38aea,_0x19749f){return function(_0x3c3cba){if(_0x3c3cba){return _0x3c3cba[_0x233d('0x26')]()[_0x233d('0x25')](function(){_0xe38aea[_0x233d('0x18')](0xcc)[_0x233d('0x19')]();});}};}function handleEntityNotFound(_0x586f62,_0x517d61){return function(_0x507b5a){if(!_0x507b5a){_0x586f62['sendStatus'](0x194);}return _0x507b5a;};}function handleError(_0x24087a,_0x14cda3){_0x14cda3=_0x14cda3||0x1f4;return function(_0x1609ed){logger['error'](_0x1609ed[_0x233d('0x27')]);if(_0x1609ed[_0x233d('0x28')]){delete _0x1609ed[_0x233d('0x28')];}_0x24087a[_0x233d('0x18')](_0x14cda3)['send'](_0x1609ed);};}exports[_0x233d('0x29')]=function(_0xf10fbe,_0x3db64c){var _0x332962={'raw':!![],'where':{'id':_0xf10fbe['params']['id']}},_0x23f4a0={};_0x23f4a0['model']=_[_0x233d('0x2a')](db[_0x233d('0x2b')][_0x233d('0x2c')]);_0x23f4a0[_0x233d('0x2d')]=_[_0x233d('0x2a')](_0xf10fbe[_0x233d('0x2d')]);_0x23f4a0[_0x233d('0x2e')]=_[_0x233d('0x2f')](_0x23f4a0[_0x233d('0x30')],_0x23f4a0['query']);_0x332962[_0x233d('0x31')]=_[_0x233d('0x2f')](_0x23f4a0[_0x233d('0x30')],qs['fields'](_0xf10fbe['query'][_0x233d('0x32')]));_0x332962['attributes']=_0x332962['attributes'][_0x233d('0x33')]?_0x332962[_0x233d('0x31')]:_0x23f4a0[_0x233d('0x30')];if(_0xf10fbe[_0x233d('0x2d')][_0x233d('0x34')]){_0x332962['include']=[{'all':!![]}];}_0x332962=_[_0x233d('0x35')]({},_0x332962,_0xf10fbe[_0x233d('0x36')]);return db[_0x233d('0x2b')][_0x233d('0x37')](_0x332962)['then'](handleEntityNotFound(_0x3db64c,null))[_0x233d('0x25')](respondWithResult(_0x3db64c,null))[_0x233d('0x38')](handleError(_0x3db64c,null));};exports[_0x233d('0x24')]=function(_0xa82d72,_0x116578){if(_0xa82d72[_0x233d('0x39')]['id']){delete _0xa82d72[_0x233d('0x39')]['id'];}return db[_0x233d('0x2b')][_0x233d('0x37')]({'where':{'id':_0xa82d72[_0x233d('0x3a')]['id']}})[_0x233d('0x25')](handleEntityNotFound(_0x116578,null))[_0x233d('0x25')](saveUpdates(_0xa82d72[_0x233d('0x39')],null))[_0x233d('0x25')](respondWithResult(_0x116578,null))[_0x233d('0x38')](handleError(_0x116578,null));};exports[_0x233d('0x26')]=function(_0x573921,_0x5ec9a3){return db[_0x233d('0x2b')][_0x233d('0x37')]({'where':{'id':_0x573921[_0x233d('0x3a')]['id']}})[_0x233d('0x25')](handleEntityNotFound(_0x5ec9a3,null))[_0x233d('0x25')](removeEntity(_0x5ec9a3,null))[_0x233d('0x38')](handleError(_0x5ec9a3,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 94d0b60..17ae1c0 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 _0xa854=['request-promise','rimraf','./chatApplication.attributes','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xa854,0x103));var _0x4a85=function(_0x3a5683,_0x185ca2){_0x3a5683=_0x3a5683-0x0;var _0x1e3c0d=_0xa854[_0x3a5683];return _0x1e3c0d;};'use strict';var _=require(_0x4a85('0x0'));var util=require(_0x4a85('0x1'));var logger=require(_0x4a85('0x2'))(_0x4a85('0x3'));var moment=require(_0x4a85('0x4'));var BPromise=require('bluebird');var rp=require(_0x4a85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a85('0x6'));var config=require('../../config/environment');var attributes=require(_0x4a85('0x7'));module[_0x4a85('0x8')]=function(_0x494d91,_0x445a95){return _0x494d91[_0x4a85('0x9')]('ChatApplication',attributes,{'tableName':_0x4a85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4a85('0xb')});};
\ No newline at end of file
+var _0x5511=['api','moment','path','rimraf','./chatApplication.attributes','exports','utf8mb4','lodash','util','../../config/logger'];(function(_0x46ae88,_0x1a29e7){var _0xa7b68a=function(_0x34707a){while(--_0x34707a){_0x46ae88['push'](_0x46ae88['shift']());}};_0xa7b68a(++_0x1a29e7);}(_0x5511,0x10b));var _0x1551=function(_0x1bbf6c,_0x42422d){_0x1bbf6c=_0x1bbf6c-0x0;var _0x1105cd=_0x5511[_0x1bbf6c];return _0x1105cd;};'use strict';var _=require(_0x1551('0x0'));var util=require(_0x1551('0x1'));var logger=require(_0x1551('0x2'))(_0x1551('0x3'));var moment=require(_0x1551('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1551('0x5'));var rimraf=require(_0x1551('0x6'));var config=require('../../config/environment');var attributes=require(_0x1551('0x7'));module[_0x1551('0x8')]=function(_0x249c5f,_0x2bf2f9){return _0x249c5f['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1551('0x9'),'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 a11fbe3..3d80328 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 _0x2f16=['../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2f16,0x13f));var _0x62f1=function(_0x688c0e,_0xc9e8e8){_0x688c0e=_0x688c0e-0x0;var _0x351de9=_0x2f16[_0x688c0e];return _0x351de9;};'use strict';var _=require(_0x62f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x62f1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f1('0x2'));var db=require(_0x62f1('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x62f1('0x4'));var jayson=require(_0x62f1('0x5'));var client=jayson[_0x62f1('0x6')][_0x62f1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b18e1,_0x19db9f,_0x53d811){return new BPromise(function(_0x4af4eb,_0x548d47){return client[_0x62f1('0x8')](_0x3b18e1,_0x53d811)[_0x62f1('0x9')](function(_0x1f49d0){logger[_0x62f1('0xa')](_0x62f1('0xb'),_0x19db9f,'request\x20sent');logger[_0x62f1('0xc')](_0x62f1('0xd'),_0x19db9f,'request\x20sent',JSON['stringify'](_0x1f49d0));if(_0x1f49d0['error']){if(_0x1f49d0[_0x62f1('0xe')][_0x62f1('0xf')]===0x1f4){logger[_0x62f1('0xe')](_0x62f1('0xb'),_0x19db9f,_0x1f49d0['error']['message']);return _0x548d47(_0x1f49d0[_0x62f1('0xe')]['message']);}logger[_0x62f1('0xe')]('ChatApplication,\x20%s,\x20%s',_0x19db9f,_0x1f49d0[_0x62f1('0xe')][_0x62f1('0x10')]);return _0x4af4eb(_0x1f49d0['error']['message']);}else{logger['info'](_0x62f1('0xb'),_0x19db9f,'request\x20sent');_0x4af4eb(_0x1f49d0[_0x62f1('0x11')][_0x62f1('0x10')]);}})[_0x62f1('0x12')](function(_0x540f48){logger['error']('ChatApplication,\x20%s,\x20%s',_0x19db9f,_0x540f48);_0x548d47(_0x540f48);});});}
\ No newline at end of file
+var _0x6775=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug'];(function(_0x270dfc,_0x561f21){var _0x1e0223=function(_0x30658a){while(--_0x30658a){_0x270dfc['push'](_0x270dfc['shift']());}};_0x1e0223(++_0x561f21);}(_0x6775,0xf8));var _0x5677=function(_0x3075ca,_0x57e4c3){_0x3075ca=_0x3075ca-0x0;var _0x3928ff=_0x6775[_0x3075ca];return _0x3928ff;};'use strict';var _=require(_0x5677('0x0'));var util=require(_0x5677('0x1'));var moment=require(_0x5677('0x2'));var BPromise=require('bluebird');var rs=require(_0x5677('0x3'));var fs=require('fs');var Redis=require(_0x5677('0x4'));var db=require(_0x5677('0x5'))['db'];var utils=require(_0x5677('0x6'));var logger=require(_0x5677('0x7'))(_0x5677('0x8'));var config=require(_0x5677('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5677('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x592759,_0x9a48da,_0x407448){return new BPromise(function(_0x5a7c36,_0x400fa5){return client[_0x5677('0xb')](_0x592759,_0x407448)[_0x5677('0xc')](function(_0x4d9c30){logger[_0x5677('0xd')]('ChatApplication,\x20%s,\x20%s',_0x9a48da,_0x5677('0xe'));logger[_0x5677('0xf')](_0x5677('0x10'),_0x9a48da,_0x5677('0xe'),JSON[_0x5677('0x11')](_0x4d9c30));if(_0x4d9c30[_0x5677('0x12')]){if(_0x4d9c30[_0x5677('0x12')][_0x5677('0x13')]===0x1f4){logger[_0x5677('0x12')](_0x5677('0x14'),_0x9a48da,_0x4d9c30[_0x5677('0x12')][_0x5677('0x15')]);return _0x400fa5(_0x4d9c30['error']['message']);}logger[_0x5677('0x12')]('ChatApplication,\x20%s,\x20%s',_0x9a48da,_0x4d9c30[_0x5677('0x12')][_0x5677('0x15')]);return _0x5a7c36(_0x4d9c30[_0x5677('0x12')][_0x5677('0x15')]);}else{logger[_0x5677('0xd')](_0x5677('0x14'),_0x9a48da,_0x5677('0xe'));_0x5a7c36(_0x4d9c30[_0x5677('0x16')]['message']);}})[_0x5677('0x17')](function(_0x1a1659){logger['error'](_0x5677('0x14'),_0x9a48da,_0x1a1659);_0x400fa5(_0x1a1659);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 64a2a2d..5c8a995 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 _0x6590=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x6590,0x127));var _0x0659=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x6590[_0x215dc8];return _0x583ea3;};'use strict';var multer=require(_0x0659('0x0'));var util=require(_0x0659('0x1'));var path=require(_0x0659('0x2'));var timeout=require('connect-timeout');var express=require(_0x0659('0x3'));var router=express[_0x0659('0x4')]();var fs_extra=require(_0x0659('0x5'));var auth=require(_0x0659('0x6'));var interaction=require(_0x0659('0x7'));var config=require(_0x0659('0x8'));var controller=require(_0x0659('0x9'));router[_0x0659('0xa')](_0x0659('0xb'),auth[_0x0659('0xc')](),controller[_0x0659('0xd')]);router[_0x0659('0xe')](_0x0659('0xb'),auth[_0x0659('0xc')](),controller[_0x0659('0xf')]);router[_0x0659('0x10')](_0x0659('0xb'),auth[_0x0659('0xc')](),controller[_0x0659('0x11')]);module[_0x0659('0x12')]=router;
\ No newline at end of file
+var _0xf532=['../../components/interaction/service','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xf206fa,_0x593446){var _0x45def5=function(_0x59558c){while(--_0x59558c){_0xf206fa['push'](_0xf206fa['shift']());}};_0x45def5(++_0x593446);}(_0xf532,0x1a9));var _0x2f53=function(_0x3b247d,_0xbe4218){_0x3b247d=_0x3b247d-0x0;var _0x131bcf=_0xf532[_0x3b247d];return _0x131bcf;};'use strict';var multer=require(_0x2f53('0x0'));var util=require(_0x2f53('0x1'));var path=require(_0x2f53('0x2'));var timeout=require(_0x2f53('0x3'));var express=require(_0x2f53('0x4'));var router=express[_0x2f53('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2f53('0x6'));var interaction=require(_0x2f53('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x2f53('0x8')](_0x2f53('0x9'),auth[_0x2f53('0xa')](),controller['show']);router[_0x2f53('0xb')](_0x2f53('0x9'),auth[_0x2f53('0xa')](),controller[_0x2f53('0xc')]);router[_0x2f53('0xd')](_0x2f53('0x9'),auth[_0x2f53('0xa')](),controller[_0x2f53('0xe')]);module[_0x2f53('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 9fd228e..a8176b4 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 _0x649e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4c837a,_0x49e506){var _0x32864a=function(_0x82a74){while(--_0x82a74){_0x4c837a['push'](_0x4c837a['shift']());}};_0x32864a(++_0x49e506);}(_0x649e,0xdd));var _0xe649=function(_0x13680f,_0x5cb289){_0x13680f=_0x13680f-0x0;var _0x1573f1=_0x649e[_0x13680f];return _0x1573f1;};'use strict';var Sequelize=require(_0xe649('0x0'));module[_0xe649('0x1')]={'name':{'type':Sequelize[_0xe649('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe649('0x2')]},'write':{'type':Sequelize[_0xe649('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5d5c=['BOOLEAN','sequelize','exports'];(function(_0xd7f994,_0xcf10b8){var _0xd4de0c=function(_0x232114){while(--_0x232114){_0xd7f994['push'](_0xd7f994['shift']());}};_0xd4de0c(++_0xcf10b8);}(_0x5d5c,0xee));var _0xc5d5=function(_0x3c116d,_0x2b1377){_0x3c116d=_0x3c116d-0x0;var _0x5dbfd6=_0x5d5c[_0x3c116d];return _0x5dbfd6;};'use strict';var Sequelize=require(_0xc5d5('0x0'));module[_0xc5d5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xc5d5('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 8a1147b..3c1321f 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 _0x975e=['options','includeAll','include','rows','catch','params','fields','find','create','body','destroy','describe','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','moment','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','then','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x1ff4e5,_0x350e42){var _0x7adf31=function(_0x4756ed){while(--_0x4756ed){_0x1ff4e5['push'](_0x1ff4e5['shift']());}};_0x7adf31(++_0x350e42);}(_0x975e,0xd0));var _0xe975=function(_0x1c5629,_0x5a0b4b){_0x1c5629=_0x1c5629-0x0;var _0x2c9f01=_0x975e[_0x1c5629];return _0x2c9f01;};'use strict';var emlformat=require(_0xe975('0x0'));var rimraf=require(_0xe975('0x1'));var zipdir=require(_0xe975('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe975('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe975('0x4'));var util=require(_0xe975('0x5'));var path=require(_0xe975('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe975('0x7'));var _=require('lodash');var squel=require(_0xe975('0x8'));var crypto=require(_0xe975('0x9'));var jsforce=require(_0xe975('0xa'));var deskjs=require(_0xe975('0xb'));var toCsv=require(_0xe975('0xc'));var querystring=require(_0xe975('0xd'));var Papa=require(_0xe975('0xe'));var Redis=require(_0xe975('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe975('0x10'));var as=require(_0xe975('0x11'));var hardwareService=require(_0xe975('0x12'));var logger=require(_0xe975('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe975('0x14'));var db=require(_0xe975('0x15'))['db'];config['redis']=_['defaults'](config[_0xe975('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xe975('0x17'))(new Redis(config[_0xe975('0x16')]));require(_0xe975('0x18'))['register'](socket);function respondWithStatusCode(_0x33e699,_0x1496c5){_0x1496c5=_0x1496c5||0xcc;return function(_0x52a36a){if(_0x52a36a){return _0x33e699[_0xe975('0x19')](_0x1496c5);}return _0x33e699['status'](_0x1496c5)['end']();};}function respondWithResult(_0x3fe5bd,_0x6d280f){_0x6d280f=_0x6d280f||0xc8;return function(_0x35bb4c){if(_0x35bb4c){return _0x3fe5bd[_0xe975('0x1a')](_0x6d280f)[_0xe975('0x1b')](_0x35bb4c);}};}function respondWithFilteredResult(_0x59edbd,_0x56a4ec){return function(_0x5866fe){if(_0x5866fe){var _0x34acdc=typeof _0x56a4ec[_0xe975('0x1c')]==='undefined'&&typeof _0x56a4ec[_0xe975('0x1d')]==='undefined';var _0x2f25fc=_0x5866fe[_0xe975('0x1e')];var _0x111882=_0x34acdc?0x0:_0x56a4ec['offset'];var _0x3a8b99=_0x34acdc?_0x5866fe['count']:_0x56a4ec['offset']+_0x56a4ec['limit'];var _0x2563d3;if(_0x3a8b99>=_0x2f25fc){_0x3a8b99=_0x2f25fc;_0x2563d3=0xc8;}else{_0x2563d3=0xce;}_0x59edbd['status'](_0x2563d3);return _0x59edbd['set'](_0xe975('0x1f'),_0x111882+'-'+_0x3a8b99+'/'+_0x2f25fc)[_0xe975('0x1b')](_0x5866fe);}return null;};}function patchUpdates(_0x82c825){return function(_0x6c896a){try{jsonpatch[_0xe975('0x20')](_0x6c896a,_0x82c825,!![]);}catch(_0x127ca6){return BPromise[_0xe975('0x21')](_0x127ca6);}return _0x6c896a[_0xe975('0x22')]();};}function saveUpdates(_0x5557c4,_0x397266){return function(_0x2ba823){if(_0x2ba823){return _0x2ba823['update'](_0x5557c4)[_0xe975('0x23')](function(_0x20aaf8){return _0x20aaf8;});}return null;};}function removeEntity(_0x4f55bf,_0x1a737e){return function(_0x40eca0){if(_0x40eca0){return _0x40eca0['destroy']()[_0xe975('0x23')](function(){_0x4f55bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe5e512,_0x48add6){return function(_0x48fb33){if(!_0x48fb33){_0xe5e512[_0xe975('0x19')](0x194);}return _0x48fb33;};}function handleError(_0x2dec32,_0x245bb1){_0x245bb1=_0x245bb1||0x1f4;return function(_0x28ff85){logger[_0xe975('0x24')](_0x28ff85[_0xe975('0x25')]);if(_0x28ff85['name']){delete _0x28ff85[_0xe975('0x26')];}_0x2dec32[_0xe975('0x1a')](_0x245bb1)['send'](_0x28ff85);};}exports[_0xe975('0x27')]=function(_0x3adf0d,_0x40e753){var _0x17abc8={},_0x30ed6e={},_0x26f702={'count':0x0,'rows':[]};var _0x5d88b7=_[_0xe975('0x28')](db[_0xe975('0x29')][_0xe975('0x2a')],function(_0x2b1908){return{'name':_0x2b1908[_0xe975('0x2b')],'type':_0x2b1908[_0xe975('0x2c')][_0xe975('0x2d')]};});_0x30ed6e[_0xe975('0x2e')]=_[_0xe975('0x28')](_0x5d88b7,'name');_0x30ed6e[_0xe975('0x2f')]=_[_0xe975('0x30')](_0x3adf0d[_0xe975('0x2f')]);_0x30ed6e[_0xe975('0x31')]=_[_0xe975('0x32')](_0x30ed6e['model'],_0x30ed6e['query']);_0x17abc8[_0xe975('0x33')]=_[_0xe975('0x32')](_0x30ed6e[_0xe975('0x2e')],qs['fields'](_0x3adf0d[_0xe975('0x2f')]['fields']));_0x17abc8[_0xe975('0x33')]=_0x17abc8[_0xe975('0x33')][_0xe975('0x34')]?_0x17abc8[_0xe975('0x33')]:_0x30ed6e[_0xe975('0x2e')];if(!_0x3adf0d[_0xe975('0x2f')][_0xe975('0x35')](_0xe975('0x36'))){_0x17abc8[_0xe975('0x1d')]=qs[_0xe975('0x1d')](_0x3adf0d['query']['limit']);_0x17abc8[_0xe975('0x1c')]=qs[_0xe975('0x1c')](_0x3adf0d[_0xe975('0x2f')]['offset']);}_0x17abc8[_0xe975('0x37')]=qs[_0xe975('0x38')](_0x3adf0d['query'][_0xe975('0x38')]);_0x17abc8['where']=qs[_0xe975('0x31')](_[_0xe975('0x39')](_0x3adf0d['query'],_0x30ed6e['filters']),_0x5d88b7);if(_0x3adf0d[_0xe975('0x2f')][_0xe975('0x3a')]){_0x17abc8[_0xe975('0x3b')]=_[_0xe975('0x3c')](_0x17abc8[_0xe975('0x3b')],{'$or':_[_0xe975('0x28')](_0x5d88b7,function(_0x527fc0){if(_0x527fc0[_0xe975('0x2c')]!==_0xe975('0x3d')){var _0x2f37d5={};_0x2f37d5[_0x527fc0['name']]={'$like':'%'+_0x3adf0d[_0xe975('0x2f')][_0xe975('0x3a')]+'%'};return _0x2f37d5;}})});}_0x17abc8=_[_0xe975('0x3c')]({},_0x17abc8,_0x3adf0d[_0xe975('0x3e')]);var _0x122163={'where':_0x17abc8[_0xe975('0x3b')]};return db[_0xe975('0x29')]['count'](_0x122163)[_0xe975('0x23')](function(_0x318528){_0x26f702['count']=_0x318528;if(_0x3adf0d[_0xe975('0x2f')][_0xe975('0x3f')]){_0x17abc8[_0xe975('0x40')]=[{'all':!![]}];}return db[_0xe975('0x29')]['findAll'](_0x17abc8);})[_0xe975('0x23')](function(_0x56976b){_0x26f702[_0xe975('0x41')]=_0x56976b;return _0x26f702;})[_0xe975('0x23')](respondWithFilteredResult(_0x40e753,_0x17abc8))[_0xe975('0x42')](handleError(_0x40e753,null));};exports['show']=function(_0xebdce2,_0x51f9a0){var _0x988699={'raw':!![],'where':{'id':_0xebdce2[_0xe975('0x43')]['id']}},_0x5e9c28={};_0x5e9c28[_0xe975('0x2e')]=_[_0xe975('0x30')](db[_0xe975('0x29')]['rawAttributes']);_0x5e9c28[_0xe975('0x2f')]=_[_0xe975('0x30')](_0xebdce2[_0xe975('0x2f')]);_0x5e9c28[_0xe975('0x31')]=_[_0xe975('0x32')](_0x5e9c28[_0xe975('0x2e')],_0x5e9c28['query']);_0x988699[_0xe975('0x33')]=_[_0xe975('0x32')](_0x5e9c28[_0xe975('0x2e')],qs[_0xe975('0x44')](_0xebdce2['query'][_0xe975('0x44')]));_0x988699[_0xe975('0x33')]=_0x988699[_0xe975('0x33')][_0xe975('0x34')]?_0x988699[_0xe975('0x33')]:_0x5e9c28[_0xe975('0x2e')];if(_0xebdce2[_0xe975('0x2f')]['includeAll']){_0x988699[_0xe975('0x40')]=[{'all':!![]}];}_0x988699=_['merge']({},_0x988699,_0xebdce2[_0xe975('0x3e')]);return db['ChatGroup'][_0xe975('0x45')](_0x988699)['then'](handleEntityNotFound(_0x51f9a0,null))[_0xe975('0x23')](respondWithResult(_0x51f9a0,null))['catch'](handleError(_0x51f9a0,null));};exports[_0xe975('0x46')]=function(_0x2b95d8,_0x142c93){return db[_0xe975('0x29')][_0xe975('0x46')](_0x2b95d8[_0xe975('0x47')],{})[_0xe975('0x23')](respondWithResult(_0x142c93,0xc9))['catch'](handleError(_0x142c93,null));};exports['update']=function(_0x4d1eb0,_0x5211b3){if(_0x4d1eb0[_0xe975('0x47')]['id']){delete _0x4d1eb0[_0xe975('0x47')]['id'];}return db['ChatGroup'][_0xe975('0x45')]({'where':{'id':_0x4d1eb0['params']['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x5211b3,null))[_0xe975('0x23')](saveUpdates(_0x4d1eb0[_0xe975('0x47')],null))[_0xe975('0x23')](respondWithResult(_0x5211b3,null))[_0xe975('0x42')](handleError(_0x5211b3,null));};exports[_0xe975('0x48')]=function(_0x1fa51e,_0x302677){return db['ChatGroup'][_0xe975('0x45')]({'where':{'id':_0x1fa51e[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x302677,null))[_0xe975('0x23')](removeEntity(_0x302677,null))['catch'](handleError(_0x302677,null));};exports[_0xe975('0x49')]=function(_0x25d66a,_0x215ca3){return db['ChatGroup'][_0xe975('0x49')]()[_0xe975('0x23')](respondWithResult(_0x215ca3,null))[_0xe975('0x42')](handleError(_0x215ca3,null));};exports['getUnread']=function(_0x38f034,_0x39ce2a,_0x21ef59){return db[_0xe975('0x4a')][_0xe975('0x1e')]({'where':{'ChatGroupId':_0x38f034[_0xe975('0x43')]['id'],'ToId':_0x38f034['user']['id'],'read':![]}})[_0xe975('0x23')](function(_0x1a814a){return{'id':_[_0xe975('0x4b')](_0x38f034[_0xe975('0x43')]['id']),'count':_0x1a814a};})[_0xe975('0x23')](respondWithResult(_0x39ce2a,null))['catch'](handleError(_0x39ce2a,null));};exports[_0xe975('0x4c')]=function(_0xe614fe,_0x1630b9,_0x5070f9){return db[_0xe975('0x29')][_0xe975('0x45')]({'where':{'id':_0xe614fe[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x1630b9,null))[_0xe975('0x23')](function(_0x1264d3){if(_0x1264d3){return _0x1264d3[_0xe975('0x4c')](_0xe614fe['body']['ids'],_[_0xe975('0x4d')](_0xe614fe['body'],[_0xe975('0x4e'),'id'])||{});}})[_0xe975('0x23')](respondWithResult(_0x1630b9,null))[_0xe975('0x42')](handleError(_0x1630b9,null));};exports[_0xe975('0x4f')]=function(_0x19a51b,_0x3adea1,_0x4f7656){var _0x120064={};var _0x4b3cff={};var _0x5dfd2f;var _0x183555;return db[_0xe975('0x29')][_0xe975('0x50')]({'where':{'id':_0x19a51b[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x3adea1,null))[_0xe975('0x23')](function(_0x214485){if(_0x214485){_0x5dfd2f=_0x214485;_0x4b3cff['model']=_[_0xe975('0x30')](db[_0xe975('0x51')][_0xe975('0x2a')]);_0x4b3cff[_0xe975('0x2f')]=_['keys'](_0x19a51b['query']);_0x4b3cff[_0xe975('0x31')]=_[_0xe975('0x32')](_0x4b3cff[_0xe975('0x2e')],_0x4b3cff[_0xe975('0x2f')]);_0x120064[_0xe975('0x33')]=_[_0xe975('0x32')](_0x4b3cff[_0xe975('0x2e')],qs[_0xe975('0x44')](_0x19a51b['query'][_0xe975('0x44')]));_0x120064[_0xe975('0x33')]=_0x120064[_0xe975('0x33')][_0xe975('0x34')]?_0x120064['attributes']:_0x4b3cff[_0xe975('0x2e')];_0x120064[_0xe975('0x37')]=qs[_0xe975('0x38')](_0x19a51b[_0xe975('0x2f')][_0xe975('0x38')]);_0x120064[_0xe975('0x3b')]=qs[_0xe975('0x31')](_[_0xe975('0x39')](_0x19a51b[_0xe975('0x2f')],_0x4b3cff[_0xe975('0x31')]));if(_0x19a51b[_0xe975('0x2f')][_0xe975('0x3a')]){_0x120064['where']=_[_0xe975('0x3c')](_0x120064[_0xe975('0x3b')],{'$or':_[_0xe975('0x28')](_0x120064[_0xe975('0x33')],function(_0x2db5bc){var _0x302689={};_0x302689[_0x2db5bc]={'$like':'%'+_0x19a51b['query']['filter']+'%'};return _0x302689;})});}_0x120064=_[_0xe975('0x3c')]({},_0x120064,_0x19a51b[_0xe975('0x3e')]);return _0x5dfd2f[_0xe975('0x4f')](_0x120064);}})['then'](function(_0x41fe4d){if(_0x41fe4d){_0x183555=_0x41fe4d[_0xe975('0x34')];if(!_0x19a51b[_0xe975('0x2f')][_0xe975('0x35')](_0xe975('0x36'))){_0x120064[_0xe975('0x1d')]=qs[_0xe975('0x1d')](_0x19a51b[_0xe975('0x2f')]['limit']);_0x120064[_0xe975('0x1c')]=qs['offset'](_0x19a51b[_0xe975('0x2f')][_0xe975('0x1c')]);}return _0x5dfd2f[_0xe975('0x4f')](_0x120064);}})[_0xe975('0x23')](function(_0x1190fe){if(_0x1190fe){return _0x1190fe?{'count':_0x183555,'rows':_0x1190fe}:null;}})[_0xe975('0x23')](respondWithResult(_0x3adea1,null))[_0xe975('0x42')](handleError(_0x3adea1,null));};exports[_0xe975('0x52')]=function(_0x3157dc,_0x5c335e,_0x17ac6e){return db[_0xe975('0x29')][_0xe975('0x45')]({'where':{'id':_0x3157dc[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x5c335e,null))[_0xe975('0x23')](function(_0x1ecb74){if(_0x1ecb74){return _0x1ecb74[_0xe975('0x52')](_0x3157dc[_0xe975('0x2f')]['ids']);}})['then'](respondWithStatusCode(_0x5c335e,null))[_0xe975('0x42')](handleError(_0x5c335e,null));};exports[_0xe975('0x53')]=function(_0x3a758d,_0x2706f4,_0x5cb8b6){if(_0x3a758d[_0xe975('0x47')]['id']){delete _0x3a758d[_0xe975('0x47')]['id'];}return db['ChatGroup'][_0xe975('0x45')]({'where':{'id':_0x3a758d[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x2706f4,null))[_0xe975('0x23')](function(_0x5cef6a){if(_0x5cef6a){_0x3a758d[_0xe975('0x47')][_0xe975('0x54')]=_0x5cef6a['id'];return db['ChatInternalMessage'][_0xe975('0x46')](_0x3a758d[_0xe975('0x47')]);}})['then'](respondWithResult(_0x2706f4,null))['catch'](handleError(_0x2706f4,null));};exports['getMessages']=function(_0x38ecab,_0xfa1616,_0x4bb304){var _0xd48106={};var _0x388f39={};var _0x204c5a;var _0x3d8573;return db[_0xe975('0x29')][_0xe975('0x50')]({'where':{'id':_0x38ecab[_0xe975('0x43')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0xfa1616,null))[_0xe975('0x23')](function(_0x3be28b){if(_0x3be28b){_0x204c5a=_0x3be28b;_0x388f39[_0xe975('0x2e')]=_['keys'](db[_0xe975('0x4a')][_0xe975('0x2a')]);_0x388f39[_0xe975('0x2f')]=_[_0xe975('0x30')](_0x38ecab[_0xe975('0x2f')]);_0x388f39[_0xe975('0x31')]=_['intersection'](_0x388f39[_0xe975('0x2e')],_0x388f39[_0xe975('0x2f')]);_0xd48106[_0xe975('0x33')]=_[_0xe975('0x32')](_0x388f39['model'],qs[_0xe975('0x44')](_0x38ecab[_0xe975('0x2f')][_0xe975('0x44')]));_0xd48106[_0xe975('0x33')]=_0xd48106['attributes'][_0xe975('0x34')]?_0xd48106[_0xe975('0x33')]:_0x388f39[_0xe975('0x2e')];_0xd48106[_0xe975('0x37')]=qs['sort'](_0x38ecab['query'][_0xe975('0x38')]);_0xd48106[_0xe975('0x3b')]=qs['filters'](_['pick'](_0x38ecab[_0xe975('0x2f')],_0x388f39[_0xe975('0x31')]));if(_0x38ecab[_0xe975('0x2f')][_0xe975('0x3a')]){_0xd48106[_0xe975('0x3b')]=_[_0xe975('0x3c')](_0xd48106['where'],{'$or':_['map'](_0xd48106[_0xe975('0x33')],function(_0x2ec25f){var _0x5a10e5={};_0x5a10e5[_0x2ec25f]={'$like':'%'+_0x38ecab[_0xe975('0x2f')][_0xe975('0x3a')]+'%'};return _0x5a10e5;})});}if(_0x38ecab[_0xe975('0x2f')][_0xe975('0x55')]){var _0x11e41b=_0x38ecab['query'][_0xe975('0x55')][_0xe975('0x56')](',');var _0x21d32e={};_0x21d32e[_0x11e41b[0x0]]={'$gte':moment(_0x11e41b[0x1])[_0xe975('0x57')](_0xe975('0x58'))};_0xd48106[_0xe975('0x3b')]=_['merge'](_0xd48106['where'],_0x21d32e);}_0xd48106=_[_0xe975('0x3c')]({},_0xd48106,_0x38ecab[_0xe975('0x3e')]);return _0x204c5a[_0xe975('0x59')](_0xd48106);}})[_0xe975('0x23')](function(_0x48400f){if(_0x48400f){_0x3d8573=_0x48400f[_0xe975('0x34')];if(!_0x38ecab[_0xe975('0x2f')][_0xe975('0x35')]('nolimit')){_0xd48106[_0xe975('0x1d')]=qs[_0xe975('0x1d')](_0x38ecab[_0xe975('0x2f')][_0xe975('0x1d')]);_0xd48106[_0xe975('0x1c')]=qs[_0xe975('0x1c')](_0x38ecab[_0xe975('0x2f')][_0xe975('0x1c')]);}return _0x204c5a[_0xe975('0x59')](_0xd48106);}})['then'](function(_0x6cdcaa){if(_0x6cdcaa){return _0x6cdcaa?{'count':_0x3d8573,'rows':_0x6cdcaa}:null;}})[_0xe975('0x23')](respondWithResult(_0xfa1616,null))[_0xe975('0x42')](handleError(_0xfa1616,null));};
\ No newline at end of file
+var _0xd519=['ids','findOne','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','keys','query','intersection','fields','attributes','length','model','nolimit','order','sort','pick','filters','where','merge','filter','includeAll','include','rows','show','params','options','find','create','body','catch','describe','getUnread','ChatInternalMessage','toInteger','addMembers'];(function(_0x96ee3d,_0x4a4214){var _0x151415=function(_0x1f3a3c){while(--_0x1f3a3c){_0x96ee3d['push'](_0x96ee3d['shift']());}};_0x151415(++_0x4a4214);}(_0xd519,0x198));var _0x9d51=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd519[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x9d51('0x0'));var rimraf=require(_0x9d51('0x1'));var zipdir=require(_0x9d51('0x2'));var jsonpatch=require(_0x9d51('0x3'));var rp=require(_0x9d51('0x4'));var moment=require(_0x9d51('0x5'));var BPromise=require(_0x9d51('0x6'));var Mustache=require('mustache');var util=require(_0x9d51('0x7'));var path=require(_0x9d51('0x8'));var sox=require(_0x9d51('0x9'));var csv=require('to-csv');var ejs=require(_0x9d51('0xa'));var fs=require('fs');var fs_extra=require(_0x9d51('0xb'));var _=require('lodash');var squel=require(_0x9d51('0xc'));var crypto=require(_0x9d51('0xd'));var jsforce=require(_0x9d51('0xe'));var deskjs=require(_0x9d51('0xf'));var toCsv=require(_0x9d51('0x10'));var querystring=require(_0x9d51('0x11'));var Papa=require('papaparse');var Redis=require(_0x9d51('0x12'));var authService=require(_0x9d51('0x13'));var qs=require(_0x9d51('0x14'));var as=require(_0x9d51('0x15'));var hardwareService=require(_0x9d51('0x16'));var logger=require(_0x9d51('0x17'))(_0x9d51('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d51('0x19'));var db=require(_0x9d51('0x1a'))['db'];config['redis']=_['defaults'](config[_0x9d51('0x1b')],{'host':_0x9d51('0x1c'),'port':0x18eb});var socket=require(_0x9d51('0x1d'))(new Redis(config[_0x9d51('0x1b')]));require(_0x9d51('0x1e'))[_0x9d51('0x1f')](socket);function respondWithStatusCode(_0x2f70db,_0x365a4a){_0x365a4a=_0x365a4a||0xcc;return function(_0x3b60bc){if(_0x3b60bc){return _0x2f70db['sendStatus'](_0x365a4a);}return _0x2f70db[_0x9d51('0x20')](_0x365a4a)[_0x9d51('0x21')]();};}function respondWithResult(_0x3a5b0c,_0x47c8f0){_0x47c8f0=_0x47c8f0||0xc8;return function(_0x25b698){if(_0x25b698){return _0x3a5b0c[_0x9d51('0x20')](_0x47c8f0)[_0x9d51('0x22')](_0x25b698);}};}function respondWithFilteredResult(_0x509f31,_0x29b19e){return function(_0x43afd1){if(_0x43afd1){var _0x4d4b1b=typeof _0x29b19e[_0x9d51('0x23')]===_0x9d51('0x24')&&typeof _0x29b19e[_0x9d51('0x25')]===_0x9d51('0x24');var _0x313d9f=_0x43afd1[_0x9d51('0x26')];var _0x54db62=_0x4d4b1b?0x0:_0x29b19e[_0x9d51('0x23')];var _0x3fdf18=_0x4d4b1b?_0x43afd1[_0x9d51('0x26')]:_0x29b19e['offset']+_0x29b19e[_0x9d51('0x25')];var _0x2c5faf;if(_0x3fdf18>=_0x313d9f){_0x3fdf18=_0x313d9f;_0x2c5faf=0xc8;}else{_0x2c5faf=0xce;}_0x509f31[_0x9d51('0x20')](_0x2c5faf);return _0x509f31[_0x9d51('0x27')](_0x9d51('0x28'),_0x54db62+'-'+_0x3fdf18+'/'+_0x313d9f)['json'](_0x43afd1);}return null;};}function patchUpdates(_0x19a4cd){return function(_0xb78f40){try{jsonpatch[_0x9d51('0x29')](_0xb78f40,_0x19a4cd,!![]);}catch(_0xfd3e24){return BPromise[_0x9d51('0x2a')](_0xfd3e24);}return _0xb78f40[_0x9d51('0x2b')]();};}function saveUpdates(_0x547550,_0x14b666){return function(_0x32aa78){if(_0x32aa78){return _0x32aa78[_0x9d51('0x2c')](_0x547550)[_0x9d51('0x2d')](function(_0x526776){return _0x526776;});}return null;};}function removeEntity(_0x289d78,_0x63892e){return function(_0x5ebe2e){if(_0x5ebe2e){return _0x5ebe2e[_0x9d51('0x2e')]()[_0x9d51('0x2d')](function(){_0x289d78[_0x9d51('0x20')](0xcc)[_0x9d51('0x21')]();});}};}function handleEntityNotFound(_0x2dc2ea,_0x1d5ada){return function(_0x51a225){if(!_0x51a225){_0x2dc2ea[_0x9d51('0x2f')](0x194);}return _0x51a225;};}function handleError(_0xb8cde7,_0x32c197){_0x32c197=_0x32c197||0x1f4;return function(_0x18bbdc){logger['error'](_0x18bbdc['stack']);if(_0x18bbdc[_0x9d51('0x30')]){delete _0x18bbdc[_0x9d51('0x30')];}_0xb8cde7[_0x9d51('0x20')](_0x32c197)[_0x9d51('0x31')](_0x18bbdc);};}exports[_0x9d51('0x32')]=function(_0x4f3da6,_0x349bdf){var _0x247446={},_0x2cf528={},_0x361931={'count':0x0,'rows':[]};var _0xdc3837=_[_0x9d51('0x33')](db[_0x9d51('0x34')][_0x9d51('0x35')],function(_0x33246c){return{'name':_0x33246c[_0x9d51('0x36')],'type':_0x33246c[_0x9d51('0x37')][_0x9d51('0x38')]};});_0x2cf528['model']=_['map'](_0xdc3837,_0x9d51('0x30'));_0x2cf528['query']=_[_0x9d51('0x39')](_0x4f3da6[_0x9d51('0x3a')]);_0x2cf528['filters']=_[_0x9d51('0x3b')](_0x2cf528['model'],_0x2cf528[_0x9d51('0x3a')]);_0x247446['attributes']=_[_0x9d51('0x3b')](_0x2cf528['model'],qs[_0x9d51('0x3c')](_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x3c')]));_0x247446[_0x9d51('0x3d')]=_0x247446[_0x9d51('0x3d')][_0x9d51('0x3e')]?_0x247446[_0x9d51('0x3d')]:_0x2cf528[_0x9d51('0x3f')];if(!_0x4f3da6[_0x9d51('0x3a')]['hasOwnProperty'](_0x9d51('0x40'))){_0x247446[_0x9d51('0x25')]=qs[_0x9d51('0x25')](_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x25')]);_0x247446[_0x9d51('0x23')]=qs['offset'](_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x23')]);}_0x247446[_0x9d51('0x41')]=qs[_0x9d51('0x42')](_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x42')]);_0x247446['where']=qs['filters'](_[_0x9d51('0x43')](_0x4f3da6[_0x9d51('0x3a')],_0x2cf528[_0x9d51('0x44')]),_0xdc3837);if(_0x4f3da6[_0x9d51('0x3a')]['filter']){_0x247446[_0x9d51('0x45')]=_[_0x9d51('0x46')](_0x247446[_0x9d51('0x45')],{'$or':_['map'](_0xdc3837,function(_0x40abee){if(_0x40abee[_0x9d51('0x37')]!=='VIRTUAL'){var _0x3e2184={};_0x3e2184[_0x40abee[_0x9d51('0x30')]]={'$like':'%'+_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x47')]+'%'};return _0x3e2184;}})});}_0x247446=_[_0x9d51('0x46')]({},_0x247446,_0x4f3da6['options']);var _0x29fb72={'where':_0x247446['where']};return db[_0x9d51('0x34')][_0x9d51('0x26')](_0x29fb72)['then'](function(_0x1dbc9e){_0x361931[_0x9d51('0x26')]=_0x1dbc9e;if(_0x4f3da6[_0x9d51('0x3a')][_0x9d51('0x48')]){_0x247446[_0x9d51('0x49')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x247446);})[_0x9d51('0x2d')](function(_0x2cc34b){_0x361931[_0x9d51('0x4a')]=_0x2cc34b;return _0x361931;})[_0x9d51('0x2d')](respondWithFilteredResult(_0x349bdf,_0x247446))['catch'](handleError(_0x349bdf,null));};exports[_0x9d51('0x4b')]=function(_0x5b921f,_0x419ae8){var _0x87947f={'raw':!![],'where':{'id':_0x5b921f[_0x9d51('0x4c')]['id']}},_0x372151={};_0x372151[_0x9d51('0x3f')]=_['keys'](db[_0x9d51('0x34')][_0x9d51('0x35')]);_0x372151[_0x9d51('0x3a')]=_['keys'](_0x5b921f[_0x9d51('0x3a')]);_0x372151['filters']=_[_0x9d51('0x3b')](_0x372151[_0x9d51('0x3f')],_0x372151['query']);_0x87947f[_0x9d51('0x3d')]=_['intersection'](_0x372151[_0x9d51('0x3f')],qs['fields'](_0x5b921f[_0x9d51('0x3a')][_0x9d51('0x3c')]));_0x87947f[_0x9d51('0x3d')]=_0x87947f[_0x9d51('0x3d')][_0x9d51('0x3e')]?_0x87947f[_0x9d51('0x3d')]:_0x372151['model'];if(_0x5b921f[_0x9d51('0x3a')][_0x9d51('0x48')]){_0x87947f[_0x9d51('0x49')]=[{'all':!![]}];}_0x87947f=_[_0x9d51('0x46')]({},_0x87947f,_0x5b921f[_0x9d51('0x4d')]);return db[_0x9d51('0x34')][_0x9d51('0x4e')](_0x87947f)[_0x9d51('0x2d')](handleEntityNotFound(_0x419ae8,null))['then'](respondWithResult(_0x419ae8,null))['catch'](handleError(_0x419ae8,null));};exports['create']=function(_0x43370f,_0x3d2ea6){return db[_0x9d51('0x34')][_0x9d51('0x4f')](_0x43370f[_0x9d51('0x50')],{})[_0x9d51('0x2d')](respondWithResult(_0x3d2ea6,0xc9))['catch'](handleError(_0x3d2ea6,null));};exports[_0x9d51('0x2c')]=function(_0x597ece,_0x22e50d){if(_0x597ece[_0x9d51('0x50')]['id']){delete _0x597ece[_0x9d51('0x50')]['id'];}return db[_0x9d51('0x34')][_0x9d51('0x4e')]({'where':{'id':_0x597ece[_0x9d51('0x4c')]['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x22e50d,null))[_0x9d51('0x2d')](saveUpdates(_0x597ece[_0x9d51('0x50')],null))['then'](respondWithResult(_0x22e50d,null))[_0x9d51('0x51')](handleError(_0x22e50d,null));};exports[_0x9d51('0x2e')]=function(_0x1c1967,_0x29321f){return db['ChatGroup'][_0x9d51('0x4e')]({'where':{'id':_0x1c1967[_0x9d51('0x4c')]['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x29321f,null))[_0x9d51('0x2d')](removeEntity(_0x29321f,null))[_0x9d51('0x51')](handleError(_0x29321f,null));};exports[_0x9d51('0x52')]=function(_0x1b3224,_0x3edf84){return db['ChatGroup'][_0x9d51('0x52')]()[_0x9d51('0x2d')](respondWithResult(_0x3edf84,null))['catch'](handleError(_0x3edf84,null));};exports[_0x9d51('0x53')]=function(_0x43aa8d,_0x284aa4,_0x424495){return db[_0x9d51('0x54')][_0x9d51('0x26')]({'where':{'ChatGroupId':_0x43aa8d[_0x9d51('0x4c')]['id'],'ToId':_0x43aa8d['user']['id'],'read':![]}})['then'](function(_0xb38315){return{'id':_[_0x9d51('0x55')](_0x43aa8d[_0x9d51('0x4c')]['id']),'count':_0xb38315};})[_0x9d51('0x2d')](respondWithResult(_0x284aa4,null))['catch'](handleError(_0x284aa4,null));};exports[_0x9d51('0x56')]=function(_0x1b892e,_0x426399,_0x4564fc){return db[_0x9d51('0x34')][_0x9d51('0x4e')]({'where':{'id':_0x1b892e[_0x9d51('0x4c')]['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x426399,null))[_0x9d51('0x2d')](function(_0x9f3f39){if(_0x9f3f39){return _0x9f3f39[_0x9d51('0x56')](_0x1b892e[_0x9d51('0x50')]['ids'],_['omit'](_0x1b892e[_0x9d51('0x50')],[_0x9d51('0x57'),'id'])||{});}})[_0x9d51('0x2d')](respondWithResult(_0x426399,null))[_0x9d51('0x51')](handleError(_0x426399,null));};exports['getMembers']=function(_0x24e8c7,_0x574a4f,_0x55c43a){var _0x55bdc4={};var _0x42ef3f={};var _0x3fcf8f;var _0x534c57;return db[_0x9d51('0x34')][_0x9d51('0x58')]({'where':{'id':_0x24e8c7[_0x9d51('0x4c')]['id']}})['then'](handleEntityNotFound(_0x574a4f,null))[_0x9d51('0x2d')](function(_0x2a5180){if(_0x2a5180){_0x3fcf8f=_0x2a5180;_0x42ef3f['model']=_[_0x9d51('0x39')](db[_0x9d51('0x59')][_0x9d51('0x35')]);_0x42ef3f[_0x9d51('0x3a')]=_[_0x9d51('0x39')](_0x24e8c7['query']);_0x42ef3f[_0x9d51('0x44')]=_[_0x9d51('0x3b')](_0x42ef3f['model'],_0x42ef3f[_0x9d51('0x3a')]);_0x55bdc4[_0x9d51('0x3d')]=_['intersection'](_0x42ef3f['model'],qs[_0x9d51('0x3c')](_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x3c')]));_0x55bdc4[_0x9d51('0x3d')]=_0x55bdc4[_0x9d51('0x3d')][_0x9d51('0x3e')]?_0x55bdc4[_0x9d51('0x3d')]:_0x42ef3f[_0x9d51('0x3f')];_0x55bdc4[_0x9d51('0x41')]=qs['sort'](_0x24e8c7['query'][_0x9d51('0x42')]);_0x55bdc4[_0x9d51('0x45')]=qs['filters'](_['pick'](_0x24e8c7['query'],_0x42ef3f[_0x9d51('0x44')]));if(_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x47')]){_0x55bdc4['where']=_[_0x9d51('0x46')](_0x55bdc4['where'],{'$or':_[_0x9d51('0x33')](_0x55bdc4['attributes'],function(_0x5b7d05){var _0xdedfe8={};_0xdedfe8[_0x5b7d05]={'$like':'%'+_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x47')]+'%'};return _0xdedfe8;})});}_0x55bdc4=_['merge']({},_0x55bdc4,_0x24e8c7[_0x9d51('0x4d')]);return _0x3fcf8f[_0x9d51('0x5a')](_0x55bdc4);}})[_0x9d51('0x2d')](function(_0x271d4f){if(_0x271d4f){_0x534c57=_0x271d4f[_0x9d51('0x3e')];if(!_0x24e8c7['query'][_0x9d51('0x5b')]('nolimit')){_0x55bdc4[_0x9d51('0x25')]=qs[_0x9d51('0x25')](_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x25')]);_0x55bdc4[_0x9d51('0x23')]=qs[_0x9d51('0x23')](_0x24e8c7[_0x9d51('0x3a')][_0x9d51('0x23')]);}return _0x3fcf8f[_0x9d51('0x5a')](_0x55bdc4);}})[_0x9d51('0x2d')](function(_0x42b862){if(_0x42b862){return _0x42b862?{'count':_0x534c57,'rows':_0x42b862}:null;}})[_0x9d51('0x2d')](respondWithResult(_0x574a4f,null))[_0x9d51('0x51')](handleError(_0x574a4f,null));};exports[_0x9d51('0x5c')]=function(_0x3a254d,_0x2e0118,_0x1e3fb1){return db[_0x9d51('0x34')][_0x9d51('0x4e')]({'where':{'id':_0x3a254d[_0x9d51('0x4c')]['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x2e0118,null))['then'](function(_0x31a283){if(_0x31a283){return _0x31a283[_0x9d51('0x5c')](_0x3a254d[_0x9d51('0x3a')][_0x9d51('0x57')]);}})[_0x9d51('0x2d')](respondWithStatusCode(_0x2e0118,null))[_0x9d51('0x51')](handleError(_0x2e0118,null));};exports[_0x9d51('0x5d')]=function(_0x3966d5,_0x2c6e12,_0x56b11b){if(_0x3966d5[_0x9d51('0x50')]['id']){delete _0x3966d5[_0x9d51('0x50')]['id'];}return db[_0x9d51('0x34')]['find']({'where':{'id':_0x3966d5['params']['id']}})['then'](handleEntityNotFound(_0x2c6e12,null))[_0x9d51('0x2d')](function(_0x50ec45){if(_0x50ec45){_0x3966d5[_0x9d51('0x50')][_0x9d51('0x5e')]=_0x50ec45['id'];return db['ChatInternalMessage'][_0x9d51('0x4f')](_0x3966d5[_0x9d51('0x50')]);}})[_0x9d51('0x2d')](respondWithResult(_0x2c6e12,null))[_0x9d51('0x51')](handleError(_0x2c6e12,null));};exports[_0x9d51('0x5f')]=function(_0x487a04,_0x4f8e79,_0x1f223a){var _0x10ec9e={};var _0x54c7ae={};var _0x50b73c;var _0x3c7cf8;return db[_0x9d51('0x34')][_0x9d51('0x58')]({'where':{'id':_0x487a04['params']['id']}})[_0x9d51('0x2d')](handleEntityNotFound(_0x4f8e79,null))['then'](function(_0x21da52){if(_0x21da52){_0x50b73c=_0x21da52;_0x54c7ae[_0x9d51('0x3f')]=_[_0x9d51('0x39')](db[_0x9d51('0x54')][_0x9d51('0x35')]);_0x54c7ae[_0x9d51('0x3a')]=_[_0x9d51('0x39')](_0x487a04[_0x9d51('0x3a')]);_0x54c7ae[_0x9d51('0x44')]=_['intersection'](_0x54c7ae[_0x9d51('0x3f')],_0x54c7ae[_0x9d51('0x3a')]);_0x10ec9e[_0x9d51('0x3d')]=_[_0x9d51('0x3b')](_0x54c7ae[_0x9d51('0x3f')],qs[_0x9d51('0x3c')](_0x487a04[_0x9d51('0x3a')][_0x9d51('0x3c')]));_0x10ec9e[_0x9d51('0x3d')]=_0x10ec9e[_0x9d51('0x3d')][_0x9d51('0x3e')]?_0x10ec9e[_0x9d51('0x3d')]:_0x54c7ae[_0x9d51('0x3f')];_0x10ec9e[_0x9d51('0x41')]=qs[_0x9d51('0x42')](_0x487a04['query'][_0x9d51('0x42')]);_0x10ec9e['where']=qs[_0x9d51('0x44')](_['pick'](_0x487a04[_0x9d51('0x3a')],_0x54c7ae[_0x9d51('0x44')]));if(_0x487a04[_0x9d51('0x3a')]['filter']){_0x10ec9e[_0x9d51('0x45')]=_[_0x9d51('0x46')](_0x10ec9e[_0x9d51('0x45')],{'$or':_['map'](_0x10ec9e[_0x9d51('0x3d')],function(_0x30204e){var _0x4a220f={};_0x4a220f[_0x30204e]={'$like':'%'+_0x487a04['query'][_0x9d51('0x47')]+'%'};return _0x4a220f;})});}if(_0x487a04['query'][_0x9d51('0x60')]){var _0x27af55=_0x487a04[_0x9d51('0x3a')][_0x9d51('0x60')][_0x9d51('0x61')](',');var _0x3ffc92={};_0x3ffc92[_0x27af55[0x0]]={'$gte':moment(_0x27af55[0x1])['format'](_0x9d51('0x62'))};_0x10ec9e[_0x9d51('0x45')]=_[_0x9d51('0x46')](_0x10ec9e['where'],_0x3ffc92);}_0x10ec9e=_[_0x9d51('0x46')]({},_0x10ec9e,_0x487a04['options']);return _0x50b73c['getMessages'](_0x10ec9e);}})[_0x9d51('0x2d')](function(_0x28b3fa){if(_0x28b3fa){_0x3c7cf8=_0x28b3fa[_0x9d51('0x3e')];if(!_0x487a04[_0x9d51('0x3a')][_0x9d51('0x5b')]('nolimit')){_0x10ec9e[_0x9d51('0x25')]=qs[_0x9d51('0x25')](_0x487a04['query'][_0x9d51('0x25')]);_0x10ec9e[_0x9d51('0x23')]=qs['offset'](_0x487a04[_0x9d51('0x3a')][_0x9d51('0x23')]);}return _0x50b73c[_0x9d51('0x5f')](_0x10ec9e);}})[_0x9d51('0x2d')](function(_0x7fcb32){if(_0x7fcb32){return _0x7fcb32?{'count':_0x3c7cf8,'rows':_0x7fcb32}:null;}})['then'](respondWithResult(_0x4f8e79,null))[_0x9d51('0x51')](handleError(_0x4f8e79,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 885e5e1..3d2d8b8 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 _0x4d1d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x3d4774,_0x498991){var _0x187f99=function(_0x34079f){while(--_0x34079f){_0x3d4774['push'](_0x3d4774['shift']());}};_0x187f99(++_0x498991);}(_0x4d1d,0x1cb));var _0xd4d1=function(_0x2368ed,_0x52e15a){_0x2368ed=_0x2368ed-0x0;var _0xfdccbd=_0x4d1d[_0x2368ed];return _0xfdccbd;};'use strict';var EventEmitter=require(_0xd4d1('0x0'));var ChatGroup=require(_0xd4d1('0x1'))['db'][_0xd4d1('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd4d1('0x3')](0x0);var events={'afterCreate':_0xd4d1('0x4'),'afterUpdate':_0xd4d1('0x5'),'afterDestroy':_0xd4d1('0x6')};function emitEvent(_0x372ea9){return function(_0x4191ca,_0x4845c6,_0x57ad17){ChatGroupEvents[_0xd4d1('0x7')](_0x372ea9+':'+_0x4191ca['id'],_0x4191ca);ChatGroupEvents[_0xd4d1('0x7')](_0x372ea9,_0x4191ca);_0x57ad17(null);};}for(var e in events){if(events[_0xd4d1('0x8')](e)){var event=events[e];ChatGroup[_0xd4d1('0x9')](e,emitEvent(event));}}module[_0xd4d1('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x2d06=['ChatGroup','setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x2a573d,_0x284675){var _0x370c3f=function(_0x1ddb31){while(--_0x1ddb31){_0x2a573d['push'](_0x2a573d['shift']());}};_0x370c3f(++_0x284675);}(_0x2d06,0x157));var _0x62d0=function(_0x5e875b,_0x38b586){_0x5e875b=_0x5e875b-0x0;var _0x3e2185=_0x2d06[_0x5e875b];return _0x3e2185;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x62d0('0x0'))['db'][_0x62d0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x62d0('0x2')](0x0);var events={'afterCreate':_0x62d0('0x3'),'afterUpdate':'update','afterDestroy':_0x62d0('0x4')};function emitEvent(_0x32be50){return function(_0x2487bb,_0x984713,_0x5cf315){ChatGroupEvents[_0x62d0('0x5')](_0x32be50+':'+_0x2487bb['id'],_0x2487bb);ChatGroupEvents[_0x62d0('0x5')](_0x32be50,_0x2487bb);_0x5cf315(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x62d0('0x6')](e,emitEvent(event));}}module[_0x62d0('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 facb409..8afe831 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 _0xfdfd=['util','../../config/logger','api','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xfdfd,0x14f));var _0xdfdf=function(_0x47bc6f,_0x17205b){_0x47bc6f=_0x47bc6f-0x0;var _0x168545=_0xfdfd[_0x47bc6f];return _0x168545;};'use strict';var _=require(_0xdfdf('0x0'));var util=require(_0xdfdf('0x1'));var logger=require(_0xdfdf('0x2'))(_0xdfdf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdfdf('0x4'));var fs=require('fs');var path=require(_0xdfdf('0x5'));var rimraf=require('rimraf');var config=require(_0xdfdf('0x6'));var attributes=require(_0xdfdf('0x7'));module[_0xdfdf('0x8')]=function(_0x559d10,_0x2e6e1e){return _0x559d10[_0xdfdf('0x9')](_0xdfdf('0xa'),attributes,{'tableName':_0xdfdf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x119d=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','lodash','util'];(function(_0x497cef,_0xdc5a30){var _0x34da0f=function(_0x39add5){while(--_0x39add5){_0x497cef['push'](_0x497cef['shift']());}};_0x34da0f(++_0xdc5a30);}(_0x119d,0x172));var _0xd119=function(_0x382147,_0x48a2f1){_0x382147=_0x382147-0x0;var _0x34bc80=_0x119d[_0x382147];return _0x34bc80;};'use strict';var _=require(_0xd119('0x0'));var util=require(_0xd119('0x1'));var logger=require(_0xd119('0x2'))(_0xd119('0x3'));var moment=require(_0xd119('0x4'));var BPromise=require('bluebird');var rp=require(_0xd119('0x5'));var fs=require('fs');var path=require(_0xd119('0x6'));var rimraf=require(_0xd119('0x7'));var config=require(_0xd119('0x8'));var attributes=require(_0xd119('0x9'));module['exports']=function(_0x50f547,_0x3fc87a){return _0x50f547[_0xd119('0xa')](_0xd119('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index bab27a6..b857490 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 _0x1f89=['socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x3a9534,_0x104c89){var _0x15c911=function(_0x472617){while(--_0x472617){_0x3a9534['push'](_0x3a9534['shift']());}};_0x15c911(++_0x104c89);}(_0x1f89,0x14c));var _0x91f8=function(_0x44a9cf,_0x11ddb5){_0x44a9cf=_0x44a9cf-0x0;var _0x5d67c2=_0x1f89[_0x44a9cf];return _0x5d67c2;};'use strict';var _=require(_0x91f8('0x0'));var util=require(_0x91f8('0x1'));var moment=require(_0x91f8('0x2'));var BPromise=require(_0x91f8('0x3'));var rs=require(_0x91f8('0x4'));var fs=require('fs');var Redis=require(_0x91f8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x91f8('0x6'));var logger=require('../../config/logger')(_0x91f8('0x7'));var config=require(_0x91f8('0x8'));var jayson=require(_0x91f8('0x9'));var client=jayson['client'][_0x91f8('0xa')]({'port':0x232a});config[_0x91f8('0xb')]=_[_0x91f8('0xc')](config[_0x91f8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x91f8('0xd'))(new Redis(config[_0x91f8('0xb')]));require('./chatGroup.socket')[_0x91f8('0xe')](socket);function respondWithRpcPromise(_0x5a508e,_0x43d6ad,_0x38a402){return new BPromise(function(_0x3dc8b0,_0x103ed5){return client[_0x91f8('0xf')](_0x5a508e,_0x38a402)['then'](function(_0x1c25e7){logger['info'](_0x91f8('0x10'),_0x43d6ad,'request\x20sent');logger['debug'](_0x91f8('0x11'),_0x43d6ad,_0x91f8('0x12'),JSON['stringify'](_0x1c25e7));if(_0x1c25e7[_0x91f8('0x13')]){if(_0x1c25e7[_0x91f8('0x13')][_0x91f8('0x14')]===0x1f4){logger[_0x91f8('0x13')]('ChatGroup,\x20%s,\x20%s',_0x43d6ad,_0x1c25e7['error']['message']);return _0x103ed5(_0x1c25e7['error'][_0x91f8('0x15')]);}logger[_0x91f8('0x13')](_0x91f8('0x10'),_0x43d6ad,_0x1c25e7[_0x91f8('0x13')][_0x91f8('0x15')]);return _0x3dc8b0(_0x1c25e7[_0x91f8('0x13')]['message']);}else{logger['info'](_0x91f8('0x10'),_0x43d6ad,_0x91f8('0x12'));_0x3dc8b0(_0x1c25e7['result']['message']);}})[_0x91f8('0x16')](function(_0x2ad8e8){logger[_0x91f8('0x13')](_0x91f8('0x10'),_0x43d6ad,_0x2ad8e8);_0x103ed5(_0x2ad8e8);});});}
\ No newline at end of file
+var _0x4350=['error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x115616,_0x59a994){var _0x16869c=function(_0x1bd34c){while(--_0x1bd34c){_0x115616['push'](_0x115616['shift']());}};_0x16869c(++_0x59a994);}(_0x4350,0x1d0));var _0x0435=function(_0x361b96,_0x2ce9fc){_0x361b96=_0x361b96-0x0;var _0x40d8a3=_0x4350[_0x361b96];return _0x40d8a3;};'use strict';var _=require(_0x0435('0x0'));var util=require(_0x0435('0x1'));var moment=require('moment');var BPromise=require(_0x0435('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0435('0x3'));var db=require(_0x0435('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0435('0x5'))(_0x0435('0x6'));var config=require(_0x0435('0x7'));var jayson=require(_0x0435('0x8'));var client=jayson['client'][_0x0435('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0435('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0435('0xa')]));require('./chatGroup.socket')[_0x0435('0xb')](socket);function respondWithRpcPromise(_0xd72d22,_0x53f1d0,_0x15893a){return new BPromise(function(_0x518b5d,_0x3154d5){return client[_0x0435('0xc')](_0xd72d22,_0x15893a)[_0x0435('0xd')](function(_0x2f27b5){logger[_0x0435('0xe')](_0x0435('0xf'),_0x53f1d0,_0x0435('0x10'));logger[_0x0435('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x53f1d0,'request\x20sent',JSON[_0x0435('0x12')](_0x2f27b5));if(_0x2f27b5['error']){if(_0x2f27b5[_0x0435('0x13')]['code']===0x1f4){logger[_0x0435('0x13')](_0x0435('0xf'),_0x53f1d0,_0x2f27b5['error'][_0x0435('0x14')]);return _0x3154d5(_0x2f27b5[_0x0435('0x13')]['message']);}logger[_0x0435('0x13')]('ChatGroup,\x20%s,\x20%s',_0x53f1d0,_0x2f27b5[_0x0435('0x13')][_0x0435('0x14')]);return _0x518b5d(_0x2f27b5[_0x0435('0x13')][_0x0435('0x14')]);}else{logger[_0x0435('0xe')]('ChatGroup,\x20%s,\x20%s',_0x53f1d0,'request\x20sent');_0x518b5d(_0x2f27b5[_0x0435('0x15')][_0x0435('0x14')]);}})[_0x0435('0x16')](function(_0x227ff2){logger[_0x0435('0x13')](_0x0435('0xf'),_0x53f1d0,_0x227ff2);_0x3154d5(_0x227ff2);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 6d66bfa..cbbef91 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 _0x4889=['save','emit','removeListener','register','length'];(function(_0x2ec6ce,_0x1a22f8){var _0x528b51=function(_0x2546c1){while(--_0x2546c1){_0x2ec6ce['push'](_0x2ec6ce['shift']());}};_0x528b51(++_0x1a22f8);}(_0x4889,0x1ef));var _0x9488=function(_0x149db1,_0x25f28b){_0x149db1=_0x149db1-0x0;var _0x2059a8=_0x4889[_0x149db1];return _0x2059a8;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9488('0x0'),'remove','update'];function createListener(_0xa9af12,_0xe5b843){return function(_0x428dcb){_0xe5b843[_0x9488('0x1')](_0xa9af12,_0x428dcb);};}function removeListener(_0x3d1ab7,_0x193a6c){return function(){ChatGroupEvents[_0x9488('0x2')](_0x3d1ab7,_0x193a6c);};}exports[_0x9488('0x3')]=function(_0x1f55ff){for(var _0x6a381=0x0,_0x43f02e=events[_0x9488('0x4')];_0x6a381<_0x43f02e;_0x6a381++){var _0x55ff41=events[_0x6a381];var _0x44e589=createListener('chatGroup:'+_0x55ff41,_0x1f55ff);ChatGroupEvents['on'](_0x55ff41,_0x44e589);}};
\ No newline at end of file
+var _0x794f=['save','remove','emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x4d96d8,_0x31e935){var _0x43ed07=function(_0xb0524b){while(--_0xb0524b){_0x4d96d8['push'](_0x4d96d8['shift']());}};_0x43ed07(++_0x31e935);}(_0x794f,0x15d));var _0xf794=function(_0x5f012f,_0xd4083f){_0x5f012f=_0x5f012f-0x0;var _0x588d9d=_0x794f[_0x5f012f];return _0x588d9d;};'use strict';var ChatGroupEvents=require(_0xf794('0x0'));var events=[_0xf794('0x1'),_0xf794('0x2'),'update'];function createListener(_0x1e1c21,_0x187667){return function(_0x2f728a){_0x187667[_0xf794('0x3')](_0x1e1c21,_0x2f728a);};}function removeListener(_0x41d742,_0x4303f5){return function(){ChatGroupEvents[_0xf794('0x4')](_0x41d742,_0x4303f5);};}exports['register']=function(_0x112e12){for(var _0x38bcf5=0x0,_0x34918c=events[_0xf794('0x5')];_0x38bcf5<_0x34918c;_0x38bcf5++){var _0x7d3175=events[_0x38bcf5];var _0x3fba2f=createListener(_0xf794('0x6')+_0x7d3175,_0x112e12);ChatGroupEvents['on'](_0x7d3175,_0x3fba2f);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index ab0fc87..867cf55 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 _0x3a56=['getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','removeMembers','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members'];(function(_0x4e135d,_0x5f54d1){var _0x466163=function(_0x26d68b){while(--_0x26d68b){_0x4e135d['push'](_0x4e135d['shift']());}};_0x466163(++_0x5f54d1);}(_0x3a56,0x143));var _0x63a5=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x3a56[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0x63a5('0x0'));var util=require('util');var path=require(_0x63a5('0x1'));var timeout=require(_0x63a5('0x2'));var express=require(_0x63a5('0x3'));var router=express[_0x63a5('0x4')]();var fs_extra=require(_0x63a5('0x5'));var auth=require(_0x63a5('0x6'));var interaction=require(_0x63a5('0x7'));var config=require(_0x63a5('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x63a5('0x9')]);router[_0x63a5('0xa')](_0x63a5('0xb'),auth[_0x63a5('0xc')](),controller[_0x63a5('0xd')]);router[_0x63a5('0xa')]('/:id',auth[_0x63a5('0xc')](),controller[_0x63a5('0xe')]);router[_0x63a5('0xa')](_0x63a5('0xf'),auth['isAuthenticated'](),controller[_0x63a5('0x10')]);router['get'](_0x63a5('0x11'),auth['isAuthenticated'](),controller[_0x63a5('0x12')]);router['get'](_0x63a5('0x13'),auth[_0x63a5('0xc')](),controller[_0x63a5('0x14')]);router[_0x63a5('0x15')]('/',auth[_0x63a5('0xc')](),controller[_0x63a5('0x16')]);router[_0x63a5('0x15')](_0x63a5('0x11'),auth['isAuthenticated'](),controller[_0x63a5('0x17')]);router[_0x63a5('0x15')](_0x63a5('0x13'),auth[_0x63a5('0xc')](),controller[_0x63a5('0x18')]);router[_0x63a5('0x19')](_0x63a5('0x1a'),auth['isAuthenticated'](),controller[_0x63a5('0x1b')]);router[_0x63a5('0x1c')](_0x63a5('0x1a'),auth[_0x63a5('0xc')](),controller[_0x63a5('0x1d')]);router[_0x63a5('0x1c')](_0x63a5('0x11'),auth[_0x63a5('0xc')](),controller[_0x63a5('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x715b=['/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','addMessage','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0x715b,0x15f));var _0xb715=function(_0x506371,_0x176091){_0x506371=_0x506371-0x0;var _0x1ccc19=_0x715b[_0x506371];return _0x1ccc19;};'use strict';var multer=require(_0xb715('0x0'));var util=require(_0xb715('0x1'));var path=require('path');var timeout=require(_0xb715('0x2'));var express=require(_0xb715('0x3'));var router=express[_0xb715('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb715('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb715('0x6'));var controller=require(_0xb715('0x7'));router[_0xb715('0x8')]('/',auth[_0xb715('0x9')](),controller[_0xb715('0xa')]);router[_0xb715('0x8')](_0xb715('0xb'),auth[_0xb715('0x9')](),controller[_0xb715('0xc')]);router[_0xb715('0x8')](_0xb715('0xd'),auth[_0xb715('0x9')](),controller[_0xb715('0xe')]);router[_0xb715('0x8')](_0xb715('0xf'),auth['isAuthenticated'](),controller[_0xb715('0x10')]);router[_0xb715('0x8')](_0xb715('0x11'),auth[_0xb715('0x9')](),controller[_0xb715('0x12')]);router[_0xb715('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb715('0x13')]);router[_0xb715('0x14')]('/',auth[_0xb715('0x9')](),controller[_0xb715('0x15')]);router[_0xb715('0x14')]('/:id/members',auth[_0xb715('0x9')](),controller[_0xb715('0x16')]);router['post'](_0xb715('0x17'),auth[_0xb715('0x9')](),controller[_0xb715('0x18')]);router[_0xb715('0x19')](_0xb715('0xd'),auth['isAuthenticated'](),controller[_0xb715('0x1a')]);router[_0xb715('0x1b')](_0xb715('0xd'),auth[_0xb715('0x9')](),controller['destroy']);router[_0xb715('0x1b')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);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 1d05bf4..d690643 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 _0xe511=['DATE','long','ENUM','out','sequelize','exports','INTEGER','star','thumb','TEXT','STRING'];(function(_0xb42aba,_0x5c15fc){var _0x4cf479=function(_0x543b57){while(--_0x543b57){_0xb42aba['push'](_0xb42aba['shift']());}};_0x4cf479(++_0x5c15fc);}(_0xe511,0x16f));var _0x1e51=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0xe511[_0x272d90];return _0x2bf4a2;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1e51('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x1e51('0x3'),_0x1e51('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1e51('0x5')]},'pathTranscript':{'type':Sequelize[_0x1e51('0x5')]},'mailTranscript':{'type':Sequelize[_0x1e51('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1e51('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1e51('0x6')]},'thirdDisposition':{'type':Sequelize[_0x1e51('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x1e51('0x6')]},'osName':{'type':Sequelize[_0x1e51('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x1e51('0x6')]},'deviceType':{'type':Sequelize[_0x1e51('0x6')]},'referer':{'type':Sequelize[_0x1e51('0x5')]},'customerIp':{'type':Sequelize[_0x1e51('0x6')]},'formData':{'type':Sequelize[_0x1e51('0x5')](_0x1e51('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x1e51('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x1e51('0x9')]('in',_0x1e51('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1e51('0x6')]},'customerPort':{'type':Sequelize[_0x1e51('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x1e51('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1cc3=['TEXT','STRING','DATE','long','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','star','thumb'];(function(_0x4abecb,_0x862916){var _0x581432=function(_0x435cc6){while(--_0x435cc6){_0x4abecb['push'](_0x4abecb['shift']());}};_0x581432(++_0x862916);}(_0x1cc3,0x11b));var _0x31cc=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1cc3[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x31cc('0x0'));module[_0x31cc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x31cc('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x31cc('0x3'),_0x31cc('0x4')),'defaultValue':_0x31cc('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x31cc('0x5')]},'mailTranscript':{'type':Sequelize[_0x31cc('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x31cc('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x31cc('0x6')]},'thirdDisposition':{'type':Sequelize[_0x31cc('0x6')]},'note':{'type':Sequelize[_0x31cc('0x6')]},'browserName':{'type':Sequelize[_0x31cc('0x6')]},'browserVersion':{'type':Sequelize[_0x31cc('0x6')]},'osName':{'type':Sequelize[_0x31cc('0x6')]},'osVersion':{'type':Sequelize[_0x31cc('0x6')]},'deviceModel':{'type':Sequelize[_0x31cc('0x6')]},'deviceVendor':{'type':Sequelize[_0x31cc('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x31cc('0x5')]},'customerIp':{'type':Sequelize[_0x31cc('0x6')]},'formData':{'type':Sequelize[_0x31cc('0x5')](_0x31cc('0x8'))},'read1stAt':{'type':Sequelize[_0x31cc('0x7')]},'lastMsgAt':{'type':Sequelize[_0x31cc('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x31cc('0x9')]('in',_0x31cc('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x31cc('0x6')]},'customerPort':{'type':Sequelize[_0x31cc('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x31cc('0xb')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 32a4210..6a50dd4 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 _0x34e8=['ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','status','end','offset','limit','undefined','count','set','json','update','then','destroy','sendStatus','stack','name','send','render','body','contact','account','Users','TagIds','split','forEach','Tags','talking','unmanaged','abandoned','UserId','waiting','closed','disposition','answered','total','index','map','ChatInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','select','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','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','type','text','start','Tag','$substring','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','follow','isNull','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','filename','mimetype','Attachment','Unauthorized','attachId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','User','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x384695,_0x24e26f){var _0x3b4309=function(_0x2fb958){while(--_0x2fb958){_0x384695['push'](_0x384695['shift']());}};_0x3b4309(++_0x24e26f);}(_0x34e8,0x12c));var _0x834e=function(_0x6f9174,_0x48e9c3){_0x6f9174=_0x6f9174-0x0;var _0x5c904a=_0x34e8[_0x6f9174];return _0x5c904a;};'use strict';var rimraf=require(_0x834e('0x0'));var zipdir=require(_0x834e('0x1'));var rp=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x834e('0x4'));var util=require(_0x834e('0x5'));var path=require(_0x834e('0x6'));var ejs=require(_0x834e('0x7'));var fs=require('fs');var _=require(_0x834e('0x8'));var squel=require(_0x834e('0x9'));var Redis=require(_0x834e('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x834e('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x834e('0xc'))(_0x834e('0xd'));var config=require(_0x834e('0xe'));var db=require(_0x834e('0xf'))['db'];config[_0x834e('0x10')]=_[_0x834e('0x11')](config[_0x834e('0x10')],{'host':_0x834e('0x12'),'port':0x18eb});var socket=require(_0x834e('0x13'))(new Redis(config[_0x834e('0x10')]));require(_0x834e('0x14'))[_0x834e('0x15')](socket);var jayson=require(_0x834e('0x16'));var client=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232b});var client9004=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x538bb3,_0x5e5b6d,_0x6cd9b9,_0x58a27e){return new BPromise(function(_0x23848e,_0x2d95f2){var _0x28e659=_0x58a27e||client;return _0x28e659[_0x834e('0x19')](_0x538bb3,_0x6cd9b9)['then'](function(_0x43156c){logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));logger['debug'](_0x834e('0x1c'),_0x5e5b6d,_0x834e('0x1b'),JSON['stringify'](_0x43156c));if(_0x43156c[_0x834e('0x1d')]){if(_0x43156c[_0x834e('0x1d')][_0x834e('0x1e')]===0x1f4){logger['error'](_0x834e('0x1f'),_0x5e5b6d,_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);return _0x2d95f2(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}logger[_0x834e('0x1d')](_0x834e('0x1f'),_0x5e5b6d,_0x43156c['error'][_0x834e('0x20')]);return _0x23848e(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}else{logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));_0x23848e(_0x43156c[_0x834e('0x21')]['message']);}})[_0x834e('0x22')](function(_0x28d687){logger[_0x834e('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x28d687);_0x2d95f2(_0x28d687);});});}function respondWithStatusCode(_0x4e3f48,_0x231619){_0x231619=_0x231619||0xcc;return function(_0x34563b){if(_0x34563b){return _0x4e3f48['sendStatus'](_0x231619);}return _0x4e3f48[_0x834e('0x23')](_0x231619)[_0x834e('0x24')]();};}function respondWithResult(_0x58f4fd,_0x3bc4f7){_0x3bc4f7=_0x3bc4f7||0xc8;return function(_0x2e1983){if(_0x2e1983){return _0x58f4fd[_0x834e('0x23')](_0x3bc4f7)['json'](_0x2e1983);}};}function respondWithFilteredResult(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(_0x5e1cc5){var _0x5bef62=typeof _0x3e310f[_0x834e('0x25')]==='undefined'&&typeof _0x3e310f[_0x834e('0x26')]===_0x834e('0x27');var _0x3db026=_0x5e1cc5[_0x834e('0x28')];var _0x3cd928=_0x5bef62?0x0:_0x3e310f[_0x834e('0x25')];var _0x491919=_0x5bef62?_0x5e1cc5['count']:_0x3e310f['offset']+_0x3e310f['limit'];var _0x2c7a8d;if(_0x491919>=_0x3db026){_0x491919=_0x3db026;_0x2c7a8d=0xc8;}else{_0x2c7a8d=0xce;}_0x24fcf7[_0x834e('0x23')](_0x2c7a8d);return _0x24fcf7[_0x834e('0x29')]('Content-Range',_0x3cd928+'-'+_0x491919+'/'+_0x3db026)[_0x834e('0x2a')](_0x5e1cc5);}return null;};}function saveUpdates(_0x11f1ce){return function(_0x1f3671){if(_0x1f3671){return _0x1f3671[_0x834e('0x2b')](_0x11f1ce)[_0x834e('0x2c')](function(_0x390119){return _0x390119;});}return null;};}function removeEntity(_0x3d149d){return function(_0xfaf716){if(_0xfaf716){return _0xfaf716[_0x834e('0x2d')]()['then'](function(){_0x3d149d[_0x834e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c75c2){return function(_0x3787b0){if(!_0x3787b0){_0x2c75c2[_0x834e('0x2e')](0x194);}return _0x3787b0;};}function handleError(_0x2b3418,_0x444366){_0x444366=_0x444366||0x1f4;return function(_0x4689c2){logger[_0x834e('0x1d')](_0x4689c2[_0x834e('0x2f')]);if(_0x4689c2[_0x834e('0x30')]){delete _0x4689c2[_0x834e('0x30')];}_0x2b3418['status'](_0x444366)[_0x834e('0x31')](_0x4689c2);};}function getMustacheRender(_0x2f408a,_0x24a9df){return Mustache[_0x834e('0x32')](_0x2f408a,_['merge'](_0x24a9df[_0x834e('0x33')],{'contact':_0x24a9df[_0x834e('0x34')],'message':_0x24a9df['message'],'agent':_0x24a9df['agent'],'interaction':_0x24a9df['interaction'],'account':_0x24a9df[_0x834e('0x35')]}))||'';}function getInteractionUsers(_0x41bf4d,_0x20c6ae){return new BPromise(function(_0x34fefb,_0x339e28){try{if(_0x20c6ae[_0x41bf4d['id']]){_0x41bf4d[_0x834e('0x36')]=_['map'](_0x20c6ae[_0x41bf4d['id']],function(_0x2c2d94){return{'id':_0x2c2d94['id'],'fullname':_0x2c2d94['fullname']};});}}catch(_0xe103fe){_0x339e28(_0xe103fe);}_0x34fefb(_0x41bf4d);});}function getInteractionTags(_0x6a3ac,_0x47abed){return new BPromise(function(_0x18ac3b,_0x2f56c7){try{if(_0x6a3ac['TagIds']){_0x6a3ac['Tags']=[];_0x6a3ac[_0x834e('0x37')][_0x834e('0x38')](',')[_0x834e('0x39')](function(_0x130c23){_0x6a3ac[_0x834e('0x3a')]['push'](_0x47abed[_0x130c23]);});}delete _0x6a3ac[_0x834e('0x37')];}catch(_0x548d1d){_0x2f56c7(_0x548d1d);}_0x18ac3b(_0x6a3ac);});}function updateChatInteraction(_0x50c243,_0x1b2edf,_0x4a7f76){return new BPromise(function(_0x2e5239,_0x1ba66d){return getInteractionUsers(_0x50c243,_0x4a7f76)[_0x834e('0x2c')](function(_0x3c59af){return getInteractionTags(_0x3c59af,_0x1b2edf);})[_0x834e('0x2c')](function(_0x574ea8){return getStateInteraction(_0x574ea8);})[_0x834e('0x2c')](function(_0x26b847){_0x2e5239(_0x26b847);})[_0x834e('0x22')](function(_0x58c5fb){_0x1ba66d(_0x58c5fb);});});}function getStateInteraction(_0x35380e){return new BPromise(function(_0x16ac45){_0x35380e['waiting']=0x0;_0x35380e[_0x834e('0x3b')]=0x0;_0x35380e['answered']=0x0;_0x35380e[_0x834e('0x3c')]=0x0;_0x35380e[_0x834e('0x3d')]=0x0;_0x35380e['total']=0x0;if(!_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3f')]+=0x1;}if(!_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3b')]+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}if(_0x35380e['closed']&&_0x35380e[_0x834e('0x41')]==='abandoned'){_0x35380e[_0x834e('0x3d')]+=0x1;if(_0x35380e['waiting']){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]&&_0x35380e[_0x834e('0x41')]){_0x35380e['unmanaged']+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x42')]+=0x1;if(_0x35380e[_0x834e('0x3b')]){_0x35380e[_0x834e('0x3b')]-=0x1;}}_0x35380e[_0x834e('0x43')]+=0x1;_0x16ac45(_0x35380e);});}exports[_0x834e('0x44')]=function(_0x279ea1,_0x5f3943){var _0x3124be={},_0x6fff27={},_0x47a8a9={'count':0x0,'rows':[]};var _0x112306=_[_0x834e('0x45')](db[_0x834e('0x46')][_0x834e('0x47')],function(_0x19b5ef){return{'name':_0x19b5ef[_0x834e('0x48')],'type':_0x19b5ef['type']['key']};});_0x6fff27[_0x834e('0x49')]=_[_0x834e('0x45')](_0x112306,_0x834e('0x30'));_0x6fff27[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x279ea1[_0x834e('0x4a')]);_0x6fff27[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],_0x6fff27[_0x834e('0x4a')]);_0x3124be[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]));_0x3124be[_0x834e('0x4e')]=_0x3124be[_0x834e('0x4e')][_0x834e('0x50')]?_0x3124be[_0x834e('0x4e')]:_0x6fff27['model'];if(!_0x279ea1[_0x834e('0x4a')][_0x834e('0x51')]('nolimit')){_0x3124be[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x279ea1['query'][_0x834e('0x26')]);_0x3124be[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x25')]);}_0x3124be[_0x834e('0x52')]=qs[_0x834e('0x53')](_0x279ea1['query'][_0x834e('0x53')]);_0x3124be[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x279ea1[_0x834e('0x4a')],_0x6fff27[_0x834e('0x4c')]),_0x112306);var _0x344b51=[];var _0x1bc975=squel['select']()[_0x834e('0x56')]('id')['field'](_0x834e('0x30'))['field'](_0x834e('0x57'))['from']('tools_tags');var _0x6c0b29=squel[_0x834e('0x58')]()['field']('u.id')[_0x834e('0x56')](_0x834e('0x59'))[_0x834e('0x56')](_0x834e('0x5a'))[_0x834e('0x5b')](_0x834e('0x5c'),'ui')[_0x834e('0x5d')](_0x834e('0x5e'),'u','u.id\x20=\x20ui.UserId');var _0x142334=squel[_0x834e('0x58')]()['from'](_0x834e('0x5f'),'i')['left_join'](_0x834e('0x60'),'c',_0x834e('0x61'))['left_join'](_0x834e('0x5e'),'o',_0x834e('0x62'))[_0x834e('0x5d')](_0x834e('0x63'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x834e('0x5d')](_0x834e('0x64'),'me',_0x834e('0x65'))['left_join'](_0x834e('0x66'),'it',_0x834e('0x67'))[_0x834e('0x5d')](_0x834e('0x68'),'t',_0x834e('0x69'));var _0x125f37=squel[_0x834e('0x6a')]();var _0x1def00=[];var _0x208c21=squel[_0x834e('0x6a')]();var _0x1e4310;if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]){_0x1e4310=as[_0x834e('0x6c')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]);var _0x297cce=_0x1e4310[_0x834e('0x6d')];for(var _0x193a15=0x0;_0x193a15<_0x1e4310[_0x834e('0x6e')][_0x834e('0x50')];_0x193a15++){var _0x2cb233=_0x1e4310['conditions'][_0x193a15];var _0x2145cf='i';var _0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),_0x2cb233['field']]);if(!_0x25d6f4){switch(_0x2cb233[_0x834e('0x56')]){case'unreadMessages':if(_0x2cb233['value']==0x1){_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x71'));}else{_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x72'));}break;case _0x834e('0x73'):if(_0x2cb233[_0x834e('0x74')]==='$substring'){if(_0x2cb233[_0x834e('0x75')]['split']('\x20')[_0x834e('0x50')]>0x1){_0x125f37[_0x297cce](_0x834e('0x76'),qs['getFullTextValue'](_0x2cb233['value']),null);}else{var _0x4a4def='%'+_0x2cb233[_0x834e('0x75')]+'%';_0x125f37[_0x297cce](_0x834e('0x77'),_0x4a4def,_0x4a4def,_0x4a4def);}}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),'ContactId']);_0x2cb233[_0x834e('0x56')]=_0x834e('0x78');_0x11f6f0=as[_0x834e('0x79')](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}break;case _0x834e('0x7d'):var _0x5b2bf6=_0x2cb233[_0x834e('0x75')][_0x834e('0x38')](',')[_0x834e('0x45')](function(_0x5b5d6f){return Number(_0x5b5d6f);});_0x5b2bf6['forEach'](function(_0x46fa0d){_0x208c21['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46fa0d+',%');});_0x1def00=_['union'](_0x1def00,_0x5b2bf6);break;case'User':if(_0x2cb233[_0x834e('0x74')]===_0x834e('0x7e')){_0x125f37[_0x297cce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2cb233[_0x834e('0x75')]+'%',null);}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,['name',_0x834e('0x3e')]);_0x2cb233[_0x834e('0x56')]='UserId';_0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')]['end']);}break;case _0x834e('0x33'):_0x11f6f0=as['buildExpression']('me',null,_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0['value'][_0x834e('0x24')]);break;}}else{var _0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')]['start'],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}}}else{var _0x402692=_(_0x279ea1[_0x834e('0x4a')])[_0x834e('0x4b')]()[_0x834e('0x45')](function(_0x1372dd){return _[_0x834e('0x7f')](_0x112306,[_0x834e('0x30'),_0x1372dd])?_0x1372dd:undefined;})[_0x834e('0x80')]()['value']();if(!_['isEmpty'](_0x402692)){_0x402692['forEach'](function(_0x36ede9){if(_0x36ede9===_0x834e('0x81')){_0x142334[_0x834e('0x54')](_0x834e('0x82'),[][_0x834e('0x83')](_0x279ea1['query'][_0x36ede9]));}else if(_0x36ede9==='createdAt'){var _0x4520fc=JSON[_0x834e('0x84')](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x85')];var _0x40a705=JSON['parse'](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x86')];_0x142334[_0x834e('0x54')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4520fc,_0x40a705);}else{if(_0x279ea1[_0x834e('0x4a')][_0x36ede9]===_0x834e('0x87')){_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+_0x834e('0x88'));}else{_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+'\x20=\x20?',_0x279ea1['query'][_0x36ede9]);}}});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x89')]){if(_0x279ea1['query'][_0x834e('0x89')]==0x1){_0x142334['having'](_0x834e('0x8a'));}else{_0x142334[_0x834e('0x70')](_0x834e('0x8b'));}}if(_0x279ea1['query'][_0x834e('0x8c')]){_0x1def00=_['isArray'](_0x279ea1['query']['tag'])?_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]:new Array(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]);_0x1def00[_0x834e('0x39')](function(_0x2dad55){_0x208c21['or'](_0x834e('0x8d'),'%,'+_0x2dad55+',%');});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8e')]){var _0x53f6e3=_0x279ea1[_0x834e('0x4a')]['filter'][_0x834e('0x8f')]('\x5c','\x5c\x5c')[_0x834e('0x8f')](/'/g,'\x27\x27');if(qs[_0x834e('0x90')](_0x53f6e3)){_0x125f37['or'](_0x834e('0x91'),_0x53f6e3+'%');}else{_0x125f37['or'](_0x834e('0x92'),qs[_0x834e('0x93')](_0x53f6e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x53f6e3+'%');}}}_0x142334['where'](_0x125f37);_0x142334[_0x834e('0x94')](_0x834e('0x95'));var _0x4eff8d={'type':db[_0x834e('0x96')][_0x834e('0x97')][_0x834e('0x98')],'raw':!![]};var _0x1e225f=_0x142334[_0x834e('0x99')]();_0x1e225f['field'](_0x834e('0x95'));_0x1e225f[_0x834e('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3124be['order']){_0x3124be[_0x834e('0x52')][_0x834e('0x39')](function(_0x4f716d){var _0x23ce49=_0x4f716d[0x0]===_0x834e('0x9a')?_0x4f716d[0x0]:'i.'+_0x4f716d[0x0];_0x142334['order'](_0x23ce49,_0x4f716d[0x1]===_0x834e('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x1def00)){_0x142334['having'](_0x208c21);_0x1e225f[_0x834e('0x54')](_0x834e('0x9c'),_0x1def00);}BPromise[_0x834e('0x9d')]()[_0x834e('0x2c')](function(){if(!_0x1e4310){if(_0x279ea1['query'][_0x834e('0x81')])return;_0x1e225f[_0x834e('0x54')](_0x834e('0x9e'));_0x142334[_0x834e('0x54')](_0x834e('0x9e'));return;}if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]!==_0x834e('0xa1'))return;return _0x279ea1[_0x834e('0x9f')][_0x834e('0xa2')]({'attributes':['id'],'raw':!![]})[_0x834e('0x2c')](function(_0x261e3d){if(_[_0x834e('0xa3')](_0x261e3d)){_0x1e225f[_0x834e('0x54')](_0x834e('0xa4'));_0x142334[_0x834e('0x54')](_0x834e('0xa4'));}else{_0x1e225f[_0x834e('0x54')](_0x834e('0x82'),_[_0x834e('0x45')](_0x261e3d,'id'));_0x142334[_0x834e('0x54')](_0x834e('0x82'),_['map'](_0x261e3d,'id'));}});})[_0x834e('0x2c')](function(){if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]===_0x834e('0xa1')&&!_0x1e4310&&!_0x279ea1[_0x834e('0x4a')][_0x834e('0x81')])return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1e225f[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x5ce790){_0x47a8a9['count']=_0x5ce790[_0x834e('0x50')];if(_0x47a8a9['count']===0x0)return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1bc975[_0x834e('0xa6')](),_0x4eff8d)['then'](function(_0xae00f){_0x344b51=_[_0x834e('0xa7')](_0xae00f,'id');_0x4eff8d=_[_0x834e('0xa8')](_0x4eff8d,{'model':db[_0x834e('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]){_0x3124be['attributes'][_0x834e('0x39')](function(_0x27bd2e){_0x142334[_0x834e('0x56')]('i.'+_0x27bd2e);});}else{_0x142334[_0x834e('0x56')](_0x834e('0xa9'),'unreadMessages');_0x142334['field']('a.key','Account.key');_0x142334[_0x834e('0x56')](_0x834e('0xaa'),'Account.mandatoryDisposition');_0x142334[_0x834e('0x56')](_0x834e('0xab'),'contactName');_0x142334[_0x834e('0x56')](_0x834e('0xac'));_0x142334[_0x834e('0x56')](_0x834e('0xad'),_0x834e('0xae'));_0x142334[_0x834e('0x56')]('c.lastName','Contact.lastName');_0x142334[_0x834e('0x56')](_0x834e('0xaf'),_0x834e('0xb0'));_0x142334['field'](_0x834e('0xb1'),_0x834e('0xb2'));_0x142334['field'](_0x834e('0xb3'),_0x834e('0xb4'));_0x142334[_0x834e('0x56')](_0x834e('0xb5'),'Contact.fax');_0x142334[_0x834e('0x56')]('o.fullname','Owner.fullname');_0x142334[_0x834e('0x56')](_0x834e('0xb6'),_0x834e('0xb7'));_0x142334[_0x834e('0x56')](_0x834e('0xb8'),_0x834e('0x37'));}if(_0x3124be['limit'])_0x142334['limit'](_0x3124be[_0x834e('0x26')]);if(_0x3124be[_0x834e('0x25')])_0x142334[_0x834e('0x25')](_0x3124be[_0x834e('0x25')]);return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x142334[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x435a75){if(_0x435a75[_0x834e('0x50')]>0x0)_0x6c0b29['where'](_0x834e('0xb9'),_[_0x834e('0x45')](_0x435a75,'id'));return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x6c0b29[_0x834e('0xa6')](),_0x4eff8d)[_0x834e('0x2c')](function(_0x231f0b){var _0x3b44f3=_[_0x834e('0xba')](_0x231f0b,_0x834e('0xbb'));var _0x496709=[];_0x435a75[_0x834e('0x39')](function(_0x17e922){_0x496709[_0x834e('0xbc')](updateChatInteraction(_0x17e922,_0x344b51,_0x3b44f3));});return BPromise['all'](_0x496709);});});})[_0x834e('0x2c')](function(_0x20fdfd){_0x47a8a9['rows']=_0x20fdfd;return _0x47a8a9;})[_0x834e('0x2c')](respondWithFilteredResult(_0x5f3943,_0x3124be))['catch'](handleError(_0x5f3943,null));};exports[_0x834e('0xbd')]=function(_0x53c483,_0x16a42b){var _0x560d10={'raw':![],'where':{'id':_0x53c483[_0x834e('0xbe')]['id']}},_0x2b6d1={};_0x2b6d1[_0x834e('0x49')]=_[_0x834e('0x4b')](db['ChatInteraction'][_0x834e('0x47')]);_0x2b6d1[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x53c483[_0x834e('0x4a')]);_0x2b6d1[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],_0x2b6d1[_0x834e('0x4a')]);_0x560d10[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x53c483[_0x834e('0x4a')][_0x834e('0x4f')]));_0x560d10[_0x834e('0x4e')]=_0x560d10[_0x834e('0x4e')][_0x834e('0x50')]?_0x560d10['attributes']:_0x2b6d1['model'];if(_0x53c483[_0x834e('0x4a')][_0x834e('0xbf')]){_0x560d10[_0x834e('0xc0')]=[{'all':!![]}];}_0x560d10=_[_0x834e('0xa8')]({},_0x560d10,_0x53c483[_0x834e('0xc1')]);return db[_0x834e('0x46')][_0x834e('0x6f')](_0x560d10)[_0x834e('0x2c')](handleEntityNotFound(_0x16a42b,null))[_0x834e('0x2c')](respondWithResult(_0x16a42b,null))[_0x834e('0x22')](handleError(_0x16a42b,null));};exports[_0x834e('0xc2')]=function(_0x32645e,_0x513d9e){return db[_0x834e('0x46')]['create'](_0x32645e[_0x834e('0x33')],{})[_0x834e('0x2c')](respondWithResult(_0x513d9e,0xc9))[_0x834e('0x22')](handleError(_0x513d9e,null));};exports['update']=function(_0x1a65b4,_0x23a386){if(_0x1a65b4['body']['id']){delete _0x1a65b4['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x1a65b4['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x23a386,null))[_0x834e('0x2c')](saveUpdates(_0x1a65b4[_0x834e('0x33')],null))[_0x834e('0x2c')](respondWithResult(_0x23a386,null))[_0x834e('0x22')](handleError(_0x23a386,null));};exports['destroy']=function(_0x4e7545,_0x453e58){return db['ChatInteraction']['find']({'where':{'id':_0x4e7545['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x453e58,null))[_0x834e('0x2c')](removeEntity(_0x453e58,null))['catch'](handleError(_0x453e58,null));};exports[_0x834e('0xc3')]=function(_0x66cbdc,_0x470568){return db[_0x834e('0x46')]['describe']()[_0x834e('0x2c')](respondWithResult(_0x470568,null))[_0x834e('0x22')](handleError(_0x470568,null));};exports[_0x834e('0xc4')]=function(_0x5633f4,_0x3d8af7){var _0x5f3b7d=_0x5633f4[_0x834e('0xbe')]['id'];var _0x4af2a2;var _0x461420;var _0x108100;return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x5f3b7d}})[_0x834e('0x2c')](function(_0x41e7a8){_0x4af2a2=_0x41e7a8;return db[_0x834e('0xc6')][_0x834e('0xc5')]({'where':{'id':_0x41e7a8[_0x834e('0x81')]},'attributes':['id','vidaooApiKey',_0x834e('0xc7'),_0x834e('0xc8'),_0x834e('0xc9'),_0x834e('0xca')],'raw':!![]});})[_0x834e('0x2c')](function(_0x1b8e67){if(_0x1b8e67&&_0x1b8e67['vidaooApiKey']&&_0x1b8e67[_0x834e('0xc7')]){_0x461420=_0x1b8e67;var _0x490a57={'interaction':{'id':_0x5f3b7d},'agent':{'id':_0x5633f4['user']['id'],'name':_0x5633f4[_0x834e('0x9f')]['name'],'fullname':_0x5633f4['user'][_0x834e('0xcb')],'email':_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]},'contact':_0x5633f4[_0x834e('0x33')][_0x834e('0x34')],'account':_0x5633f4[_0x834e('0x33')][_0x834e('0x35')]};var _0x155f2d={'rejectUnauthorized':![],'method':_0x834e('0xcd'),'url':_0x834e('0xce'),'headers':{'X-APIKEY':_0x1b8e67[_0x834e('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]],'buttons':null,'topic':_0x461420[_0x834e('0xc8')],'note':_['isNull'](_0x461420[_0x834e('0xc9')])?null:getMustacheRender(_0x461420['vidaooNote'],_0x490a57),'metadata':null},'redirect':_0x834e('0xd0'),'json':!![]};try{if(!_[_0x834e('0xd1')](_0x461420[_0x834e('0xca')])){var _0x2cdbe0=getMustacheRender(_0x461420['vidaooMetadata'],_0x490a57);var _0x5f558a=JSON[_0x834e('0x84')](_0x2cdbe0);_0x155f2d[_0x834e('0x33')]['metadata']=_0x5f558a;}}catch(_0x375c35){throw new db[(_0x834e('0x96'))]['ValidationError'](_0x834e('0xd2'));}return rp(_0x155f2d);}else{throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xd4'));}})['then'](function(_0x57ff06){_0x108100=_0x57ff06;if(_0x108100['id']){var _0x4ead1d={'body':_0x108100['join_url'],'ChatWebsiteId':_0x461420['id'],'ChatInteractionId':_0x4af2a2['id'],'direction':_0x834e('0xd5'),'UserId':_0x5633f4[_0x834e('0x9f')]['id']};return db['ChatMessage'][_0x834e('0xc2')](_0x4ead1d,{});}else{throw new db['Sequelize'][(_0x834e('0xd3'))](_0x834e('0xd6'));}})[_0x834e('0x2c')](function(){return _0x4af2a2[_0x834e('0xd7')]({'vidaooSessionId':_0x108100['id']});})[_0x834e('0x2c')](respondWithResult(_0x3d8af7,null))[_0x834e('0x22')](handleError(_0x3d8af7,null));};exports[_0x834e('0xd8')]=function(_0x4fc61d,_0x12a0f3){if(_0x4fc61d[_0x834e('0x33')]['id']){delete _0x4fc61d['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x4fc61d['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x834e('0x2c')](handleEntityNotFound(_0x12a0f3,null))[_0x834e('0x2c')](saveUpdates(_0x4fc61d[_0x834e('0x33')],null))['then'](respondWithResult(_0x12a0f3,null))[_0x834e('0x22')](handleError(_0x12a0f3,null));};exports[_0x834e('0xd9')]=function(_0xbd0346,_0x17e729){if(_0xbd0346[_0x834e('0x33')]['id']){delete _0xbd0346[_0x834e('0x33')]['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0xbd0346[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](function(_0x48b6c4){if(!_0x48b6c4){logger['error'](_0x834e('0xda'),_0x834e('0xd9'),0x194,_0x834e('0xdb'));_0x17e729[_0x834e('0x2e')](0x194);}else{if(_0x48b6c4[_0x834e('0x3e')]){throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xdc'));}}return _0x48b6c4;})[_0x834e('0x2c')](function(_0x97a4b2){if(_0x97a4b2){return _0x97a4b2[_0x834e('0x2b')]({'closed':_0xbd0346[_0x834e('0x33')][_0x834e('0x40')],'disposition':_0xbd0346['body'][_0x834e('0x41')]})[_0x834e('0x2c')](function(_0x3f5b2e){return _0x3f5b2e;});}})[_0x834e('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0xbd0346['body'],client9004);})[_0x834e('0x2c')](respondWithResult(_0x17e729,null))[_0x834e('0x22')](handleError(_0x17e729,null));};exports[_0x834e('0xdd')]=function(_0x23d7e6,_0x181ecd){_0x23d7e6[_0x834e('0x33')][_0x834e('0x30')]=_0x23d7e6[_0x834e('0xde')]['originalname'];_0x23d7e6['body']['basename']=_0x23d7e6['file'][_0x834e('0xdf')];_0x23d7e6[_0x834e('0x33')][_0x834e('0x7a')]=_0x23d7e6[_0x834e('0xde')][_0x834e('0xe0')];return db[_0x834e('0xe1')][_0x834e('0xc2')](_0x23d7e6[_0x834e('0x33')])[_0x834e('0x2c')](respondWithResult(_0x181ecd,0xc9))['catch'](handleError(_0x181ecd,null));};exports['attachmentDownload']=function(_0x4d1545,_0x5dc651){return db[_0x834e('0x46')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0xbe')]['id']},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null))[_0x834e('0x2c')](function(_0xcb9751){if(_0xcb9751){if(_0xcb9751[_0x834e('0x40')]){return _0x5dc651[_0x834e('0x23')](0x193)[_0x834e('0x2a')]({'status':0x193,'message':_0x834e('0xe2')});}return db[_0x834e('0xe1')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0x4a')][_0x834e('0xe3')]},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null));}})[_0x834e('0x2c')](function(_0x5022f2){if(_0x5022f2){var _0x13f473=_0x5022f2['ChatOfflineMessageId']!==null;var _0x1f6bb9=path[_0x834e('0xe4')](config[_0x834e('0xe5')],'server/files/attachments/');if(_0x13f473){_0x1f6bb9=path[_0x834e('0xe4')](_0x1f6bb9,_0x834e('0xe6'));}var _0x4d7fef=path['join'](_0x1f6bb9,_0x5022f2[_0x834e('0xe7')]);return _0x5dc651[_0x834e('0xe8')](_0x4d7fef);}})[_0x834e('0x22')](handleError(_0x5dc651,null));};exports[_0x834e('0xe9')]=function(_0x12d468,_0x2e9116){var _0x3eb2e8=null;var _0x239a4e=null;var _0x569a80=null;if(_0x12d468[_0x834e('0x33')]['id']){delete _0x12d468[_0x834e('0x33')]['id'];}if(_0x12d468[_0x834e('0x33')][_0x834e('0xea')]){_0x569a80=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0xeb'),util['format'](_0x834e('0xec'),Date['now']()));_0x12d468['body'][_0x834e('0xed')]=_0x569a80;}return db[_0x834e('0x46')]['find']({'where':{'id':_0x12d468[_0x834e('0xbe')]['id']},'include':[{'model':db[_0x834e('0xee')],'as':'Messages','include':[{'model':db[_0x834e('0xef')],'as':_0x834e('0xef')}]}]})['then'](handleEntityNotFound(_0x2e9116,null))['then'](saveUpdates(_0x12d468[_0x834e('0x33')],null))[_0x834e('0x2c')](function(_0x4e6525){if(_0x4e6525){_0x3eb2e8=_0x4e6525;return db['ChatWebsite'][_0x834e('0x6f')]({'where':{'id':_0x3eb2e8[_0x834e('0x81')]}});}})['then'](function(_0x480290){if(_0x480290){_0x239a4e=_0x480290;return db['CmContact']['find']({'where':{'id':_0x3eb2e8[_0x834e('0x78')]}});}})['then'](function(_0x3be4c3){if(_0x3be4c3){if(_0x569a80){var _0x52cdcc=null;for(var _0x343348=0x1;_0x343348<_0x3eb2e8[_0x834e('0xf0')][_0x834e('0x50')];++_0x343348){_0x52cdcc=_0x3eb2e8[_0x834e('0xf0')][_0x343348];var _0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc[_0x834e('0x3e')]):_0x834e('0xf4');var _0x3d8abb=_0x12d468[_0x834e('0x33')][_0x834e('0xf5')]||util[_0x834e('0xf1')]('%s%d',_0x834e('0xf6'),_0x52cdcc['ContactId']);switch(_0x239a4e[_0x834e('0xf7')]){case _0x834e('0xf8'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e['agentAlias'],_0x52cdcc[_0x834e('0x3e')]):'System';break;case'agent_alias':_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xf9')]||_0x52cdcc['User'][_0x834e('0xcb')]:_0x834e('0xf4');break;case _0x834e('0xfa'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4');break;default:_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc['UserId']):_0x834e('0xf4');}var _0x121d87=util[_0x834e('0xf1')](_0x834e('0xfb'),moment(_0x52cdcc[_0x834e('0xfc')])[_0x834e('0xf1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x52cdcc[_0x834e('0xfd')]==='in'?_0x3d8abb:_0x4fabe6,_0x52cdcc[_0x834e('0x33')]);if(!_0x52cdcc[_0x834e('0xfe')]){fs[_0x834e('0xff')](_0x569a80,_0x121d87);}}return db[_0x834e('0x100')][_0x834e('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x834e('0x101')],'as':_0x834e('0x102'),'raw':!![],'include':[{'model':db[_0x834e('0x103')],'as':_0x834e('0x103'),'raw':!![]}]}]});}}})['then'](function(_0x571645){if(!_0x571645||!_0x571645[_0x834e('0x102')]||!_0x12d468['body'])return _0x3eb2e8;var _0x4094d5=_0x571645[_0x834e('0x104')]();return respondWithRpcPromise(_0x834e('0x105'),_0x834e('0x106'),{'account':_0x4094d5,'message':{'from':util[_0x834e('0xf1')](_0x834e('0x107'),_0x571645['name'],_0x571645[_0x834e('0xcc')]||_0x571645['Smtp']['user']),'to':_0x12d468['body'][_0x834e('0xea')],'subject':_0x834e('0x108'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12d468['body'][_0x834e('0xea')]),'attachments':[{'path':_0x569a80}]}})[_0x834e('0x2c')](function(){return _0x3eb2e8;})[_0x834e('0x22')](function(_0x5e0bfe){logger[_0x834e('0x1d')](_0x5e0bfe);});})[_0x834e('0x2c')](respondWithStatusCode(_0x2e9116,0xc8))[_0x834e('0x22')](handleError(_0x2e9116,null));};exports[_0x834e('0x109')]=function(_0xb9635a,_0x3c1a19){return db['ChatMessage']['find']({'where':{'id':_0xb9635a['params']['id']}})['then'](handleEntityNotFound(_0x3c1a19,null))[_0x834e('0x2c')](function(_0xf82ca8){if(_0xf82ca8){return _0xf82ca8[_0x834e('0x109')](_0xb9635a[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0xb9635a[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{});}})[_0x834e('0x2c')](respondWithResult(_0x3c1a19,null))[_0x834e('0x22')](handleError(_0x3c1a19,null));};exports[_0x834e('0x10c')]=function(_0x18735a,_0x3446ff){var _0x1e11e0={'raw':![],'where':{}};var _0x38796c={};var _0x59bd0e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x18735a[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3446ff,null))['then'](function(_0xf89b9e){if(_0xf89b9e){_0x38796c[_0x834e('0x49')]=_[_0x834e('0x4b')](db[_0x834e('0xee')][_0x834e('0x47')]);_0x38796c[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x18735a[_0x834e('0x4a')]);_0x38796c[_0x834e('0x4c')]=_['intersection'](_0x38796c[_0x834e('0x49')],_0x38796c[_0x834e('0x4a')]);_0x1e11e0[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x38796c['model'],qs[_0x834e('0x4f')](_0x18735a[_0x834e('0x4a')][_0x834e('0x4f')]));_0x1e11e0[_0x834e('0x4e')]=_0x1e11e0[_0x834e('0x4e')][_0x834e('0x50')]?_0x1e11e0[_0x834e('0x4e')]:_0x38796c[_0x834e('0x49')];if(!_0x18735a[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x1e11e0['limit']=qs[_0x834e('0x26')](_0x18735a['query'][_0x834e('0x26')]);_0x1e11e0[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x18735a[_0x834e('0x4a')][_0x834e('0x25')]);}_0x1e11e0['order']=qs[_0x834e('0x53')](_0x18735a[_0x834e('0x4a')]['sort']);_0x1e11e0['where']=qs[_0x834e('0x4c')](_['pick'](_0x18735a['query'],_0x38796c['filters']));_0x1e11e0[_0x834e('0x54')][_0x834e('0xbb')]=_0xf89b9e['id'];if(_0x18735a[_0x834e('0x4a')][_0x834e('0x8e')]){_0x1e11e0[_0x834e('0x54')]=_[_0x834e('0xa8')](_0x1e11e0[_0x834e('0x54')],{'$or':_['map'](_0x1e11e0[_0x834e('0x4e')],function(_0x278052){var _0x4a428c={};_0x4a428c[_0x278052]={'$like':'%'+_0x18735a['query'][_0x834e('0x8e')]+'%'};return _0x4a428c;})});}if(_0x18735a[_0x834e('0x4a')]['$gte']){var _0x5920f3=_0x18735a[_0x834e('0x4a')][_0x834e('0x85')][_0x834e('0x38')](',');var _0x599664={};_0x599664[_0x5920f3[0x0]]={'$gte':moment(_0x5920f3[0x1])[_0x834e('0xf1')](_0x834e('0x10e'))};_0x1e11e0[_0x834e('0x54')]=_['merge'](_0x1e11e0[_0x834e('0x54')],_0x599664);}_0x1e11e0=_['merge']({},_0x1e11e0,_0x18735a[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x1e11e0[_0x834e('0x54')]})[_0x834e('0x2c')](function(_0x516a53){_0x59bd0e[_0x834e('0x28')]=_0x516a53;if(_0x18735a[_0x834e('0x4a')][_0x834e('0xbf')]){_0x1e11e0[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')]['findAll'](_0x1e11e0);})['then'](function(_0x2ca127){_0x59bd0e[_0x834e('0x10f')]=_0x2ca127;return _0x59bd0e;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x3446ff,_0x1e11e0))['catch'](handleError(_0x3446ff,null));};exports[_0x834e('0x110')]=function(_0x2e3294,_0x28d9c3){var _0x386b73={'where':{}},_0x53faec={},_0x3cc563={'count':0x0,'rows':[]};return db[_0x834e('0x46')]['findOne']({'where':{'id':_0x2e3294[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x28d9c3,null))[_0x834e('0x2c')](function(_0x3e408c){if(_0x3e408c){_0x53faec['model']=_[_0x834e('0x4b')](db['ChatMessage'][_0x834e('0x47')]);_0x53faec[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x2e3294[_0x834e('0x4a')]);_0x53faec[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x53faec['model'],_0x53faec['query']);_0x386b73[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x53faec['model'],qs[_0x834e('0x4f')](_0x2e3294['query'][_0x834e('0x4f')]));_0x386b73[_0x834e('0x4e')]=_0x386b73[_0x834e('0x4e')][_0x834e('0x50')]?_0x386b73[_0x834e('0x4e')]:_0x53faec[_0x834e('0x49')];if(!_0x2e3294[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x386b73[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x26')]);_0x386b73['offset']=qs[_0x834e('0x25')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x25')]);}_0x386b73['order']=qs['sort'](_0x2e3294['query'][_0x834e('0x53')]);_0x386b73[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x2e3294[_0x834e('0x4a')],_0x53faec[_0x834e('0x4c')]));_0x386b73[_0x834e('0x54')][_0x834e('0xbb')]=_0x3e408c['id'];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]){_0x386b73[_0x834e('0x54')]=_['merge'](_0x386b73[_0x834e('0x54')],{'$or':_[_0x834e('0x45')](_0x386b73[_0x834e('0x4e')],function(_0x26534d){var _0x4081a1={};_0x4081a1[_0x26534d]={'$like':'%'+_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]+'%'};return _0x4081a1;})});}_0x386b73[_0x834e('0x54')]['secret']=![];if(_0x2e3294[_0x834e('0x4a')]['id']){_0x386b73[_0x834e('0x54')]['id']={'$gt':_0x2e3294['query']['id']};}_0x386b73=_[_0x834e('0xa8')]({},_0x386b73,_0x2e3294[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x386b73['where']})['then'](function(_0x3d37c8){_0x3cc563['count']=_0x3d37c8;_0x386b73[_0x834e('0xc0')]=[];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x111')]){_0x386b73[_0x834e('0xc0')][_0x834e('0xbc')]({'model':db['User'],'as':_0x834e('0xef'),'attributes':['id','fullname','alias']});}if(_0x2e3294[_0x834e('0x4a')][_0x834e('0xbf')]){_0x386b73[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')][_0x834e('0x112')](_0x386b73);})[_0x834e('0x2c')](function(_0x5912ee){_0x3cc563[_0x834e('0x10f')]=_0x5912ee;return _0x3cc563;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x28d9c3,_0x386b73))['catch'](handleError(_0x28d9c3,null));};exports[_0x834e('0x113')]=function(_0x3b4264,_0x4b070a){return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x3b4264['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x4b070a,null))[_0x834e('0x2c')](function(_0x164170){if(_0x164170){return _0x164170[_0x834e('0x114')](_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0x3b4264[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{})[_0x834e('0x115')](function(){return db['Tag'][_0x834e('0x112')]({'attributes':['id',_0x834e('0x30'),_0x834e('0x57')],'where':{'id':_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')]}});})[_0x834e('0x2c')](function(_0x2d61c1){socket[_0x834e('0x116')](_0x834e('0x117'),{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]});return{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]};});}})[_0x834e('0x2c')](respondWithResult(_0x4b070a,null))['catch'](handleError(_0x4b070a,null));};exports[_0x834e('0x118')]=function(_0x1cd122,_0x49be08){return db['ChatInteraction']['find']({'where':{'id':_0x1cd122[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x49be08,null))[_0x834e('0x2c')](function(_0x3530bc){if(_0x3530bc){return _0x3530bc[_0x834e('0x118')](_0x1cd122[_0x834e('0x4a')][_0x834e('0x10a')]);}})['then'](respondWithStatusCode(_0x49be08,null))['catch'](handleError(_0x49be08,null));};exports['download']=function(_0x47947b,_0x684a97){var _0x3c8fc2=moment()[_0x834e('0x119')]()['toString']();var _0x5776c5=path['join'](config[_0x834e('0xe5')],'server','files',_0x834e('0x11a'));var _0x378bf3=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x11c'),_0x834e('0x11d'));var _0x59a706=path[_0x834e('0xe4')](_0x5776c5,_0x3c8fc2);var _0x11f472=util[_0x834e('0xf1')](_0x834e('0x11e'),_0x47947b[_0x834e('0xbe')]['id'],_0x3c8fc2);var _0x488f82=path[_0x834e('0xe4')](_0x5776c5,_0x11f472);var _0x5a3876=[];_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xef')],'as':_0x834e('0xef'),'attributes':['id','fullname'],'raw':!![]});_0x5a3876['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x834e('0x11f'),_0x834e('0x120')],'raw':!![]});if(_0x47947b['query']['attachments']){_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xe1')],'as':_0x834e('0xe1'),'raw':!![]});}var _0x51f527=[{'model':db[_0x834e('0xee')],'as':_0x834e('0xf0'),'attributes':['id',_0x834e('0x33'),'createdAt',_0x834e('0xfd'),_0x834e('0xfe'),_0x834e('0x89')],'include':_0x5a3876}];_0x51f527[_0x834e('0xbc')]({'model':db[_0x834e('0xc6')],'as':_0x834e('0x121'),'attributes':['id',_0x834e('0x30')]});_0x51f527['push']({'model':db[_0x834e('0xef')],'as':_0x834e('0x122'),'attributes':['id',_0x834e('0xcb')]});return db['ChatInteraction'][_0x834e('0x6f')]({'where':{'id':_0x47947b[_0x834e('0xbe')]['id']},'include':_0x51f527})[_0x834e('0x2c')](handleEntityNotFound(_0x684a97,null))[_0x834e('0x2c')](function(_0x2bbb1a){if(_0x2bbb1a){var _0x1ffed9=_0x2bbb1a[_0x834e('0x123')]({'plain':!![]});fs[_0x834e('0x124')](_0x59a706);var _0x25fa75={'channel':_0x834e('0x125'),'account':_0x1ffed9[_0x834e('0x121')][_0x834e('0x30')],'agent':_0x1ffed9['Owner']?_0x1ffed9[_0x834e('0x122')]['fullname']:_0x834e('0x126'),'createdAt':moment(_0x1ffed9['createdAt'])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'closedAt':_0x1ffed9[_0x834e('0x40')]?moment(_0x1ffed9[_0x834e('0x127')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')]():'','disposition':_0x1ffed9['disposition'],'chatInfo':{'browser':_0x1ffed9['browserName'],'os':_0x1ffed9['osName'],'referer':_0x1ffed9[_0x834e('0x128')],'customerIp':_0x1ffed9[_0x834e('0x129')],'customerPort':_0x1ffed9[_0x834e('0x12a')]?_0x1ffed9[_0x834e('0x12a')]:_0x834e('0x126')},'messages':_(_0x1ffed9[_0x834e('0xf0')])[_0x834e('0x12b')]()[_0x834e('0x8e')]({'secret':![]})['map'](function(_0x5a312e){if(_0x5a312e[_0x834e('0xe1')]){var _0x42e5ee=path[_0x834e('0xe4')](_0x378bf3,_0x5a312e['Attachment']['basename']);if(fs[_0x834e('0x12c')](_0x42e5ee)){fs['createReadStream'](_0x42e5ee)[_0x834e('0x12d')](fs[_0x834e('0x12e')](path[_0x834e('0xe4')](_0x59a706,_0x5a312e['Attachment'][_0x834e('0xe7')])));}}return{'date':moment(_0x5a312e[_0x834e('0xfc')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'sender':_0x5a312e[_0x834e('0xfd')]===_0x834e('0xd5')?_0x5a312e['User']?_0x5a312e[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4'):_0x5a312e[_0x834e('0x73')][_0x834e('0x11f')]+(_0x5a312e[_0x834e('0x73')][_0x834e('0x120')]?'\x20'+_0x5a312e['Contact']['lastName']:''),'body':_0x5a312e[_0x834e('0xe1')]?_0x5a312e['Attachment']['basename']:_0x5a312e[_0x834e('0x33')],'direction':_0x5a312e[_0x834e('0xfd')]==='out'?'A':'C','secret':_0x5a312e[_0x834e('0xfe')],'read':_0x5a312e['read'],'attachment':_0x5a312e['Attachment']};})[_0x834e('0x75')]()};return ejs['renderFile'](path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x12f'),_0x834e('0x130')),{'interaction':_0x25fa75})[_0x834e('0x2c')](function(_0x1a48f9){var _0x196f86=path[_0x834e('0xe4')](_0x59a706,'transcript-'+_0x1ffed9['id']+'-'+_0x3c8fc2+_0x834e('0x131'));var _0x19a42c={'path':_0x196f86,'channel':_0x834e('0x125'),'interactionId':_0x1ffed9['id']};return pdf[_0x834e('0x132')](_0x1a48f9,_0x19a42c);})['then'](function(){return new Promise(function(_0x4b1178,_0x46e533){zipdir(_0x59a706,{'saveTo':_0x488f82},function(_0x13a7e1,_0x5d801a){if(_0x13a7e1)return _0x46e533(_0x13a7e1);return _0x4b1178(_0x5d801a);});})[_0x834e('0x2c')](function(){return new BPromise(function(_0x505821,_0x2f46cf){rimraf(_0x59a706,function(_0x884f38){if(_0x884f38)_0x2f46cf(_0x884f38);return _0x505821();});});})[_0x834e('0x2c')](function(){return _0x684a97[_0x834e('0xe8')](_0x488f82,_0x11f472,function(_0xd7026f){if(_0xd7026f){logger[_0x834e('0x1d')]('err',_0xd7026f);}else{fs['unlinkSync'](_0x488f82);}});});});}else{return _0x684a97['sendStatus'](0xc8);}})[_0x834e('0x22')](handleError(_0x684a97,null));};
\ No newline at end of file
+var _0xd0bb=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','text','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','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','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','toString','count','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','includeAll','include','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','attachmentDownload','Unauthorized','Attachment','ChatOfflineMessageId','join','root','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','agentAlias','customer','Visitor','System','agent_alias','alias','agent_fullname','%s%d','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','server','files','transcript-%d-%s.zip','firstName','attachments','Owner','Chat','Account','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','catch','waiting','talking','answered','abandoned','total','closed','UserId','disposition','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','union'];(function(_0x35524d,_0x210701){var _0x56d59b=function(_0x45aa91){while(--_0x45aa91){_0x35524d['push'](_0x35524d['shift']());}};_0x56d59b(++_0x210701);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x2e1d7c,_0x1742f0){_0x2e1d7c=_0x2e1d7c-0x0;var _0x4508b9=_0xd0bb[_0x2e1d7c];return _0x4508b9;};'use strict';var rimraf=require(_0xbd0b('0x0'));var zipdir=require(_0xbd0b('0x1'));var rp=require(_0xbd0b('0x2'));var moment=require('moment');var BPromise=require(_0xbd0b('0x3'));var Mustache=require('mustache');var util=require(_0xbd0b('0x4'));var path=require(_0xbd0b('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbd0b('0x6'));var squel=require('squel');var Redis=require(_0xbd0b('0x7'));var qs=require(_0xbd0b('0x8'));var as=require(_0xbd0b('0x9'));var pdf=require(_0xbd0b('0xa'));var logger=require(_0xbd0b('0xb'))('api');var config=require(_0xbd0b('0xc'));var db=require(_0xbd0b('0xd'))['db'];config[_0xbd0b('0xe')]=_[_0xbd0b('0xf')](config[_0xbd0b('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd0b('0xe')]));require(_0xbd0b('0x10'))['register'](socket);var jayson=require(_0xbd0b('0x11'));var client=jayson[_0xbd0b('0x12')]['http']({'port':0x232b});var client9004=jayson[_0xbd0b('0x12')][_0xbd0b('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x3a4b28,_0x315ed9,_0x2621bf,_0x42a96b){return new BPromise(function(_0x420f96,_0x1f25b6){var _0x1a55ab=_0x42a96b||client;return _0x1a55ab[_0xbd0b('0x14')](_0x3a4b28,_0x2621bf)[_0xbd0b('0x15')](function(_0x57077a){logger[_0xbd0b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x315ed9,'request\x20sent');logger[_0xbd0b('0x17')](_0xbd0b('0x18'),_0x315ed9,_0xbd0b('0x19'),JSON[_0xbd0b('0x1a')](_0x57077a));if(_0x57077a[_0xbd0b('0x1b')]){if(_0x57077a['error']['code']===0x1f4){logger[_0xbd0b('0x1b')](_0xbd0b('0x1c'),_0x315ed9,_0x57077a[_0xbd0b('0x1b')][_0xbd0b('0x1d')]);return _0x1f25b6(_0x57077a[_0xbd0b('0x1b')][_0xbd0b('0x1d')]);}logger['error'](_0xbd0b('0x1c'),_0x315ed9,_0x57077a['error'][_0xbd0b('0x1d')]);return _0x420f96(_0x57077a[_0xbd0b('0x1b')][_0xbd0b('0x1d')]);}else{logger[_0xbd0b('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x315ed9,_0xbd0b('0x19'));_0x420f96(_0x57077a[_0xbd0b('0x1e')][_0xbd0b('0x1d')]);}})['catch'](function(_0x1c5b52){logger['error'](_0xbd0b('0x1c'),_0x315ed9,_0x1c5b52);_0x1f25b6(_0x1c5b52);});});}function respondWithStatusCode(_0x3c4938,_0x3bbc03){_0x3bbc03=_0x3bbc03||0xcc;return function(_0x17a92a){if(_0x17a92a){return _0x3c4938[_0xbd0b('0x1f')](_0x3bbc03);}return _0x3c4938['status'](_0x3bbc03)[_0xbd0b('0x20')]();};}function respondWithResult(_0x58a721,_0x3e7e9c){_0x3e7e9c=_0x3e7e9c||0xc8;return function(_0x18b9dc){if(_0x18b9dc){return _0x58a721[_0xbd0b('0x21')](_0x3e7e9c)[_0xbd0b('0x22')](_0x18b9dc);}};}function respondWithFilteredResult(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(_0x4fe9ed){var _0x382f76=typeof _0xb06342[_0xbd0b('0x23')]===_0xbd0b('0x24')&&typeof _0xb06342[_0xbd0b('0x25')]===_0xbd0b('0x24');var _0x122893=_0x4fe9ed['count'];var _0x149403=_0x382f76?0x0:_0xb06342[_0xbd0b('0x23')];var _0x82d326=_0x382f76?_0x4fe9ed['count']:_0xb06342['offset']+_0xb06342[_0xbd0b('0x25')];var _0x684b09;if(_0x82d326>=_0x122893){_0x82d326=_0x122893;_0x684b09=0xc8;}else{_0x684b09=0xce;}_0xfd9f82[_0xbd0b('0x21')](_0x684b09);return _0xfd9f82[_0xbd0b('0x26')](_0xbd0b('0x27'),_0x149403+'-'+_0x82d326+'/'+_0x122893)[_0xbd0b('0x22')](_0x4fe9ed);}return null;};}function saveUpdates(_0x41e083){return function(_0x4bc752){if(_0x4bc752){return _0x4bc752[_0xbd0b('0x28')](_0x41e083)[_0xbd0b('0x15')](function(_0x5e1cb3){return _0x5e1cb3;});}return null;};}function removeEntity(_0x5e5e69){return function(_0x206c6a){if(_0x206c6a){return _0x206c6a[_0xbd0b('0x29')]()['then'](function(){_0x5e5e69[_0xbd0b('0x21')](0xcc)[_0xbd0b('0x20')]();});}};}function handleEntityNotFound(_0x431e51){return function(_0x417e25){if(!_0x417e25){_0x431e51[_0xbd0b('0x1f')](0x194);}return _0x417e25;};}function handleError(_0x27c478,_0x5f224e){_0x5f224e=_0x5f224e||0x1f4;return function(_0x2c8e69){logger[_0xbd0b('0x1b')](_0x2c8e69[_0xbd0b('0x2a')]);if(_0x2c8e69[_0xbd0b('0x2b')]){delete _0x2c8e69[_0xbd0b('0x2b')];}_0x27c478[_0xbd0b('0x21')](_0x5f224e)[_0xbd0b('0x2c')](_0x2c8e69);};}function getMustacheRender(_0x1029a0,_0x10e06b){return Mustache[_0xbd0b('0x2d')](_0x1029a0,_[_0xbd0b('0x2e')](_0x10e06b[_0xbd0b('0x2f')],{'contact':_0x10e06b[_0xbd0b('0x30')],'message':_0x10e06b[_0xbd0b('0x1d')],'agent':_0x10e06b['agent'],'interaction':_0x10e06b[_0xbd0b('0x31')],'account':_0x10e06b[_0xbd0b('0x32')]}))||'';}function getInteractionUsers(_0x545f59,_0x44b09e){return new BPromise(function(_0x1145b6,_0x19957a){try{if(_0x44b09e[_0x545f59['id']]){_0x545f59[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x44b09e[_0x545f59['id']],function(_0x288715){return{'id':_0x288715['id'],'fullname':_0x288715['fullname']};});}}catch(_0x327425){_0x19957a(_0x327425);}_0x1145b6(_0x545f59);});}function getInteractionTags(_0x11cf5a,_0x3b5098){return new BPromise(function(_0x2597ab,_0x6ef6ed){try{if(_0x11cf5a['TagIds']){_0x11cf5a['Tags']=[];_0x11cf5a[_0xbd0b('0x35')][_0xbd0b('0x36')](',')[_0xbd0b('0x37')](function(_0x2ac653){_0x11cf5a['Tags']['push'](_0x3b5098[_0x2ac653]);});}delete _0x11cf5a[_0xbd0b('0x35')];}catch(_0x4d8237){_0x6ef6ed(_0x4d8237);}_0x2597ab(_0x11cf5a);});}function updateChatInteraction(_0x27f973,_0x27bdc5,_0x3f34dc){return new BPromise(function(_0x297ddb,_0x3e2ad9){return getInteractionUsers(_0x27f973,_0x3f34dc)[_0xbd0b('0x15')](function(_0x43115e){return getInteractionTags(_0x43115e,_0x27bdc5);})[_0xbd0b('0x15')](function(_0x2acc9f){return getStateInteraction(_0x2acc9f);})[_0xbd0b('0x15')](function(_0x16a40c){_0x297ddb(_0x16a40c);})[_0xbd0b('0x38')](function(_0x2a6e4a){_0x3e2ad9(_0x2a6e4a);});});}function getStateInteraction(_0x425c8a){return new BPromise(function(_0x11b1a0){_0x425c8a[_0xbd0b('0x39')]=0x0;_0x425c8a[_0xbd0b('0x3a')]=0x0;_0x425c8a[_0xbd0b('0x3b')]=0x0;_0x425c8a['unmanaged']=0x0;_0x425c8a[_0xbd0b('0x3c')]=0x0;_0x425c8a[_0xbd0b('0x3d')]=0x0;if(!_0x425c8a[_0xbd0b('0x3e')]&&!_0x425c8a[_0xbd0b('0x3f')]){_0x425c8a[_0xbd0b('0x39')]+=0x1;}if(!_0x425c8a[_0xbd0b('0x3e')]&&_0x425c8a[_0xbd0b('0x3f')]){_0x425c8a[_0xbd0b('0x3a')]+=0x1;if(_0x425c8a[_0xbd0b('0x39')]){_0x425c8a[_0xbd0b('0x39')]-=0x1;}}if(_0x425c8a[_0xbd0b('0x3e')]&&_0x425c8a[_0xbd0b('0x40')]==='abandoned'){_0x425c8a[_0xbd0b('0x3c')]+=0x1;if(_0x425c8a['waiting']){_0x425c8a['waiting']-=0x1;}}else if(_0x425c8a[_0xbd0b('0x3e')]&&!_0x425c8a[_0xbd0b('0x3f')]&&_0x425c8a[_0xbd0b('0x40')]){_0x425c8a['unmanaged']+=0x1;if(_0x425c8a[_0xbd0b('0x39')]){_0x425c8a[_0xbd0b('0x39')]-=0x1;}}else if(_0x425c8a[_0xbd0b('0x3e')]&&_0x425c8a[_0xbd0b('0x3f')]){_0x425c8a[_0xbd0b('0x3b')]+=0x1;if(_0x425c8a['talking']){_0x425c8a[_0xbd0b('0x3a')]-=0x1;}}_0x425c8a[_0xbd0b('0x3d')]+=0x1;_0x11b1a0(_0x425c8a);});}exports[_0xbd0b('0x41')]=function(_0x43e626,_0x102147){var _0xaaefaa={},_0x480c00={},_0x335728={'count':0x0,'rows':[]};var _0xaeb8b6=_[_0xbd0b('0x34')](db[_0xbd0b('0x42')][_0xbd0b('0x43')],function(_0x35bed3){return{'name':_0x35bed3[_0xbd0b('0x44')],'type':_0x35bed3[_0xbd0b('0x45')][_0xbd0b('0x46')]};});_0x480c00[_0xbd0b('0x47')]=_[_0xbd0b('0x34')](_0xaeb8b6,_0xbd0b('0x2b'));_0x480c00[_0xbd0b('0x48')]=_[_0xbd0b('0x49')](_0x43e626[_0xbd0b('0x48')]);_0x480c00[_0xbd0b('0x4a')]=_[_0xbd0b('0x4b')](_0x480c00[_0xbd0b('0x47')],_0x480c00[_0xbd0b('0x48')]);_0xaaefaa[_0xbd0b('0x4c')]=_[_0xbd0b('0x4b')](_0x480c00[_0xbd0b('0x47')],qs[_0xbd0b('0x4d')](_0x43e626['query'][_0xbd0b('0x4d')]));_0xaaefaa[_0xbd0b('0x4c')]=_0xaaefaa['attributes']['length']?_0xaaefaa['attributes']:_0x480c00[_0xbd0b('0x47')];if(!_0x43e626['query'][_0xbd0b('0x4e')](_0xbd0b('0x4f'))){_0xaaefaa[_0xbd0b('0x25')]=qs[_0xbd0b('0x25')](_0x43e626['query'][_0xbd0b('0x25')]);_0xaaefaa['offset']=qs[_0xbd0b('0x23')](_0x43e626['query']['offset']);}_0xaaefaa[_0xbd0b('0x50')]=qs[_0xbd0b('0x51')](_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x51')]);_0xaaefaa[_0xbd0b('0x52')]=qs[_0xbd0b('0x4a')](_[_0xbd0b('0x53')](_0x43e626[_0xbd0b('0x48')],_0x480c00['filters']),_0xaeb8b6);var _0x48a78c=[];var _0x2d13fd=squel[_0xbd0b('0x54')]()['field']('id')['field'](_0xbd0b('0x2b'))[_0xbd0b('0x55')](_0xbd0b('0x56'))[_0xbd0b('0x57')]('tools_tags');var _0x444f7d=squel[_0xbd0b('0x54')]()[_0xbd0b('0x55')](_0xbd0b('0x58'))['field'](_0xbd0b('0x59'))[_0xbd0b('0x55')]('ui.ChatInteractionId')[_0xbd0b('0x57')](_0xbd0b('0x5a'),'ui')[_0xbd0b('0x5b')](_0xbd0b('0x5c'),'u',_0xbd0b('0x5d'));var _0x2c86eb=squel[_0xbd0b('0x54')]()[_0xbd0b('0x57')]('chat_interactions','i')[_0xbd0b('0x5b')](_0xbd0b('0x5e'),'c',_0xbd0b('0x5f'))[_0xbd0b('0x5b')](_0xbd0b('0x5c'),'o',_0xbd0b('0x60'))['left_join']('chat_websites','a',_0xbd0b('0x61'))[_0xbd0b('0x5b')]('chat_messages','me',_0xbd0b('0x62'))[_0xbd0b('0x5b')](_0xbd0b('0x63'),'it',_0xbd0b('0x64'))[_0xbd0b('0x5b')]('tools_tags','t',_0xbd0b('0x65'));var _0xcc2012=squel[_0xbd0b('0x66')]();var _0x26a7d9=[];var _0x3fe55a=squel[_0xbd0b('0x66')]();var _0x19e3c0;if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x67')]){_0x19e3c0=as[_0xbd0b('0x68')](_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x67')]);var _0x20502d=_0x19e3c0[_0xbd0b('0x69')];for(var _0x164a2e=0x0;_0x164a2e<_0x19e3c0[_0xbd0b('0x6a')][_0xbd0b('0x6b')];_0x164a2e++){var _0x5363eb=_0x19e3c0[_0xbd0b('0x6a')][_0x164a2e];var _0x3f6f14='i';var _0x319ee8=_[_0xbd0b('0x6c')](_0xaeb8b6,['name',_0x5363eb['field']]);if(!_0x319ee8){switch(_0x5363eb[_0xbd0b('0x55')]){case _0xbd0b('0x6d'):if(_0x5363eb[_0xbd0b('0x6e')]==0x1){_0x2c86eb[_0xbd0b('0x6f')]('`'+_0x5363eb[_0xbd0b('0x55')]+'`\x20=\x200');}else{_0x2c86eb[_0xbd0b('0x6f')]('`'+_0x5363eb['field']+_0xbd0b('0x70'));}break;case _0xbd0b('0x71'):if(_0x5363eb[_0xbd0b('0x72')]===_0xbd0b('0x73')){if(_0x5363eb[_0xbd0b('0x6e')][_0xbd0b('0x36')]('\x20')['length']>0x1){_0xcc2012[_0x20502d](_0xbd0b('0x74'),qs[_0xbd0b('0x75')](_0x5363eb[_0xbd0b('0x6e')]),null);}else{var _0x33313a='%'+_0x5363eb['value']+'%';_0xcc2012[_0x20502d](_0xbd0b('0x76'),_0x33313a,_0x33313a,_0x33313a);}}else{_0x319ee8=_[_0xbd0b('0x6c')](_0xaeb8b6,[_0xbd0b('0x2b'),_0xbd0b('0x77')]);_0x5363eb[_0xbd0b('0x55')]='ContactId';_0x3dd85f=as['buildExpression'](_0x3f6f14,_0x319ee8[_0xbd0b('0x45')],_0x5363eb);_0xcc2012[_0x20502d](_0x3dd85f['text'],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x78')],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x20')]);}break;case _0xbd0b('0x79'):var _0x42d8ed=_0x5363eb['value'][_0xbd0b('0x36')](',')['map'](function(_0x271463){return Number(_0x271463);});_0x42d8ed['forEach'](function(_0x4f2d7c){_0x3fe55a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f2d7c+',%');});_0x26a7d9=_[_0xbd0b('0x7a')](_0x26a7d9,_0x42d8ed);break;case'User':if(_0x5363eb['operator']===_0xbd0b('0x73')){_0xcc2012[_0x20502d](_0xbd0b('0x7b'),'%'+_0x5363eb['value']+'%',null);}else{_0x319ee8=_[_0xbd0b('0x6c')](_0xaeb8b6,['name','UserId']);_0x5363eb[_0xbd0b('0x55')]=_0xbd0b('0x3f');_0x3dd85f=as[_0xbd0b('0x7c')](_0x3f6f14,_0x319ee8[_0xbd0b('0x45')],_0x5363eb);_0xcc2012[_0x20502d](_0x3dd85f[_0xbd0b('0x7d')],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x78')],_0x3dd85f[_0xbd0b('0x6e')]['end']);}break;case'body':_0x3dd85f=as[_0xbd0b('0x7c')]('me',null,_0x5363eb);_0xcc2012[_0x20502d](_0x3dd85f['text'],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x78')],_0x3dd85f[_0xbd0b('0x6e')]['end']);break;}}else{var _0x3dd85f=as[_0xbd0b('0x7c')](_0x3f6f14,_0x319ee8['type'],_0x5363eb);_0xcc2012[_0x20502d](_0x3dd85f[_0xbd0b('0x7d')],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x78')],_0x3dd85f[_0xbd0b('0x6e')][_0xbd0b('0x20')]);}}}else{var _0x5e7d6a=_(_0x43e626[_0xbd0b('0x48')])[_0xbd0b('0x49')]()[_0xbd0b('0x34')](function(_0x2db3a0){return _['some'](_0xaeb8b6,[_0xbd0b('0x2b'),_0x2db3a0])?_0x2db3a0:undefined;})[_0xbd0b('0x7e')]()['value']();if(!_[_0xbd0b('0x7f')](_0x5e7d6a)){_0x5e7d6a['forEach'](function(_0x39c327){if(_0x39c327===_0xbd0b('0x80')){_0x2c86eb[_0xbd0b('0x52')](_0xbd0b('0x81'),[][_0xbd0b('0x82')](_0x43e626['query'][_0x39c327]));}else if(_0x39c327==='createdAt'){var _0x4ccc9e=JSON[_0xbd0b('0x83')](_0x43e626[_0xbd0b('0x48')][_0x39c327])[_0xbd0b('0x84')];var _0x4f3b37=JSON[_0xbd0b('0x83')](_0x43e626[_0xbd0b('0x48')][_0x39c327])[_0xbd0b('0x85')];_0x2c86eb[_0xbd0b('0x52')](_0xbd0b('0x86'),_0x4ccc9e,_0x4f3b37);}else{if(_0x43e626['query'][_0x39c327]===_0xbd0b('0x87')){_0x2c86eb['where']('i.'+_0x39c327+_0xbd0b('0x88'));}else{_0x2c86eb[_0xbd0b('0x52')]('i.'+_0x39c327+_0xbd0b('0x89'),_0x43e626[_0xbd0b('0x48')][_0x39c327]);}}});}if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8a')]){if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8a')]==0x1){_0x2c86eb[_0xbd0b('0x6f')](_0xbd0b('0x8b'));}else{_0x2c86eb['having'](_0xbd0b('0x8c'));}}if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8d')]){_0x26a7d9=_[_0xbd0b('0x8e')](_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8d')])?_0x43e626[_0xbd0b('0x48')]['tag']:new Array(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x8d')]);_0x26a7d9[_0xbd0b('0x37')](function(_0x568ce5){_0x3fe55a['or'](_0xbd0b('0x8f'),'%,'+_0x568ce5+',%');});}if(_0x43e626['query'][_0xbd0b('0x90')]){var _0x1c81d6=_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x90')][_0xbd0b('0x91')]('\x5c','\x5c\x5c')[_0xbd0b('0x91')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1c81d6)){_0xcc2012['or'](_0xbd0b('0x92'),_0x1c81d6+'%');}else{_0xcc2012['or'](_0xbd0b('0x93'),qs[_0xbd0b('0x75')](_0x1c81d6))['or'](_0xbd0b('0x94'),_0x1c81d6+'%');}}}_0x2c86eb['where'](_0xcc2012);_0x2c86eb[_0xbd0b('0x95')]('i.id');var _0x17dd54={'type':db[_0xbd0b('0x96')][_0xbd0b('0x97')][_0xbd0b('0x98')],'raw':!![]};var _0x107275=_0x2c86eb[_0xbd0b('0x99')]();_0x107275[_0xbd0b('0x55')](_0xbd0b('0x9a'));_0x107275[_0xbd0b('0x55')](_0xbd0b('0x9b'),_0xbd0b('0x6d'));if(_0xaaefaa[_0xbd0b('0x50')]){_0xaaefaa[_0xbd0b('0x50')]['forEach'](function(_0x39740c){var _0x2a86f5=_0x39740c[0x0]===_0xbd0b('0x9c')?_0x39740c[0x0]:'i.'+_0x39740c[0x0];_0x2c86eb[_0xbd0b('0x50')](_0x2a86f5,_0x39740c[0x1]===_0xbd0b('0x9d')?![]:!![]);});}if(!_[_0xbd0b('0x7f')](_0x26a7d9)){_0x2c86eb[_0xbd0b('0x6f')](_0x3fe55a);_0x107275[_0xbd0b('0x52')](_0xbd0b('0x9e'),_0x26a7d9);}BPromise[_0xbd0b('0x9f')]()[_0xbd0b('0x15')](function(){if(!_0x19e3c0){if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x80')])return;_0x107275['where'](_0xbd0b('0xa0'));_0x2c86eb[_0xbd0b('0x52')](_0xbd0b('0xa0'));return;}if(_0x43e626[_0xbd0b('0xa1')]['role']!==_0xbd0b('0xa2'))return;return _0x43e626[_0xbd0b('0xa1')][_0xbd0b('0xa3')]({'attributes':['id'],'raw':!![]})[_0xbd0b('0x15')](function(_0x114906){if(_['isEmpty'](_0x114906)){_0x107275['where'](_0xbd0b('0xa4'));_0x2c86eb[_0xbd0b('0x52')](_0xbd0b('0xa4'));}else{_0x107275['where'](_0xbd0b('0x81'),_[_0xbd0b('0x34')](_0x114906,'id'));_0x2c86eb[_0xbd0b('0x52')]('i.ChatWebsiteId\x20IN\x20?',_[_0xbd0b('0x34')](_0x114906,'id'));}});})['then'](function(){if(_0x43e626['user'][_0xbd0b('0xa5')]==='agent'&&!_0x19e3c0&&!_0x43e626['query'][_0xbd0b('0x80')])return[];return db['sequelize'][_0xbd0b('0x48')](_0x107275[_0xbd0b('0xa6')](),_0x17dd54);})['then'](function(_0x1ddc8c){_0x335728[_0xbd0b('0xa7')]=_0x1ddc8c[_0xbd0b('0x6b')];if(_0x335728[_0xbd0b('0xa7')]===0x0)return[];return db[_0xbd0b('0xa8')]['query'](_0x2d13fd[_0xbd0b('0xa6')](),_0x17dd54)[_0xbd0b('0x15')](function(_0x534b7b){_0x48a78c=_[_0xbd0b('0xa9')](_0x534b7b,'id');_0x17dd54=_[_0xbd0b('0x2e')](_0x17dd54,{'model':db[_0xbd0b('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43e626[_0xbd0b('0x48')][_0xbd0b('0x4d')]){_0xaaefaa[_0xbd0b('0x4c')]['forEach'](function(_0x3d3ab8){_0x2c86eb[_0xbd0b('0x55')]('i.'+_0x3d3ab8);});}else{_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0x9b'),_0xbd0b('0x6d'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xaa'),_0xbd0b('0xab'));_0x2c86eb[_0xbd0b('0x55')]('a.mandatoryDisposition',_0xbd0b('0xac'));_0x2c86eb['field'](_0xbd0b('0xad'),_0xbd0b('0x9c'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xae'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xaf'),_0xbd0b('0xb0'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xb1'),_0xbd0b('0xb2'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xb3'),'Contact.email');_0x2c86eb[_0xbd0b('0x55')]('c.phone',_0xbd0b('0xb4'));_0x2c86eb[_0xbd0b('0x55')]('c.mobile',_0xbd0b('0xb5'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xb6'),_0xbd0b('0xb7'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xb8'),_0xbd0b('0xb9'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xba'),_0xbd0b('0xbb'));_0x2c86eb[_0xbd0b('0x55')](_0xbd0b('0xbc'),'TagIds');}if(_0xaaefaa[_0xbd0b('0x25')])_0x2c86eb[_0xbd0b('0x25')](_0xaaefaa['limit']);if(_0xaaefaa[_0xbd0b('0x23')])_0x2c86eb[_0xbd0b('0x23')](_0xaaefaa['offset']);return db[_0xbd0b('0xa8')]['query'](_0x2c86eb[_0xbd0b('0xa6')](),_0x17dd54);})['then'](function(_0x240a5a){if(_0x240a5a[_0xbd0b('0x6b')]>0x0)_0x444f7d[_0xbd0b('0x52')](_0xbd0b('0xbd'),_[_0xbd0b('0x34')](_0x240a5a,'id'));return db[_0xbd0b('0xa8')]['query'](_0x444f7d['toString'](),_0x17dd54)[_0xbd0b('0x15')](function(_0x2d8514){var _0x1bd048=_[_0xbd0b('0xbe')](_0x2d8514,_0xbd0b('0xbf'));var _0x21ce06=[];_0x240a5a[_0xbd0b('0x37')](function(_0x5f5205){_0x21ce06[_0xbd0b('0xc0')](updateChatInteraction(_0x5f5205,_0x48a78c,_0x1bd048));});return BPromise[_0xbd0b('0xc1')](_0x21ce06);});});})[_0xbd0b('0x15')](function(_0x4d14f7){_0x335728[_0xbd0b('0xc2')]=_0x4d14f7;return _0x335728;})[_0xbd0b('0x15')](respondWithFilteredResult(_0x102147,_0xaaefaa))[_0xbd0b('0x38')](handleError(_0x102147,null));};exports['show']=function(_0x37e5d9,_0x535609){var _0x1131ab={'raw':![],'where':{'id':_0x37e5d9[_0xbd0b('0xc3')]['id']}},_0x198f62={};_0x198f62[_0xbd0b('0x47')]=_['keys'](db['ChatInteraction'][_0xbd0b('0x43')]);_0x198f62['query']=_[_0xbd0b('0x49')](_0x37e5d9['query']);_0x198f62['filters']=_[_0xbd0b('0x4b')](_0x198f62[_0xbd0b('0x47')],_0x198f62[_0xbd0b('0x48')]);_0x1131ab[_0xbd0b('0x4c')]=_['intersection'](_0x198f62[_0xbd0b('0x47')],qs[_0xbd0b('0x4d')](_0x37e5d9[_0xbd0b('0x48')][_0xbd0b('0x4d')]));_0x1131ab['attributes']=_0x1131ab[_0xbd0b('0x4c')][_0xbd0b('0x6b')]?_0x1131ab[_0xbd0b('0x4c')]:_0x198f62[_0xbd0b('0x47')];if(_0x37e5d9['query'][_0xbd0b('0xc4')]){_0x1131ab[_0xbd0b('0xc5')]=[{'all':!![]}];}_0x1131ab=_[_0xbd0b('0x2e')]({},_0x1131ab,_0x37e5d9['options']);return db[_0xbd0b('0x42')][_0xbd0b('0x6c')](_0x1131ab)[_0xbd0b('0x15')](handleEntityNotFound(_0x535609,null))[_0xbd0b('0x15')](respondWithResult(_0x535609,null))[_0xbd0b('0x38')](handleError(_0x535609,null));};exports[_0xbd0b('0xc6')]=function(_0x367240,_0x2bd438){return db[_0xbd0b('0x42')][_0xbd0b('0xc6')](_0x367240['body'],{})['then'](respondWithResult(_0x2bd438,0xc9))[_0xbd0b('0x38')](handleError(_0x2bd438,null));};exports[_0xbd0b('0x28')]=function(_0x49a091,_0x269f34){if(_0x49a091[_0xbd0b('0x2f')]['id']){delete _0x49a091[_0xbd0b('0x2f')]['id'];}return db[_0xbd0b('0x42')]['find']({'where':{'id':_0x49a091['params']['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x269f34,null))[_0xbd0b('0x15')](saveUpdates(_0x49a091[_0xbd0b('0x2f')],null))['then'](respondWithResult(_0x269f34,null))[_0xbd0b('0x38')](handleError(_0x269f34,null));};exports[_0xbd0b('0x29')]=function(_0x1ce516,_0x29f888){return db[_0xbd0b('0x42')]['find']({'where':{'id':_0x1ce516[_0xbd0b('0xc3')]['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x29f888,null))[_0xbd0b('0x15')](removeEntity(_0x29f888,null))['catch'](handleError(_0x29f888,null));};exports[_0xbd0b('0xc7')]=function(_0x744ad0,_0x4d285e){return db[_0xbd0b('0x42')][_0xbd0b('0xc7')]()[_0xbd0b('0x15')](respondWithResult(_0x4d285e,null))[_0xbd0b('0x38')](handleError(_0x4d285e,null));};exports[_0xbd0b('0xc8')]=function(_0x54f668,_0x3e7a0a){var _0xfe0025=_0x54f668[_0xbd0b('0xc3')]['id'];var _0x3b6b99;var _0x4b94d1;var _0x2fc4f8;return db[_0xbd0b('0x42')][_0xbd0b('0xc9')]({'where':{'id':_0xfe0025}})[_0xbd0b('0x15')](function(_0xb96caa){_0x3b6b99=_0xb96caa;return db[_0xbd0b('0xca')][_0xbd0b('0xc9')]({'where':{'id':_0xb96caa[_0xbd0b('0x80')]},'attributes':['id','vidaooApiKey',_0xbd0b('0xcb'),'vidaooTopic',_0xbd0b('0xcc'),_0xbd0b('0xcd')],'raw':!![]});})[_0xbd0b('0x15')](function(_0x38bcd0){if(_0x38bcd0&&_0x38bcd0[_0xbd0b('0xce')]&&_0x38bcd0['vidaooEscalation']){_0x4b94d1=_0x38bcd0;var _0x3f96b9={'interaction':{'id':_0xfe0025},'agent':{'id':_0x54f668['user']['id'],'name':_0x54f668[_0xbd0b('0xa1')]['name'],'fullname':_0x54f668['user'][_0xbd0b('0xcf')],'email':_0x54f668[_0xbd0b('0xa1')]['email']},'contact':_0x54f668[_0xbd0b('0x2f')]['contact'],'account':_0x54f668[_0xbd0b('0x2f')]['account']};var _0x151b30={'rejectUnauthorized':![],'method':_0xbd0b('0xd0'),'url':_0xbd0b('0xd1'),'headers':{'X-APIKEY':_0x38bcd0[_0xbd0b('0xce')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x54f668[_0xbd0b('0xa1')]['email']],'buttons':null,'topic':_0x4b94d1['vidaooTopic'],'note':_[_0xbd0b('0xd2')](_0x4b94d1[_0xbd0b('0xcc')])?null:getMustacheRender(_0x4b94d1[_0xbd0b('0xcc')],_0x3f96b9),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xbd0b('0xd2')](_0x4b94d1[_0xbd0b('0xcd')])){var _0x618588=getMustacheRender(_0x4b94d1[_0xbd0b('0xcd')],_0x3f96b9);var _0x4acf00=JSON[_0xbd0b('0x83')](_0x618588);_0x151b30[_0xbd0b('0x2f')][_0xbd0b('0xd3')]=_0x4acf00;}}catch(_0x50bac5){throw new db[(_0xbd0b('0x96'))][(_0xbd0b('0xd4'))](_0xbd0b('0xd5'));}return rp(_0x151b30);}else{throw new db['Sequelize'][(_0xbd0b('0xd4'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xbd0b('0x15')](function(_0x392920){_0x2fc4f8=_0x392920;if(_0x2fc4f8['id']){var _0xe38274={'body':_0x2fc4f8[_0xbd0b('0xd6')],'ChatWebsiteId':_0x4b94d1['id'],'ChatInteractionId':_0x3b6b99['id'],'direction':_0xbd0b('0xd7'),'UserId':_0x54f668[_0xbd0b('0xa1')]['id']};return db[_0xbd0b('0xd8')][_0xbd0b('0xc6')](_0xe38274,{});}else{throw new db['Sequelize']['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xbd0b('0x15')](function(){return _0x3b6b99[_0xbd0b('0xd9')]({'vidaooSessionId':_0x2fc4f8['id']});})[_0xbd0b('0x15')](respondWithResult(_0x3e7a0a,null))[_0xbd0b('0x38')](handleError(_0x3e7a0a,null));};exports['customUpdate']=function(_0x33103a,_0x16f90f){if(_0x33103a[_0xbd0b('0x2f')]['id']){delete _0x33103a[_0xbd0b('0x2f')]['id'];}return db[_0xbd0b('0x42')][_0xbd0b('0x6c')]({'where':{'id':_0x33103a[_0xbd0b('0xc3')]['id']},'include':[{'model':db[_0xbd0b('0xda')],'as':_0xbd0b('0x71')}]})['then'](handleEntityNotFound(_0x16f90f,null))[_0xbd0b('0x15')](saveUpdates(_0x33103a['body'],null))['then'](respondWithResult(_0x16f90f,null))[_0xbd0b('0x38')](handleError(_0x16f90f,null));};exports[_0xbd0b('0xdb')]=function(_0x34de02,_0x126c50){if(_0x34de02[_0xbd0b('0x2f')]['id']){delete _0x34de02['body']['id'];}return db[_0xbd0b('0x42')][_0xbd0b('0x6c')]({'where':{'id':_0x34de02[_0xbd0b('0xc3')]['id']}})[_0xbd0b('0x15')](function(_0x1dbfe6){if(!_0x1dbfe6){logger[_0xbd0b('0x1b')](_0xbd0b('0xdc'),_0xbd0b('0xdb'),0x194,_0xbd0b('0xdd'));_0x126c50[_0xbd0b('0x1f')](0x194);}else{if(_0x1dbfe6[_0xbd0b('0x3f')]){throw new db[(_0xbd0b('0x96'))][(_0xbd0b('0xd4'))](_0xbd0b('0xde'));}}return _0x1dbfe6;})[_0xbd0b('0x15')](function(_0x36b990){if(_0x36b990){return _0x36b990['update']({'closed':_0x34de02[_0xbd0b('0x2f')][_0xbd0b('0x3e')],'disposition':_0x34de02['body'][_0xbd0b('0x40')]})[_0xbd0b('0x15')](function(_0x489988){return _0x489988;});}})[_0xbd0b('0x15')](function(){return respondWithRpcPromise('AbandonInteraction',_0xbd0b('0xdb'),_0x34de02[_0xbd0b('0x2f')],client9004);})[_0xbd0b('0x15')](respondWithResult(_0x126c50,null))[_0xbd0b('0x38')](handleError(_0x126c50,null));};exports[_0xbd0b('0xdf')]=function(_0x127fa5,_0x57c3b4){_0x127fa5['body']['name']=_0x127fa5[_0xbd0b('0xe0')][_0xbd0b('0xe1')];_0x127fa5[_0xbd0b('0x2f')][_0xbd0b('0xe2')]=_0x127fa5[_0xbd0b('0xe0')]['filename'];_0x127fa5[_0xbd0b('0x2f')][_0xbd0b('0x45')]=_0x127fa5[_0xbd0b('0xe0')]['mimetype'];return db['Attachment'][_0xbd0b('0xc6')](_0x127fa5['body'])[_0xbd0b('0x15')](respondWithResult(_0x57c3b4,0xc9))[_0xbd0b('0x38')](handleError(_0x57c3b4,null));};exports[_0xbd0b('0xe3')]=function(_0x35ac14,_0x2cf9c5){return db[_0xbd0b('0x42')][_0xbd0b('0xc9')]({'where':{'id':_0x35ac14[_0xbd0b('0xc3')]['id']},'raw':!![]})[_0xbd0b('0x15')](handleEntityNotFound(_0x2cf9c5,null))['then'](function(_0x51a3a7){if(_0x51a3a7){if(_0x51a3a7['closed']){return _0x2cf9c5[_0xbd0b('0x21')](0x193)[_0xbd0b('0x22')]({'status':0x193,'message':_0xbd0b('0xe4')});}return db[_0xbd0b('0xe5')][_0xbd0b('0xc9')]({'where':{'id':_0x35ac14['query']['attachId']},'raw':!![]})[_0xbd0b('0x15')](handleEntityNotFound(_0x2cf9c5,null));}})[_0xbd0b('0x15')](function(_0x268c6d){if(_0x268c6d){var _0x309ce2=_0x268c6d[_0xbd0b('0xe6')]!==null;var _0x34bb0d=path[_0xbd0b('0xe7')](config[_0xbd0b('0xe8')],'server/files/attachments/');if(_0x309ce2){_0x34bb0d=path[_0xbd0b('0xe7')](_0x34bb0d,_0xbd0b('0xe9'));}var _0x48f4e9=path[_0xbd0b('0xe7')](_0x34bb0d,_0x268c6d[_0xbd0b('0xe2')]);return _0x2cf9c5[_0xbd0b('0xea')](_0x48f4e9);}})[_0xbd0b('0x38')](handleError(_0x2cf9c5,null));};exports['close']=function(_0x479ad9,_0x491b2a){var _0xf0ad9e=null;var _0x34eb67=null;var _0x211868=null;if(_0x479ad9[_0xbd0b('0x2f')]['id']){delete _0x479ad9[_0xbd0b('0x2f')]['id'];}if(_0x479ad9[_0xbd0b('0x2f')]['mailTranscript']){_0x211868=path[_0xbd0b('0xe7')](config[_0xbd0b('0xe8')],_0xbd0b('0xeb'),util[_0xbd0b('0xec')](_0xbd0b('0xed'),Date[_0xbd0b('0xee')]()));_0x479ad9[_0xbd0b('0x2f')][_0xbd0b('0xef')]=_0x211868;}return db[_0xbd0b('0x42')][_0xbd0b('0x6c')]({'where':{'id':_0x479ad9[_0xbd0b('0xc3')]['id']},'include':[{'model':db[_0xbd0b('0xd8')],'as':_0xbd0b('0xf0'),'include':[{'model':db[_0xbd0b('0xf1')],'as':_0xbd0b('0xf1')}]}]})['then'](handleEntityNotFound(_0x491b2a,null))[_0xbd0b('0x15')](saveUpdates(_0x479ad9[_0xbd0b('0x2f')],null))[_0xbd0b('0x15')](function(_0x1956ad){if(_0x1956ad){_0xf0ad9e=_0x1956ad;return db[_0xbd0b('0xca')][_0xbd0b('0x6c')]({'where':{'id':_0xf0ad9e[_0xbd0b('0x80')]}});}})[_0xbd0b('0x15')](function(_0x37d028){if(_0x37d028){_0x34eb67=_0x37d028;return db[_0xbd0b('0xda')][_0xbd0b('0x6c')]({'where':{'id':_0xf0ad9e['ContactId']}});}})[_0xbd0b('0x15')](function(_0x41ef22){if(_0x41ef22){if(_0x211868){var _0x1d966f=null;for(var _0x3828f0=0x1;_0x3828f0<_0xf0ad9e[_0xbd0b('0xf0')][_0xbd0b('0x6b')];++_0x3828f0){_0x1d966f=_0xf0ad9e[_0xbd0b('0xf0')][_0x3828f0];var _0x5a1ce3=_0x1d966f['UserId']?util[_0xbd0b('0xec')]('%s%d',_0x34eb67[_0xbd0b('0xf2')],_0x1d966f[_0xbd0b('0x3f')]):'System';var _0x49b7fd=_0x479ad9[_0xbd0b('0x2f')][_0xbd0b('0xf3')]||util[_0xbd0b('0xec')]('%s%d',_0xbd0b('0xf4'),_0x1d966f['ContactId']);switch(_0x34eb67['agentIdentifier']){case'website_alias':_0x5a1ce3=_0x1d966f[_0xbd0b('0x3f')]?util[_0xbd0b('0xec')]('%s%d',_0x34eb67[_0xbd0b('0xf2')],_0x1d966f[_0xbd0b('0x3f')]):_0xbd0b('0xf5');break;case _0xbd0b('0xf6'):_0x5a1ce3=_0x1d966f[_0xbd0b('0x3f')]?_0x1d966f[_0xbd0b('0xf1')][_0xbd0b('0xf7')]||_0x1d966f[_0xbd0b('0xf1')]['fullname']:_0xbd0b('0xf5');break;case _0xbd0b('0xf8'):_0x5a1ce3=_0x1d966f[_0xbd0b('0x3f')]?_0x1d966f[_0xbd0b('0xf1')][_0xbd0b('0xcf')]:_0xbd0b('0xf5');break;default:_0x5a1ce3=_0x1d966f['UserId']?util[_0xbd0b('0xec')](_0xbd0b('0xf9'),_0x34eb67[_0xbd0b('0xf2')],_0x1d966f[_0xbd0b('0x3f')]):'System';}var _0x487a04=util['format'](_0xbd0b('0xfa'),moment(_0x1d966f[_0xbd0b('0xfb')])['format'](_0xbd0b('0xfc')),_0x1d966f[_0xbd0b('0xfd')]==='in'?_0x49b7fd:_0x5a1ce3,_0x1d966f[_0xbd0b('0x2f')]);if(!_0x1d966f[_0xbd0b('0xfe')]){fs[_0xbd0b('0xff')](_0x211868,_0x487a04);}}return db[_0xbd0b('0x100')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xbd0b('0x101')],'as':_0xbd0b('0x102'),'raw':!![],'include':[{'model':db[_0xbd0b('0x103')],'as':_0xbd0b('0x103'),'raw':!![]}]}]});}}})[_0xbd0b('0x15')](function(_0x379097){if(!_0x379097||!_0x379097[_0xbd0b('0x102')]||!_0x479ad9[_0xbd0b('0x2f')])return _0xf0ad9e;var _0x350b16=_0x379097['getSmtpOptions']();return respondWithRpcPromise(_0xbd0b('0x104'),'sendMail',{'account':_0x350b16,'message':{'from':util[_0xbd0b('0xec')](_0xbd0b('0x105'),_0x379097[_0xbd0b('0x2b')],_0x379097[_0xbd0b('0x106')]||_0x379097['Smtp'][_0xbd0b('0xa1')]),'to':_0x479ad9[_0xbd0b('0x2f')][_0xbd0b('0x107')],'subject':_0xbd0b('0x108'),'text':util['format'](_0xbd0b('0x109'),_0x479ad9['body'][_0xbd0b('0x107')]),'attachments':[{'path':_0x211868}]}})[_0xbd0b('0x15')](function(){return _0xf0ad9e;})[_0xbd0b('0x38')](function(_0x317171){logger['error'](_0x317171);});})[_0xbd0b('0x15')](respondWithStatusCode(_0x491b2a,0xc8))[_0xbd0b('0x38')](handleError(_0x491b2a,null));};exports[_0xbd0b('0x10a')]=function(_0xb4cfe6,_0x21e92b){return db[_0xbd0b('0xd8')][_0xbd0b('0x6c')]({'where':{'id':_0xb4cfe6[_0xbd0b('0xc3')]['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x21e92b,null))[_0xbd0b('0x15')](function(_0x301f75){if(_0x301f75){return _0x301f75[_0xbd0b('0x10a')](_0xb4cfe6[_0xbd0b('0x2f')][_0xbd0b('0x10b')],_[_0xbd0b('0x10c')](_0xb4cfe6[_0xbd0b('0x2f')],[_0xbd0b('0x10b'),'id'])||{});}})[_0xbd0b('0x15')](respondWithResult(_0x21e92b,null))['catch'](handleError(_0x21e92b,null));};exports[_0xbd0b('0x10d')]=function(_0x2daea0,_0x5ace8b){var _0x153d7a={'raw':![],'where':{}};var _0x222290={};var _0x64b5f2={'count':0x0,'rows':[]};return db[_0xbd0b('0x42')][_0xbd0b('0xc9')]({'where':{'id':_0x2daea0[_0xbd0b('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5ace8b,null))[_0xbd0b('0x15')](function(_0x2b5201){if(_0x2b5201){_0x222290[_0xbd0b('0x47')]=_[_0xbd0b('0x49')](db['ChatMessage']['rawAttributes']);_0x222290[_0xbd0b('0x48')]=_['keys'](_0x2daea0[_0xbd0b('0x48')]);_0x222290['filters']=_['intersection'](_0x222290[_0xbd0b('0x47')],_0x222290[_0xbd0b('0x48')]);_0x153d7a[_0xbd0b('0x4c')]=_[_0xbd0b('0x4b')](_0x222290['model'],qs[_0xbd0b('0x4d')](_0x2daea0[_0xbd0b('0x48')]['fields']));_0x153d7a[_0xbd0b('0x4c')]=_0x153d7a[_0xbd0b('0x4c')][_0xbd0b('0x6b')]?_0x153d7a['attributes']:_0x222290[_0xbd0b('0x47')];if(!_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x4e')](_0xbd0b('0x4f'))){_0x153d7a['limit']=qs[_0xbd0b('0x25')](_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x25')]);_0x153d7a['offset']=qs[_0xbd0b('0x23')](_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x23')]);}_0x153d7a[_0xbd0b('0x50')]=qs[_0xbd0b('0x51')](_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x51')]);_0x153d7a[_0xbd0b('0x52')]=qs[_0xbd0b('0x4a')](_[_0xbd0b('0x53')](_0x2daea0[_0xbd0b('0x48')],_0x222290[_0xbd0b('0x4a')]));_0x153d7a[_0xbd0b('0x52')]['ChatInteractionId']=_0x2b5201['id'];if(_0x2daea0[_0xbd0b('0x48')][_0xbd0b('0x90')]){_0x153d7a[_0xbd0b('0x52')]=_[_0xbd0b('0x2e')](_0x153d7a[_0xbd0b('0x52')],{'$or':_['map'](_0x153d7a[_0xbd0b('0x4c')],function(_0x17779e){var _0xb14185={};_0xb14185[_0x17779e]={'$like':'%'+_0x2daea0['query'][_0xbd0b('0x90')]+'%'};return _0xb14185;})});}if(_0x2daea0['query'][_0xbd0b('0x84')]){var _0x9d3adb=_0x2daea0['query']['$gte'][_0xbd0b('0x36')](',');var _0x4ad616={};_0x4ad616[_0x9d3adb[0x0]]={'$gte':moment(_0x9d3adb[0x1])[_0xbd0b('0xec')](_0xbd0b('0x10e'))};_0x153d7a[_0xbd0b('0x52')]=_[_0xbd0b('0x2e')](_0x153d7a[_0xbd0b('0x52')],_0x4ad616);}_0x153d7a=_[_0xbd0b('0x2e')]({},_0x153d7a,_0x2daea0[_0xbd0b('0x10f')]);return db[_0xbd0b('0xd8')][_0xbd0b('0xa7')]({'where':_0x153d7a[_0xbd0b('0x52')]})[_0xbd0b('0x15')](function(_0x569043){_0x64b5f2['count']=_0x569043;if(_0x2daea0[_0xbd0b('0x48')]['includeAll']){_0x153d7a[_0xbd0b('0xc5')]=[{'all':!![]}];}return db[_0xbd0b('0xd8')][_0xbd0b('0x110')](_0x153d7a);})['then'](function(_0x20e8f9){_0x64b5f2[_0xbd0b('0xc2')]=_0x20e8f9;return _0x64b5f2;});}})[_0xbd0b('0x15')](respondWithFilteredResult(_0x5ace8b,_0x153d7a))[_0xbd0b('0x38')](handleError(_0x5ace8b,null));};exports[_0xbd0b('0x111')]=function(_0x556126,_0x1b764f){var _0x33d449={'where':{}},_0x447fe3={},_0x51e87b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbd0b('0xc9')]({'where':{'id':_0x556126[_0xbd0b('0xc3')]['id']}})['then'](handleEntityNotFound(_0x1b764f,null))[_0xbd0b('0x15')](function(_0x19f0ad){if(_0x19f0ad){_0x447fe3[_0xbd0b('0x47')]=_[_0xbd0b('0x49')](db['ChatMessage'][_0xbd0b('0x43')]);_0x447fe3[_0xbd0b('0x48')]=_[_0xbd0b('0x49')](_0x556126[_0xbd0b('0x48')]);_0x447fe3['filters']=_[_0xbd0b('0x4b')](_0x447fe3['model'],_0x447fe3[_0xbd0b('0x48')]);_0x33d449[_0xbd0b('0x4c')]=_['intersection'](_0x447fe3[_0xbd0b('0x47')],qs['fields'](_0x556126['query'][_0xbd0b('0x4d')]));_0x33d449['attributes']=_0x33d449[_0xbd0b('0x4c')][_0xbd0b('0x6b')]?_0x33d449[_0xbd0b('0x4c')]:_0x447fe3['model'];if(!_0x556126['query'][_0xbd0b('0x4e')](_0xbd0b('0x4f'))){_0x33d449[_0xbd0b('0x25')]=qs[_0xbd0b('0x25')](_0x556126[_0xbd0b('0x48')][_0xbd0b('0x25')]);_0x33d449[_0xbd0b('0x23')]=qs[_0xbd0b('0x23')](_0x556126[_0xbd0b('0x48')][_0xbd0b('0x23')]);}_0x33d449['order']=qs[_0xbd0b('0x51')](_0x556126[_0xbd0b('0x48')]['sort']);_0x33d449[_0xbd0b('0x52')]=qs['filters'](_[_0xbd0b('0x53')](_0x556126[_0xbd0b('0x48')],_0x447fe3[_0xbd0b('0x4a')]));_0x33d449[_0xbd0b('0x52')]['ChatInteractionId']=_0x19f0ad['id'];if(_0x556126[_0xbd0b('0x48')][_0xbd0b('0x90')]){_0x33d449[_0xbd0b('0x52')]=_[_0xbd0b('0x2e')](_0x33d449['where'],{'$or':_[_0xbd0b('0x34')](_0x33d449[_0xbd0b('0x4c')],function(_0x53e0cc){var _0x1e0816={};_0x1e0816[_0x53e0cc]={'$like':'%'+_0x556126[_0xbd0b('0x48')][_0xbd0b('0x90')]+'%'};return _0x1e0816;})});}_0x33d449[_0xbd0b('0x52')]['secret']=![];if(_0x556126[_0xbd0b('0x48')]['id']){_0x33d449[_0xbd0b('0x52')]['id']={'$gt':_0x556126[_0xbd0b('0x48')]['id']};}_0x33d449=_['merge']({},_0x33d449,_0x556126[_0xbd0b('0x10f')]);return db[_0xbd0b('0xd8')][_0xbd0b('0xa7')]({'where':_0x33d449['where']})[_0xbd0b('0x15')](function(_0x265840){_0x51e87b[_0xbd0b('0xa7')]=_0x265840;_0x33d449[_0xbd0b('0xc5')]=[];if(_0x556126['query']['includeAgent']){_0x33d449[_0xbd0b('0xc5')]['push']({'model':db[_0xbd0b('0xf1')],'as':_0xbd0b('0xf1'),'attributes':['id',_0xbd0b('0xcf'),'alias']});}if(_0x556126['query']['includeAll']){_0x33d449['include']=[{'all':!![]}];}return db[_0xbd0b('0xd8')][_0xbd0b('0x110')](_0x33d449);})[_0xbd0b('0x15')](function(_0x34c91c){_0x51e87b[_0xbd0b('0xc2')]=_0x34c91c;return _0x51e87b;});}})[_0xbd0b('0x15')](respondWithFilteredResult(_0x1b764f,_0x33d449))['catch'](handleError(_0x1b764f,null));};exports[_0xbd0b('0x112')]=function(_0x11b961,_0x31846a){return db['ChatInteraction'][_0xbd0b('0x6c')]({'where':{'id':_0x11b961[_0xbd0b('0xc3')]['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x31846a,null))[_0xbd0b('0x15')](function(_0x207ff3){if(_0x207ff3){return _0x207ff3[_0xbd0b('0x113')](_0x11b961['body'][_0xbd0b('0x10b')],_[_0xbd0b('0x10c')](_0x11b961[_0xbd0b('0x2f')],[_0xbd0b('0x10b'),'id'])||{})['spread'](function(){return db['Tag'][_0xbd0b('0x110')]({'attributes':['id',_0xbd0b('0x2b'),_0xbd0b('0x56')],'where':{'id':_0x11b961[_0xbd0b('0x2f')][_0xbd0b('0x10b')]}});})[_0xbd0b('0x15')](function(_0x13aaf1){socket[_0xbd0b('0x114')](_0xbd0b('0x115'),{'id':Number(_0x11b961['params']['id']),'tags':_0x13aaf1||[]});return{'id':Number(_0x11b961[_0xbd0b('0xc3')]['id']),'tags':_0x13aaf1||[]};});}})[_0xbd0b('0x15')](respondWithResult(_0x31846a,null))[_0xbd0b('0x38')](handleError(_0x31846a,null));};exports[_0xbd0b('0x116')]=function(_0x2c06c8,_0x335b2f){return db[_0xbd0b('0x42')][_0xbd0b('0x6c')]({'where':{'id':_0x2c06c8['params']['id']}})[_0xbd0b('0x15')](handleEntityNotFound(_0x335b2f,null))[_0xbd0b('0x15')](function(_0xb2d193){if(_0xb2d193){return _0xb2d193[_0xbd0b('0x116')](_0x2c06c8[_0xbd0b('0x48')][_0xbd0b('0x10b')]);}})[_0xbd0b('0x15')](respondWithStatusCode(_0x335b2f,null))[_0xbd0b('0x38')](handleError(_0x335b2f,null));};exports[_0xbd0b('0xea')]=function(_0x58c16c,_0x1ad62d){var _0x24971c=moment()[_0xbd0b('0x117')]()[_0xbd0b('0xa6')]();var _0x312865=path[_0xbd0b('0xe7')](config[_0xbd0b('0xe8')],_0xbd0b('0x118'),_0xbd0b('0x119'),'tmp');var _0x4fe50b=path['join'](config[_0xbd0b('0xe8')],_0xbd0b('0x118'),_0xbd0b('0x119'),'attachments');var _0x145e57=path[_0xbd0b('0xe7')](_0x312865,_0x24971c);var _0x5408ab=util[_0xbd0b('0xec')](_0xbd0b('0x11a'),_0x58c16c[_0xbd0b('0xc3')]['id'],_0x24971c);var _0x576316=path[_0xbd0b('0xe7')](_0x312865,_0x5408ab);var _0x97fbc=[];_0x97fbc[_0xbd0b('0xc0')]({'model':db[_0xbd0b('0xf1')],'as':'User','attributes':['id',_0xbd0b('0xcf')],'raw':!![]});_0x97fbc[_0xbd0b('0xc0')]({'model':db[_0xbd0b('0xda')],'as':'Contact','attributes':['id',_0xbd0b('0x11b'),'lastName'],'raw':!![]});if(_0x58c16c['query'][_0xbd0b('0x11c')]){_0x97fbc[_0xbd0b('0xc0')]({'model':db['Attachment'],'as':_0xbd0b('0xe5'),'raw':!![]});}var _0x1a9120=[{'model':db[_0xbd0b('0xd8')],'as':_0xbd0b('0xf0'),'attributes':['id',_0xbd0b('0x2f'),_0xbd0b('0xfb'),_0xbd0b('0xfd'),_0xbd0b('0xfe'),_0xbd0b('0x8a')],'include':_0x97fbc}];_0x1a9120[_0xbd0b('0xc0')]({'model':db[_0xbd0b('0xca')],'as':'Account','attributes':['id',_0xbd0b('0x2b')]});_0x1a9120['push']({'model':db[_0xbd0b('0xf1')],'as':_0xbd0b('0x11d'),'attributes':['id',_0xbd0b('0xcf')]});return db['ChatInteraction'][_0xbd0b('0x6c')]({'where':{'id':_0x58c16c[_0xbd0b('0xc3')]['id']},'include':_0x1a9120})[_0xbd0b('0x15')](handleEntityNotFound(_0x1ad62d,null))[_0xbd0b('0x15')](function(_0x2ee1c3){if(_0x2ee1c3){var _0x509ab1=_0x2ee1c3['get']({'plain':!![]});fs['mkdirSync'](_0x145e57);var _0x273e61={'channel':_0xbd0b('0x11e'),'account':_0x509ab1[_0xbd0b('0x11f')][_0xbd0b('0x2b')],'agent':_0x509ab1[_0xbd0b('0x11d')]?_0x509ab1[_0xbd0b('0x11d')][_0xbd0b('0xcf')]:_0xbd0b('0x120'),'createdAt':moment(_0x509ab1[_0xbd0b('0xfb')])[_0xbd0b('0xec')](_0xbd0b('0x10e'))['toString'](),'closedAt':_0x509ab1['closed']?moment(_0x509ab1[_0xbd0b('0x121')])[_0xbd0b('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbd0b('0xa6')]():'','disposition':_0x509ab1[_0xbd0b('0x40')],'chatInfo':{'browser':_0x509ab1[_0xbd0b('0x122')],'os':_0x509ab1[_0xbd0b('0x123')],'referer':_0x509ab1[_0xbd0b('0x124')],'customerIp':_0x509ab1[_0xbd0b('0x125')],'customerPort':_0x509ab1[_0xbd0b('0x126')]?_0x509ab1[_0xbd0b('0x126')]:_0xbd0b('0x120')},'messages':_(_0x509ab1[_0xbd0b('0xf0')])[_0xbd0b('0x127')]()[_0xbd0b('0x90')]({'secret':![]})[_0xbd0b('0x34')](function(_0x450447){if(_0x450447[_0xbd0b('0xe5')]){var _0x33867c=path['join'](_0x4fe50b,_0x450447[_0xbd0b('0xe5')]['basename']);if(fs[_0xbd0b('0x128')](_0x33867c)){fs[_0xbd0b('0x129')](_0x33867c)[_0xbd0b('0x12a')](fs[_0xbd0b('0x12b')](path[_0xbd0b('0xe7')](_0x145e57,_0x450447[_0xbd0b('0xe5')][_0xbd0b('0xe2')])));}}return{'date':moment(_0x450447[_0xbd0b('0xfb')])[_0xbd0b('0xec')](_0xbd0b('0x10e'))[_0xbd0b('0xa6')](),'sender':_0x450447[_0xbd0b('0xfd')]==='out'?_0x450447['User']?_0x450447[_0xbd0b('0xf1')][_0xbd0b('0xcf')]:_0xbd0b('0xf5'):_0x450447[_0xbd0b('0x71')]['firstName']+(_0x450447['Contact'][_0xbd0b('0x12c')]?'\x20'+_0x450447[_0xbd0b('0x71')]['lastName']:''),'body':_0x450447[_0xbd0b('0xe5')]?_0x450447[_0xbd0b('0xe5')][_0xbd0b('0xe2')]:_0x450447[_0xbd0b('0x2f')],'direction':_0x450447[_0xbd0b('0xfd')]===_0xbd0b('0xd7')?'A':'C','secret':_0x450447[_0xbd0b('0xfe')],'read':_0x450447[_0xbd0b('0x8a')],'attachment':_0x450447[_0xbd0b('0xe5')]};})[_0xbd0b('0x6e')]()};return ejs[_0xbd0b('0x12d')](path[_0xbd0b('0xe7')](config[_0xbd0b('0xe8')],_0xbd0b('0x118'),_0xbd0b('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x273e61})[_0xbd0b('0x15')](function(_0x32d480){var _0x17f198=path[_0xbd0b('0xe7')](_0x145e57,'transcript-'+_0x509ab1['id']+'-'+_0x24971c+_0xbd0b('0x12f'));var _0x11ee69={'path':_0x17f198,'channel':_0xbd0b('0x11e'),'interactionId':_0x509ab1['id']};return pdf[_0xbd0b('0x130')](_0x32d480,_0x11ee69);})['then'](function(){return new Promise(function(_0x44aa74,_0x373868){zipdir(_0x145e57,{'saveTo':_0x576316},function(_0x2d361f,_0xd80e5b){if(_0x2d361f)return _0x373868(_0x2d361f);return _0x44aa74(_0xd80e5b);});})[_0xbd0b('0x15')](function(){return new BPromise(function(_0x52c132,_0x81e7e6){rimraf(_0x145e57,function(_0x5e8c8c){if(_0x5e8c8c)_0x81e7e6(_0x5e8c8c);return _0x52c132();});});})[_0xbd0b('0x15')](function(){return _0x1ad62d[_0xbd0b('0xea')](_0x576316,_0x5408ab,function(_0x45b33e){if(_0x45b33e){logger['error'](_0xbd0b('0x131'),_0x45b33e);}else{fs[_0xbd0b('0x132')](_0x576316);}});});});}else{return _0x1ad62d[_0xbd0b('0x1f')](0xc8);}})[_0xbd0b('0x38')](handleError(_0x1ad62d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 2f9a2a1..1fd9414 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 _0xbbab=['catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit'];(function(_0x5e0823,_0x146024){var _0x592fbb=function(_0x5ec112){while(--_0x5ec112){_0x5e0823['push'](_0x5e0823['shift']());}};_0x592fbb(++_0x146024);}(_0xbbab,0xe7));var _0xbbba=function(_0x1fd732,_0x1c33ff){_0x1fd732=_0x1fd732-0x0;var _0x5d2cda=_0xbbab[_0x1fd732];return _0x5d2cda;};'use strict';var EventEmitter=require(_0xbbba('0x0'));var ChatInteraction=require(_0xbbba('0x1'))['db'][_0xbbba('0x2')];var ChatMessage=require(_0xbbba('0x1'))['db'][_0xbbba('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbbba('0x4')](0x0);var events={'afterCreate':_0xbbba('0x5'),'afterUpdate':_0xbbba('0x6'),'afterDestroy':_0xbbba('0x7')};function emitEvent(_0x835182){return function(_0x30dd5b,_0x3d134b,_0x1dd068){_0x30dd5b[_0xbbba('0x8')]({'attributes':['id'],'raw':!![]})[_0xbbba('0x9')](function(_0x5c473b){_0x30dd5b['setDataValue'](_0xbbba('0xa'),_0x5c473b[_0xbbba('0xb')](function(_0x3a1589){return{'id':_0x3a1589['id']};}));return ChatMessage[_0xbbba('0xc')]({'where':{'ChatInteractionId':_0x30dd5b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5eaad1){_0x30dd5b[_0xbbba('0xd')](_0xbbba('0xe'),_0x5eaad1['length']);ChatInteractionEvents[_0xbbba('0xf')](_0x835182+':'+_0x30dd5b['id'],_0x30dd5b);ChatInteractionEvents[_0xbbba('0xf')](_0x835182,_0x30dd5b);_0x1dd068(null);})[_0xbbba('0x10')](_0x1dd068(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xbbba('0x11')](e,emitEvent(event));}}module[_0xbbba('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x1656=['update','remove','getUsers','setDataValue','Users','map','then','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1656,0x12d));var _0x6165=function(_0x432044,_0x35d99b){_0x432044=_0x432044-0x0;var _0x108d8d=_0x1656[_0x432044];return _0x108d8d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x6165('0x0'))['db'][_0x6165('0x1')];var ChatMessage=require(_0x6165('0x0'))['db'][_0x6165('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6165('0x3')](0x0);var events={'afterCreate':_0x6165('0x4'),'afterUpdate':_0x6165('0x5'),'afterDestroy':_0x6165('0x6')};function emitEvent(_0x47dc46){return function(_0x21361d,_0x479321,_0x1c25b0){_0x21361d[_0x6165('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x542338){_0x21361d[_0x6165('0x8')](_0x6165('0x9'),_0x542338[_0x6165('0xa')](function(_0xfa81c7){return{'id':_0xfa81c7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x21361d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6165('0xb')](function(_0x1bdbcc){_0x21361d[_0x6165('0x8')](_0x6165('0xc'),_0x1bdbcc[_0x6165('0xd')]);ChatInteractionEvents[_0x6165('0xe')](_0x47dc46+':'+_0x21361d['id'],_0x21361d);ChatInteractionEvents[_0x6165('0xe')](_0x47dc46,_0x21361d);_0x1c25b0(null);})['catch'](_0x1c25b0(null));};}for(var e in events){if(events[_0x6165('0xf')](e)){var event=events[e];ChatInteraction[_0x6165('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 70b16a3..4597f9a 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 _0xaed7=['./chatInteraction.attributes','ChatInteraction','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5d6d8f,_0x4ae47d){var _0x4e27cf=function(_0x467f58){while(--_0x467f58){_0x5d6d8f['push'](_0x5d6d8f['shift']());}};_0x4e27cf(++_0x4ae47d);}(_0xaed7,0x147));var _0x7aed=function(_0x340d92,_0x4722a3){_0x340d92=_0x340d92-0x0;var _0x1b86db=_0xaed7[_0x340d92];return _0x1b86db;};'use strict';var _=require(_0x7aed('0x0'));var util=require(_0x7aed('0x1'));var logger=require(_0x7aed('0x2'))(_0x7aed('0x3'));var moment=require(_0x7aed('0x4'));var BPromise=require(_0x7aed('0x5'));var rp=require(_0x7aed('0x6'));var fs=require('fs');var path=require(_0x7aed('0x7'));var rimraf=require('rimraf');var config=require(_0x7aed('0x8'));var attributes=require(_0x7aed('0x9'));module['exports']=function(_0x44f3fc,_0xe897b8){return _0x44f3fc['define'](_0x7aed('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3331f3,_0x8851a5,_0x51ddd3){if(_0x3331f3['changed'](_0x7aed('0xb'))){_0x3331f3[_0x7aed('0xc')]=moment()[_0x7aed('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x51ddd3(null,_0x3331f3);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x785c=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x785c,0x1c9));var _0xc785=function(_0x531ffd,_0xe6e95){_0x531ffd=_0x531ffd-0x0;var _0x58eb1f=_0x785c[_0x531ffd];return _0x58eb1f;};'use strict';var _=require(_0xc785('0x0'));var util=require(_0xc785('0x1'));var logger=require(_0xc785('0x2'))(_0xc785('0x3'));var moment=require(_0xc785('0x4'));var BPromise=require('bluebird');var rp=require(_0xc785('0x5'));var fs=require('fs');var path=require(_0xc785('0x6'));var rimraf=require(_0xc785('0x7'));var config=require(_0xc785('0x8'));var attributes=require(_0xc785('0x9'));module[_0xc785('0xa')]=function(_0x2048ac,_0x27f121){return _0x2048ac[_0xc785('0xb')](_0xc785('0xc'),attributes,{'tableName':_0xc785('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33c01e,_0x20e39d,_0x29c370){if(_0x33c01e[_0xc785('0xe')](_0xc785('0xf'))){_0x33c01e[_0xc785('0x10')]=moment()[_0xc785('0x11')](_0xc785('0x12'));}_0x29c370(null,_0x33c01e);}},'charset':_0xc785('0x13'),'collate':_0xc785('0x14')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index fdd25ed..a4896cf 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 _0xd20d=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','defaults','redis','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ChatInteraction','update','body','options','raw','where','attributes','UpdateChatInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x2905c,_0x408ef3){var _0x5631e0=function(_0x5e7d24){while(--_0x5e7d24){_0x2905c['push'](_0x2905c['shift']());}};_0x5631e0(++_0x408ef3);}(_0xd20d,0x118));var _0xdd20=function(_0x4ebae2,_0x236be8){_0x4ebae2=_0x4ebae2-0x0;var _0x4586ae=_0xd20d[_0x4ebae2];return _0x4586ae;};'use strict';var _=require(_0xdd20('0x0'));var util=require(_0xdd20('0x1'));var moment=require('moment');var BPromise=require(_0xdd20('0x2'));var rs=require(_0xdd20('0x3'));var fs=require('fs');var Redis=require(_0xdd20('0x4'));var db=require(_0xdd20('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd20('0x6'))(_0xdd20('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdd20('0x8')]['http']({'port':0x232a});config['redis']=_[_0xdd20('0x9')](config[_0xdd20('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd20('0xb'))(new Redis(config[_0xdd20('0xa')]));require('./chatInteraction.socket')[_0xdd20('0xc')](socket);function respondWithRpcPromise(_0x58aa37,_0x33faa2,_0xa918ab){return new BPromise(function(_0x3beb01,_0x204846){return client[_0xdd20('0xd')](_0x58aa37,_0xa918ab)[_0xdd20('0xe')](function(_0x52c062){logger['info'](_0xdd20('0xf'),_0x33faa2,'request\x20sent');logger[_0xdd20('0x10')](_0xdd20('0x11'),_0x33faa2,_0xdd20('0x12'),JSON[_0xdd20('0x13')](_0x52c062));if(_0x52c062['error']){if(_0x52c062[_0xdd20('0x14')][_0xdd20('0x15')]===0x1f4){logger[_0xdd20('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x33faa2,_0x52c062[_0xdd20('0x14')][_0xdd20('0x16')]);return _0x204846(_0x52c062[_0xdd20('0x14')][_0xdd20('0x16')]);}logger[_0xdd20('0x14')](_0xdd20('0xf'),_0x33faa2,_0x52c062[_0xdd20('0x14')][_0xdd20('0x16')]);return _0x3beb01(_0x52c062[_0xdd20('0x14')][_0xdd20('0x16')]);}else{logger[_0xdd20('0x17')](_0xdd20('0xf'),_0x33faa2,_0xdd20('0x12'));_0x3beb01(_0x52c062[_0xdd20('0x18')][_0xdd20('0x16')]);}})[_0xdd20('0x19')](function(_0x43a756){logger[_0xdd20('0x14')](_0xdd20('0xf'),_0x33faa2,_0x43a756);_0x204846(_0x43a756);});});}exports['UpdateChatInteraction']=function(_0x14a949){var _0x3cf728=this;return new Promise(function(_0x3e8ec0,_0x5cd7ba){return db[_0xdd20('0x1a')][_0xdd20('0x1b')](_0x14a949[_0xdd20('0x1c')],{'raw':_0x14a949[_0xdd20('0x1d')]?_0x14a949['options'][_0xdd20('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14a949['options']?_0x14a949[_0xdd20('0x1d')][_0xdd20('0x1f')]||null:null,'attributes':_0x14a949[_0xdd20('0x1d')]?_0x14a949['options'][_0xdd20('0x20')]||null:null,'limit':_0x14a949[_0xdd20('0x1d')]?_0x14a949['options']['limit']||null:null})[_0xdd20('0xe')](function(_0x3f3411){logger[_0xdd20('0x17')](_0xdd20('0x21'),_0x14a949);logger[_0xdd20('0x10')]('UpdateChatInteraction',_0x14a949,JSON[_0xdd20('0x13')](_0x3f3411));_0x3e8ec0(_0x3f3411);})[_0xdd20('0x19')](function(_0x536736){logger[_0xdd20('0x14')](_0xdd20('0x21'),_0x536736['message'],_0x14a949);_0x5cd7ba(_0x3cf728[_0xdd20('0x14')](0x1f4,_0x536736[_0xdd20('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x350703){return new Promise(function(_0x16af6d,_0x4f315b){return db[_0xdd20('0x1a')][_0xdd20('0x22')]({'where':_0x350703[_0xdd20('0x1d')]?_0x350703[_0xdd20('0x1d')][_0xdd20('0x1f')]||null:null})[_0xdd20('0xe')](function(_0x3a67b5){if(_0x3a67b5){return _0x3a67b5[_0xdd20('0x23')](_0x350703[_0xdd20('0x1c')][_0xdd20('0x24')],_[_0xdd20('0x25')](_0x350703['body'],[_0xdd20('0x24'),'id'])||{});}})[_0xdd20('0x26')](function(_0x1b0351){logger[_0xdd20('0x17')](_0xdd20('0x27'),_0x350703);logger[_0xdd20('0x10')](_0xdd20('0x27'),_0x350703,JSON[_0xdd20('0x13')](_0x1b0351));_0x16af6d(_0x1b0351);})[_0xdd20('0x19')](function(_0x4397b8){logger['error']('AddTags',_0x4397b8[_0xdd20('0x16')],_0x350703);_0x4f315b(_this[_0xdd20('0x14')](0x1f4,_0x4397b8[_0xdd20('0x16')]));});});};
\ No newline at end of file
+var _0x0600=['where','attributes','limit','AddTagsToChatInteraction','find','addTags','omit','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x1c3f44,_0x3b9db4){var _0x1bc285=function(_0x4f1781){while(--_0x4f1781){_0x1c3f44['push'](_0x1c3f44['shift']());}};_0x1bc285(++_0x3b9db4);}(_0x0600,0x18f));var _0x0060=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x0600[_0x13843f];return _0x1063ae;};'use strict';var _=require(_0x0060('0x0'));var util=require('util');var moment=require(_0x0060('0x1'));var BPromise=require(_0x0060('0x2'));var rs=require(_0x0060('0x3'));var fs=require('fs');var Redis=require(_0x0060('0x4'));var db=require(_0x0060('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0060('0x6'));var config=require('../../config/environment');var jayson=require(_0x0060('0x7'));var client=jayson[_0x0060('0x8')]['http']({'port':0x232a});config[_0x0060('0x9')]=_[_0x0060('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0060('0xb'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x0060('0xc')](socket);function respondWithRpcPromise(_0xfc1316,_0x47c888,_0x30d8eb){return new BPromise(function(_0x249dd2,_0x248092){return client[_0x0060('0xd')](_0xfc1316,_0x30d8eb)[_0x0060('0xe')](function(_0x3e49ef){logger[_0x0060('0xf')](_0x0060('0x10'),_0x47c888,_0x0060('0x11'));logger[_0x0060('0x12')](_0x0060('0x13'),_0x47c888,_0x0060('0x11'),JSON[_0x0060('0x14')](_0x3e49ef));if(_0x3e49ef['error']){if(_0x3e49ef[_0x0060('0x15')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x47c888,_0x3e49ef[_0x0060('0x15')][_0x0060('0x16')]);return _0x248092(_0x3e49ef['error'][_0x0060('0x16')]);}logger[_0x0060('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x47c888,_0x3e49ef[_0x0060('0x15')][_0x0060('0x16')]);return _0x249dd2(_0x3e49ef[_0x0060('0x15')][_0x0060('0x16')]);}else{logger[_0x0060('0xf')](_0x0060('0x10'),_0x47c888,_0x0060('0x11'));_0x249dd2(_0x3e49ef[_0x0060('0x17')][_0x0060('0x16')]);}})[_0x0060('0x18')](function(_0x4acfad){logger[_0x0060('0x15')](_0x0060('0x10'),_0x47c888,_0x4acfad);_0x248092(_0x4acfad);});});}exports[_0x0060('0x19')]=function(_0xaf8e4b){var _0x47354c=this;return new Promise(function(_0x56a6c5,_0x18eb61){return db[_0x0060('0x1a')][_0x0060('0x1b')](_0xaf8e4b[_0x0060('0x1c')],{'raw':_0xaf8e4b['options']?_0xaf8e4b[_0x0060('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaf8e4b[_0x0060('0x1d')]?_0xaf8e4b[_0x0060('0x1d')][_0x0060('0x1e')]||null:null,'attributes':_0xaf8e4b['options']?_0xaf8e4b['options'][_0x0060('0x1f')]||null:null,'limit':_0xaf8e4b[_0x0060('0x1d')]?_0xaf8e4b['options'][_0x0060('0x20')]||null:null})[_0x0060('0xe')](function(_0x3546b9){logger[_0x0060('0xf')](_0x0060('0x19'),_0xaf8e4b);logger[_0x0060('0x12')](_0x0060('0x19'),_0xaf8e4b,JSON[_0x0060('0x14')](_0x3546b9));_0x56a6c5(_0x3546b9);})[_0x0060('0x18')](function(_0x18b3fd){logger['error'](_0x0060('0x19'),_0x18b3fd['message'],_0xaf8e4b);_0x18eb61(_0x47354c[_0x0060('0x15')](0x1f4,_0x18b3fd[_0x0060('0x16')]));});});};exports[_0x0060('0x21')]=function(_0x2a4145){return new Promise(function(_0x583930,_0x1c2097){return db[_0x0060('0x1a')][_0x0060('0x22')]({'where':_0x2a4145[_0x0060('0x1d')]?_0x2a4145[_0x0060('0x1d')]['where']||null:null})['then'](function(_0x3292f8){if(_0x3292f8){return _0x3292f8[_0x0060('0x23')](_0x2a4145[_0x0060('0x1c')]['ids'],_[_0x0060('0x24')](_0x2a4145[_0x0060('0x1c')],[_0x0060('0x25'),'id'])||{});}})['spread'](function(_0x5f13d2){logger[_0x0060('0xf')](_0x0060('0x26'),_0x2a4145);logger[_0x0060('0x12')]('AddTags',_0x2a4145,JSON['stringify'](_0x5f13d2));_0x583930(_0x5f13d2);})['catch'](function(_0xcbd01a){logger[_0x0060('0x15')](_0x0060('0x26'),_0xcbd01a['message'],_0x2a4145);_0x1c2097(_this['error'](0x1f4,_0xcbd01a[_0x0060('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index ccf6373..ba32a0b 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 _0x5ddc=['emit','removeListener','register','length','chatInteraction:','save','remove','update'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x5ddc,0x13d));var _0xc5dd=function(_0x1d1281,_0x1b3c7d){_0x1d1281=_0x1d1281-0x0;var _0x5e8c2e=_0x5ddc[_0x1d1281];return _0x5e8c2e;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xc5dd('0x0'),_0xc5dd('0x1'),_0xc5dd('0x2')];function createListener(_0x224962,_0x38ece4){return function(_0x1282b3){_0x38ece4[_0xc5dd('0x3')](_0x224962,_0x1282b3);};}function removeListener(_0x363b02,_0x205800){return function(){ChatInteractionEvents[_0xc5dd('0x4')](_0x363b02,_0x205800);};}exports[_0xc5dd('0x5')]=function(_0x3d64a8){for(var _0x2bfe44=0x0,_0x71db7b=events[_0xc5dd('0x6')];_0x2bfe44<_0x71db7b;_0x2bfe44++){var _0x42a979=events[_0x2bfe44];var _0xc9d03a=createListener(_0xc5dd('0x7')+_0x42a979,_0x3d64a8);ChatInteractionEvents['on'](_0x42a979,_0xc9d03a);}};
\ No newline at end of file
+var _0xafb4=['remove','emit','register','length','./chatInteraction.events','save'];(function(_0x306381,_0x5348bf){var _0x2333a4=function(_0xfb4d05){while(--_0xfb4d05){_0x306381['push'](_0x306381['shift']());}};_0x2333a4(++_0x5348bf);}(_0xafb4,0x124));var _0x4afb=function(_0x302027,_0x49d4bc){_0x302027=_0x302027-0x0;var _0x992bcb=_0xafb4[_0x302027];return _0x992bcb;};'use strict';var ChatInteractionEvents=require(_0x4afb('0x0'));var events=[_0x4afb('0x1'),_0x4afb('0x2'),'update'];function createListener(_0x531e8d,_0x49c1c6){return function(_0x632af4){_0x49c1c6[_0x4afb('0x3')](_0x531e8d,_0x632af4);};}function removeListener(_0x4319b2,_0x857858){return function(){ChatInteractionEvents['removeListener'](_0x4319b2,_0x857858);};}exports[_0x4afb('0x4')]=function(_0x4e3207){for(var _0xa88fc5=0x0,_0x47e938=events[_0x4afb('0x5')];_0xa88fc5<_0x47e938;_0xa88fc5++){var _0x1a35ed=events[_0xa88fc5];var _0x18b62c=createListener('chatInteraction:'+_0x1a35ed,_0x4e3207);ChatInteractionEvents['on'](_0x1a35ed,_0x18b62c);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 66da13b..54a307a 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 _0x86a8=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','/describe','describe','isChatInteractionAuthorized','show','get','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','/:id','chat','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','multer'];(function(_0x8b76d8,_0x3b4a33){var _0x124649=function(_0x3fa55c){while(--_0x3fa55c){_0x8b76d8['push'](_0x8b76d8['shift']());}};_0x124649(++_0x3b4a33);}(_0x86a8,0xa1));var _0x886a=function(_0x457f1e,_0x5c883b){_0x457f1e=_0x457f1e-0x0;var _0x2afbbe=_0x86a8[_0x457f1e];return _0x2afbbe;};'use strict';var multer=require(_0x886a('0x0'));var util=require(_0x886a('0x1'));var path=require(_0x886a('0x2'));var timeout=require('connect-timeout');var express=require(_0x886a('0x3'));var router=express[_0x886a('0x4')]();var fs_extra=require(_0x886a('0x5'));var auth=require(_0x886a('0x6'));var interaction=require(_0x886a('0x7'));var config=require('../../config/environment');var controller=require(_0x886a('0x8'));router['get']('/',auth[_0x886a('0x9')](),controller['index']);router['get'](_0x886a('0xa'),auth[_0x886a('0x9')](),controller[_0x886a('0xb')]);router['get']('/:id',auth[_0x886a('0xc')](),controller[_0x886a('0xd')]);router[_0x886a('0xe')](_0x886a('0xf'),auth[_0x886a('0xc')](),controller[_0x886a('0x10')]);router[_0x886a('0xe')](_0x886a('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x886a('0xe')](_0x886a('0x12'),auth[_0x886a('0xc')](),controller[_0x886a('0x13')]);router[_0x886a('0xe')](_0x886a('0x14'),auth[_0x886a('0x9')](),controller[_0x886a('0x15')]);router[_0x886a('0x16')]('/',auth[_0x886a('0x9')](),controller[_0x886a('0x17')]);router[_0x886a('0x16')]('/:id/vidaoo',auth[_0x886a('0x9')](),controller[_0x886a('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4f270d,_0x6d564c,_0x1840ae){_0x1840ae(null,path['join'](config[_0x886a('0x19')],_0x886a('0x1a')));},'filename':function(_0x2ad188,_0xbf11e6,_0x1a679e){_0x1a679e(null,util[_0x886a('0x1b')](_0x886a('0x1c'),Date[_0x886a('0x1d')](),_0xbf11e6[_0x886a('0x1e')][_0x886a('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x886a('0x16')](_0x886a('0x20'),upload[_0x886a('0x21')](_0x886a('0x22')),controller[_0x886a('0x23')]);router['post']('/:id/messages',auth[_0x886a('0xc')](),controller[_0x886a('0x24')]);router[_0x886a('0x16')](_0x886a('0x25'),auth[_0x886a('0x9')](),interaction[_0x886a('0x26')]('chat',_0x886a('0x27')),controller[_0x886a('0x28')]);router[_0x886a('0x29')](_0x886a('0x2a'),auth[_0x886a('0x9')](),interaction[_0x886a('0x26')](_0x886a('0x2b'),_0x886a('0x2c')),controller['update']);router['put']('/:id/custom_update',controller[_0x886a('0x2d')]);router[_0x886a('0x29')](_0x886a('0x2e'),auth[_0x886a('0xc')](),controller[_0x886a('0x2f')]);router[_0x886a('0x29')](_0x886a('0x30'),controller[_0x886a('0x31')]);router['delete'](_0x886a('0x2a'),auth[_0x886a('0x9')](),interaction[_0x886a('0x26')](_0x886a('0x2b'),_0x886a('0x32')),controller['destroy']);router[_0x886a('0x33')](_0x886a('0x25'),auth[_0x886a('0x9')](),controller[_0x886a('0x34')]);module[_0x886a('0x35')]=router;
\ No newline at end of file
+var _0xf5e9=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','file','attachmentUpload','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','tracked','chatinteraction:destroy','destroy','removeTags','exports','multer','util'];(function(_0x294f1b,_0x3f792c){var _0x15f86d=function(_0x367d30){while(--_0x367d30){_0x294f1b['push'](_0x294f1b['shift']());}};_0x15f86d(++_0x3f792c);}(_0xf5e9,0x9d));var _0x9f5e=function(_0x58fcda,_0x1c3d13){_0x58fcda=_0x58fcda-0x0;var _0x8e4b88=_0xf5e9[_0x58fcda];return _0x8e4b88;};'use strict';var multer=require(_0x9f5e('0x0'));var util=require(_0x9f5e('0x1'));var path=require(_0x9f5e('0x2'));var timeout=require(_0x9f5e('0x3'));var express=require(_0x9f5e('0x4'));var router=express['Router']();var fs_extra=require(_0x9f5e('0x5'));var auth=require(_0x9f5e('0x6'));var interaction=require(_0x9f5e('0x7'));var config=require('../../config/environment');var controller=require(_0x9f5e('0x8'));router['get']('/',auth[_0x9f5e('0x9')](),controller[_0x9f5e('0xa')]);router[_0x9f5e('0xb')]('/describe',auth[_0x9f5e('0x9')](),controller[_0x9f5e('0xc')]);router[_0x9f5e('0xb')](_0x9f5e('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x9f5e('0xe')]);router[_0x9f5e('0xb')](_0x9f5e('0xf'),auth[_0x9f5e('0x10')](),controller['attachmentDownload']);router[_0x9f5e('0xb')](_0x9f5e('0x11'),auth[_0x9f5e('0x9')](),controller[_0x9f5e('0x12')]);router[_0x9f5e('0xb')](_0x9f5e('0x13'),auth[_0x9f5e('0x10')](),controller[_0x9f5e('0x14')]);router['get'](_0x9f5e('0x15'),auth[_0x9f5e('0x9')](),controller['download']);router[_0x9f5e('0x16')]('/',auth[_0x9f5e('0x9')](),controller[_0x9f5e('0x17')]);router[_0x9f5e('0x16')](_0x9f5e('0x18'),auth['isAuthenticated'](),controller[_0x9f5e('0x19')]);var upload=multer({'storage':multer[_0x9f5e('0x1a')]({'destination':function(_0x2ec16c,_0x2210ad,_0x4e6499){_0x4e6499(null,path[_0x9f5e('0x1b')](config[_0x9f5e('0x1c')],_0x9f5e('0x1d')));},'filename':function(_0x125221,_0x387035,_0x566fd1){_0x566fd1(null,util[_0x9f5e('0x1e')](_0x9f5e('0x1f'),Date[_0x9f5e('0x20')](),_0x387035[_0x9f5e('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9f5e('0x16')]('/:id/attachment_upload',upload['single'](_0x9f5e('0x22')),controller[_0x9f5e('0x23')]);router[_0x9f5e('0x16')](_0x9f5e('0x11'),auth[_0x9f5e('0x10')](),controller['addMessage']);router[_0x9f5e('0x16')](_0x9f5e('0x24'),auth[_0x9f5e('0x9')](),interaction['tracked'](_0x9f5e('0x25'),_0x9f5e('0x26')),controller[_0x9f5e('0x27')]);router[_0x9f5e('0x28')](_0x9f5e('0xd'),auth[_0x9f5e('0x9')](),interaction['tracked'](_0x9f5e('0x25'),_0x9f5e('0x29')),controller['update']);router[_0x9f5e('0x28')](_0x9f5e('0x2a'),controller[_0x9f5e('0x2b')]);router['put'](_0x9f5e('0x2c'),auth[_0x9f5e('0x10')](),controller[_0x9f5e('0x2d')]);router[_0x9f5e('0x28')](_0x9f5e('0x2e'),controller['close']);router[_0x9f5e('0x2f')](_0x9f5e('0xd'),auth[_0x9f5e('0x9')](),interaction[_0x9f5e('0x30')](_0x9f5e('0x25'),_0x9f5e('0x31')),controller[_0x9f5e('0x32')]);router[_0x9f5e('0x2f')]('/:id/tags',auth[_0x9f5e('0x9')](),controller[_0x9f5e('0x33')]);module[_0x9f5e('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7bdfb60..e550e32 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 _0x1237=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x370841,_0x1eb3bf){var _0x282f9a=function(_0x3b6ea4){while(--_0x3b6ea4){_0x370841['push'](_0x370841['shift']());}};_0x282f9a(++_0x1eb3bf);}(_0x1237,0x19c));var _0x7123=function(_0x341dd3,_0x458bce){_0x341dd3=_0x341dd3-0x0;var _0x21c6f2=_0x1237[_0x341dd3];return _0x21c6f2;};'use strict';var Sequelize=require(_0x7123('0x0'));module[_0x7123('0x1')]={'body':{'type':Sequelize[_0x7123('0x2')](_0x7123('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7123('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7126=['BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x39f488,_0x4b73e3){var _0x10d29b=function(_0x2e1b5f){while(--_0x2e1b5f){_0x39f488['push'](_0x39f488['shift']());}};_0x10d29b(++_0x4b73e3);}(_0x7126,0x11f));var _0x6712=function(_0x3abbf7,_0x4a2b98){_0x3abbf7=_0x3abbf7-0x0;var _0x3ed4c4=_0x7126[_0x3abbf7];return _0x3ed4c4;};'use strict';var Sequelize=require(_0x6712('0x0'));module[_0x6712('0x1')]={'body':{'type':Sequelize[_0x6712('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6712('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6712('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 5311dd9..2632178 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 _0x63d5=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','User','agent','admin','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x63d5,0x155));var _0x563d=function(_0x50faaa,_0x59d114){_0x50faaa=_0x50faaa-0x0;var _0x48300e=_0x63d5[_0x50faaa];return _0x48300e;};'use strict';var emlformat=require(_0x563d('0x0'));var rimraf=require(_0x563d('0x1'));var zipdir=require(_0x563d('0x2'));var jsonpatch=require(_0x563d('0x3'));var rp=require(_0x563d('0x4'));var moment=require(_0x563d('0x5'));var BPromise=require(_0x563d('0x6'));var Mustache=require('mustache');var util=require(_0x563d('0x7'));var path=require('path');var sox=require(_0x563d('0x8'));var csv=require(_0x563d('0x9'));var ejs=require(_0x563d('0xa'));var fs=require('fs');var fs_extra=require(_0x563d('0xb'));var _=require(_0x563d('0xc'));var squel=require(_0x563d('0xd'));var crypto=require(_0x563d('0xe'));var jsforce=require(_0x563d('0xf'));var deskjs=require(_0x563d('0x10'));var toCsv=require(_0x563d('0x9'));var querystring=require(_0x563d('0x11'));var Papa=require(_0x563d('0x12'));var Redis=require(_0x563d('0x13'));var authService=require(_0x563d('0x14'));var qs=require(_0x563d('0x15'));var as=require(_0x563d('0x16'));var hardwareService=require(_0x563d('0x17'));var logger=require(_0x563d('0x18'))(_0x563d('0x19'));var utils=require(_0x563d('0x1a'));var config=require(_0x563d('0x1b'));var licenseUtil=require(_0x563d('0x1c'));var db=require(_0x563d('0x1d'))['db'];config[_0x563d('0x1e')]=_['defaults'](config[_0x563d('0x1e')],{'host':_0x563d('0x1f'),'port':0x18eb});var socket=require(_0x563d('0x20'))(new Redis(config[_0x563d('0x1e')]));require(_0x563d('0x21'))[_0x563d('0x22')](socket);function respondWithStatusCode(_0x2c779e,_0x3dcf2d){_0x3dcf2d=_0x3dcf2d||0xcc;return function(_0x1f8ca4){if(_0x1f8ca4){return _0x2c779e[_0x563d('0x23')](_0x3dcf2d);}return _0x2c779e[_0x563d('0x24')](_0x3dcf2d)[_0x563d('0x25')]();};}function respondWithResult(_0x54d57c,_0x9d84b1){_0x9d84b1=_0x9d84b1||0xc8;return function(_0x11209d){if(_0x11209d){return _0x54d57c['status'](_0x9d84b1)[_0x563d('0x26')](_0x11209d);}};}function respondWithFilteredResult(_0x2591a2,_0x5da478){return function(_0x5bf130){if(_0x5bf130){var _0x451d38=typeof _0x5da478[_0x563d('0x27')]==='undefined'&&typeof _0x5da478[_0x563d('0x28')]===_0x563d('0x29');var _0x3c37bd=_0x5bf130[_0x563d('0x2a')];var _0x2b4260=_0x451d38?0x0:_0x5da478[_0x563d('0x27')];var _0xb97bdc=_0x451d38?_0x5bf130['count']:_0x5da478[_0x563d('0x27')]+_0x5da478[_0x563d('0x28')];var _0x441738;if(_0xb97bdc>=_0x3c37bd){_0xb97bdc=_0x3c37bd;_0x441738=0xc8;}else{_0x441738=0xce;}_0x2591a2[_0x563d('0x24')](_0x441738);return _0x2591a2[_0x563d('0x2b')](_0x563d('0x2c'),_0x2b4260+'-'+_0xb97bdc+'/'+_0x3c37bd)['json'](_0x5bf130);}return null;};}function patchUpdates(_0x4c40b5){return function(_0x49c12d){try{jsonpatch[_0x563d('0x2d')](_0x49c12d,_0x4c40b5,!![]);}catch(_0xcde284){return BPromise[_0x563d('0x2e')](_0xcde284);}return _0x49c12d[_0x563d('0x2f')]();};}function saveUpdates(_0x35686f,_0x41ed08){return function(_0x24a7fb){if(_0x24a7fb){return _0x24a7fb[_0x563d('0x30')](_0x35686f)[_0x563d('0x31')](function(_0x19269d){return _0x19269d;});}return null;};}function removeEntity(_0x33c404,_0x5ac9a7){return function(_0x22e2a6){if(_0x22e2a6){return _0x22e2a6[_0x563d('0x32')]()['then'](function(){_0x33c404[_0x563d('0x24')](0xcc)[_0x563d('0x25')]();});}};}function handleEntityNotFound(_0xa666ba,_0x1fc8c4){return function(_0x5de75c){if(!_0x5de75c){_0xa666ba[_0x563d('0x23')](0x194);}return _0x5de75c;};}function handleError(_0x2493b0,_0x2e2427){_0x2e2427=_0x2e2427||0x1f4;return function(_0x46b1d9){logger[_0x563d('0x33')](_0x46b1d9[_0x563d('0x34')]);if(_0x46b1d9[_0x563d('0x35')]){delete _0x46b1d9[_0x563d('0x35')];}_0x2493b0[_0x563d('0x24')](_0x2e2427)[_0x563d('0x36')](_0x46b1d9);};}exports[_0x563d('0x37')]=function(_0x3d36bc,_0x42f30f){var _0x3db5b1={},_0x4863f2={},_0x3c922b={'count':0x0,'rows':[]};var _0x3aed99=_[_0x563d('0x38')](db[_0x563d('0x39')]['rawAttributes'],function(_0x3a9094){return{'name':_0x3a9094['fieldName'],'type':_0x3a9094[_0x563d('0x3a')]['key']};});_0x4863f2[_0x563d('0x3b')]=_['map'](_0x3aed99,_0x563d('0x35'));_0x4863f2[_0x563d('0x3c')]=_[_0x563d('0x3d')](_0x3d36bc[_0x563d('0x3c')]);_0x4863f2[_0x563d('0x3e')]=_[_0x563d('0x3f')](_0x4863f2[_0x563d('0x3b')],_0x4863f2[_0x563d('0x3c')]);_0x3db5b1[_0x563d('0x40')]=_[_0x563d('0x3f')](_0x4863f2['model'],qs[_0x563d('0x41')](_0x3d36bc['query'][_0x563d('0x41')]));_0x3db5b1['attributes']=_0x3db5b1[_0x563d('0x40')][_0x563d('0x42')]?_0x3db5b1[_0x563d('0x40')]:_0x4863f2[_0x563d('0x3b')];if(!_0x3d36bc['query'][_0x563d('0x43')](_0x563d('0x44'))){_0x3db5b1['limit']=qs['limit'](_0x3d36bc[_0x563d('0x3c')]['limit']);_0x3db5b1[_0x563d('0x27')]=qs[_0x563d('0x27')](_0x3d36bc[_0x563d('0x3c')][_0x563d('0x27')]);}_0x3db5b1[_0x563d('0x45')]=qs['sort'](_0x3d36bc[_0x563d('0x3c')][_0x563d('0x46')]);_0x3db5b1[_0x563d('0x47')]=qs[_0x563d('0x3e')](_[_0x563d('0x48')](_0x3d36bc[_0x563d('0x3c')],_0x4863f2['filters']),_0x3aed99);if(_0x3d36bc[_0x563d('0x3c')][_0x563d('0x49')]){_0x3db5b1['where']=_[_0x563d('0x4a')](_0x3db5b1[_0x563d('0x47')],{'$or':_[_0x563d('0x38')](_0x3aed99,function(_0x1d1fbd){if(_0x1d1fbd[_0x563d('0x3a')]!=='VIRTUAL'){var _0x182613={};_0x182613[_0x1d1fbd[_0x563d('0x35')]]={'$like':'%'+_0x3d36bc[_0x563d('0x3c')][_0x563d('0x49')]+'%'};return _0x182613;}})});}_0x3db5b1=_['merge']({},_0x3db5b1,_0x3d36bc['options']);var _0x29feb4={'where':_0x3db5b1[_0x563d('0x47')]};return db['ChatInternalMessage'][_0x563d('0x2a')](_0x29feb4)[_0x563d('0x31')](function(_0x41a798){_0x3c922b[_0x563d('0x2a')]=_0x41a798;if(_0x3d36bc[_0x563d('0x3c')]['includeAll']){_0x3db5b1[_0x563d('0x4b')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x563d('0x4c')](_0x3db5b1);})[_0x563d('0x31')](function(_0x34d9d4){_0x3c922b[_0x563d('0x4d')]=_0x34d9d4;return _0x3c922b;})['then'](respondWithFilteredResult(_0x42f30f,_0x3db5b1))[_0x563d('0x4e')](handleError(_0x42f30f,null));};exports['show']=function(_0x1acbc4,_0x2ed804){var _0x381af4={'raw':!![],'where':{'id':_0x1acbc4[_0x563d('0x4f')]['id']}},_0x4b2e21={};_0x4b2e21['model']=_[_0x563d('0x3d')](db[_0x563d('0x39')][_0x563d('0x50')]);_0x4b2e21[_0x563d('0x3c')]=_[_0x563d('0x3d')](_0x1acbc4[_0x563d('0x3c')]);_0x4b2e21['filters']=_[_0x563d('0x3f')](_0x4b2e21[_0x563d('0x3b')],_0x4b2e21[_0x563d('0x3c')]);_0x381af4[_0x563d('0x40')]=_[_0x563d('0x3f')](_0x4b2e21[_0x563d('0x3b')],qs['fields'](_0x1acbc4[_0x563d('0x3c')][_0x563d('0x41')]));_0x381af4['attributes']=_0x381af4[_0x563d('0x40')][_0x563d('0x42')]?_0x381af4[_0x563d('0x40')]:_0x4b2e21[_0x563d('0x3b')];if(_0x1acbc4['query'][_0x563d('0x51')]){_0x381af4['include']=[{'all':!![]}];}_0x381af4=_[_0x563d('0x4a')]({},_0x381af4,_0x1acbc4[_0x563d('0x52')]);return db[_0x563d('0x39')][_0x563d('0x53')](_0x381af4)[_0x563d('0x31')](handleEntityNotFound(_0x2ed804,null))[_0x563d('0x31')](respondWithResult(_0x2ed804,null))[_0x563d('0x4e')](handleError(_0x2ed804,null));};exports[_0x563d('0x54')]=function(_0x111cfe,_0x106db7){return db['ChatInternalMessage'][_0x563d('0x54')](_0x111cfe['body'],{})['then'](respondWithResult(_0x106db7,0xc9))[_0x563d('0x4e')](handleError(_0x106db7,null));};exports['update']=function(_0x1c3f21,_0x56b2a5){if(_0x1c3f21[_0x563d('0x55')]['id']){delete _0x1c3f21[_0x563d('0x55')]['id'];}return db[_0x563d('0x39')][_0x563d('0x53')]({'where':{'id':_0x1c3f21['params']['id']}})['then'](handleEntityNotFound(_0x56b2a5,null))[_0x563d('0x31')](saveUpdates(_0x1c3f21[_0x563d('0x55')],null))[_0x563d('0x31')](respondWithResult(_0x56b2a5,null))[_0x563d('0x4e')](handleError(_0x56b2a5,null));};exports[_0x563d('0x32')]=function(_0x3e9f96,_0x1bb095){return db[_0x563d('0x39')]['find']({'where':{'id':_0x3e9f96[_0x563d('0x4f')]['id']}})[_0x563d('0x31')](handleEntityNotFound(_0x1bb095,null))['then'](removeEntity(_0x1bb095,null))[_0x563d('0x4e')](handleError(_0x1bb095,null));};exports['describe']=function(_0x117b2e,_0x4cda51){return db[_0x563d('0x39')][_0x563d('0x56')]()[_0x563d('0x31')](respondWithResult(_0x4cda51,null))['catch'](handleError(_0x4cda51,null));};function wrapUser(_0xb40c87){return function(_0x4e7bb4){var _0x2ca552=_0xb40c87[_0x563d('0x57')]({'plain':!![]});_0x2ca552['messages']=[];if(_0x4e7bb4){_0x2ca552[_0x563d('0x58')]=_0x4e7bb4[_0x563d('0x59')];_0x2ca552[_0x563d('0x5a')]=_0x4e7bb4;}else{_0x2ca552[_0x563d('0x58')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2ca552['lastMessage']={};}return _0x2ca552;};}exports['getUsers']=function(_0x59f546,_0x18023a,_0x10a13a){var _0x3530a4=[];return db[_0x563d('0x5b')][_0x563d('0x4c')]({'where':{'role':[_0x563d('0x5c'),_0x563d('0x5d'),'user']},'attributes':['id',_0x563d('0x5e'),_0x563d('0x35'),'role',_0x563d('0x5f'),_0x563d('0x60'),_0x563d('0x61'),_0x563d('0x62'),_0x563d('0x63'),_0x563d('0x64')],'order':qs[_0x563d('0x46')](_0x563d('0x65')),'include':[{'model':db[_0x563d('0x66')],'as':_0x563d('0x67'),'attributes':['id','name',_0x563d('0x3a')],'through':{'attributes':[]}}]})[_0x563d('0x31')](function(_0x6bf38e){if(_0x6bf38e){var _0x2a627a=_0x59f546[_0x563d('0x68')][_0x563d('0x57')]({'plain':!![]});if(!_0x2a627a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a627a[_0x563d('0x69')]===_0x563d('0x68')){return db[_0x563d('0x6a')][_0x563d('0x53')]({'where':{'name':_0x563d('0x6b'),'userProfileId':_0x2a627a[_0x563d('0x6c')]},'raw':!![]})[_0x563d('0x31')](function(_0x3019c9){if(_0x3019c9){if(_0x3019c9['autoAssociation']===0x0){return db[_0x563d('0x6d')][_0x563d('0x4c')]({'where':{'sectionId':_0x3019c9['id']},'raw':!![]})['then'](function(_0x357a20){var _0x4f06b8=[];if(_[_0x563d('0x6e')](_0x357a20)){_0x4f06b8=_[_0x563d('0x49')](_0x6bf38e,function(_0x3e209c){if(_0x3e209c['role']!==_0x563d('0x5c')){return _0x3e209c;}});return _0x4f06b8;}else{for(var _0x146686=0x0;_0x146686<_0x6bf38e[_0x563d('0x42')];_0x146686++){var _0x5cfa03=_0x6bf38e[_0x146686];if(_0x5cfa03[_0x563d('0x69')]===_0x563d('0x5c')){var _0x235528=_[_0x563d('0x53')](_0x357a20,function(_0x2d943f){return _0x2d943f[_0x563d('0x6f')]===_0x5cfa03['id'];});if(_0x235528)_0x4f06b8[_0x563d('0x70')](_0x5cfa03);}else{_0x4f06b8[_0x563d('0x70')](_0x5cfa03);}}return _0x4f06b8;}});}else{return _0x6bf38e;}}else{var _0x2bcd7d=_[_0x563d('0x49')](_0x6bf38e,function(_0x1f93e2){if(_0x1f93e2[_0x563d('0x69')]!==_0x563d('0x5c')){return _0x1f93e2;}});return _0x2bcd7d;}});}else{return _0x6bf38e;}}})['then'](function(_0x182422){var _0x58dcd6=[];if(_0x182422){_0x3530a4=_0x182422;for(var _0x4bf460=0x0;_0x4bf460<_0x182422[_0x563d('0x42')];_0x4bf460+=0x1){_0x3530a4[_0x4bf460]['messages']=[];_0x58dcd6['push'](db['ChatInternalMessage'][_0x563d('0x53')]({'where':{'FromId':[_0x59f546[_0x563d('0x68')]['id'],_0x182422[_0x4bf460]['id']],'ToId':[_0x59f546[_0x563d('0x68')]['id'],_0x182422[_0x4bf460]['id']],'ChatGroupId':null},'attributes':['id',_0x563d('0x59'),'FromId','ToId',_0x563d('0x71'),'body'],'order':qs[_0x563d('0x46')](_0x563d('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x182422[_0x4bf460])));}return BPromise[_0x563d('0x73')](_0x58dcd6);}return[];})[_0x563d('0x31')](function(_0x1fb434){return{'rows':_0x1fb434,'count':_0x1fb434[_0x563d('0x42')]};})[_0x563d('0x31')](respondWithResult(_0x18023a,null))['catch'](handleError(_0x18023a,null));};
\ No newline at end of file
+var _0xdf91=['../../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','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','ChatInternalMessage','include','findAll','rows','catch','rawAttributes','includeAll','options','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','agent','admin','user','fullname','userpic','lastLoginAt','allowmessenger','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0xdf91,0x1ae));var _0x1df9=function(_0x1efa9,_0x1774fc){_0x1efa9=_0x1efa9-0x0;var _0x30157e=_0xdf91[_0x1efa9];return _0x30157e;};'use strict';var emlformat=require(_0x1df9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1df9('0x1'));var jsonpatch=require(_0x1df9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1df9('0x3'));var Mustache=require(_0x1df9('0x4'));var util=require(_0x1df9('0x5'));var path=require(_0x1df9('0x6'));var sox=require(_0x1df9('0x7'));var csv=require(_0x1df9('0x8'));var ejs=require(_0x1df9('0x9'));var fs=require('fs');var fs_extra=require(_0x1df9('0xa'));var _=require(_0x1df9('0xb'));var squel=require(_0x1df9('0xc'));var crypto=require(_0x1df9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1df9('0x8'));var querystring=require(_0x1df9('0xe'));var Papa=require(_0x1df9('0xf'));var Redis=require(_0x1df9('0x10'));var authService=require(_0x1df9('0x11'));var qs=require(_0x1df9('0x12'));var as=require(_0x1df9('0x13'));var hardwareService=require(_0x1df9('0x14'));var logger=require(_0x1df9('0x15'))(_0x1df9('0x16'));var utils=require(_0x1df9('0x17'));var config=require(_0x1df9('0x18'));var licenseUtil=require(_0x1df9('0x19'));var db=require(_0x1df9('0x1a'))['db'];config[_0x1df9('0x1b')]=_[_0x1df9('0x1c')](config[_0x1df9('0x1b')],{'host':_0x1df9('0x1d'),'port':0x18eb});var socket=require(_0x1df9('0x1e'))(new Redis(config[_0x1df9('0x1b')]));require(_0x1df9('0x1f'))['register'](socket);function respondWithStatusCode(_0x4f7965,_0x22297d){_0x22297d=_0x22297d||0xcc;return function(_0x4d2948){if(_0x4d2948){return _0x4f7965[_0x1df9('0x20')](_0x22297d);}return _0x4f7965[_0x1df9('0x21')](_0x22297d)[_0x1df9('0x22')]();};}function respondWithResult(_0x2805cc,_0x1b9347){_0x1b9347=_0x1b9347||0xc8;return function(_0x42f221){if(_0x42f221){return _0x2805cc[_0x1df9('0x21')](_0x1b9347)[_0x1df9('0x23')](_0x42f221);}};}function respondWithFilteredResult(_0x582b43,_0x1f967c){return function(_0x4668ad){if(_0x4668ad){var _0x5ddb1c=typeof _0x1f967c[_0x1df9('0x24')]===_0x1df9('0x25')&&typeof _0x1f967c[_0x1df9('0x26')]===_0x1df9('0x25');var _0x7ac859=_0x4668ad['count'];var _0x545d1c=_0x5ddb1c?0x0:_0x1f967c[_0x1df9('0x24')];var _0xe1e29e=_0x5ddb1c?_0x4668ad[_0x1df9('0x27')]:_0x1f967c[_0x1df9('0x24')]+_0x1f967c['limit'];var _0x3e8319;if(_0xe1e29e>=_0x7ac859){_0xe1e29e=_0x7ac859;_0x3e8319=0xc8;}else{_0x3e8319=0xce;}_0x582b43[_0x1df9('0x21')](_0x3e8319);return _0x582b43['set'](_0x1df9('0x28'),_0x545d1c+'-'+_0xe1e29e+'/'+_0x7ac859)[_0x1df9('0x23')](_0x4668ad);}return null;};}function patchUpdates(_0x144440){return function(_0x398460){try{jsonpatch[_0x1df9('0x29')](_0x398460,_0x144440,!![]);}catch(_0x39acb7){return BPromise[_0x1df9('0x2a')](_0x39acb7);}return _0x398460[_0x1df9('0x2b')]();};}function saveUpdates(_0x53b4da,_0x2fc140){return function(_0x1f76d2){if(_0x1f76d2){return _0x1f76d2[_0x1df9('0x2c')](_0x53b4da)[_0x1df9('0x2d')](function(_0x2a964e){return _0x2a964e;});}return null;};}function removeEntity(_0x22a32a,_0x24b178){return function(_0x27e242){if(_0x27e242){return _0x27e242[_0x1df9('0x2e')]()[_0x1df9('0x2d')](function(){_0x22a32a['status'](0xcc)[_0x1df9('0x22')]();});}};}function handleEntityNotFound(_0x101913,_0xfe433b){return function(_0x304d9b){if(!_0x304d9b){_0x101913[_0x1df9('0x20')](0x194);}return _0x304d9b;};}function handleError(_0x5db4c6,_0x5d7e98){_0x5d7e98=_0x5d7e98||0x1f4;return function(_0x143ad8){logger[_0x1df9('0x2f')](_0x143ad8[_0x1df9('0x30')]);if(_0x143ad8[_0x1df9('0x31')]){delete _0x143ad8[_0x1df9('0x31')];}_0x5db4c6[_0x1df9('0x21')](_0x5d7e98)[_0x1df9('0x32')](_0x143ad8);};}exports[_0x1df9('0x33')]=function(_0x201b61,_0x5f79ae){var _0x4a1e91={},_0x2efeb4={},_0x534b1f={'count':0x0,'rows':[]};var _0x22448b=_[_0x1df9('0x34')](db['ChatInternalMessage']['rawAttributes'],function(_0x88dbcb){return{'name':_0x88dbcb[_0x1df9('0x35')],'type':_0x88dbcb[_0x1df9('0x36')]['key']};});_0x2efeb4[_0x1df9('0x37')]=_['map'](_0x22448b,_0x1df9('0x31'));_0x2efeb4[_0x1df9('0x38')]=_[_0x1df9('0x39')](_0x201b61['query']);_0x2efeb4[_0x1df9('0x3a')]=_[_0x1df9('0x3b')](_0x2efeb4[_0x1df9('0x37')],_0x2efeb4['query']);_0x4a1e91['attributes']=_['intersection'](_0x2efeb4[_0x1df9('0x37')],qs[_0x1df9('0x3c')](_0x201b61['query']['fields']));_0x4a1e91[_0x1df9('0x3d')]=_0x4a1e91[_0x1df9('0x3d')][_0x1df9('0x3e')]?_0x4a1e91[_0x1df9('0x3d')]:_0x2efeb4[_0x1df9('0x37')];if(!_0x201b61[_0x1df9('0x38')][_0x1df9('0x3f')](_0x1df9('0x40'))){_0x4a1e91[_0x1df9('0x26')]=qs[_0x1df9('0x26')](_0x201b61[_0x1df9('0x38')][_0x1df9('0x26')]);_0x4a1e91[_0x1df9('0x24')]=qs[_0x1df9('0x24')](_0x201b61[_0x1df9('0x38')][_0x1df9('0x24')]);}_0x4a1e91['order']=qs[_0x1df9('0x41')](_0x201b61['query'][_0x1df9('0x41')]);_0x4a1e91['where']=qs['filters'](_[_0x1df9('0x42')](_0x201b61[_0x1df9('0x38')],_0x2efeb4['filters']),_0x22448b);if(_0x201b61[_0x1df9('0x38')][_0x1df9('0x43')]){_0x4a1e91[_0x1df9('0x44')]=_[_0x1df9('0x45')](_0x4a1e91[_0x1df9('0x44')],{'$or':_[_0x1df9('0x34')](_0x22448b,function(_0x12994b){if(_0x12994b['type']!==_0x1df9('0x46')){var _0x357df2={};_0x357df2[_0x12994b['name']]={'$like':'%'+_0x201b61[_0x1df9('0x38')][_0x1df9('0x43')]+'%'};return _0x357df2;}})});}_0x4a1e91=_['merge']({},_0x4a1e91,_0x201b61['options']);var _0xc30831={'where':_0x4a1e91[_0x1df9('0x44')]};return db[_0x1df9('0x47')][_0x1df9('0x27')](_0xc30831)[_0x1df9('0x2d')](function(_0x5912f7){_0x534b1f[_0x1df9('0x27')]=_0x5912f7;if(_0x201b61[_0x1df9('0x38')]['includeAll']){_0x4a1e91[_0x1df9('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x1df9('0x49')](_0x4a1e91);})[_0x1df9('0x2d')](function(_0x32f827){_0x534b1f[_0x1df9('0x4a')]=_0x32f827;return _0x534b1f;})['then'](respondWithFilteredResult(_0x5f79ae,_0x4a1e91))[_0x1df9('0x4b')](handleError(_0x5f79ae,null));};exports['show']=function(_0x49bb61,_0x1d2bc9){var _0x2f669c={'raw':!![],'where':{'id':_0x49bb61['params']['id']}},_0x45aa58={};_0x45aa58[_0x1df9('0x37')]=_[_0x1df9('0x39')](db[_0x1df9('0x47')][_0x1df9('0x4c')]);_0x45aa58[_0x1df9('0x38')]=_[_0x1df9('0x39')](_0x49bb61[_0x1df9('0x38')]);_0x45aa58[_0x1df9('0x3a')]=_[_0x1df9('0x3b')](_0x45aa58[_0x1df9('0x37')],_0x45aa58[_0x1df9('0x38')]);_0x2f669c[_0x1df9('0x3d')]=_[_0x1df9('0x3b')](_0x45aa58[_0x1df9('0x37')],qs['fields'](_0x49bb61['query'][_0x1df9('0x3c')]));_0x2f669c[_0x1df9('0x3d')]=_0x2f669c[_0x1df9('0x3d')][_0x1df9('0x3e')]?_0x2f669c[_0x1df9('0x3d')]:_0x45aa58[_0x1df9('0x37')];if(_0x49bb61[_0x1df9('0x38')][_0x1df9('0x4d')]){_0x2f669c[_0x1df9('0x48')]=[{'all':!![]}];}_0x2f669c=_['merge']({},_0x2f669c,_0x49bb61[_0x1df9('0x4e')]);return db[_0x1df9('0x47')][_0x1df9('0x4f')](_0x2f669c)[_0x1df9('0x2d')](handleEntityNotFound(_0x1d2bc9,null))[_0x1df9('0x2d')](respondWithResult(_0x1d2bc9,null))[_0x1df9('0x4b')](handleError(_0x1d2bc9,null));};exports[_0x1df9('0x50')]=function(_0x512be5,_0x1bc4b2){return db['ChatInternalMessage'][_0x1df9('0x50')](_0x512be5[_0x1df9('0x51')],{})[_0x1df9('0x2d')](respondWithResult(_0x1bc4b2,0xc9))['catch'](handleError(_0x1bc4b2,null));};exports[_0x1df9('0x2c')]=function(_0x46d58a,_0x482da3){if(_0x46d58a[_0x1df9('0x51')]['id']){delete _0x46d58a['body']['id'];}return db[_0x1df9('0x47')][_0x1df9('0x4f')]({'where':{'id':_0x46d58a[_0x1df9('0x52')]['id']}})[_0x1df9('0x2d')](handleEntityNotFound(_0x482da3,null))['then'](saveUpdates(_0x46d58a[_0x1df9('0x51')],null))[_0x1df9('0x2d')](respondWithResult(_0x482da3,null))[_0x1df9('0x4b')](handleError(_0x482da3,null));};exports[_0x1df9('0x2e')]=function(_0xcb7866,_0x2597e9){return db['ChatInternalMessage'][_0x1df9('0x4f')]({'where':{'id':_0xcb7866[_0x1df9('0x52')]['id']}})['then'](handleEntityNotFound(_0x2597e9,null))[_0x1df9('0x2d')](removeEntity(_0x2597e9,null))['catch'](handleError(_0x2597e9,null));};exports[_0x1df9('0x53')]=function(_0x5d1117,_0x365892){return db[_0x1df9('0x47')][_0x1df9('0x53')]()[_0x1df9('0x2d')](respondWithResult(_0x365892,null))[_0x1df9('0x4b')](handleError(_0x365892,null));};function wrapUser(_0x4591b5){return function(_0x3ba9c8){var _0x2d9548=_0x4591b5[_0x1df9('0x54')]({'plain':!![]});_0x2d9548[_0x1df9('0x55')]=[];if(_0x3ba9c8){_0x2d9548[_0x1df9('0x56')]=_0x3ba9c8[_0x1df9('0x57')];_0x2d9548[_0x1df9('0x58')]=_0x3ba9c8;}else{_0x2d9548['lastMessageAt']=moment(0x0)[_0x1df9('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d9548['lastMessage']={};}return _0x2d9548;};}exports['getUsers']=function(_0x30a5b1,_0x1215e0,_0x509daf){var _0x48d35e=[];return db[_0x1df9('0x5a')][_0x1df9('0x49')]({'where':{'role':[_0x1df9('0x5b'),_0x1df9('0x5c'),_0x1df9('0x5d')]},'attributes':['id',_0x1df9('0x5e'),_0x1df9('0x31'),'role',_0x1df9('0x5f'),'internal','online',_0x1df9('0x60'),_0x1df9('0x61'),'showWebBar'],'order':qs['sort'](_0x1df9('0x62')),'include':[{'model':db['VoiceQueue'],'as':_0x1df9('0x63'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x1df9('0x2d')](function(_0x280f6f){if(_0x280f6f){var _0x464bf1=_0x30a5b1[_0x1df9('0x5d')][_0x1df9('0x54')]({'plain':!![]});if(!_0x464bf1)throw new Error(_0x1df9('0x64'));if(_0x464bf1[_0x1df9('0x65')]===_0x1df9('0x5d')){return db[_0x1df9('0x66')][_0x1df9('0x4f')]({'where':{'name':'Agents','userProfileId':_0x464bf1[_0x1df9('0x67')]},'raw':!![]})[_0x1df9('0x2d')](function(_0x3f02da){if(_0x3f02da){if(_0x3f02da[_0x1df9('0x68')]===0x0){return db[_0x1df9('0x69')]['findAll']({'where':{'sectionId':_0x3f02da['id']},'raw':!![]})[_0x1df9('0x2d')](function(_0x2ca515){var _0x4c7385=[];if(_[_0x1df9('0x6a')](_0x2ca515)){_0x4c7385=_[_0x1df9('0x43')](_0x280f6f,function(_0x446631){if(_0x446631[_0x1df9('0x65')]!=='agent'){return _0x446631;}});return _0x4c7385;}else{for(var _0xc08845=0x0;_0xc08845<_0x280f6f[_0x1df9('0x3e')];_0xc08845++){var _0x1d8713=_0x280f6f[_0xc08845];if(_0x1d8713[_0x1df9('0x65')]===_0x1df9('0x5b')){var _0x474014=_[_0x1df9('0x4f')](_0x2ca515,function(_0x3ca67c){return _0x3ca67c[_0x1df9('0x6b')]===_0x1d8713['id'];});if(_0x474014)_0x4c7385[_0x1df9('0x6c')](_0x1d8713);}else{_0x4c7385[_0x1df9('0x6c')](_0x1d8713);}}return _0x4c7385;}});}else{return _0x280f6f;}}else{var _0x3141f9=_['filter'](_0x280f6f,function(_0x437428){if(_0x437428[_0x1df9('0x65')]!==_0x1df9('0x5b')){return _0x437428;}});return _0x3141f9;}});}else{return _0x280f6f;}}})[_0x1df9('0x2d')](function(_0x7413e2){var _0x6b8c8=[];if(_0x7413e2){_0x48d35e=_0x7413e2;for(var _0x623278=0x0;_0x623278<_0x7413e2['length'];_0x623278+=0x1){_0x48d35e[_0x623278][_0x1df9('0x55')]=[];_0x6b8c8[_0x1df9('0x6c')](db['ChatInternalMessage'][_0x1df9('0x4f')]({'where':{'FromId':[_0x30a5b1[_0x1df9('0x5d')]['id'],_0x7413e2[_0x623278]['id']],'ToId':[_0x30a5b1[_0x1df9('0x5d')]['id'],_0x7413e2[_0x623278]['id']],'ChatGroupId':null},'attributes':['id',_0x1df9('0x57'),_0x1df9('0x6d'),_0x1df9('0x6e'),'read','body'],'order':qs[_0x1df9('0x41')](_0x1df9('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x7413e2[_0x623278])));}return BPromise['all'](_0x6b8c8);}return[];})[_0x1df9('0x2d')](function(_0x579aef){return{'rows':_0x579aef,'count':_0x579aef[_0x1df9('0x3e')]};})[_0x1df9('0x2d')](respondWithResult(_0x1215e0,null))[_0x1df9('0x4b')](handleError(_0x1215e0,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 17672a3..d9df775 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 _0x1666=['emit','exports','events','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x235e66,_0x4bef96){var _0x36019b=function(_0x3674f3){while(--_0x3674f3){_0x235e66['push'](_0x235e66['shift']());}};_0x36019b(++_0x4bef96);}(_0x1666,0xbf));var _0x6166=function(_0x160c44,_0x1deaf1){_0x160c44=_0x160c44-0x0;var _0x518efd=_0x1666[_0x160c44];return _0x518efd;};'use strict';var EventEmitter=require(_0x6166('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x6166('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6166('0x2')](0x0);var events={'afterCreate':_0x6166('0x3'),'afterUpdate':_0x6166('0x4'),'afterDestroy':'remove'};function emitEvent(_0x489f2d){return function(_0x255767,_0x411db1,_0x55c2b5){ChatInternalMessageEvents[_0x6166('0x5')](_0x489f2d+':'+_0x255767['id'],_0x255767);ChatInternalMessageEvents[_0x6166('0x5')](_0x489f2d,_0x255767);_0x55c2b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x6166('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe408=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x10db6b,_0x319505){var _0xa0fb99=function(_0x35fa67){while(--_0x35fa67){_0x10db6b['push'](_0x10db6b['shift']());}};_0xa0fb99(++_0x319505);}(_0xe408,0x74));var _0x8e40=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe408[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x8e40('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e40('0x1'),'afterUpdate':_0x8e40('0x2'),'afterDestroy':_0x8e40('0x3')};function emitEvent(_0x539421){return function(_0x5e5bae,_0x7f5126,_0x32f527){ChatInternalMessageEvents[_0x8e40('0x4')](_0x539421+':'+_0x5e5bae['id'],_0x5e5bae);ChatInternalMessageEvents['emit'](_0x539421,_0x5e5bae);_0x32f527(null);};}for(var e in events){if(events[_0x8e40('0x5')](e)){var event=events[e];ChatInternalMessage[_0x8e40('0x6')](e,emitEvent(event));}}module[_0x8e40('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 30a4e10..6704b1f 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 _0xe90b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5175b8,_0x20b486){var _0x25085d=function(_0x407b08){while(--_0x407b08){_0x5175b8['push'](_0x5175b8['shift']());}};_0x25085d(++_0x20b486);}(_0xe90b,0x107));var _0xbe90=function(_0xf89ad3,_0x4a4a05){_0xf89ad3=_0xf89ad3-0x0;var _0x324449=_0xe90b[_0xf89ad3];return _0x324449;};'use strict';var _=require(_0xbe90('0x0'));var util=require('util');var logger=require(_0xbe90('0x1'))(_0xbe90('0x2'));var moment=require(_0xbe90('0x3'));var BPromise=require(_0xbe90('0x4'));var rp=require(_0xbe90('0x5'));var fs=require('fs');var path=require(_0xbe90('0x6'));var rimraf=require(_0xbe90('0x7'));var config=require(_0xbe90('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xbe90('0x9')]=function(_0x2a2c5e,_0x450bff){return _0x2a2c5e['define'](_0xbe90('0xa'),attributes,{'tableName':_0xbe90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe90('0xc'),'collate':_0xbe90('0xd')});};
\ No newline at end of file
+var _0x4e5d=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x102fe7,_0x2329d7){var _0x28baeb=function(_0x5c8475){while(--_0x5c8475){_0x102fe7['push'](_0x102fe7['shift']());}};_0x28baeb(++_0x2329d7);}(_0x4e5d,0x6c));var _0xd4e5=function(_0x1d1918,_0x9b060b){_0x1d1918=_0x1d1918-0x0;var _0x40242b=_0x4e5d[_0x1d1918];return _0x40242b;};'use strict';var _=require(_0xd4e5('0x0'));var util=require(_0xd4e5('0x1'));var logger=require(_0xd4e5('0x2'))(_0xd4e5('0x3'));var moment=require('moment');var BPromise=require(_0xd4e5('0x4'));var rp=require(_0xd4e5('0x5'));var fs=require('fs');var path=require(_0xd4e5('0x6'));var rimraf=require(_0xd4e5('0x7'));var config=require(_0xd4e5('0x8'));var attributes=require(_0xd4e5('0x9'));module[_0xd4e5('0xa')]=function(_0x17a134,_0x2e3997){return _0x17a134[_0xd4e5('0xb')](_0xd4e5('0xc'),attributes,{'tableName':_0xd4e5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4e5('0xe'),'collate':_0xd4e5('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index b4c60f1..5b0ee2b 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 _0x093d=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x58482e,_0x370ce6){var _0x43e87d=function(_0x5ddda8){while(--_0x5ddda8){_0x58482e['push'](_0x58482e['shift']());}};_0x43e87d(++_0x370ce6);}(_0x093d,0x1c9));var _0xd093=function(_0x5be46a,_0x2fb035){_0x5be46a=_0x5be46a-0x0;var _0x1ce3b8=_0x093d[_0x5be46a];return _0x1ce3b8;};'use strict';var _=require(_0xd093('0x0'));var util=require(_0xd093('0x1'));var moment=require(_0xd093('0x2'));var BPromise=require(_0xd093('0x3'));var rs=require(_0xd093('0x4'));var fs=require('fs');var Redis=require(_0xd093('0x5'));var db=require(_0xd093('0x6'))['db'];var utils=require(_0xd093('0x7'));var logger=require(_0xd093('0x8'))(_0xd093('0x9'));var config=require(_0xd093('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xd093('0xb')](config[_0xd093('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd093('0xd'))(new Redis(config[_0xd093('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3b7f9e,_0x27f19b,_0x354827){return new BPromise(function(_0x93a722,_0x55939d){return client[_0xd093('0xe')](_0x3b7f9e,_0x354827)['then'](function(_0xc77895){logger['info'](_0xd093('0xf'),_0x27f19b,_0xd093('0x10'));logger[_0xd093('0x11')](_0xd093('0x12'),_0x27f19b,_0xd093('0x10'),JSON[_0xd093('0x13')](_0xc77895));if(_0xc77895['error']){if(_0xc77895[_0xd093('0x14')]['code']===0x1f4){logger[_0xd093('0x14')](_0xd093('0xf'),_0x27f19b,_0xc77895[_0xd093('0x14')][_0xd093('0x15')]);return _0x55939d(_0xc77895[_0xd093('0x14')]['message']);}logger['error'](_0xd093('0xf'),_0x27f19b,_0xc77895[_0xd093('0x14')]['message']);return _0x93a722(_0xc77895[_0xd093('0x14')][_0xd093('0x15')]);}else{logger[_0xd093('0x16')](_0xd093('0xf'),_0x27f19b,_0xd093('0x10'));_0x93a722(_0xc77895[_0xd093('0x17')]['message']);}})['catch'](function(_0x2f19a9){logger[_0xd093('0x14')](_0xd093('0xf'),_0x27f19b,_0x2f19a9);_0x55939d(_0x2f19a9);});});}
\ No newline at end of file
+var _0x0c74=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x370802,_0x2f1062){var _0x508d1e=function(_0x635a0e){while(--_0x635a0e){_0x370802['push'](_0x370802['shift']());}};_0x508d1e(++_0x2f1062);}(_0x0c74,0x1cd));var _0x40c7=function(_0x25510b,_0x46fc92){_0x25510b=_0x25510b-0x0;var _0x5a07e9=_0x0c74[_0x25510b];return _0x5a07e9;};'use strict';var _=require('lodash');var util=require(_0x40c7('0x0'));var moment=require(_0x40c7('0x1'));var BPromise=require(_0x40c7('0x2'));var rs=require(_0x40c7('0x3'));var fs=require('fs');var Redis=require(_0x40c7('0x4'));var db=require(_0x40c7('0x5'))['db'];var utils=require(_0x40c7('0x6'));var logger=require('../../config/logger')(_0x40c7('0x7'));var config=require(_0x40c7('0x8'));var jayson=require(_0x40c7('0x9'));var client=jayson[_0x40c7('0xa')]['http']({'port':0x232a});config[_0x40c7('0xb')]=_[_0x40c7('0xc')](config[_0x40c7('0xb')],{'host':_0x40c7('0xd'),'port':0x18eb});var socket=require(_0x40c7('0xe'))(new Redis(config[_0x40c7('0xb')]));require(_0x40c7('0xf'))[_0x40c7('0x10')](socket);function respondWithRpcPromise(_0x2106a1,_0x429402,_0x292b85){return new BPromise(function(_0x5854d6,_0x1df969){return client['request'](_0x2106a1,_0x292b85)[_0x40c7('0x11')](function(_0x5ccadb){logger[_0x40c7('0x12')](_0x40c7('0x13'),_0x429402,_0x40c7('0x14'));logger['debug'](_0x40c7('0x15'),_0x429402,_0x40c7('0x14'),JSON[_0x40c7('0x16')](_0x5ccadb));if(_0x5ccadb['error']){if(_0x5ccadb[_0x40c7('0x17')]['code']===0x1f4){logger['error'](_0x40c7('0x13'),_0x429402,_0x5ccadb[_0x40c7('0x17')]['message']);return _0x1df969(_0x5ccadb['error']['message']);}logger[_0x40c7('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x429402,_0x5ccadb['error'][_0x40c7('0x18')]);return _0x5854d6(_0x5ccadb[_0x40c7('0x17')][_0x40c7('0x18')]);}else{logger[_0x40c7('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x429402,_0x40c7('0x14'));_0x5854d6(_0x5ccadb[_0x40c7('0x19')][_0x40c7('0x18')]);}})[_0x40c7('0x1a')](function(_0x4e6d4a){logger['error'](_0x40c7('0x13'),_0x429402,_0x4e6d4a);_0x1df969(_0x4e6d4a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index e9de56a..243fc06 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 _0xb175=['remove','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x4c0619,_0x58dd6b){var _0x40ee84=function(_0x507ec6){while(--_0x507ec6){_0x4c0619['push'](_0x4c0619['shift']());}};_0x40ee84(++_0x58dd6b);}(_0xb175,0x1e9));var _0x5b17=function(_0x12f1e9,_0x5e4b21){_0x12f1e9=_0x12f1e9-0x0;var _0x2dc2de=_0xb175[_0x12f1e9];return _0x2dc2de;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5b17('0x0'),_0x5b17('0x1'),'update'];function createListener(_0x15f6fa,_0x363647){return function(_0x316e2f){_0x363647[_0x5b17('0x2')](_0x15f6fa,_0x316e2f);};}function removeListener(_0x1be9da,_0x3e190d){return function(){ChatInternalMessageEvents[_0x5b17('0x3')](_0x1be9da,_0x3e190d);};}exports[_0x5b17('0x4')]=function(_0x5c560a){for(var _0x51006a=0x0,_0xd49f93=events[_0x5b17('0x5')];_0x51006a<_0xd49f93;_0x51006a++){var _0x59d155=events[_0x51006a];var _0x5d81d6=createListener(_0x5b17('0x6')+_0x59d155,_0x5c560a);ChatInternalMessageEvents['on'](_0x59d155,_0x5d81d6);}};
\ No newline at end of file
+var _0x828f=['save','remove','update','emit','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x39768c,_0x46b47d){var _0x17f06c=function(_0xc08ab4){while(--_0xc08ab4){_0x39768c['push'](_0x39768c['shift']());}};_0x17f06c(++_0x46b47d);}(_0x828f,0x12b));var _0xf828=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x828f[_0x5eef05];return _0x56d4b8;};'use strict';var ChatInternalMessageEvents=require(_0xf828('0x0'));var events=[_0xf828('0x1'),_0xf828('0x2'),_0xf828('0x3')];function createListener(_0x1e571d,_0x4ae3b3){return function(_0x14ea31){_0x4ae3b3[_0xf828('0x4')](_0x1e571d,_0x14ea31);};}function removeListener(_0x588942,_0x3319b7){return function(){ChatInternalMessageEvents['removeListener'](_0x588942,_0x3319b7);};}exports['register']=function(_0x4d0ec8){for(var _0x2f9dc5=0x0,_0x1a63dd=events['length'];_0x2f9dc5<_0x1a63dd;_0x2f9dc5++){var _0x2f1d26=events[_0x2f9dc5];var _0x48fa7c=createListener(_0xf828('0x5')+_0x2f1d26,_0x4d0ec8);ChatInternalMessageEvents['on'](_0x2f1d26,_0x48fa7c);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index d1d27c2..c67d04d 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 _0x4beb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','destroy','exports','util','express','Router'];(function(_0x59556b,_0x3db7cb){var _0x3f3150=function(_0x22fed7){while(--_0x22fed7){_0x59556b['push'](_0x59556b['shift']());}};_0x3f3150(++_0x3db7cb);}(_0x4beb,0x14d));var _0xb4be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4beb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb4be('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb4be('0x1'));var router=express[_0xb4be('0x2')]();var fs_extra=require(_0xb4be('0x3'));var auth=require(_0xb4be('0x4'));var interaction=require(_0xb4be('0x5'));var config=require(_0xb4be('0x6'));var controller=require(_0xb4be('0x7'));router[_0xb4be('0x8')]('/',auth['isAuthenticated'](),controller[_0xb4be('0x9')]);router[_0xb4be('0x8')](_0xb4be('0xa'),auth[_0xb4be('0xb')](),controller['describe']);router['get'](_0xb4be('0xc'),auth['isAuthenticated'](),controller[_0xb4be('0xd')]);router[_0xb4be('0x8')](_0xb4be('0xe'),auth[_0xb4be('0xb')](),controller['show']);router[_0xb4be('0xf')]('/',auth[_0xb4be('0xb')](),controller[_0xb4be('0x10')]);router[_0xb4be('0x11')]('/:id',controller[_0xb4be('0x12')]);router['delete'](_0xb4be('0xe'),auth[_0xb4be('0xb')](),controller[_0xb4be('0x13')]);module[_0xb4be('0x14')]=router;
\ No newline at end of file
+var _0x8c04=['isAuthenticated','/describe','describe','getUsers','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x5159fd,_0x4b760b){var _0x409bae=function(_0x30f5f0){while(--_0x30f5f0){_0x5159fd['push'](_0x5159fd['shift']());}};_0x409bae(++_0x4b760b);}(_0x8c04,0x155));var _0x48c0=function(_0x12aa5f,_0x1a6cc9){_0x12aa5f=_0x12aa5f-0x0;var _0x1302d1=_0x8c04[_0x12aa5f];return _0x1302d1;};'use strict';var multer=require(_0x48c0('0x0'));var util=require(_0x48c0('0x1'));var path=require(_0x48c0('0x2'));var timeout=require(_0x48c0('0x3'));var express=require(_0x48c0('0x4'));var router=express['Router']();var fs_extra=require(_0x48c0('0x5'));var auth=require(_0x48c0('0x6'));var interaction=require(_0x48c0('0x7'));var config=require(_0x48c0('0x8'));var controller=require(_0x48c0('0x9'));router[_0x48c0('0xa')]('/',auth[_0x48c0('0xb')](),controller['index']);router['get'](_0x48c0('0xc'),auth[_0x48c0('0xb')](),controller[_0x48c0('0xd')]);router[_0x48c0('0xa')]('/users',auth['isAuthenticated'](),controller[_0x48c0('0xe')]);router['get'](_0x48c0('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x48c0('0x10')]('/',auth[_0x48c0('0xb')](),controller[_0x48c0('0x11')]);router[_0x48c0('0x12')](_0x48c0('0xf'),controller[_0x48c0('0x13')]);router[_0x48c0('0x14')]('/:id',auth[_0x48c0('0xb')](),controller['destroy']);module[_0x48c0('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 494f32f..833f9dc 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 _0xbcff=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x1aae33,_0x110a80){var _0x2e91e9=function(_0x218767){while(--_0x218767){_0x1aae33['push'](_0x1aae33['shift']());}};_0x2e91e9(++_0x110a80);}(_0xbcff,0x12e));var _0xfbcf=function(_0x541037,_0x582f95){_0x541037=_0x541037-0x0;var _0x225dd7=_0xbcff[_0x541037];return _0x225dd7;};'use strict';var Sequelize=require(_0xfbcf('0x0'));module[_0xfbcf('0x1')]={'body':{'type':Sequelize[_0xfbcf('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfbcf('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfbcf('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfbcf('0x4')]('in','out'),'defaultValue':_0xfbcf('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfbcf('0x6')]},'providerName':{'type':Sequelize[_0xfbcf('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x71f4=['ENUM','out','STRING','TEXT','medium','BOOLEAN'];(function(_0x596e17,_0x401b1e){var _0x220436=function(_0x11cbde){while(--_0x11cbde){_0x596e17['push'](_0x596e17['shift']());}};_0x220436(++_0x401b1e);}(_0x71f4,0xf9));var _0x471f=function(_0x523d5e,_0x3ce2d2){_0x523d5e=_0x523d5e-0x0;var _0x432c25=_0x71f4[_0x523d5e];return _0x432c25;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x471f('0x0')](_0x471f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x471f('0x3')]('in','out'),'defaultValue':_0x471f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x471f('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 13ad7a7..92fec3f 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 _0xae0d=['order','sort','merge','where','VIRTUAL','filter','ChatMessage','findAll','rows','catch','show','keys','rawAttributes','length','includeAll','include','find','create','body','params','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x385472,_0x194f20){var _0x2dc2f0=function(_0x5580ca){while(--_0x5580ca){_0x385472['push'](_0x385472['shift']());}};_0x2dc2f0(++_0x194f20);}(_0xae0d,0x14e));var _0xdae0=function(_0x4f3f68,_0x2a4010){_0x4f3f68=_0x4f3f68-0x0;var _0x141010=_0xae0d[_0x4f3f68];return _0x141010;};'use strict';var emlformat=require(_0xdae0('0x0'));var rimraf=require(_0xdae0('0x1'));var zipdir=require(_0xdae0('0x2'));var jsonpatch=require(_0xdae0('0x3'));var rp=require('request-promise');var moment=require(_0xdae0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdae0('0x5'));var util=require(_0xdae0('0x6'));var path=require(_0xdae0('0x7'));var sox=require('sox');var csv=require(_0xdae0('0x8'));var ejs=require(_0xdae0('0x9'));var fs=require('fs');var fs_extra=require(_0xdae0('0xa'));var _=require(_0xdae0('0xb'));var squel=require('squel');var crypto=require(_0xdae0('0xc'));var jsforce=require(_0xdae0('0xd'));var deskjs=require(_0xdae0('0xe'));var toCsv=require(_0xdae0('0x8'));var querystring=require('querystring');var Papa=require(_0xdae0('0xf'));var Redis=require(_0xdae0('0x10'));var authService=require(_0xdae0('0x11'));var qs=require(_0xdae0('0x12'));var as=require(_0xdae0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdae0('0x14'))(_0xdae0('0x15'));var utils=require('../../config/utils');var config=require(_0xdae0('0x16'));var licenseUtil=require(_0xdae0('0x17'));var db=require(_0xdae0('0x18'))['db'];config[_0xdae0('0x19')]=_['defaults'](config[_0xdae0('0x19')],{'host':_0xdae0('0x1a'),'port':0x18eb});var socket=require(_0xdae0('0x1b'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xdae0('0x1c')](socket);var jayson=require(_0xdae0('0x1d'));var client=jayson[_0xdae0('0x1e')][_0xdae0('0x1f')]({'port':0x232c});var client9002=jayson[_0xdae0('0x1e')][_0xdae0('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4d7bce,_0x42c54c,_0x7f388a,_0x3db4c1){return new BPromise(function(_0xc43acb,_0x1983fc){var _0x22bccf=_0x3db4c1||client;return _0x22bccf['request'](_0x4d7bce,_0x7f388a)[_0xdae0('0x20')](function(_0x4c4637){logger[_0xdae0('0x21')](_0xdae0('0x22'),_0x42c54c,_0xdae0('0x23'));logger['debug'](_0xdae0('0x24'),_0x42c54c,'request\x20sent',JSON[_0xdae0('0x25')](_0x4c4637));if(_0x4c4637['error']){if(_0x4c4637['error']['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x42c54c,_0x4c4637[_0xdae0('0x26')]['message']);return _0x1983fc(_0x4c4637['error'][_0xdae0('0x27')]);}logger[_0xdae0('0x26')]('ChatMessage,\x20%s,\x20%s',_0x42c54c,_0x4c4637[_0xdae0('0x26')][_0xdae0('0x27')]);return _0xc43acb(_0x4c4637[_0xdae0('0x26')][_0xdae0('0x27')]);}else{logger['info'](_0xdae0('0x22'),_0x42c54c,_0xdae0('0x23'));_0xc43acb(_0x4c4637[_0xdae0('0x28')][_0xdae0('0x27')]);}})['catch'](function(_0x163605){logger[_0xdae0('0x26')]('ChatMessage,\x20%s,\x20%s',_0x42c54c,_0x163605);_0x1983fc(_0x163605);});});}function respondWithStatusCode(_0x4ae881,_0x2a81fd){_0x2a81fd=_0x2a81fd||0xcc;return function(_0x3f718e){if(_0x3f718e){return _0x4ae881[_0xdae0('0x29')](_0x2a81fd);}return _0x4ae881[_0xdae0('0x2a')](_0x2a81fd)[_0xdae0('0x2b')]();};}function respondWithResult(_0x1c404c,_0x6f49de){_0x6f49de=_0x6f49de||0xc8;return function(_0x9c0df7){if(_0x9c0df7){return _0x1c404c['status'](_0x6f49de)[_0xdae0('0x2c')](_0x9c0df7);}};}function respondWithFilteredResult(_0xd55123,_0x233b04){return function(_0xebd483){if(_0xebd483){var _0x49f72b=typeof _0x233b04[_0xdae0('0x2d')]==='undefined'&&typeof _0x233b04[_0xdae0('0x2e')]===_0xdae0('0x2f');var _0x4ff905=_0xebd483['count'];var _0x3f7188=_0x49f72b?0x0:_0x233b04['offset'];var _0x4174ba=_0x49f72b?_0xebd483[_0xdae0('0x30')]:_0x233b04[_0xdae0('0x2d')]+_0x233b04['limit'];var _0x1a2e9a;if(_0x4174ba>=_0x4ff905){_0x4174ba=_0x4ff905;_0x1a2e9a=0xc8;}else{_0x1a2e9a=0xce;}_0xd55123[_0xdae0('0x2a')](_0x1a2e9a);return _0xd55123['set'](_0xdae0('0x31'),_0x3f7188+'-'+_0x4174ba+'/'+_0x4ff905)[_0xdae0('0x2c')](_0xebd483);}return null;};}function patchUpdates(_0x116921){return function(_0x5ac294){try{jsonpatch[_0xdae0('0x32')](_0x5ac294,_0x116921,!![]);}catch(_0x1101e7){return BPromise[_0xdae0('0x33')](_0x1101e7);}return _0x5ac294[_0xdae0('0x34')]();};}function saveUpdates(_0x29089e,_0x1db575){return function(_0x4308df){if(_0x4308df){return _0x4308df[_0xdae0('0x35')](_0x29089e)['then'](function(_0x2b4a18){return _0x2b4a18;});}return null;};}function removeEntity(_0x5b9600,_0x321818){return function(_0x1ba6b0){if(_0x1ba6b0){return _0x1ba6b0[_0xdae0('0x36')]()['then'](function(){_0x5b9600['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c26f0,_0x477ae7){return function(_0x5067ba){if(!_0x5067ba){_0x1c26f0[_0xdae0('0x29')](0x194);}return _0x5067ba;};}function handleError(_0x46d113,_0x166d60){_0x166d60=_0x166d60||0x1f4;return function(_0x4b2b33){logger['error'](_0x4b2b33[_0xdae0('0x37')]);if(_0x4b2b33[_0xdae0('0x38')]){delete _0x4b2b33[_0xdae0('0x38')];}_0x46d113[_0xdae0('0x2a')](_0x166d60)[_0xdae0('0x39')](_0x4b2b33);};}exports[_0xdae0('0x3a')]=function(_0x542900,_0x896cc4){var _0x2e8a27={},_0x5c876f={},_0x21c502={'count':0x0,'rows':[]};var _0x2c159f=_[_0xdae0('0x3b')](db['ChatMessage']['rawAttributes'],function(_0x2ecf0e){return{'name':_0x2ecf0e[_0xdae0('0x3c')],'type':_0x2ecf0e[_0xdae0('0x3d')][_0xdae0('0x3e')]};});_0x5c876f[_0xdae0('0x3f')]=_[_0xdae0('0x3b')](_0x2c159f,_0xdae0('0x38'));_0x5c876f[_0xdae0('0x40')]=_['keys'](_0x542900['query']);_0x5c876f[_0xdae0('0x41')]=_[_0xdae0('0x42')](_0x5c876f[_0xdae0('0x3f')],_0x5c876f[_0xdae0('0x40')]);_0x2e8a27['attributes']=_[_0xdae0('0x42')](_0x5c876f[_0xdae0('0x3f')],qs[_0xdae0('0x43')](_0x542900['query'][_0xdae0('0x43')]));_0x2e8a27[_0xdae0('0x44')]=_0x2e8a27[_0xdae0('0x44')]['length']?_0x2e8a27[_0xdae0('0x44')]:_0x5c876f[_0xdae0('0x3f')];if(!_0x542900[_0xdae0('0x40')][_0xdae0('0x45')](_0xdae0('0x46'))){_0x2e8a27['limit']=qs[_0xdae0('0x2e')](_0x542900[_0xdae0('0x40')]['limit']);_0x2e8a27[_0xdae0('0x2d')]=qs[_0xdae0('0x2d')](_0x542900['query'][_0xdae0('0x2d')]);}_0x2e8a27[_0xdae0('0x47')]=qs['sort'](_0x542900[_0xdae0('0x40')][_0xdae0('0x48')]);_0x2e8a27['where']=qs[_0xdae0('0x41')](_['pick'](_0x542900[_0xdae0('0x40')],_0x5c876f[_0xdae0('0x41')]),_0x2c159f);if(_0x542900[_0xdae0('0x40')]['filter']){_0x2e8a27['where']=_[_0xdae0('0x49')](_0x2e8a27[_0xdae0('0x4a')],{'$or':_['map'](_0x2c159f,function(_0x903bab){if(_0x903bab[_0xdae0('0x3d')]!==_0xdae0('0x4b')){var _0x36d81d={};_0x36d81d[_0x903bab[_0xdae0('0x38')]]={'$like':'%'+_0x542900[_0xdae0('0x40')][_0xdae0('0x4c')]+'%'};return _0x36d81d;}})});}_0x2e8a27=_[_0xdae0('0x49')]({},_0x2e8a27,_0x542900['options']);var _0x4081d6={'where':_0x2e8a27[_0xdae0('0x4a')]};return db[_0xdae0('0x4d')][_0xdae0('0x30')](_0x4081d6)[_0xdae0('0x20')](function(_0x530392){_0x21c502[_0xdae0('0x30')]=_0x530392;if(_0x542900['query']['includeAll']){_0x2e8a27['include']=[{'all':!![]}];}return db[_0xdae0('0x4d')][_0xdae0('0x4e')](_0x2e8a27);})[_0xdae0('0x20')](function(_0x2589f4){_0x21c502[_0xdae0('0x4f')]=_0x2589f4;return _0x21c502;})[_0xdae0('0x20')](respondWithFilteredResult(_0x896cc4,_0x2e8a27))[_0xdae0('0x50')](handleError(_0x896cc4,null));};exports[_0xdae0('0x51')]=function(_0x29b981,_0x33ee45){var _0x37624f={'raw':!![],'where':{'id':_0x29b981['params']['id']}},_0x173d6c={};_0x173d6c[_0xdae0('0x3f')]=_[_0xdae0('0x52')](db[_0xdae0('0x4d')][_0xdae0('0x53')]);_0x173d6c[_0xdae0('0x40')]=_[_0xdae0('0x52')](_0x29b981[_0xdae0('0x40')]);_0x173d6c[_0xdae0('0x41')]=_[_0xdae0('0x42')](_0x173d6c[_0xdae0('0x3f')],_0x173d6c[_0xdae0('0x40')]);_0x37624f[_0xdae0('0x44')]=_[_0xdae0('0x42')](_0x173d6c[_0xdae0('0x3f')],qs[_0xdae0('0x43')](_0x29b981[_0xdae0('0x40')][_0xdae0('0x43')]));_0x37624f[_0xdae0('0x44')]=_0x37624f[_0xdae0('0x44')][_0xdae0('0x54')]?_0x37624f[_0xdae0('0x44')]:_0x173d6c[_0xdae0('0x3f')];if(_0x29b981['query'][_0xdae0('0x55')]){_0x37624f[_0xdae0('0x56')]=[{'all':!![]}];}_0x37624f=_[_0xdae0('0x49')]({},_0x37624f,_0x29b981['options']);return db['ChatMessage'][_0xdae0('0x57')](_0x37624f)[_0xdae0('0x20')](handleEntityNotFound(_0x33ee45,null))[_0xdae0('0x20')](respondWithResult(_0x33ee45,null))[_0xdae0('0x50')](handleError(_0x33ee45,null));};exports[_0xdae0('0x58')]=function(_0x36f46e,_0x50375e){return db[_0xdae0('0x4d')][_0xdae0('0x58')](_0x36f46e[_0xdae0('0x59')],{})[_0xdae0('0x20')](respondWithResult(_0x50375e,0xc9))[_0xdae0('0x50')](handleError(_0x50375e,null));};exports[_0xdae0('0x35')]=function(_0x108b11,_0x16fc7c){if(_0x108b11[_0xdae0('0x59')]['id']){delete _0x108b11[_0xdae0('0x59')]['id'];}return db[_0xdae0('0x4d')][_0xdae0('0x57')]({'where':{'id':_0x108b11[_0xdae0('0x5a')]['id']}})[_0xdae0('0x20')](handleEntityNotFound(_0x16fc7c,null))[_0xdae0('0x20')](saveUpdates(_0x108b11[_0xdae0('0x59')],null))[_0xdae0('0x20')](respondWithResult(_0x16fc7c,null))[_0xdae0('0x50')](handleError(_0x16fc7c,null));};exports[_0xdae0('0x36')]=function(_0x295f91,_0x2370b1){return db[_0xdae0('0x4d')][_0xdae0('0x57')]({'where':{'id':_0x295f91[_0xdae0('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2370b1,null))['then'](removeEntity(_0x2370b1,null))[_0xdae0('0x50')](handleError(_0x2370b1,null));};exports[_0xdae0('0x5b')]=function(_0x24eee7,_0x86dd92){return db[_0xdae0('0x4d')]['describe']()[_0xdae0('0x20')](respondWithResult(_0x86dd92,null))[_0xdae0('0x50')](handleError(_0x86dd92,null));};var interaction_log=require(_0xdae0('0x14'))(_0xdae0('0x5c'));exports[_0xdae0('0x5d')]=function(_0x2204de,_0x2b303b,_0x61d75b){var _0x4d76e7={'agent':{},'channel':_0xdae0('0x5e')};if(_0x2204de[_0xdae0('0x59')]['id']){delete _0x2204de[_0xdae0('0x59')]['id'];}_0x2204de[_0xdae0('0x59')][_0xdae0('0x5f')]=!![];_0x2204de['body']['readAt']=moment()['format'](_0xdae0('0x60'));_0x2204de[_0xdae0('0x59')][_0xdae0('0x61')]=_0x2204de[_0xdae0('0x59')][_0xdae0('0x61')]||_0x2204de[_0xdae0('0x62')]['id'];_0x4d76e7[_0xdae0('0x63')]['id']=_0x2204de[_0xdae0('0x59')]['UserId'];return db[_0xdae0('0x4d')]['find']({'where':{'id':_0x2204de['params']['id'],'UserId':null}})[_0xdae0('0x20')](handleEntityNotFound(_0x2b303b,null))['then'](saveUpdates(_0x2204de[_0xdae0('0x59')],null))[_0xdae0('0x20')](function(_0x310189){if(_0x310189){_0x4d76e7['message']=_0x310189[_0xdae0('0x64')]({'plain':!![]});return db[_0xdae0('0x65')][_0xdae0('0x57')]({'where':{'id':_0x310189[_0xdae0('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x2b303b,null))[_0xdae0('0x20')](function(_0x5add62){if(_0x5add62){return _0x5add62[_0xdae0('0x35')]({'UserId':_0x2204de[_0xdae0('0x59')][_0xdae0('0x61')],'read1stAt':_['isNil'](_0x5add62[_0xdae0('0x67')])?moment()[_0xdae0('0x68')](_0xdae0('0x60')):undefined});}return null;})['then'](function(_0x1eff88){if(_0x1eff88){_0x4d76e7['interaction']=_0x1eff88[_0xdae0('0x64')]({'plain':!![]});interaction_log[_0xdae0('0x21')](_0xdae0('0x69'),_0x2204de[_0xdae0('0x62')]['id'],_0x2204de[_0xdae0('0x62')]['name'],_0x2204de[_0xdae0('0x62')][_0xdae0('0x6a')],_0x4d76e7['interaction']['id'],_0x2204de[_0xdae0('0x59')]?JSON['stringify'](_0x2204de[_0xdae0('0x59')]):_0xdae0('0x6b'));return respondWithRpcPromise(_0xdae0('0x6c'),_0xdae0('0x6d'),_0x4d76e7);}return null;})[_0xdae0('0x20')](function(_0x179e2a){var _0x136e1e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x179e2a[_0xdae0('0x27')][_0xdae0('0x6e')];return db['sequelize'][_0xdae0('0x40')](_0x136e1e,{'type':db[_0xdae0('0x6f')][_0xdae0('0x70')][_0xdae0('0x71')],'raw':!![]})[_0xdae0('0x20')](function(_0x44b4ba){return _0x44b4ba;});})['then'](function(_0x679c9){if(_0x679c9){_0x4d76e7[_0xdae0('0x27')][_0xdae0('0x72')]=_0x679c9[0x0];if(!_0x2204de['body'][_0xdae0('0x61')])return;return db[_0xdae0('0x73')][_0xdae0('0x57')]({'where':{'id':_0x2204de['body'][_0xdae0('0x61')],'role':'agent'},'attributes':['id',_0xdae0('0x38'),_0xdae0('0x74'),_0xdae0('0x75'),_0xdae0('0x76')],'raw':!![]});}return null;})[_0xdae0('0x20')](function(_0x3015ae){if(!_0x3015ae)return null;_0x4d76e7['message']['agent']=_0x3015ae;return _0x4d76e7;})[_0xdae0('0x20')](function(_0x39dc44){if(_0x39dc44){if(_0x2204de['body'][_0xdae0('0x77')]){_0x4d76e7['message']['interface']=util[_0xdae0('0x68')](_0xdae0('0x78'),_0x2204de[_0xdae0('0x62')][_0xdae0('0x38')]);_0x4d76e7[_0xdae0('0x27')]['channel']=_0x4d76e7[_0xdae0('0x79')];_0x4d76e7[_0xdae0('0x27')][_0xdae0('0x7a')]=_0x4d76e7['channel'];_0x4d76e7[_0xdae0('0x27')][_0xdae0('0x7b')]=_0xdae0('0x5d');return respondWithRpcPromise(_0xdae0('0x7c'),_0xdae0('0x7c'),{'event':_0xdae0('0x7d'),'message':_['merge'](_0x4d76e7[_0xdae0('0x27')],JSON['parse'](_0x4d76e7[_0xdae0('0x7e')][_0xdae0('0x7f')]))},client9002)[_0xdae0('0x20')](function(){return _0x4d76e7;});}return _0x4d76e7;}return null;})[_0xdae0('0x20')](respondWithResult(_0x2b303b,null))[_0xdae0('0x50')](handleError(_0x2b303b,null));};var interaction_log=require(_0xdae0('0x14'))(_0xdae0('0x5c'));exports[_0xdae0('0x33')]=function(_0x346503,_0x364ff0,_0x15859b){var _0x1a171d={'agent':{},'channel':_0xdae0('0x5e')};if(_0x346503[_0xdae0('0x59')]['id']){delete _0x346503['body']['id'];}_0x346503[_0xdae0('0x59')][_0xdae0('0x61')]=_0x346503[_0xdae0('0x59')][_0xdae0('0x61')]||_0x346503[_0xdae0('0x62')]['id'];_0x1a171d[_0xdae0('0x63')]['id']=_0x346503[_0xdae0('0x59')][_0xdae0('0x61')];return db[_0xdae0('0x4d')][_0xdae0('0x57')]({'where':{'id':_0x346503['params']['id'],'UserId':null}})[_0xdae0('0x20')](handleEntityNotFound(_0x364ff0,null))[_0xdae0('0x20')](function(_0x431244){if(_0x431244){_0x1a171d[_0xdae0('0x27')]=_0x431244[_0xdae0('0x64')]({'plain':!![]});return db['ChatInteraction'][_0xdae0('0x57')]({'where':{'id':_0x431244['ChatInteractionId']}});}return null;})[_0xdae0('0x20')](handleEntityNotFound(_0x364ff0,null))[_0xdae0('0x20')](function(_0x134a71){if(_0x134a71){_0x1a171d[_0xdae0('0x7e')]=_0x134a71[_0xdae0('0x64')]({'plain':!![]});interaction_log[_0xdae0('0x21')](_0xdae0('0x80'),_0x346503[_0xdae0('0x62')]['id'],_0x346503[_0xdae0('0x62')][_0xdae0('0x38')],_0x346503[_0xdae0('0x62')][_0xdae0('0x6a')],_0x1a171d[_0xdae0('0x7e')]['id'],_0x346503[_0xdae0('0x59')]?JSON['stringify'](_0x346503[_0xdae0('0x59')]):_0xdae0('0x6b'));return respondWithRpcPromise(_0xdae0('0x81'),_0xdae0('0x82'),_0x1a171d);}return null;})['then'](function(_0x2bd4bd){var _0x2e7854=_0xdae0('0x83')+_0x2bd4bd['message']['ContactId'];return db[_0xdae0('0x84')][_0xdae0('0x40')](_0x2e7854,{'type':db['Sequelize'][_0xdae0('0x70')][_0xdae0('0x71')],'raw':!![]})[_0xdae0('0x20')](function(_0x2ec906){return _0x2ec906;});})[_0xdae0('0x20')](function(_0x5718ca){if(_0x5718ca){_0x1a171d[_0xdae0('0x27')][_0xdae0('0x72')]=_0x5718ca[0x0];if(!_0x346503[_0xdae0('0x59')][_0xdae0('0x61')])return;return db[_0xdae0('0x73')][_0xdae0('0x57')]({'where':{'id':_0x346503['body']['UserId'],'role':_0xdae0('0x63')},'attributes':['id',_0xdae0('0x38'),_0xdae0('0x74'),_0xdae0('0x75'),_0xdae0('0x76')],'raw':!![]});}return null;})[_0xdae0('0x20')](function(_0x4936ae){if(!_0x4936ae)return null;_0x1a171d[_0xdae0('0x27')][_0xdae0('0x63')]=_0x4936ae;return _0x1a171d;})[_0xdae0('0x20')](function(_0x173bdf){if(_0x173bdf){_0x173bdf['message'][_0xdae0('0x85')]=util[_0xdae0('0x68')](_0xdae0('0x78'),_0x346503['user']['name']);_0x173bdf[_0xdae0('0x27')][_0xdae0('0x79')]=_0x1a171d['channel'];_0x173bdf[_0xdae0('0x27')][_0xdae0('0x7a')]=_0x1a171d[_0xdae0('0x79')];_0x173bdf[_0xdae0('0x27')][_0xdae0('0x7b')]=_0xdae0('0x33');respondWithRpcPromise(_0xdae0('0x7c'),'EventManager',{'event':_0xdae0('0x86'),'message':_[_0xdae0('0x49')](_0x1a171d['message'],JSON['parse'](_0x1a171d[_0xdae0('0x7e')]['formData']))},client9002);return _0x1a171d;}return null;})[_0xdae0('0x20')](respondWithResult(_0x364ff0,null))[_0xdae0('0x50')](handleError(_0x364ff0,null));};
\ No newline at end of file
+var _0xe217=['ChatMessage','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','chat-interactions','read','readAt','format','UserId','agent','ChatInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','sequelize','Sequelize','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','parse','formData','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','sendStatus','stack','name','map'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xe217,0xc7));var _0x7e21=function(_0x373cfa,_0xaa057d){_0x373cfa=_0x373cfa-0x0;var _0x58a029=_0xe217[_0x373cfa];return _0x58a029;};'use strict';var emlformat=require(_0x7e21('0x0'));var rimraf=require(_0x7e21('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e21('0x2'));var rp=require(_0x7e21('0x3'));var moment=require(_0x7e21('0x4'));var BPromise=require(_0x7e21('0x5'));var Mustache=require(_0x7e21('0x6'));var util=require(_0x7e21('0x7'));var path=require(_0x7e21('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e21('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e21('0xa'));var squel=require(_0x7e21('0xb'));var crypto=require(_0x7e21('0xc'));var jsforce=require(_0x7e21('0xd'));var deskjs=require(_0x7e21('0xe'));var toCsv=require(_0x7e21('0xf'));var querystring=require(_0x7e21('0x10'));var Papa=require(_0x7e21('0x11'));var Redis=require(_0x7e21('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7e21('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e21('0x14'))(_0x7e21('0x15'));var utils=require(_0x7e21('0x16'));var config=require(_0x7e21('0x17'));var licenseUtil=require(_0x7e21('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7e21('0x19')](config['redis'],{'host':_0x7e21('0x1a'),'port':0x18eb});var socket=require(_0x7e21('0x1b'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x7e21('0x1c'));var client=jayson[_0x7e21('0x1d')][_0x7e21('0x1e')]({'port':0x232c});var client9002=jayson[_0x7e21('0x1d')][_0x7e21('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4f033d,_0x1df5d3,_0x3b3467,_0x49e180){return new BPromise(function(_0x397647,_0x3368fb){var _0x283d1e=_0x49e180||client;return _0x283d1e[_0x7e21('0x1f')](_0x4f033d,_0x3b3467)[_0x7e21('0x20')](function(_0x56dae1){logger[_0x7e21('0x21')](_0x7e21('0x22'),_0x1df5d3,_0x7e21('0x23'));logger['debug'](_0x7e21('0x24'),_0x1df5d3,_0x7e21('0x23'),JSON[_0x7e21('0x25')](_0x56dae1));if(_0x56dae1[_0x7e21('0x26')]){if(_0x56dae1[_0x7e21('0x26')][_0x7e21('0x27')]===0x1f4){logger[_0x7e21('0x26')]('ChatMessage,\x20%s,\x20%s',_0x1df5d3,_0x56dae1[_0x7e21('0x26')][_0x7e21('0x28')]);return _0x3368fb(_0x56dae1[_0x7e21('0x26')][_0x7e21('0x28')]);}logger['error'](_0x7e21('0x22'),_0x1df5d3,_0x56dae1[_0x7e21('0x26')]['message']);return _0x397647(_0x56dae1['error'][_0x7e21('0x28')]);}else{logger['info'](_0x7e21('0x22'),_0x1df5d3,_0x7e21('0x23'));_0x397647(_0x56dae1['result'][_0x7e21('0x28')]);}})[_0x7e21('0x29')](function(_0xfe189f){logger['error'](_0x7e21('0x22'),_0x1df5d3,_0xfe189f);_0x3368fb(_0xfe189f);});});}function respondWithStatusCode(_0x16830a,_0x1abe28){_0x1abe28=_0x1abe28||0xcc;return function(_0x465a98){if(_0x465a98){return _0x16830a['sendStatus'](_0x1abe28);}return _0x16830a[_0x7e21('0x2a')](_0x1abe28)['end']();};}function respondWithResult(_0x47c9c5,_0x12cea3){_0x12cea3=_0x12cea3||0xc8;return function(_0x5393da){if(_0x5393da){return _0x47c9c5['status'](_0x12cea3)['json'](_0x5393da);}};}function respondWithFilteredResult(_0x7afb7a,_0x3ee78a){return function(_0xde7bcb){if(_0xde7bcb){var _0x3388a0=typeof _0x3ee78a[_0x7e21('0x2b')]===_0x7e21('0x2c')&&typeof _0x3ee78a[_0x7e21('0x2d')]===_0x7e21('0x2c');var _0x27bbfb=_0xde7bcb[_0x7e21('0x2e')];var _0x16c46b=_0x3388a0?0x0:_0x3ee78a['offset'];var _0x173ade=_0x3388a0?_0xde7bcb[_0x7e21('0x2e')]:_0x3ee78a['offset']+_0x3ee78a[_0x7e21('0x2d')];var _0x718130;if(_0x173ade>=_0x27bbfb){_0x173ade=_0x27bbfb;_0x718130=0xc8;}else{_0x718130=0xce;}_0x7afb7a['status'](_0x718130);return _0x7afb7a[_0x7e21('0x2f')](_0x7e21('0x30'),_0x16c46b+'-'+_0x173ade+'/'+_0x27bbfb)[_0x7e21('0x31')](_0xde7bcb);}return null;};}function patchUpdates(_0x54430a){return function(_0x20556b){try{jsonpatch['apply'](_0x20556b,_0x54430a,!![]);}catch(_0x5eaa78){return BPromise[_0x7e21('0x32')](_0x5eaa78);}return _0x20556b['save']();};}function saveUpdates(_0x17e810,_0x4fe150){return function(_0x478dfb){if(_0x478dfb){return _0x478dfb[_0x7e21('0x33')](_0x17e810)[_0x7e21('0x20')](function(_0xd2e9b8){return _0xd2e9b8;});}return null;};}function removeEntity(_0x578182,_0x245fe5){return function(_0x48740b){if(_0x48740b){return _0x48740b[_0x7e21('0x34')]()[_0x7e21('0x20')](function(){_0x578182[_0x7e21('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380731,_0x3ebafd){return function(_0xf60a3d){if(!_0xf60a3d){_0x380731[_0x7e21('0x35')](0x194);}return _0xf60a3d;};}function handleError(_0x2f96e2,_0x392b46){_0x392b46=_0x392b46||0x1f4;return function(_0x1c7b8e){logger[_0x7e21('0x26')](_0x1c7b8e[_0x7e21('0x36')]);if(_0x1c7b8e[_0x7e21('0x37')]){delete _0x1c7b8e[_0x7e21('0x37')];}_0x2f96e2[_0x7e21('0x2a')](_0x392b46)['send'](_0x1c7b8e);};}exports['index']=function(_0x525a50,_0x44b399){var _0x50dcb3={},_0x44fce8={},_0x1ec647={'count':0x0,'rows':[]};var _0xc33e2c=_[_0x7e21('0x38')](db[_0x7e21('0x39')]['rawAttributes'],function(_0x262d47){return{'name':_0x262d47[_0x7e21('0x3a')],'type':_0x262d47['type']['key']};});_0x44fce8[_0x7e21('0x3b')]=_[_0x7e21('0x38')](_0xc33e2c,_0x7e21('0x37'));_0x44fce8[_0x7e21('0x3c')]=_[_0x7e21('0x3d')](_0x525a50[_0x7e21('0x3c')]);_0x44fce8[_0x7e21('0x3e')]=_[_0x7e21('0x3f')](_0x44fce8[_0x7e21('0x3b')],_0x44fce8[_0x7e21('0x3c')]);_0x50dcb3[_0x7e21('0x40')]=_['intersection'](_0x44fce8['model'],qs[_0x7e21('0x41')](_0x525a50['query'][_0x7e21('0x41')]));_0x50dcb3[_0x7e21('0x40')]=_0x50dcb3[_0x7e21('0x40')][_0x7e21('0x42')]?_0x50dcb3[_0x7e21('0x40')]:_0x44fce8[_0x7e21('0x3b')];if(!_0x525a50[_0x7e21('0x3c')][_0x7e21('0x43')](_0x7e21('0x44'))){_0x50dcb3[_0x7e21('0x2d')]=qs[_0x7e21('0x2d')](_0x525a50[_0x7e21('0x3c')]['limit']);_0x50dcb3[_0x7e21('0x2b')]=qs[_0x7e21('0x2b')](_0x525a50[_0x7e21('0x3c')]['offset']);}_0x50dcb3[_0x7e21('0x45')]=qs[_0x7e21('0x46')](_0x525a50[_0x7e21('0x3c')][_0x7e21('0x46')]);_0x50dcb3[_0x7e21('0x47')]=qs['filters'](_[_0x7e21('0x48')](_0x525a50[_0x7e21('0x3c')],_0x44fce8['filters']),_0xc33e2c);if(_0x525a50['query'][_0x7e21('0x49')]){_0x50dcb3[_0x7e21('0x47')]=_[_0x7e21('0x4a')](_0x50dcb3['where'],{'$or':_[_0x7e21('0x38')](_0xc33e2c,function(_0x4e1e3c){if(_0x4e1e3c[_0x7e21('0x4b')]!==_0x7e21('0x4c')){var _0x4dbc61={};_0x4dbc61[_0x4e1e3c[_0x7e21('0x37')]]={'$like':'%'+_0x525a50['query'][_0x7e21('0x49')]+'%'};return _0x4dbc61;}})});}_0x50dcb3=_['merge']({},_0x50dcb3,_0x525a50[_0x7e21('0x4d')]);var _0x3404bf={'where':_0x50dcb3[_0x7e21('0x47')]};return db[_0x7e21('0x39')][_0x7e21('0x2e')](_0x3404bf)['then'](function(_0x4812eb){_0x1ec647[_0x7e21('0x2e')]=_0x4812eb;if(_0x525a50['query'][_0x7e21('0x4e')]){_0x50dcb3[_0x7e21('0x4f')]=[{'all':!![]}];}return db[_0x7e21('0x39')][_0x7e21('0x50')](_0x50dcb3);})[_0x7e21('0x20')](function(_0x55370a){_0x1ec647[_0x7e21('0x51')]=_0x55370a;return _0x1ec647;})['then'](respondWithFilteredResult(_0x44b399,_0x50dcb3))[_0x7e21('0x29')](handleError(_0x44b399,null));};exports[_0x7e21('0x52')]=function(_0x56618a,_0x307b77){var _0x97f48c={'raw':!![],'where':{'id':_0x56618a[_0x7e21('0x53')]['id']}},_0x5c92f7={};_0x5c92f7['model']=_[_0x7e21('0x3d')](db['ChatMessage'][_0x7e21('0x54')]);_0x5c92f7['query']=_[_0x7e21('0x3d')](_0x56618a[_0x7e21('0x3c')]);_0x5c92f7[_0x7e21('0x3e')]=_[_0x7e21('0x3f')](_0x5c92f7[_0x7e21('0x3b')],_0x5c92f7[_0x7e21('0x3c')]);_0x97f48c[_0x7e21('0x40')]=_[_0x7e21('0x3f')](_0x5c92f7[_0x7e21('0x3b')],qs['fields'](_0x56618a[_0x7e21('0x3c')][_0x7e21('0x41')]));_0x97f48c[_0x7e21('0x40')]=_0x97f48c[_0x7e21('0x40')]['length']?_0x97f48c['attributes']:_0x5c92f7[_0x7e21('0x3b')];if(_0x56618a[_0x7e21('0x3c')]['includeAll']){_0x97f48c['include']=[{'all':!![]}];}_0x97f48c=_['merge']({},_0x97f48c,_0x56618a[_0x7e21('0x4d')]);return db['ChatMessage'][_0x7e21('0x55')](_0x97f48c)[_0x7e21('0x20')](handleEntityNotFound(_0x307b77,null))[_0x7e21('0x20')](respondWithResult(_0x307b77,null))[_0x7e21('0x29')](handleError(_0x307b77,null));};exports[_0x7e21('0x56')]=function(_0x302829,_0x3753f2){return db[_0x7e21('0x39')][_0x7e21('0x56')](_0x302829[_0x7e21('0x57')],{})[_0x7e21('0x20')](respondWithResult(_0x3753f2,0xc9))[_0x7e21('0x29')](handleError(_0x3753f2,null));};exports[_0x7e21('0x33')]=function(_0x37cfe3,_0x36b839){if(_0x37cfe3[_0x7e21('0x57')]['id']){delete _0x37cfe3['body']['id'];}return db[_0x7e21('0x39')][_0x7e21('0x55')]({'where':{'id':_0x37cfe3[_0x7e21('0x53')]['id']}})[_0x7e21('0x20')](handleEntityNotFound(_0x36b839,null))[_0x7e21('0x20')](saveUpdates(_0x37cfe3[_0x7e21('0x57')],null))[_0x7e21('0x20')](respondWithResult(_0x36b839,null))[_0x7e21('0x29')](handleError(_0x36b839,null));};exports[_0x7e21('0x34')]=function(_0x52a639,_0x1018ae){return db[_0x7e21('0x39')][_0x7e21('0x55')]({'where':{'id':_0x52a639['params']['id']}})[_0x7e21('0x20')](handleEntityNotFound(_0x1018ae,null))[_0x7e21('0x20')](removeEntity(_0x1018ae,null))['catch'](handleError(_0x1018ae,null));};exports['describe']=function(_0x2202a7,_0xb756ff){return db[_0x7e21('0x39')][_0x7e21('0x58')]()[_0x7e21('0x20')](respondWithResult(_0xb756ff,null))[_0x7e21('0x29')](handleError(_0xb756ff,null));};var interaction_log=require(_0x7e21('0x14'))(_0x7e21('0x59'));exports['accept']=function(_0x6ff838,_0x3d0d94,_0x12147a){var _0x5cdae6={'agent':{},'channel':'chat'};if(_0x6ff838[_0x7e21('0x57')]['id']){delete _0x6ff838['body']['id'];}_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5a')]=!![];_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5b')]=moment()[_0x7e21('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5d')]=_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5d')]||_0x6ff838['user']['id'];_0x5cdae6[_0x7e21('0x5e')]['id']=_0x6ff838[_0x7e21('0x57')][_0x7e21('0x5d')];return db[_0x7e21('0x39')]['find']({'where':{'id':_0x6ff838['params']['id'],'UserId':null}})[_0x7e21('0x20')](handleEntityNotFound(_0x3d0d94,null))[_0x7e21('0x20')](saveUpdates(_0x6ff838[_0x7e21('0x57')],null))[_0x7e21('0x20')](function(_0x20d1cd){if(_0x20d1cd){_0x5cdae6[_0x7e21('0x28')]=_0x20d1cd['get']({'plain':!![]});return db[_0x7e21('0x5f')][_0x7e21('0x55')]({'where':{'id':_0x20d1cd['ChatInteractionId']}});}return null;})[_0x7e21('0x20')](handleEntityNotFound(_0x3d0d94,null))[_0x7e21('0x20')](function(_0x3e8614){if(_0x3e8614){return _0x3e8614['update']({'UserId':_0x6ff838[_0x7e21('0x57')]['UserId'],'read1stAt':_[_0x7e21('0x60')](_0x3e8614[_0x7e21('0x61')])?moment()['format'](_0x7e21('0x62')):undefined});}return null;})[_0x7e21('0x20')](function(_0x3a80fd){if(_0x3a80fd){_0x5cdae6[_0x7e21('0x63')]=_0x3a80fd[_0x7e21('0x64')]({'plain':!![]});interaction_log['info'](_0x7e21('0x65'),_0x6ff838[_0x7e21('0x66')]['id'],_0x6ff838[_0x7e21('0x66')][_0x7e21('0x37')],_0x6ff838[_0x7e21('0x66')][_0x7e21('0x67')],_0x5cdae6['interaction']['id'],_0x6ff838[_0x7e21('0x57')]?JSON[_0x7e21('0x25')](_0x6ff838[_0x7e21('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0x7e21('0x68'),_0x5cdae6);}return null;})[_0x7e21('0x20')](function(_0x3e54f9){var _0x47d367='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e54f9['message']['ContactId'];return db[_0x7e21('0x69')][_0x7e21('0x3c')](_0x47d367,{'type':db[_0x7e21('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0x7e21('0x20')](function(_0x965b22){return _0x965b22;});})[_0x7e21('0x20')](function(_0x224f8a){if(_0x224f8a){_0x5cdae6[_0x7e21('0x28')][_0x7e21('0x6b')]=_0x224f8a[0x0];if(!_0x6ff838[_0x7e21('0x57')]['UserId'])return;return db['User']['find']({'where':{'id':_0x6ff838['body'][_0x7e21('0x5d')],'role':_0x7e21('0x5e')},'attributes':['id',_0x7e21('0x37'),_0x7e21('0x6c'),_0x7e21('0x6d'),_0x7e21('0x6e')],'raw':!![]});}return null;})['then'](function(_0x497ac4){if(!_0x497ac4)return null;_0x5cdae6['message'][_0x7e21('0x5e')]=_0x497ac4;return _0x5cdae6;})[_0x7e21('0x20')](function(_0x102d57){if(_0x102d57){if(_0x6ff838[_0x7e21('0x57')][_0x7e21('0x6f')]){_0x5cdae6[_0x7e21('0x28')][_0x7e21('0x70')]=util[_0x7e21('0x5c')](_0x7e21('0x71'),_0x6ff838[_0x7e21('0x66')][_0x7e21('0x37')]);_0x5cdae6['message'][_0x7e21('0x72')]=_0x5cdae6[_0x7e21('0x72')];_0x5cdae6[_0x7e21('0x28')][_0x7e21('0x73')]=_0x5cdae6[_0x7e21('0x72')];_0x5cdae6['message'][_0x7e21('0x74')]=_0x7e21('0x75');return respondWithRpcPromise(_0x7e21('0x76'),'EventManager',{'event':'acceptmessage','message':_[_0x7e21('0x4a')](_0x5cdae6[_0x7e21('0x28')],JSON[_0x7e21('0x77')](_0x5cdae6[_0x7e21('0x63')][_0x7e21('0x78')]))},client9002)[_0x7e21('0x20')](function(){return _0x5cdae6;});}return _0x5cdae6;}return null;})[_0x7e21('0x20')](respondWithResult(_0x3d0d94,null))[_0x7e21('0x29')](handleError(_0x3d0d94,null));};var interaction_log=require(_0x7e21('0x14'))(_0x7e21('0x59'));exports[_0x7e21('0x32')]=function(_0x4e01f9,_0x10a1a4,_0x474a1d){var _0x27fa39={'agent':{},'channel':'chat'};if(_0x4e01f9['body']['id']){delete _0x4e01f9[_0x7e21('0x57')]['id'];}_0x4e01f9['body'][_0x7e21('0x5d')]=_0x4e01f9[_0x7e21('0x57')]['UserId']||_0x4e01f9[_0x7e21('0x66')]['id'];_0x27fa39[_0x7e21('0x5e')]['id']=_0x4e01f9['body'][_0x7e21('0x5d')];return db[_0x7e21('0x39')][_0x7e21('0x55')]({'where':{'id':_0x4e01f9[_0x7e21('0x53')]['id'],'UserId':null}})[_0x7e21('0x20')](handleEntityNotFound(_0x10a1a4,null))['then'](function(_0x1fa1c8){if(_0x1fa1c8){_0x27fa39[_0x7e21('0x28')]=_0x1fa1c8[_0x7e21('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x7e21('0x55')]({'where':{'id':_0x1fa1c8['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x10a1a4,null))[_0x7e21('0x20')](function(_0x246333){if(_0x246333){_0x27fa39[_0x7e21('0x63')]=_0x246333[_0x7e21('0x64')]({'plain':!![]});interaction_log[_0x7e21('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e01f9[_0x7e21('0x66')]['id'],_0x4e01f9['user'][_0x7e21('0x37')],_0x4e01f9[_0x7e21('0x66')]['role'],_0x27fa39[_0x7e21('0x63')]['id'],_0x4e01f9[_0x7e21('0x57')]?JSON[_0x7e21('0x25')](_0x4e01f9[_0x7e21('0x57')]):_0x7e21('0x79'));return respondWithRpcPromise(_0x7e21('0x7a'),_0x7e21('0x7b'),_0x27fa39);}return null;})['then'](function(_0x134e9f){var _0x390ab1=_0x7e21('0x7c')+_0x134e9f[_0x7e21('0x28')][_0x7e21('0x7d')];return db['sequelize'][_0x7e21('0x3c')](_0x390ab1,{'type':db[_0x7e21('0x6a')]['QueryTypes'][_0x7e21('0x7e')],'raw':!![]})[_0x7e21('0x20')](function(_0x5a4ed7){return _0x5a4ed7;});})[_0x7e21('0x20')](function(_0x2addc4){if(_0x2addc4){_0x27fa39['message'][_0x7e21('0x6b')]=_0x2addc4[0x0];if(!_0x4e01f9[_0x7e21('0x57')]['UserId'])return;return db['User'][_0x7e21('0x55')]({'where':{'id':_0x4e01f9[_0x7e21('0x57')]['UserId'],'role':_0x7e21('0x5e')},'attributes':['id',_0x7e21('0x37'),_0x7e21('0x6c'),_0x7e21('0x6d'),_0x7e21('0x6e')],'raw':!![]});}return null;})['then'](function(_0x223604){if(!_0x223604)return null;_0x27fa39[_0x7e21('0x28')][_0x7e21('0x5e')]=_0x223604;return _0x27fa39;})['then'](function(_0x279f9f){if(_0x279f9f){_0x279f9f[_0x7e21('0x28')][_0x7e21('0x70')]=util['format'](_0x7e21('0x71'),_0x4e01f9[_0x7e21('0x66')]['name']);_0x279f9f[_0x7e21('0x28')]['channel']=_0x27fa39['channel'];_0x279f9f[_0x7e21('0x28')][_0x7e21('0x73')]=_0x27fa39[_0x7e21('0x72')];_0x279f9f[_0x7e21('0x28')][_0x7e21('0x74')]=_0x7e21('0x32');respondWithRpcPromise(_0x7e21('0x76'),_0x7e21('0x76'),{'event':_0x7e21('0x7f'),'message':_['merge'](_0x27fa39[_0x7e21('0x28')],JSON[_0x7e21('0x77')](_0x27fa39[_0x7e21('0x63')][_0x7e21('0x78')]))},client9002);return _0x27fa39;}return null;})[_0x7e21('0x20')](respondWithResult(_0x10a1a4,null))[_0x7e21('0x29')](handleError(_0x10a1a4,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 3d0d259..3aacf3c 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 _0xda9b=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x3b134c,_0x15d0d0){var _0x7def28=function(_0x208b6c){while(--_0x208b6c){_0x3b134c['push'](_0x3b134c['shift']());}};_0x7def28(++_0x15d0d0);}(_0xda9b,0x7e));var _0xbda9=function(_0x38df46,_0x477780){_0x38df46=_0x38df46-0x0;var _0x47dace=_0xda9b[_0x38df46];return _0x47dace;};'use strict';var EventEmitter=require(_0xbda9('0x0'));var ChatMessage=require(_0xbda9('0x1'))['db'][_0xbda9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbda9('0x3')](0x0);var events={'afterCreate':_0xbda9('0x4'),'afterUpdate':_0xbda9('0x5'),'afterDestroy':_0xbda9('0x6')};function emitEvent(_0x5a4a28){return function(_0x34d820,_0x518aed,_0xc1e14e){ChatMessageEvents[_0xbda9('0x7')](_0x5a4a28+':'+_0x34d820['id'],_0x34d820);ChatMessageEvents[_0xbda9('0x7')](_0x5a4a28,_0x34d820);_0xc1e14e(null);};}for(var e in events){if(events[_0xbda9('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xbda9('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x59c1=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x20658e,_0x404a03){var _0xb901=function(_0x72e736){while(--_0x72e736){_0x20658e['push'](_0x20658e['shift']());}};_0xb901(++_0x404a03);}(_0x59c1,0x90));var _0x159c=function(_0x4f8ca0,_0xe8b643){_0x4f8ca0=_0x4f8ca0-0x0;var _0x4287a4=_0x59c1[_0x4f8ca0];return _0x4287a4;};'use strict';var EventEmitter=require(_0x159c('0x0'));var ChatMessage=require(_0x159c('0x1'))['db'][_0x159c('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x159c('0x3')](0x0);var events={'afterCreate':_0x159c('0x4'),'afterUpdate':_0x159c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4e5954){return function(_0x539e13,_0x120476,_0x56a77a){ChatMessageEvents[_0x159c('0x6')](_0x4e5954+':'+_0x539e13['id'],_0x539e13);ChatMessageEvents[_0x159c('0x6')](_0x4e5954,_0x539e13);_0x56a77a(null);};}for(var e in events){if(events[_0x159c('0x7')](e)){var event=events[e];ChatMessage[_0x159c('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 4261453..2a303e2 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 _0xfc7b=['moment','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api'];(function(_0x3fbdde,_0x2b5a7a){var _0x10bf7b=function(_0x4ef0aa){while(--_0x4ef0aa){_0x3fbdde['push'](_0x3fbdde['shift']());}};_0x10bf7b(++_0x2b5a7a);}(_0xfc7b,0xc1));var _0xbfc7=function(_0xc4a89a,_0x322f6a){_0xc4a89a=_0xc4a89a-0x0;var _0x13f7bc=_0xfc7b[_0xc4a89a];return _0x13f7bc;};'use strict';var _=require(_0xbfc7('0x0'));var util=require(_0xbfc7('0x1'));var logger=require('../../config/logger')(_0xbfc7('0x2'));var moment=require(_0xbfc7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfc7('0x4'));var rimraf=require('rimraf');var config=require(_0xbfc7('0x5'));var attributes=require(_0xbfc7('0x6'));module[_0xbfc7('0x7')]=function(_0x56b76b,_0x243a2f){return _0x56b76b[_0xbfc7('0x8')](_0xbfc7('0x9'),attributes,{'tableName':_0xbfc7('0xa'),'paranoid':![],'indexes':[{'name':_0xbfc7('0xb'),'fields':[_0xbfc7('0xc')],'type':_0xbfc7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x597b35,_0x15857e,_0x296553){var _0x4afdaf=_0x56b76b['models'];var _0x1dc9a4=_0x597b35[_0xbfc7('0xe')]({'plain':!![]});if(_0x1dc9a4['direction']['toLowerCase']()==='in'||_0x1dc9a4[_0xbfc7('0xf')]['toLowerCase']()===_0xbfc7('0x10')&&!_0x1dc9a4[_0xbfc7('0x11')]&&!_[_0xbfc7('0x12')](_0x1dc9a4[_0xbfc7('0x13')])){_0x4afdaf[_0xbfc7('0x14')]['findOne']({'where':{'id':_0x1dc9a4[_0xbfc7('0x15')]}})[_0xbfc7('0x16')](function(_0x1d566b){if(_0x1d566b){_0x1d566b[_0xbfc7('0x17')]({'lastMsgAt':_0x1dc9a4[_0xbfc7('0x18')],'lastMsgDirection':_0x1dc9a4[_0xbfc7('0xf')]['toLowerCase']()});}})[_0xbfc7('0x19')](function(_0x5b5c62){console[_0xbfc7('0x1a')](_0x5b5c62);});}_0x296553();}},'charset':_0xbfc7('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd521=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xd521,0x184));var _0x1d52=function(_0x4ba97e,_0x194ab6){_0x4ba97e=_0x4ba97e-0x0;var _0x31730d=_0xd521[_0x4ba97e];return _0x31730d;};'use strict';var _=require('lodash');var util=require(_0x1d52('0x0'));var logger=require(_0x1d52('0x1'))(_0x1d52('0x2'));var moment=require(_0x1d52('0x3'));var BPromise=require(_0x1d52('0x4'));var rp=require(_0x1d52('0x5'));var fs=require('fs');var path=require(_0x1d52('0x6'));var rimraf=require(_0x1d52('0x7'));var config=require(_0x1d52('0x8'));var attributes=require(_0x1d52('0x9'));module[_0x1d52('0xa')]=function(_0x34d49f,_0x2b76c4){return _0x34d49f[_0x1d52('0xb')](_0x1d52('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1d52('0xd')],'type':_0x1d52('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20df4e,_0x33a00d,_0x2100d7){var _0x59ecc1=_0x34d49f[_0x1d52('0xf')];var _0x5cf940=_0x20df4e[_0x1d52('0x10')]({'plain':!![]});if(_0x5cf940[_0x1d52('0x11')][_0x1d52('0x12')]()==='in'||_0x5cf940[_0x1d52('0x11')][_0x1d52('0x12')]()==='out'&&!_0x5cf940[_0x1d52('0x13')]&&!_[_0x1d52('0x14')](_0x5cf940[_0x1d52('0x15')])){_0x59ecc1[_0x1d52('0x16')]['findOne']({'where':{'id':_0x5cf940[_0x1d52('0x17')]}})[_0x1d52('0x18')](function(_0x90d74c){if(_0x90d74c){_0x90d74c[_0x1d52('0x19')]({'lastMsgAt':_0x5cf940['createdAt'],'lastMsgDirection':_0x5cf940['direction']['toLowerCase']()});}})[_0x1d52('0x1a')](function(_0x2cf137){console[_0x1d52('0x1b')](_0x2cf137);});}_0x2100d7();}},'charset':_0x1d52('0x1c'),'collate':_0x1d52('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index e9b1653..91be68d 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 _0x1d34=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','body','options'];(function(_0x4a411b,_0xa4fbb1){var _0x4f415f=function(_0x494204){while(--_0x494204){_0x4a411b['push'](_0x4a411b['shift']());}};_0x4f415f(++_0xa4fbb1);}(_0x1d34,0x1c8));var _0x41d3=function(_0x367f08,_0x37adf2){_0x367f08=_0x367f08-0x0;var _0x2382a4=_0x1d34[_0x367f08];return _0x2382a4;};'use strict';var _=require(_0x41d3('0x0'));var util=require(_0x41d3('0x1'));var moment=require(_0x41d3('0x2'));var BPromise=require(_0x41d3('0x3'));var rs=require(_0x41d3('0x4'));var fs=require('fs');var Redis=require(_0x41d3('0x5'));var db=require(_0x41d3('0x6'))['db'];var utils=require(_0x41d3('0x7'));var logger=require(_0x41d3('0x8'))(_0x41d3('0x9'));var config=require(_0x41d3('0xa'));var jayson=require(_0x41d3('0xb'));var client=jayson[_0x41d3('0xc')][_0x41d3('0xd')]({'port':0x232a});config[_0x41d3('0xe')]=_[_0x41d3('0xf')](config['redis'],{'host':_0x41d3('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0x41d3('0x11')](socket);function respondWithRpcPromise(_0x37d82d,_0x2da160,_0x3dbc88){return new BPromise(function(_0x584117,_0x242788){return client[_0x41d3('0x12')](_0x37d82d,_0x3dbc88)[_0x41d3('0x13')](function(_0x87b09d){logger[_0x41d3('0x14')](_0x41d3('0x15'),_0x2da160,_0x41d3('0x16'));logger[_0x41d3('0x17')](_0x41d3('0x18'),_0x2da160,_0x41d3('0x16'),JSON[_0x41d3('0x19')](_0x87b09d));if(_0x87b09d[_0x41d3('0x1a')]){if(_0x87b09d['error']['code']===0x1f4){logger[_0x41d3('0x1a')](_0x41d3('0x15'),_0x2da160,_0x87b09d[_0x41d3('0x1a')][_0x41d3('0x1b')]);return _0x242788(_0x87b09d['error'][_0x41d3('0x1b')]);}logger[_0x41d3('0x1a')](_0x41d3('0x15'),_0x2da160,_0x87b09d[_0x41d3('0x1a')][_0x41d3('0x1b')]);return _0x584117(_0x87b09d[_0x41d3('0x1a')][_0x41d3('0x1b')]);}else{logger[_0x41d3('0x14')]('ChatMessage,\x20%s,\x20%s',_0x2da160,_0x41d3('0x16'));_0x584117(_0x87b09d[_0x41d3('0x1c')][_0x41d3('0x1b')]);}})[_0x41d3('0x1d')](function(_0x1d3690){logger[_0x41d3('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x2da160,_0x1d3690);_0x242788(_0x1d3690);});});}exports[_0x41d3('0x1e')]=function(_0x4bec68){var _0x34e676=this;return new Promise(function(_0x1ee1c0,_0x1da237){return db[_0x41d3('0x1f')]['create'](_0x4bec68[_0x41d3('0x20')],{'raw':_0x4bec68['options']?_0x4bec68[_0x41d3('0x21')][_0x41d3('0x22')]===undefined?!![]:![]:!![]})[_0x41d3('0x13')](function(_0x51fa58){logger['info'](_0x41d3('0x1e'),_0x4bec68);logger[_0x41d3('0x17')]('CreateChatMessage',_0x4bec68,JSON[_0x41d3('0x19')](_0x51fa58));_0x1ee1c0(_0x51fa58);})['catch'](function(_0x2937d8){logger['error'](_0x41d3('0x1e'),_0x2937d8[_0x41d3('0x1b')],_0x4bec68);_0x1da237(_0x34e676[_0x41d3('0x1a')](0x1f4,_0x2937d8[_0x41d3('0x1b')]));});});};
\ No newline at end of file
+var _0xa806=['redis','localhost','socket.io-emitter','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa806,0xf5));var _0x6a80=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xa806[_0x49c68e];return _0x33032b;};'use strict';var _=require(_0x6a80('0x0'));var util=require(_0x6a80('0x1'));var moment=require(_0x6a80('0x2'));var BPromise=require(_0x6a80('0x3'));var rs=require(_0x6a80('0x4'));var fs=require('fs');var Redis=require(_0x6a80('0x5'));var db=require(_0x6a80('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6a80('0x7'));var config=require(_0x6a80('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a80('0x9')][_0x6a80('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6a80('0xb')],{'host':_0x6a80('0xc'),'port':0x18eb});var socket=require(_0x6a80('0xd'))(new Redis(config[_0x6a80('0xb')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x181479,_0x3d9cc1,_0x159d29){return new BPromise(function(_0x4455c7,_0x3a3a42){return client[_0x6a80('0xe')](_0x181479,_0x159d29)[_0x6a80('0xf')](function(_0x4b4969){logger[_0x6a80('0x10')](_0x6a80('0x11'),_0x3d9cc1,_0x6a80('0x12'));logger[_0x6a80('0x13')](_0x6a80('0x14'),_0x3d9cc1,_0x6a80('0x12'),JSON[_0x6a80('0x15')](_0x4b4969));if(_0x4b4969[_0x6a80('0x16')]){if(_0x4b4969[_0x6a80('0x16')][_0x6a80('0x17')]===0x1f4){logger[_0x6a80('0x16')](_0x6a80('0x11'),_0x3d9cc1,_0x4b4969[_0x6a80('0x16')]['message']);return _0x3a3a42(_0x4b4969['error'][_0x6a80('0x18')]);}logger[_0x6a80('0x16')](_0x6a80('0x11'),_0x3d9cc1,_0x4b4969[_0x6a80('0x16')][_0x6a80('0x18')]);return _0x4455c7(_0x4b4969[_0x6a80('0x16')]['message']);}else{logger[_0x6a80('0x10')](_0x6a80('0x11'),_0x3d9cc1,'request\x20sent');_0x4455c7(_0x4b4969[_0x6a80('0x19')]['message']);}})[_0x6a80('0x1a')](function(_0x189d56){logger[_0x6a80('0x16')](_0x6a80('0x11'),_0x3d9cc1,_0x189d56);_0x3a3a42(_0x189d56);});});}exports[_0x6a80('0x1b')]=function(_0x4336c7){var _0x1db01f=this;return new Promise(function(_0x507b25,_0x51cc2e){return db['ChatMessage'][_0x6a80('0x1c')](_0x4336c7[_0x6a80('0x1d')],{'raw':_0x4336c7[_0x6a80('0x1e')]?_0x4336c7[_0x6a80('0x1e')][_0x6a80('0x1f')]===undefined?!![]:![]:!![]})[_0x6a80('0xf')](function(_0x3be32a){logger[_0x6a80('0x10')](_0x6a80('0x1b'),_0x4336c7);logger[_0x6a80('0x13')](_0x6a80('0x1b'),_0x4336c7,JSON['stringify'](_0x3be32a));_0x507b25(_0x3be32a);})[_0x6a80('0x1a')](function(_0x2c3fd4){logger[_0x6a80('0x16')]('CreateChatMessage',_0x2c3fd4[_0x6a80('0x18')],_0x4336c7);_0x51cc2e(_0x1db01f[_0x6a80('0x16')](0x1f4,_0x2c3fd4[_0x6a80('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index bb5ad7f..7fec954 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 _0xd9ef=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','update'];(function(_0x25f3bd,_0x508d5a){var _0x2581ff=function(_0x5a1cd9){while(--_0x5a1cd9){_0x25f3bd['push'](_0x25f3bd['shift']());}};_0x2581ff(++_0x508d5a);}(_0xd9ef,0x95));var _0xfd9e=function(_0x394cb0,_0x5c4eee){_0x394cb0=_0x394cb0-0x0;var _0x3f2409=_0xd9ef[_0x394cb0];return _0x3f2409;};'use strict';var ChatMessageEvents=require(_0xfd9e('0x0'));var events=[_0xfd9e('0x1'),'remove',_0xfd9e('0x2')];function createListener(_0x55d1e2,_0x57c743){return function(_0x505f7f){_0x57c743[_0xfd9e('0x3')](_0x55d1e2,_0x505f7f);};}function removeListener(_0x28cfac,_0xe6990b){return function(){ChatMessageEvents[_0xfd9e('0x4')](_0x28cfac,_0xe6990b);};}exports[_0xfd9e('0x5')]=function(_0x178ceb){for(var _0x2d549f=0x0,_0x3c3dec=events[_0xfd9e('0x6')];_0x2d549f<_0x3c3dec;_0x2d549f++){var _0x302795=events[_0x2d549f];var _0xb61585=createListener(_0xfd9e('0x7')+_0x302795,_0x178ceb);ChatMessageEvents['on'](_0x302795,_0xb61585);}};
\ No newline at end of file
+var _0x7d55=['emit','removeListener','register','length','./chatMessage.events','save','remove','update'];(function(_0x41ba41,_0x145412){var _0x22d385=function(_0x571d2a){while(--_0x571d2a){_0x41ba41['push'](_0x41ba41['shift']());}};_0x22d385(++_0x145412);}(_0x7d55,0x1bc));var _0x57d5=function(_0x3369f6,_0x4ad4f2){_0x3369f6=_0x3369f6-0x0;var _0x5f521a=_0x7d55[_0x3369f6];return _0x5f521a;};'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
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 8bccb76..556668a 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 _0xf4ae=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','put','update','/:id/accept'];(function(_0x2cc86e,_0x5e9be8){var _0x3c43e1=function(_0x522ecc){while(--_0x522ecc){_0x2cc86e['push'](_0x2cc86e['shift']());}};_0x3c43e1(++_0x5e9be8);}(_0xf4ae,0x75));var _0xef4a=function(_0x263f76,_0x2ee49f){_0x263f76=_0x263f76-0x0;var _0x4112de=_0xf4ae[_0x263f76];return _0x4112de;};'use strict';var multer=require(_0xef4a('0x0'));var util=require(_0xef4a('0x1'));var path=require(_0xef4a('0x2'));var timeout=require(_0xef4a('0x3'));var express=require(_0xef4a('0x4'));var router=express[_0xef4a('0x5')]();var fs_extra=require(_0xef4a('0x6'));var auth=require(_0xef4a('0x7'));var interaction=require(_0xef4a('0x8'));var config=require('../../config/environment');var controller=require(_0xef4a('0x9'));router[_0xef4a('0xa')]('/',auth[_0xef4a('0xb')](),controller[_0xef4a('0xc')]);router[_0xef4a('0xa')](_0xef4a('0xd'),auth['isAuthenticated'](),controller[_0xef4a('0xe')]);router[_0xef4a('0xa')](_0xef4a('0xf'),auth[_0xef4a('0xb')](),controller[_0xef4a('0x10')]);router[_0xef4a('0x11')]('/',auth[_0xef4a('0xb')](),interaction[_0xef4a('0x12')]('chat',_0xef4a('0x13')),controller['create']);router[_0xef4a('0x14')](_0xef4a('0xf'),controller[_0xef4a('0x15')]);router[_0xef4a('0x14')](_0xef4a('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0xef4a('0x14')](_0xef4a('0x17'),auth[_0xef4a('0xb')](),controller[_0xef4a('0x18')]);router[_0xef4a('0x19')](_0xef4a('0xf'),auth[_0xef4a('0xb')](),controller[_0xef4a('0x1a')]);module[_0xef4a('0x1b')]=router;
\ No newline at end of file
+var _0x2f96=['chatmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','post','tracked','chat'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x2f96,0x1be));var _0x62f9=function(_0x215cd8,_0x186835){_0x215cd8=_0x215cd8-0x0;var _0x52685b=_0x2f96[_0x215cd8];return _0x52685b;};'use strict';var multer=require(_0x62f9('0x0'));var util=require(_0x62f9('0x1'));var path=require(_0x62f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x62f9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x62f9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x62f9('0x5'));var controller=require(_0x62f9('0x6'));router[_0x62f9('0x7')]('/',auth[_0x62f9('0x8')](),controller['index']);router[_0x62f9('0x7')]('/describe',auth[_0x62f9('0x8')](),controller[_0x62f9('0x9')]);router[_0x62f9('0x7')](_0x62f9('0xa'),auth[_0x62f9('0x8')](),controller['show']);router[_0x62f9('0xb')]('/',auth[_0x62f9('0x8')](),interaction[_0x62f9('0xc')](_0x62f9('0xd'),_0x62f9('0xe')),controller[_0x62f9('0xf')]);router[_0x62f9('0x10')](_0x62f9('0xa'),controller['update']);router[_0x62f9('0x10')](_0x62f9('0x11'),auth[_0x62f9('0x8')](),controller['accept']);router[_0x62f9('0x10')](_0x62f9('0x12'),auth[_0x62f9('0x8')](),controller[_0x62f9('0x13')]);router[_0x62f9('0x14')]('/:id',auth[_0x62f9('0x8')](),controller[_0x62f9('0x15')]);module[_0x62f9('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index a63853a..ccde130 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 _0x5f66=['medium','TEXT','exports'];(function(_0x484cf3,_0x511df2){var _0x38173e=function(_0x5db4af){while(--_0x5db4af){_0x484cf3['push'](_0x484cf3['shift']());}};_0x38173e(++_0x511df2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x1944f2,_0x212cd8){var _0x5934b7=function(_0x2e7aba){while(--_0x2e7aba){_0x1944f2['push'](_0x1944f2['shift']());}};_0x5934b7(++_0x212cd8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 4fc70fa..4e19971 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(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x7a54,0x106));var _0x47a5=function(_0x35187b,_0x5e1982){_0x35187b=_0x35187b-0x0;var _0x5be486=_0x7a54[_0x35187b];return _0x5be486;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x525868,_0x4c72b5){var _0x3cc38a=function(_0x469743){while(--_0x469743){_0x525868['push'](_0x525868['shift']());}};_0x3cc38a(++_0x4c72b5);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index bf151f2..bf8d2ee 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15a0=['hook','events','ChatOfflineMessage','setMaxListeners','save','remove','emit'];(function(_0x54c71e,_0x5a2938){var _0x572e6d=function(_0x260b79){while(--_0x260b79){_0x54c71e['push'](_0x54c71e['shift']());}};_0x572e6d(++_0x5a2938);}(_0x15a0,0x8d));var _0x015a=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x15a0[_0x2f8530];return _0x5e814e;};'use strict';var EventEmitter=require(_0x015a('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x015a('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x015a('0x2')](0x0);var events={'afterCreate':_0x015a('0x3'),'afterUpdate':'update','afterDestroy':_0x015a('0x4')};function emitEvent(_0x6bec6f){return function(_0x47e028,_0x346473,_0x24b1ba){ChatOfflineMessageEvents[_0x015a('0x5')](_0x6bec6f+':'+_0x47e028['id'],_0x47e028);ChatOfflineMessageEvents[_0x015a('0x5')](_0x6bec6f,_0x47e028);_0x24b1ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x015a('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xcec8=['remove','emit','hasOwnProperty','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xcec8,0x10c));var _0x8cec=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0xcec8[_0xd9f102];return _0x2652e4;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x8cec('0x0'))['db'][_0x8cec('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8cec('0x2')](0x0);var events={'afterCreate':_0x8cec('0x3'),'afterUpdate':'update','afterDestroy':_0x8cec('0x4')};function emitEvent(_0x5cce98){return function(_0x3063a5,_0x18dcea,_0x28abdd){ChatOfflineMessageEvents['emit'](_0x5cce98+':'+_0x3063a5['id'],_0x3063a5);ChatOfflineMessageEvents[_0x8cec('0x5')](_0x5cce98,_0x3063a5);_0x28abdd(null);};}for(var e in events){if(events[_0x8cec('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x8cec('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 51c3a62..8804e66 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 _0x29bf=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x5ea797,_0x2d39dd){var _0x500783=function(_0x4923f2){while(--_0x4923f2){_0x5ea797['push'](_0x5ea797['shift']());}};_0x500783(++_0x2d39dd);}(_0x29bf,0x6e));var _0xf29b=function(_0x4dc3d0,_0xf6dbe1){_0x4dc3d0=_0x4dc3d0-0x0;var _0x2c7cd8=_0x29bf[_0x4dc3d0];return _0x2c7cd8;};'use strict';var attributes=require(_0xf29b('0x0'));module[_0xf29b('0x1')]=function(_0xa310de){return _0xa310de[_0xf29b('0x2')](_0xf29b('0x3'),attributes,{'tableName':_0xf29b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf29b('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1244=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x1244,0x169));var _0x4124=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x1244[_0x543084];return _0x306a57;};'use strict';var attributes=require(_0x4124('0x0'));module[_0x4124('0x1')]=function(_0x32ed3d){return _0x32ed3d[_0x4124('0x2')](_0x4124('0x3'),attributes,{'tableName':_0x4124('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4124('0x5'),'collate':_0x4124('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 2444b5e..a934b37 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 _0x01ad=['then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3791a3,_0x237ad1){var _0x5e5d6f=function(_0x171b91){while(--_0x171b91){_0x3791a3['push'](_0x3791a3['shift']());}};_0x5e5d6f(++_0x237ad1);}(_0x01ad,0xd2));var _0xd01a=function(_0x23c2b7,_0x57b41a){_0x23c2b7=_0x23c2b7-0x0;var _0x4c7225=_0x01ad[_0x23c2b7];return _0x4c7225;};'use strict';var _=require(_0xd01a('0x0'));var util=require('util');var moment=require(_0xd01a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd01a('0x2'));var db=require(_0xd01a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd01a('0x4'))(_0xd01a('0x5'));var config=require(_0xd01a('0x6'));var jayson=require(_0xd01a('0x7'));var client=jayson['client'][_0xd01a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26f150,_0x1df345,_0x5be6a1){return new BPromise(function(_0x24895f,_0x4f1b67){return client[_0xd01a('0x9')](_0x26f150,_0x5be6a1)[_0xd01a('0xa')](function(_0x3087d7){logger[_0xd01a('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1df345,_0xd01a('0xc'));logger[_0xd01a('0xd')](_0xd01a('0xe'),_0x1df345,_0xd01a('0xc'),JSON[_0xd01a('0xf')](_0x3087d7));if(_0x3087d7[_0xd01a('0x10')]){if(_0x3087d7[_0xd01a('0x10')]['code']===0x1f4){logger[_0xd01a('0x10')](_0xd01a('0x11'),_0x1df345,_0x3087d7['error'][_0xd01a('0x12')]);return _0x4f1b67(_0x3087d7[_0xd01a('0x10')][_0xd01a('0x12')]);}logger[_0xd01a('0x10')](_0xd01a('0x11'),_0x1df345,_0x3087d7[_0xd01a('0x10')][_0xd01a('0x12')]);return _0x24895f(_0x3087d7[_0xd01a('0x10')][_0xd01a('0x12')]);}else{logger[_0xd01a('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1df345,'request\x20sent');_0x24895f(_0x3087d7['result'][_0xd01a('0x12')]);}})[_0xd01a('0x13')](function(_0x1bf3a7){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1df345,_0x1bf3a7);_0x4f1b67(_0x1bf3a7);});});}
\ No newline at end of file
+var _0x7cf6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x25f01d,_0x463b20){var _0x55f403=function(_0x388972){while(--_0x388972){_0x25f01d['push'](_0x25f01d['shift']());}};_0x55f403(++_0x463b20);}(_0x7cf6,0x143));var _0x67cf=function(_0x1b7529,_0x2daff6){_0x1b7529=_0x1b7529-0x0;var _0x542bfb=_0x7cf6[_0x1b7529];return _0x542bfb;};'use strict';var _=require('lodash');var util=require(_0x67cf('0x0'));var moment=require(_0x67cf('0x1'));var BPromise=require(_0x67cf('0x2'));var rs=require(_0x67cf('0x3'));var fs=require('fs');var Redis=require(_0x67cf('0x4'));var db=require(_0x67cf('0x5'))['db'];var utils=require(_0x67cf('0x6'));var logger=require(_0x67cf('0x7'))(_0x67cf('0x8'));var config=require(_0x67cf('0x9'));var jayson=require(_0x67cf('0xa'));var client=jayson[_0x67cf('0xb')][_0x67cf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e0d72,_0x15ffd0,_0x4c5006){return new BPromise(function(_0x26900a,_0xb46df4){return client[_0x67cf('0xd')](_0x1e0d72,_0x4c5006)[_0x67cf('0xe')](function(_0x29c6b5){logger['info'](_0x67cf('0xf'),_0x15ffd0,_0x67cf('0x10'));logger[_0x67cf('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x15ffd0,_0x67cf('0x10'),JSON[_0x67cf('0x12')](_0x29c6b5));if(_0x29c6b5[_0x67cf('0x13')]){if(_0x29c6b5[_0x67cf('0x13')]['code']===0x1f4){logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x29c6b5['error']['message']);return _0xb46df4(_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);}logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);return _0x26900a(_0x29c6b5[_0x67cf('0x13')][_0x67cf('0x14')]);}else{logger['info'](_0x67cf('0xf'),_0x15ffd0,_0x67cf('0x10'));_0x26900a(_0x29c6b5['result'][_0x67cf('0x14')]);}})[_0x67cf('0x15')](function(_0x1d90ad){logger[_0x67cf('0x13')](_0x67cf('0xf'),_0x15ffd0,_0x1d90ad);_0xb46df4(_0x1d90ad);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 5f9b234..25e2832 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 _0x5785=['get','isAuthenticated','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5785,0xd2));var _0x5578=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x5785[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var path=require(_0x5578('0x2'));var timeout=require(_0x5578('0x3'));var express=require(_0x5578('0x4'));var router=express[_0x5578('0x5')]();var fs_extra=require(_0x5578('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5578('0x7'));var config=require(_0x5578('0x8'));var controller=require(_0x5578('0x9'));router[_0x5578('0xa')]('/',auth[_0x5578('0xb')](),controller['index']);router[_0x5578('0xa')](_0x5578('0xc'),auth['isAuthenticated'](),controller[_0x5578('0xd')]);router[_0x5578('0xa')]('/:id',auth[_0x5578('0xb')](),controller[_0x5578('0xe')]);router[_0x5578('0xf')]('/',auth[_0x5578('0xb')](),controller['create']);router[_0x5578('0x10')](_0x5578('0x11'),auth[_0x5578('0xb')](),controller[_0x5578('0x12')]);router[_0x5578('0x13')](_0x5578('0x11'),auth[_0x5578('0xb')](),controller[_0x5578('0x14')]);module[_0x5578('0x15')]=router;
\ No newline at end of file
+var _0x51a2=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x575283,_0x3f1c36){var _0x7ce7df=function(_0x4133c5){while(--_0x4133c5){_0x575283['push'](_0x575283['shift']());}};_0x7ce7df(++_0x3f1c36);}(_0x51a2,0x11c));var _0x251a=function(_0x13179f,_0x21f5dd){_0x13179f=_0x13179f-0x0;var _0x51b9e3=_0x51a2[_0x13179f];return _0x51b9e3;};'use strict';var multer=require(_0x251a('0x0'));var util=require(_0x251a('0x1'));var path=require(_0x251a('0x2'));var timeout=require(_0x251a('0x3'));var express=require('express');var router=express[_0x251a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x251a('0x5'));var config=require(_0x251a('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x251a('0x7')]('/',auth[_0x251a('0x8')](),controller[_0x251a('0x9')]);router[_0x251a('0x7')](_0x251a('0xa'),auth[_0x251a('0x8')](),controller[_0x251a('0xb')]);router[_0x251a('0x7')](_0x251a('0xc'),auth['isAuthenticated'](),controller[_0x251a('0xd')]);router[_0x251a('0xe')]('/',auth['isAuthenticated'](),controller[_0x251a('0xf')]);router[_0x251a('0x10')](_0x251a('0xc'),auth['isAuthenticated'](),controller[_0x251a('0x11')]);router[_0x251a('0x12')](_0x251a('0xc'),auth[_0x251a('0x8')](),controller[_0x251a('0x13')]);module[_0x251a('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 0d63aef..7199107 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 _0x6c71=['ENUM','mouseOver','exports','STRING'];(function(_0x5c090b,_0x2d5e53){var _0x13e6b6=function(_0xcf49f9){while(--_0xcf49f9){_0x5c090b['push'](_0x5c090b['shift']());}};_0x13e6b6(++_0x2d5e53);}(_0x6c71,0x8e));var _0x16c7=function(_0x3a4c3d,_0x2cca41){_0x3a4c3d=_0x3a4c3d-0x0;var _0x3d7710=_0x6c71[_0x3a4c3d];return _0x3d7710;};'use strict';var Sequelize=require('sequelize');module[_0x16c7('0x0')]={'name':{'type':Sequelize[_0x16c7('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x16c7('0x2')](_0x16c7('0x3'),'timeout'),'defaultValue':_0x16c7('0x3')},'selector':{'type':Sequelize[_0x16c7('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0930=['sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x5e06c2,_0x56b454){var _0x379fe9=function(_0x3db971){while(--_0x3db971){_0x5e06c2['push'](_0x5e06c2['shift']());}};_0x379fe9(++_0x56b454);}(_0x0930,0x19e));var _0x0093=function(_0x5caf77,_0x44bd89){_0x5caf77=_0x5caf77-0x0;var _0xa4056d=_0x0930[_0x5caf77];return _0xa4056d;};'use strict';var Sequelize=require(_0x0093('0x0'));module[_0x0093('0x1')]={'name':{'type':Sequelize[_0x0093('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0093('0x3')](_0x0093('0x4'),_0x0093('0x5')),'defaultValue':_0x0093('0x4')},'selector':{'type':Sequelize[_0x0093('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 1721498..2293256 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 _0xdbf7=['params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','show'];(function(_0xac0a6f,_0x55ae26){var _0x4a1e61=function(_0x46a679){while(--_0x46a679){_0xac0a6f['push'](_0xac0a6f['shift']());}};_0x4a1e61(++_0x55ae26);}(_0xdbf7,0x8d));var _0x7dbf=function(_0xe36578,_0x167e63){_0xe36578=_0xe36578-0x0;var _0x55b8ad=_0xdbf7[_0xe36578];return _0x55b8ad;};'use strict';var emlformat=require(_0x7dbf('0x0'));var rimraf=require(_0x7dbf('0x1'));var zipdir=require(_0x7dbf('0x2'));var jsonpatch=require(_0x7dbf('0x3'));var rp=require(_0x7dbf('0x4'));var moment=require(_0x7dbf('0x5'));var BPromise=require(_0x7dbf('0x6'));var Mustache=require(_0x7dbf('0x7'));var util=require('util');var path=require(_0x7dbf('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x7dbf('0xa'));var _=require(_0x7dbf('0xb'));var squel=require(_0x7dbf('0xc'));var crypto=require(_0x7dbf('0xd'));var jsforce=require(_0x7dbf('0xe'));var deskjs=require(_0x7dbf('0xf'));var toCsv=require(_0x7dbf('0x10'));var querystring=require(_0x7dbf('0x11'));var Papa=require(_0x7dbf('0x12'));var Redis=require(_0x7dbf('0x13'));var authService=require(_0x7dbf('0x14'));var qs=require(_0x7dbf('0x15'));var as=require(_0x7dbf('0x16'));var hardwareService=require(_0x7dbf('0x17'));var logger=require('../../config/logger')(_0x7dbf('0x18'));var utils=require(_0x7dbf('0x19'));var config=require(_0x7dbf('0x1a'));var licenseUtil=require(_0x7dbf('0x1b'));var db=require(_0x7dbf('0x1c'))['db'];function respondWithStatusCode(_0x2254d7,_0x50bddb){_0x50bddb=_0x50bddb||0xcc;return function(_0x54bb0a){if(_0x54bb0a){return _0x2254d7['sendStatus'](_0x50bddb);}return _0x2254d7['status'](_0x50bddb)['end']();};}function respondWithResult(_0x524ed4,_0x201d38){_0x201d38=_0x201d38||0xc8;return function(_0x35686a){if(_0x35686a){return _0x524ed4[_0x7dbf('0x1d')](_0x201d38)['json'](_0x35686a);}};}function respondWithFilteredResult(_0x3dd291,_0x4492c8){return function(_0x38be73){if(_0x38be73){var _0x4a3cd3=typeof _0x4492c8[_0x7dbf('0x1e')]===_0x7dbf('0x1f')&&typeof _0x4492c8[_0x7dbf('0x20')]===_0x7dbf('0x1f');var _0x1d6b88=_0x38be73[_0x7dbf('0x21')];var _0xc47749=_0x4a3cd3?0x0:_0x4492c8['offset'];var _0x3abe64=_0x4a3cd3?_0x38be73['count']:_0x4492c8[_0x7dbf('0x1e')]+_0x4492c8['limit'];var _0x3dfcb8;if(_0x3abe64>=_0x1d6b88){_0x3abe64=_0x1d6b88;_0x3dfcb8=0xc8;}else{_0x3dfcb8=0xce;}_0x3dd291[_0x7dbf('0x1d')](_0x3dfcb8);return _0x3dd291[_0x7dbf('0x22')](_0x7dbf('0x23'),_0xc47749+'-'+_0x3abe64+'/'+_0x1d6b88)['json'](_0x38be73);}return null;};}function patchUpdates(_0xe2b82){return function(_0x104025){try{jsonpatch[_0x7dbf('0x24')](_0x104025,_0xe2b82,!![]);}catch(_0x56d108){return BPromise[_0x7dbf('0x25')](_0x56d108);}return _0x104025[_0x7dbf('0x26')]();};}function saveUpdates(_0x8b988d,_0xd2460c){return function(_0x4638b8){if(_0x4638b8){return _0x4638b8['update'](_0x8b988d)[_0x7dbf('0x27')](function(_0x26a5e2){return _0x26a5e2;});}return null;};}function removeEntity(_0x29f89f,_0x502014){return function(_0x48d753){if(_0x48d753){return _0x48d753[_0x7dbf('0x28')]()[_0x7dbf('0x27')](function(){_0x29f89f[_0x7dbf('0x1d')](0xcc)[_0x7dbf('0x29')]();});}};}function handleEntityNotFound(_0x205a70,_0x2360a3){return function(_0x35d4d2){if(!_0x35d4d2){_0x205a70['sendStatus'](0x194);}return _0x35d4d2;};}function handleError(_0x5a68fb,_0xba1115){_0xba1115=_0xba1115||0x1f4;return function(_0x2403d7){logger['error'](_0x2403d7[_0x7dbf('0x2a')]);if(_0x2403d7[_0x7dbf('0x2b')]){delete _0x2403d7[_0x7dbf('0x2b')];}_0x5a68fb[_0x7dbf('0x1d')](_0xba1115)['send'](_0x2403d7);};}exports[_0x7dbf('0x2c')]=function(_0x5dcdf4,_0x36d433){var _0x55c1f6={'raw':!![],'where':{'id':_0x5dcdf4[_0x7dbf('0x2d')]['id']}},_0x3c0515={};_0x3c0515[_0x7dbf('0x2e')]=_[_0x7dbf('0x2f')](db[_0x7dbf('0x30')][_0x7dbf('0x31')]);_0x3c0515[_0x7dbf('0x32')]=_[_0x7dbf('0x2f')](_0x5dcdf4[_0x7dbf('0x32')]);_0x3c0515[_0x7dbf('0x33')]=_[_0x7dbf('0x34')](_0x3c0515[_0x7dbf('0x2e')],_0x3c0515[_0x7dbf('0x32')]);_0x55c1f6[_0x7dbf('0x35')]=_[_0x7dbf('0x34')](_0x3c0515['model'],qs[_0x7dbf('0x36')](_0x5dcdf4[_0x7dbf('0x32')][_0x7dbf('0x36')]));_0x55c1f6[_0x7dbf('0x35')]=_0x55c1f6[_0x7dbf('0x35')]['length']?_0x55c1f6[_0x7dbf('0x35')]:_0x3c0515[_0x7dbf('0x2e')];if(_0x5dcdf4[_0x7dbf('0x32')][_0x7dbf('0x37')]){_0x55c1f6[_0x7dbf('0x38')]=[{'all':!![]}];}_0x55c1f6=_['merge']({},_0x55c1f6,_0x5dcdf4[_0x7dbf('0x39')]);return db[_0x7dbf('0x30')]['find'](_0x55c1f6)[_0x7dbf('0x27')](handleEntityNotFound(_0x36d433,null))['then'](respondWithResult(_0x36d433,null))[_0x7dbf('0x3a')](handleError(_0x36d433,null));};exports[_0x7dbf('0x3b')]=function(_0x431c00,_0x4ab0eb){return db[_0x7dbf('0x30')][_0x7dbf('0x3b')](_0x431c00['body'],{})[_0x7dbf('0x27')](respondWithResult(_0x4ab0eb,0xc9))[_0x7dbf('0x3a')](handleError(_0x4ab0eb,null));};exports['update']=function(_0x1a1362,_0x4fda6f){if(_0x1a1362[_0x7dbf('0x3c')]['id']){delete _0x1a1362['body']['id'];}return db[_0x7dbf('0x30')][_0x7dbf('0x3d')]({'where':{'id':_0x1a1362[_0x7dbf('0x2d')]['id']}})[_0x7dbf('0x27')](handleEntityNotFound(_0x4fda6f,null))[_0x7dbf('0x27')](saveUpdates(_0x1a1362[_0x7dbf('0x3c')],null))['then'](respondWithResult(_0x4fda6f,null))['catch'](handleError(_0x4fda6f,null));};exports[_0x7dbf('0x28')]=function(_0x1d2d5d,_0x5dda39){return db[_0x7dbf('0x30')][_0x7dbf('0x3d')]({'where':{'id':_0x1d2d5d[_0x7dbf('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5dda39,null))[_0x7dbf('0x27')](removeEntity(_0x5dda39,null))[_0x7dbf('0x3a')](handleError(_0x5dda39,null));};
\ No newline at end of file
+var _0xed08=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','show','params','rawAttributes','query','intersection','model','fields','attributes','length','include','options','ChatProactiveAction','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','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'];(function(_0x231448,_0x998fea){var _0x45a17c=function(_0x381e9f){while(--_0x381e9f){_0x231448['push'](_0x231448['shift']());}};_0x45a17c(++_0x998fea);}(_0xed08,0x67));var _0x8ed0=function(_0x1cbf5b,_0x4aa7ad){_0x1cbf5b=_0x1cbf5b-0x0;var _0x5a93c6=_0xed08[_0x1cbf5b];return _0x5a93c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed0('0x0'));var zipdir=require(_0x8ed0('0x1'));var jsonpatch=require(_0x8ed0('0x2'));var rp=require(_0x8ed0('0x3'));var moment=require(_0x8ed0('0x4'));var BPromise=require(_0x8ed0('0x5'));var Mustache=require(_0x8ed0('0x6'));var util=require(_0x8ed0('0x7'));var path=require(_0x8ed0('0x8'));var sox=require(_0x8ed0('0x9'));var csv=require(_0x8ed0('0xa'));var ejs=require(_0x8ed0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ed0('0xc'));var squel=require(_0x8ed0('0xd'));var crypto=require(_0x8ed0('0xe'));var jsforce=require(_0x8ed0('0xf'));var deskjs=require(_0x8ed0('0x10'));var toCsv=require(_0x8ed0('0xa'));var querystring=require(_0x8ed0('0x11'));var Papa=require('papaparse');var Redis=require(_0x8ed0('0x12'));var authService=require(_0x8ed0('0x13'));var qs=require(_0x8ed0('0x14'));var as=require(_0x8ed0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ed0('0x16'))(_0x8ed0('0x17'));var utils=require(_0x8ed0('0x18'));var config=require(_0x8ed0('0x19'));var licenseUtil=require(_0x8ed0('0x1a'));var db=require(_0x8ed0('0x1b'))['db'];function respondWithStatusCode(_0x1b2161,_0x431018){_0x431018=_0x431018||0xcc;return function(_0x3ed67b){if(_0x3ed67b){return _0x1b2161[_0x8ed0('0x1c')](_0x431018);}return _0x1b2161['status'](_0x431018)[_0x8ed0('0x1d')]();};}function respondWithResult(_0x14d46a,_0x5e4ea7){_0x5e4ea7=_0x5e4ea7||0xc8;return function(_0x1e729a){if(_0x1e729a){return _0x14d46a[_0x8ed0('0x1e')](_0x5e4ea7)['json'](_0x1e729a);}};}function respondWithFilteredResult(_0x469354,_0x21f4fd){return function(_0x5eda69){if(_0x5eda69){var _0x72bf7a=typeof _0x21f4fd[_0x8ed0('0x1f')]==='undefined'&&typeof _0x21f4fd[_0x8ed0('0x20')]===_0x8ed0('0x21');var _0xb255c=_0x5eda69['count'];var _0x55a134=_0x72bf7a?0x0:_0x21f4fd['offset'];var _0x12fb2c=_0x72bf7a?_0x5eda69[_0x8ed0('0x22')]:_0x21f4fd[_0x8ed0('0x1f')]+_0x21f4fd[_0x8ed0('0x20')];var _0x3548a2;if(_0x12fb2c>=_0xb255c){_0x12fb2c=_0xb255c;_0x3548a2=0xc8;}else{_0x3548a2=0xce;}_0x469354[_0x8ed0('0x1e')](_0x3548a2);return _0x469354[_0x8ed0('0x23')](_0x8ed0('0x24'),_0x55a134+'-'+_0x12fb2c+'/'+_0xb255c)[_0x8ed0('0x25')](_0x5eda69);}return null;};}function patchUpdates(_0x5b8dcb){return function(_0x55726a){try{jsonpatch[_0x8ed0('0x26')](_0x55726a,_0x5b8dcb,!![]);}catch(_0x23e6c2){return BPromise['reject'](_0x23e6c2);}return _0x55726a[_0x8ed0('0x27')]();};}function saveUpdates(_0x28351a,_0x322e90){return function(_0xcba4d4){if(_0xcba4d4){return _0xcba4d4['update'](_0x28351a)[_0x8ed0('0x28')](function(_0x397b51){return _0x397b51;});}return null;};}function removeEntity(_0x5f19e9,_0x1bf9ef){return function(_0xf6208a){if(_0xf6208a){return _0xf6208a[_0x8ed0('0x29')]()[_0x8ed0('0x28')](function(){_0x5f19e9[_0x8ed0('0x1e')](0xcc)[_0x8ed0('0x1d')]();});}};}function handleEntityNotFound(_0x551c91,_0x5165c3){return function(_0x2a35b1){if(!_0x2a35b1){_0x551c91[_0x8ed0('0x1c')](0x194);}return _0x2a35b1;};}function handleError(_0x3a17d4,_0x158364){_0x158364=_0x158364||0x1f4;return function(_0x108f04){logger[_0x8ed0('0x2a')](_0x108f04['stack']);if(_0x108f04[_0x8ed0('0x2b')]){delete _0x108f04[_0x8ed0('0x2b')];}_0x3a17d4['status'](_0x158364)[_0x8ed0('0x2c')](_0x108f04);};}exports[_0x8ed0('0x2d')]=function(_0x29c986,_0x25617c){var _0x15eec2={'raw':!![],'where':{'id':_0x29c986[_0x8ed0('0x2e')]['id']}},_0xec3bd2={};_0xec3bd2['model']=_['keys'](db['ChatProactiveAction'][_0x8ed0('0x2f')]);_0xec3bd2[_0x8ed0('0x30')]=_['keys'](_0x29c986[_0x8ed0('0x30')]);_0xec3bd2['filters']=_[_0x8ed0('0x31')](_0xec3bd2[_0x8ed0('0x32')],_0xec3bd2['query']);_0x15eec2['attributes']=_[_0x8ed0('0x31')](_0xec3bd2[_0x8ed0('0x32')],qs[_0x8ed0('0x33')](_0x29c986['query'][_0x8ed0('0x33')]));_0x15eec2['attributes']=_0x15eec2[_0x8ed0('0x34')][_0x8ed0('0x35')]?_0x15eec2[_0x8ed0('0x34')]:_0xec3bd2[_0x8ed0('0x32')];if(_0x29c986[_0x8ed0('0x30')]['includeAll']){_0x15eec2[_0x8ed0('0x36')]=[{'all':!![]}];}_0x15eec2=_['merge']({},_0x15eec2,_0x29c986[_0x8ed0('0x37')]);return db[_0x8ed0('0x38')][_0x8ed0('0x39')](_0x15eec2)[_0x8ed0('0x28')](handleEntityNotFound(_0x25617c,null))[_0x8ed0('0x28')](respondWithResult(_0x25617c,null))[_0x8ed0('0x3a')](handleError(_0x25617c,null));};exports[_0x8ed0('0x3b')]=function(_0x44f82e,_0x3714f6){return db[_0x8ed0('0x38')][_0x8ed0('0x3b')](_0x44f82e[_0x8ed0('0x3c')],{})[_0x8ed0('0x28')](respondWithResult(_0x3714f6,0xc9))['catch'](handleError(_0x3714f6,null));};exports[_0x8ed0('0x3d')]=function(_0x58b2b6,_0x3aacf9){if(_0x58b2b6['body']['id']){delete _0x58b2b6[_0x8ed0('0x3c')]['id'];}return db[_0x8ed0('0x38')][_0x8ed0('0x39')]({'where':{'id':_0x58b2b6['params']['id']}})[_0x8ed0('0x28')](handleEntityNotFound(_0x3aacf9,null))[_0x8ed0('0x28')](saveUpdates(_0x58b2b6[_0x8ed0('0x3c')],null))['then'](respondWithResult(_0x3aacf9,null))['catch'](handleError(_0x3aacf9,null));};exports[_0x8ed0('0x29')]=function(_0x2c155a,_0x7e32b0){return db[_0x8ed0('0x38')]['find']({'where':{'id':_0x2c155a[_0x8ed0('0x2e')]['id']}})['then'](handleEntityNotFound(_0x7e32b0,null))[_0x8ed0('0x28')](removeEntity(_0x7e32b0,null))[_0x8ed0('0x3a')](handleError(_0x7e32b0,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 1aebc03..2ebeb1c 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 _0x8498=['moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','api'];(function(_0x53b659,_0x445f5f){var _0x57e1fd=function(_0x170be3){while(--_0x170be3){_0x53b659['push'](_0x53b659['shift']());}};_0x57e1fd(++_0x445f5f);}(_0x8498,0x9a));var _0x8849=function(_0x353736,_0x2a1699){_0x353736=_0x353736-0x0;var _0x3764eb=_0x8498[_0x353736];return _0x3764eb;};'use strict';var _=require(_0x8849('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8849('0x1'));var moment=require(_0x8849('0x2'));var BPromise=require('bluebird');var rp=require(_0x8849('0x3'));var fs=require('fs');var path=require(_0x8849('0x4'));var rimraf=require(_0x8849('0x5'));var config=require(_0x8849('0x6'));var attributes=require(_0x8849('0x7'));module[_0x8849('0x8')]=function(_0x1accc0,_0x16a447){return _0x1accc0[_0x8849('0x9')](_0x8849('0xa'),attributes,{'tableName':_0x8849('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd66c=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','api','moment','bluebird','request-promise','path'];(function(_0x52ca43,_0x311547){var _0xeb374=function(_0x464854){while(--_0x464854){_0x52ca43['push'](_0x52ca43['shift']());}};_0xeb374(++_0x311547);}(_0xd66c,0x12e));var _0xcd66=function(_0x53001c,_0x27ac34){_0x53001c=_0x53001c-0x0;var _0x2b9c6d=_0xd66c[_0x53001c];return _0x2b9c6d;};'use strict';var _=require('lodash');var util=require(_0xcd66('0x0'));var logger=require('../../config/logger')(_0xcd66('0x1'));var moment=require(_0xcd66('0x2'));var BPromise=require(_0xcd66('0x3'));var rp=require(_0xcd66('0x4'));var fs=require('fs');var path=require(_0xcd66('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd66('0x6'));module[_0xcd66('0x7')]=function(_0x25399b,_0x1b35d6){return _0x25399b[_0xcd66('0x8')](_0xcd66('0x9'),attributes,{'tableName':_0xcd66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 296ebcb..555ac7a 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 _0x61c2=['result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x61c2,0x1a6));var _0x261c=function(_0x3136ed,_0x123cc0){_0x3136ed=_0x3136ed-0x0;var _0x3d7fd4=_0x61c2[_0x3136ed];return _0x3d7fd4;};'use strict';var _=require(_0x261c('0x0'));var util=require('util');var moment=require(_0x261c('0x1'));var BPromise=require(_0x261c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x261c('0x3'))['db'];var utils=require(_0x261c('0x4'));var logger=require(_0x261c('0x5'))(_0x261c('0x6'));var config=require(_0x261c('0x7'));var jayson=require(_0x261c('0x8'));var client=jayson[_0x261c('0x9')][_0x261c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5470f7,_0x1eb0ae,_0x980710){return new BPromise(function(_0x59f685,_0x2cf803){return client[_0x261c('0xb')](_0x5470f7,_0x980710)['then'](function(_0x53fce5){logger[_0x261c('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x1eb0ae,_0x261c('0xd'));logger['debug'](_0x261c('0xe'),_0x1eb0ae,_0x261c('0xd'),JSON['stringify'](_0x53fce5));if(_0x53fce5['error']){if(_0x53fce5[_0x261c('0xf')][_0x261c('0x10')]===0x1f4){logger[_0x261c('0xf')](_0x261c('0x11'),_0x1eb0ae,_0x53fce5['error']['message']);return _0x2cf803(_0x53fce5[_0x261c('0xf')][_0x261c('0x12')]);}logger[_0x261c('0xf')](_0x261c('0x11'),_0x1eb0ae,_0x53fce5[_0x261c('0xf')]['message']);return _0x59f685(_0x53fce5[_0x261c('0xf')]['message']);}else{logger[_0x261c('0xc')](_0x261c('0x11'),_0x1eb0ae,'request\x20sent');_0x59f685(_0x53fce5[_0x261c('0x13')][_0x261c('0x12')]);}})[_0x261c('0x14')](function(_0x25207d){logger[_0x261c('0xf')](_0x261c('0x11'),_0x1eb0ae,_0x25207d);_0x2cf803(_0x25207d);});});}
\ No newline at end of file
+var _0xc885=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5d6a0e,_0x170b9d){var _0xcf13e8=function(_0x1fd02f){while(--_0x1fd02f){_0x5d6a0e['push'](_0x5d6a0e['shift']());}};_0xcf13e8(++_0x170b9d);}(_0xc885,0xc7));var _0x5c88=function(_0x291449,_0x52117d){_0x291449=_0x291449-0x0;var _0x569795=_0xc885[_0x291449];return _0x569795;};'use strict';var _=require(_0x5c88('0x0'));var util=require('util');var moment=require(_0x5c88('0x1'));var BPromise=require(_0x5c88('0x2'));var rs=require(_0x5c88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c88('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c88('0x5'))(_0x5c88('0x6'));var config=require('../../config/environment');var jayson=require(_0x5c88('0x7'));var client=jayson['client'][_0x5c88('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xddab06,_0x1d7edb,_0x20565c){return new BPromise(function(_0x499555,_0x2c28b2){return client[_0x5c88('0x9')](_0xddab06,_0x20565c)[_0x5c88('0xa')](function(_0x49ce28){logger[_0x5c88('0xb')](_0x5c88('0xc'),_0x1d7edb,'request\x20sent');logger[_0x5c88('0xd')](_0x5c88('0xe'),_0x1d7edb,_0x5c88('0xf'),JSON[_0x5c88('0x10')](_0x49ce28));if(_0x49ce28[_0x5c88('0x11')]){if(_0x49ce28[_0x5c88('0x11')][_0x5c88('0x12')]===0x1f4){logger[_0x5c88('0x11')](_0x5c88('0xc'),_0x1d7edb,_0x49ce28[_0x5c88('0x11')][_0x5c88('0x13')]);return _0x2c28b2(_0x49ce28[_0x5c88('0x11')]['message']);}logger['error'](_0x5c88('0xc'),_0x1d7edb,_0x49ce28[_0x5c88('0x11')][_0x5c88('0x13')]);return _0x499555(_0x49ce28['error'][_0x5c88('0x13')]);}else{logger[_0x5c88('0xb')](_0x5c88('0xc'),_0x1d7edb,_0x5c88('0xf'));_0x499555(_0x49ce28[_0x5c88('0x14')][_0x5c88('0x13')]);}})[_0x5c88('0x15')](function(_0x16a819){logger[_0x5c88('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1d7edb,_0x16a819);_0x2c28b2(_0x16a819);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d1e010b..6bde240 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x5280b0,_0x17a850){var _0x490826=function(_0x2cc0fe){while(--_0x2cc0fe){_0x5280b0['push'](_0x5280b0['shift']());}};_0x490826(++_0x17a850);}(_0xf494,0x1c6));var _0x4f49=function(_0x449041,_0x5d1a18){_0x449041=_0x449041-0x0;var _0x26dc8b=_0xf494[_0x449041];return _0x26dc8b;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router;
\ No newline at end of file
+var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x2eb2[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 62bbe0c..a810e74 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 _0xd7a7=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x19e58e,_0x540b5a){var _0x5c4d79=function(_0xad26a){while(--_0xad26a){_0x19e58e['push'](_0x19e58e['shift']());}};_0x5c4d79(++_0x540b5a);}(_0xd7a7,0xb0));var _0x7d7a=function(_0x480760,_0x5689df){_0x480760=_0x480760-0x0;var _0x429b49=_0xd7a7[_0x480760];return _0x429b49;};'use strict';var Sequelize=require(_0x7d7a('0x0'));module[_0x7d7a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d7a('0x2')]},'timeout':{'type':Sequelize[_0x7d7a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7d7a('0x4'),_0x7d7a('0x5'),_0x7d7a('0x6'))}};
\ No newline at end of file
+var _0x0fcc=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3c4ed9,_0x4b3eea){var _0x4f5bb7=function(_0x482742){while(--_0x482742){_0x3c4ed9['push'](_0x3c4ed9['shift']());}};_0x4f5bb7(++_0x4b3eea);}(_0x0fcc,0x11d));var _0xc0fc=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x0fcc[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0xc0fc('0x0'));module[_0xc0fc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc0fc('0x2')]},'timeout':{'type':Sequelize[_0xc0fc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc0fc('0x4')](_0xc0fc('0x5'),_0xc0fc('0x6'),_0xc0fc('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 2eb140a..ec22e9c 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 _0xacd9=['ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../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','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','ChatQueues','UserProfileResource','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','body','describe','getMembers','findOne','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','chatPause','%s/%s','SIP','createdAt','updatedAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0xacd9,0x150));var _0x9acd=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xacd9[_0x934425];return _0x31d596;};'use strict';var emlformat=require(_0x9acd('0x0'));var rimraf=require(_0x9acd('0x1'));var zipdir=require(_0x9acd('0x2'));var jsonpatch=require(_0x9acd('0x3'));var rp=require(_0x9acd('0x4'));var moment=require(_0x9acd('0x5'));var BPromise=require(_0x9acd('0x6'));var Mustache=require(_0x9acd('0x7'));var util=require(_0x9acd('0x8'));var path=require(_0x9acd('0x9'));var sox=require('sox');var csv=require(_0x9acd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9acd('0xb'));var _=require(_0x9acd('0xc'));var squel=require('squel');var crypto=require(_0x9acd('0xd'));var jsforce=require(_0x9acd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9acd('0xa'));var querystring=require('querystring');var Papa=require(_0x9acd('0xf'));var Redis=require(_0x9acd('0x10'));var authService=require(_0x9acd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9acd('0x12'));var hardwareService=require(_0x9acd('0x13'));var logger=require(_0x9acd('0x14'))(_0x9acd('0x15'));var utils=require(_0x9acd('0x16'));var config=require(_0x9acd('0x17'));var licenseUtil=require(_0x9acd('0x18'));var db=require(_0x9acd('0x19'))['db'];config[_0x9acd('0x1a')]=_[_0x9acd('0x1b')](config[_0x9acd('0x1a')],{'host':_0x9acd('0x1c'),'port':0x18eb});var socket=require(_0x9acd('0x1d'))(new Redis(config[_0x9acd('0x1a')]));require(_0x9acd('0x1e'))['register'](socket);var jayson=require(_0x9acd('0x1f'));var client=jayson[_0x9acd('0x20')][_0x9acd('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x56293b,_0x4c369b,_0x436e3f,_0x726eb9){return new BPromise(function(_0x115a5b,_0x394993){var _0x14d92c=_0x726eb9||client;return _0x14d92c[_0x9acd('0x22')](_0x56293b,_0x436e3f)[_0x9acd('0x23')](function(_0x5afed0){logger[_0x9acd('0x24')](_0x9acd('0x25'),_0x4c369b,_0x9acd('0x26'));logger[_0x9acd('0x27')](_0x9acd('0x28'),_0x4c369b,_0x9acd('0x26'),JSON[_0x9acd('0x29')](_0x5afed0));if(_0x5afed0[_0x9acd('0x2a')]){if(_0x5afed0[_0x9acd('0x2a')][_0x9acd('0x2b')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4c369b,_0x5afed0[_0x9acd('0x2a')][_0x9acd('0x2c')]);return _0x394993(_0x5afed0['error'][_0x9acd('0x2c')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x4c369b,_0x5afed0[_0x9acd('0x2a')][_0x9acd('0x2c')]);return _0x115a5b(_0x5afed0['error']['message']);}else{logger[_0x9acd('0x24')](_0x9acd('0x25'),_0x4c369b,_0x9acd('0x26'));_0x115a5b(_0x5afed0['result'][_0x9acd('0x2c')]);}})[_0x9acd('0x2d')](function(_0x5cb1fb){logger[_0x9acd('0x2a')](_0x9acd('0x25'),_0x4c369b,_0x5cb1fb);_0x394993(_0x5cb1fb);});});}function respondWithStatusCode(_0x2487b2,_0x2ba3c5){_0x2ba3c5=_0x2ba3c5||0xcc;return function(_0x1c15aa){if(_0x1c15aa){return _0x2487b2['sendStatus'](_0x2ba3c5);}return _0x2487b2[_0x9acd('0x2e')](_0x2ba3c5)[_0x9acd('0x2f')]();};}function respondWithResult(_0x3a4c0a,_0x5eea3f){_0x5eea3f=_0x5eea3f||0xc8;return function(_0x1225ac){if(_0x1225ac){return _0x3a4c0a['status'](_0x5eea3f)[_0x9acd('0x30')](_0x1225ac);}};}function respondWithFilteredResult(_0x2f8132,_0x3245c5){return function(_0x3f8d3b){if(_0x3f8d3b){var _0x3fb80f=typeof _0x3245c5[_0x9acd('0x31')]===_0x9acd('0x32')&&typeof _0x3245c5[_0x9acd('0x33')]===_0x9acd('0x32');var _0x36400a=_0x3f8d3b[_0x9acd('0x34')];var _0x209d58=_0x3fb80f?0x0:_0x3245c5['offset'];var _0x55c31b=_0x3fb80f?_0x3f8d3b[_0x9acd('0x34')]:_0x3245c5[_0x9acd('0x31')]+_0x3245c5[_0x9acd('0x33')];var _0x1e94e6;if(_0x55c31b>=_0x36400a){_0x55c31b=_0x36400a;_0x1e94e6=0xc8;}else{_0x1e94e6=0xce;}_0x2f8132['status'](_0x1e94e6);return _0x2f8132[_0x9acd('0x35')](_0x9acd('0x36'),_0x209d58+'-'+_0x55c31b+'/'+_0x36400a)[_0x9acd('0x30')](_0x3f8d3b);}return null;};}function patchUpdates(_0x4599a9){return function(_0x5a59c4){try{jsonpatch[_0x9acd('0x37')](_0x5a59c4,_0x4599a9,!![]);}catch(_0x50b2d2){return BPromise[_0x9acd('0x38')](_0x50b2d2);}return _0x5a59c4['save']();};}function saveUpdates(_0x3c639c,_0x49df31){return function(_0x21b84e){if(_0x21b84e){return _0x21b84e['update'](_0x3c639c)[_0x9acd('0x23')](function(_0x2d3a79){return _0x2d3a79;});}return null;};}function removeEntity(_0x1f1847,_0x270b61){return function(_0x11a0cf){if(_0x11a0cf){return _0x11a0cf[_0x9acd('0x39')]()[_0x9acd('0x23')](function(){var _0x25d9e4=_0x11a0cf['get']({'plain':!![]});var _0x141659=_0x9acd('0x3a');return db[_0x9acd('0x3b')][_0x9acd('0x39')]({'where':{'type':_0x141659,'resourceId':_0x25d9e4['id']}})[_0x9acd('0x23')](function(){return _0x11a0cf;});})[_0x9acd('0x23')](function(){_0x1f1847[_0x9acd('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b646c,_0x4fe471){return function(_0x17064d){if(!_0x17064d){_0x2b646c['sendStatus'](0x194);}return _0x17064d;};}function handleError(_0x17a31a,_0x545c47){_0x545c47=_0x545c47||0x1f4;return function(_0x11867e){logger['error'](_0x11867e['stack']);if(_0x11867e[_0x9acd('0x3c')]){delete _0x11867e[_0x9acd('0x3c')];}_0x17a31a[_0x9acd('0x2e')](_0x545c47)['send'](_0x11867e);};}exports[_0x9acd('0x3d')]=function(_0x3a9e41,_0x11c0e1){var _0x3a7033={},_0x52e40a={},_0xf0aa8f={'count':0x0,'rows':[]};var _0x145bd0=_[_0x9acd('0x3e')](db[_0x9acd('0x3f')][_0x9acd('0x40')],function(_0x330516){return{'name':_0x330516[_0x9acd('0x41')],'type':_0x330516[_0x9acd('0x42')][_0x9acd('0x43')]};});_0x52e40a[_0x9acd('0x44')]=_['map'](_0x145bd0,_0x9acd('0x3c'));_0x52e40a[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0x3a9e41[_0x9acd('0x45')]);_0x52e40a[_0x9acd('0x47')]=_[_0x9acd('0x48')](_0x52e40a[_0x9acd('0x44')],_0x52e40a[_0x9acd('0x45')]);_0x3a7033['attributes']=_['intersection'](_0x52e40a[_0x9acd('0x44')],qs[_0x9acd('0x49')](_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x49')]));_0x3a7033[_0x9acd('0x4a')]=_0x3a7033[_0x9acd('0x4a')][_0x9acd('0x4b')]?_0x3a7033[_0x9acd('0x4a')]:_0x52e40a[_0x9acd('0x44')];if(!_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x4c')](_0x9acd('0x4d'))){_0x3a7033[_0x9acd('0x33')]=qs[_0x9acd('0x33')](_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x33')]);_0x3a7033[_0x9acd('0x31')]=qs[_0x9acd('0x31')](_0x3a9e41['query'][_0x9acd('0x31')]);}_0x3a7033[_0x9acd('0x4e')]=qs[_0x9acd('0x4f')](_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x4f')]);_0x3a7033[_0x9acd('0x50')]=qs[_0x9acd('0x47')](_[_0x9acd('0x51')](_0x3a9e41[_0x9acd('0x45')],_0x52e40a[_0x9acd('0x47')]),_0x145bd0);if(_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x52')]){_0x3a7033[_0x9acd('0x50')]=_[_0x9acd('0x53')](_0x3a7033[_0x9acd('0x50')],{'$or':_['map'](_0x145bd0,function(_0x35680a){if(_0x35680a[_0x9acd('0x42')]!=='VIRTUAL'){var _0x5793d1={};_0x5793d1[_0x35680a[_0x9acd('0x3c')]]={'$like':'%'+_0x3a9e41['query']['filter']+'%'};return _0x5793d1;}})});}_0x3a7033=_[_0x9acd('0x53')]({},_0x3a7033,_0x3a9e41[_0x9acd('0x54')]);var _0x45d17c={'where':_0x3a7033['where']};return db['ChatQueue'][_0x9acd('0x34')](_0x45d17c)['then'](function(_0x31b63e){_0xf0aa8f['count']=_0x31b63e;if(_0x3a9e41[_0x9acd('0x45')][_0x9acd('0x55')]){_0x3a7033[_0x9acd('0x56')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x3a7033);})[_0x9acd('0x23')](function(_0x12c66d){_0xf0aa8f[_0x9acd('0x57')]=_0x12c66d;return _0xf0aa8f;})['then'](respondWithFilteredResult(_0x11c0e1,_0x3a7033))[_0x9acd('0x2d')](handleError(_0x11c0e1,null));};exports[_0x9acd('0x58')]=function(_0x5ab0be,_0x4a7b4f){var _0x437b33={'raw':!![],'where':{'id':_0x5ab0be[_0x9acd('0x59')]['id']}},_0x2b95a2={};_0x2b95a2[_0x9acd('0x44')]=_[_0x9acd('0x46')](db[_0x9acd('0x3f')][_0x9acd('0x40')]);_0x2b95a2[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0x5ab0be['query']);_0x2b95a2[_0x9acd('0x47')]=_[_0x9acd('0x48')](_0x2b95a2['model'],_0x2b95a2[_0x9acd('0x45')]);_0x437b33[_0x9acd('0x4a')]=_['intersection'](_0x2b95a2['model'],qs[_0x9acd('0x49')](_0x5ab0be[_0x9acd('0x45')][_0x9acd('0x49')]));_0x437b33['attributes']=_0x437b33[_0x9acd('0x4a')][_0x9acd('0x4b')]?_0x437b33['attributes']:_0x2b95a2['model'];if(_0x5ab0be['query'][_0x9acd('0x55')]){_0x437b33[_0x9acd('0x56')]=[{'all':!![]}];}_0x437b33=_[_0x9acd('0x53')]({},_0x437b33,_0x5ab0be[_0x9acd('0x54')]);return db[_0x9acd('0x3f')][_0x9acd('0x5a')](_0x437b33)[_0x9acd('0x23')](handleEntityNotFound(_0x4a7b4f,null))[_0x9acd('0x23')](respondWithResult(_0x4a7b4f,null))[_0x9acd('0x2d')](handleError(_0x4a7b4f,null));};exports['create']=function(_0xedf774,_0x366815){return db[_0x9acd('0x3f')][_0x9acd('0x5b')](_0xedf774['body'],{})[_0x9acd('0x23')](function(_0x5628ac){var _0x24fcef=_0xedf774[_0x9acd('0x5c')][_0x9acd('0x5d')]({'plain':!![]});if(!_0x24fcef)throw new Error(_0x9acd('0x5e'));if(_0x24fcef['role']===_0x9acd('0x5c')){var _0x1a10f5=_0x5628ac[_0x9acd('0x5d')]({'plain':!![]});var _0x4958f5=_0x9acd('0x3a');return db[_0x9acd('0x5f')]['find']({'where':{'name':_0x4958f5,'userProfileId':_0x24fcef[_0x9acd('0x60')]},'raw':!![]})['then'](function(_0x4c02db){if(_0x4c02db&&_0x4c02db[_0x9acd('0x61')]===0x0){return db['UserProfileResource'][_0x9acd('0x5b')]({'name':_0x1a10f5[_0x9acd('0x3c')],'resourceId':_0x1a10f5['id'],'type':_0x4c02db['name'],'sectionId':_0x4c02db['id']},{})[_0x9acd('0x23')](function(){return _0x5628ac;});}else{return _0x5628ac;}})[_0x9acd('0x2d')](function(_0x249ee5){logger[_0x9acd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x249ee5);throw _0x249ee5;});}return _0x5628ac;})[_0x9acd('0x23')](respondWithResult(_0x366815,0xc9))[_0x9acd('0x2d')](handleError(_0x366815,null));};exports[_0x9acd('0x62')]=function(_0xa4faa6,_0x388ae2){if(_0xa4faa6[_0x9acd('0x63')]['id']){delete _0xa4faa6[_0x9acd('0x63')]['id'];}return db[_0x9acd('0x3f')]['find']({'where':{'id':_0xa4faa6[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x388ae2,null))[_0x9acd('0x23')](saveUpdates(_0xa4faa6['body'],null))[_0x9acd('0x23')](respondWithResult(_0x388ae2,null))[_0x9acd('0x2d')](handleError(_0x388ae2,null));};exports['destroy']=function(_0xbaa1fd,_0x2ca32c){return db[_0x9acd('0x3f')][_0x9acd('0x5a')]({'where':{'id':_0xbaa1fd[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x2ca32c,null))[_0x9acd('0x23')](removeEntity(_0x2ca32c,null))['catch'](handleError(_0x2ca32c,null));};exports[_0x9acd('0x64')]=function(_0x5e24e3,_0x327dce){return db[_0x9acd('0x3f')]['describe']()[_0x9acd('0x23')](respondWithResult(_0x327dce,null))[_0x9acd('0x2d')](handleError(_0x327dce,null));};exports[_0x9acd('0x65')]=function(_0x28071c,_0x2a7df0,_0x331bb2){var _0x341333={'raw':!![],'where':{}},_0x519fd9={},_0x4dc4e8;return db[_0x9acd('0x3f')][_0x9acd('0x66')]({'where':{'id':_0x28071c['params']['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x2a7df0,null))[_0x9acd('0x23')](function(_0x4d39cd){if(_0x4d39cd){_0x4dc4e8=_0x4d39cd['get']({'plain':!![]});_0x519fd9[_0x9acd('0x44')]=_[_0x9acd('0x46')](db[_0x9acd('0x67')][_0x9acd('0x40')]);_0x519fd9[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0x28071c[_0x9acd('0x45')]);_0x519fd9['filters']=_[_0x9acd('0x48')](_0x519fd9['model'],_0x519fd9[_0x9acd('0x45')]);_0x341333[_0x9acd('0x4a')]=_[_0x9acd('0x48')](_0x519fd9[_0x9acd('0x44')],qs['fields'](_0x28071c[_0x9acd('0x45')][_0x9acd('0x49')]));_0x341333['attributes']=_0x341333[_0x9acd('0x4a')][_0x9acd('0x4b')]?_0x341333[_0x9acd('0x4a')]:_0x519fd9[_0x9acd('0x44')];if(!_0x28071c['query'][_0x9acd('0x4c')](_0x9acd('0x4d'))){_0x341333['limit']=qs[_0x9acd('0x33')](_0x28071c['query'][_0x9acd('0x33')]);_0x341333[_0x9acd('0x31')]=qs['offset'](_0x28071c['query'][_0x9acd('0x31')]);}_0x341333[_0x9acd('0x4e')]=qs[_0x9acd('0x4f')](_0x28071c['query'][_0x9acd('0x4f')]);_0x341333['where']=qs[_0x9acd('0x47')](_[_0x9acd('0x51')](_0x28071c[_0x9acd('0x45')],_0x519fd9[_0x9acd('0x47')]));_0x341333[_0x9acd('0x50')]['ChatQueueId']=_0x4d39cd['id'];if(_0x28071c[_0x9acd('0x45')][_0x9acd('0x52')]){_0x341333[_0x9acd('0x50')]=_['merge'](_0x341333[_0x9acd('0x50')],{'$or':_[_0x9acd('0x3e')](_0x341333['attributes'],function(_0xfcb899){var _0x1ab597={};_0x1ab597[_0xfcb899]={'$like':'%'+_0x28071c[_0x9acd('0x45')][_0x9acd('0x52')]+'%'};return _0x1ab597;})});}_0x341333=_[_0x9acd('0x53')]({},_0x341333,_0x28071c[_0x9acd('0x54')]);return db[_0x9acd('0x67')][_0x9acd('0x68')](_0x341333);}})[_0x9acd('0x23')](function(_0x5c6b7d){if(_0x5c6b7d){return db[_0x9acd('0x69')][_0x9acd('0x6a')]({'where':{'id':_['map'](_0x5c6b7d,_0x9acd('0x6b')),'role':_0x9acd('0x6c')},'attributes':['id',_0x9acd('0x3c'),_0x9acd('0x6d'),'updatedAt','createdAt']});}})[_0x9acd('0x23')](function(_0x37b046){if(_0x37b046){return{'count':_0x37b046['count'],'rows':_['map'](_0x37b046[_0x9acd('0x57')],function(_0x3b3466){return{'membername':_0x3b3466[_0x9acd('0x3c')],'UserId':_0x3b3466['id'],'queue_name':_0x4dc4e8[_0x9acd('0x3c')],'ChatQueueId':_0x4dc4e8['id'],'interface':util['format'](_0x9acd('0x6e'),_0x9acd('0x6f'),_0x3b3466[_0x9acd('0x3c')]),'penalty':0x0,'paused':_0x3b3466[_0x9acd('0x6d')],'createdAt':_0x3b3466[_0x9acd('0x70')],'updatedAt':_0x3b3466[_0x9acd('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9acd('0x23')](respondWithFilteredResult(_0x2a7df0,_0x341333))[_0x9acd('0x2d')](handleError(_0x2a7df0,null));};exports['getTeams']=function(_0x3a8ed6,_0x3523c6,_0xadffb7){var _0x282418={};var _0x25027e={};var _0x1f29ca;var _0x4479f9;return db[_0x9acd('0x3f')][_0x9acd('0x66')]({'where':{'id':_0x3a8ed6[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x3523c6,null))[_0x9acd('0x23')](function(_0xd9a09c){if(_0xd9a09c){_0x1f29ca=_0xd9a09c;_0x25027e[_0x9acd('0x44')]=_[_0x9acd('0x46')](db[_0x9acd('0x72')][_0x9acd('0x40')]);_0x25027e[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0x3a8ed6[_0x9acd('0x45')]);_0x25027e['filters']=_[_0x9acd('0x48')](_0x25027e[_0x9acd('0x44')],_0x25027e['query']);_0x282418[_0x9acd('0x4a')]=_[_0x9acd('0x48')](_0x25027e[_0x9acd('0x44')],qs[_0x9acd('0x49')](_0x3a8ed6[_0x9acd('0x45')]['fields']));_0x282418[_0x9acd('0x4a')]=_0x282418['attributes'][_0x9acd('0x4b')]?_0x282418['attributes']:_0x25027e[_0x9acd('0x44')];_0x282418[_0x9acd('0x4e')]=qs[_0x9acd('0x4f')](_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x4f')]);_0x282418[_0x9acd('0x50')]=qs[_0x9acd('0x47')](_[_0x9acd('0x51')](_0x3a8ed6[_0x9acd('0x45')],_0x25027e[_0x9acd('0x47')]));if(_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x52')]){_0x282418[_0x9acd('0x50')]=_[_0x9acd('0x53')](_0x282418[_0x9acd('0x50')],{'$or':_[_0x9acd('0x3e')](_0x282418['attributes'],function(_0x13d9d8){var _0x2d456b={};_0x2d456b[_0x13d9d8]={'$like':'%'+_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x52')]+'%'};return _0x2d456b;})});}_0x282418=_[_0x9acd('0x53')]({},_0x282418,_0x3a8ed6['options']);return _0x1f29ca['getTeams'](_0x282418);}})[_0x9acd('0x23')](function(_0x5aef6e){if(_0x5aef6e){_0x4479f9=_0x5aef6e[_0x9acd('0x4b')];if(!_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x4c')]('nolimit')){_0x282418[_0x9acd('0x33')]=qs[_0x9acd('0x33')](_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x33')]);_0x282418[_0x9acd('0x31')]=qs[_0x9acd('0x31')](_0x3a8ed6[_0x9acd('0x45')][_0x9acd('0x31')]);}return _0x1f29ca[_0x9acd('0x73')](_0x282418);}})['then'](function(_0x14974e){if(_0x14974e){return _0x14974e?{'count':_0x4479f9,'rows':_0x14974e}:null;}})[_0x9acd('0x23')](respondWithResult(_0x3523c6,null))[_0x9acd('0x2d')](handleError(_0x3523c6,null));};exports[_0x9acd('0x74')]=function(_0x272271,_0x59c36a,_0x293461){var _0x5dad9a=_0x272271[_0x9acd('0x63')]['ids'];return db[_0x9acd('0x72')][_0x9acd('0x68')]({'where':{'id':_0x5dad9a},'attributes':['id'],'include':[{'model':db[_0x9acd('0x69')],'as':_0x9acd('0x75'),'attributes':['id',_0x9acd('0x3c'),_0x9acd('0x76'),_0x9acd('0x77'),_0x9acd('0x78')],'raw':!![]}]})[_0x9acd('0x23')](function(_0x5b0c13){if(_0x5b0c13){var _0x3d64ef=_[_0x9acd('0x79')](_0x5b0c13,function(_0x42f8b7){var _0x4b999d=_0x42f8b7['get']({'plain':!![]});return _0x4b999d[_0x9acd('0x75')];});return db[_0x9acd('0x3f')][_0x9acd('0x5a')]({'where':{'id':_0x272271[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](function(_0x25bcd4){return db['sequelize'][_0x9acd('0x7a')](function(_0x4d52f0){return _0x25bcd4[_0x9acd('0x74')](_0x5dad9a,{'transaction':_0x4d52f0})[_0x9acd('0x23')](function(){return BPromise[_0x9acd('0x7b')](_0x3d64ef,function(_0xbbaf19){return db['UserChatQueue'][_0x9acd('0x7c')]({'where':{'UserId':_0xbbaf19['id'],'ChatQueueId':_0x272271[_0x9acd('0x59')]['id']},'transaction':_0x4d52f0});});})[_0x9acd('0x23')](function(){_0x3d64ef[_0x9acd('0x7d')](function(_0x581b2c){socket[_0x9acd('0x7e')](_0x9acd('0x7f'),{'UserId':_0x581b2c['id'],'ChatQueueId':_0x25bcd4['id']});});});});});}})[_0x9acd('0x23')](respondWithStatusCode(_0x59c36a,null))[_0x9acd('0x2d')](handleError(_0x59c36a,null));};exports[_0x9acd('0x80')]=function(_0x5af89f,_0x1e8b2b,_0x3183b5){return db[_0x9acd('0x72')]['findAll']({'where':{'id':_0x5af89f[_0x9acd('0x45')][_0x9acd('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9acd('0x75'),'attributes':['id'],'raw':!![]}]})[_0x9acd('0x23')](handleEntityNotFound(_0x1e8b2b,null))['then'](function(_0x8c0163){var _0x21a02b=_['map'](_0x8c0163,'id');var _0x978369=[];var _0x46bef8=[];var _0x521666=squel['select']();_0x521666[_0x9acd('0x82')](_0x9acd('0x83'))[_0x9acd('0x84')]('team_has_chat_queues','tq')[_0x9acd('0x85')](_0x9acd('0x86'),'ut',_0x9acd('0x87'))[_0x9acd('0x50')](_0x9acd('0x88'),_0x5af89f[_0x9acd('0x59')]['id']);for(var _0x1c27eb=0x0;_0x1c27eb<_0x8c0163[_0x9acd('0x4b')];_0x1c27eb+=0x1){let _0x15e778=_0x8c0163[_0x1c27eb];for(var _0x5483f5=0x0;_0x5483f5<_0x15e778['Agents']['length'];_0x5483f5+=0x1){let _0x188da7=_0x15e778['Agents'][_0x5483f5];var _0x386552=_0x521666[_0x9acd('0x89')]();_0x386552[_0x9acd('0x50')]('ut.UserId\x20=\x20?',_0x188da7['id']);_0x46bef8[_0x9acd('0x8a')](db[_0x9acd('0x8b')][_0x9acd('0x45')](_0x386552['toString'](),{'type':db['sequelize'][_0x9acd('0x8c')]['SELECT']})[_0x9acd('0x23')](function(_0x10f8b6){if(_0x10f8b6[_0x9acd('0x4b')]===0x1){return _0x188da7['id'];}else{var _0x4c8fea=_[_0x9acd('0x8d')](_[_0x9acd('0x3e')](_0x10f8b6,_0x9acd('0x8e')),function(_0x2788cb){return _['includes'](_0x21a02b,_0x2788cb);});if(_0x4c8fea){return _0x188da7['id'];}}}));}}return BPromise[_0x9acd('0x8f')](_0x46bef8)['then'](function(_0x12f589){_0x978369=_(_0x978369)[_0x9acd('0x90')](_0x12f589)[_0x9acd('0x91')]()[_0x9acd('0x92')]();return db[_0x9acd('0x3f')]['find']({'where':{'id':_0x5af89f[_0x9acd('0x59')]['id']}})['then'](function(_0x284b0a){return db['sequelize'][_0x9acd('0x7a')](function(_0x29a830){return _0x284b0a[_0x9acd('0x80')](_0x5af89f['query'][_0x9acd('0x81')],{'transaction':_0x29a830})[_0x9acd('0x23')](function(){if(!_[_0x9acd('0x93')](_0x978369)){return _0x284b0a[_0x9acd('0x94')](_0x978369,{'transaction':_0x29a830});}})['then'](function(){_0x978369[_0x9acd('0x7d')](function(_0x2c578e){socket[_0x9acd('0x7e')]('userChatQueue:remove',{'UserId':_0x2c578e,'ChatQueueId':_0x284b0a['id']});});});});});});})[_0x9acd('0x23')](respondWithStatusCode(_0x1e8b2b,null))[_0x9acd('0x2d')](handleError(_0x1e8b2b,null));};exports[_0x9acd('0x95')]=function(_0x5ec909,_0x5f1189,_0x9d5db7){return db[_0x9acd('0x3f')][_0x9acd('0x5a')]({'where':{'id':_0x5ec909[_0x9acd('0x59')]['id']}})['then'](handleEntityNotFound(_0x5f1189,null))['then'](function(_0xa3038c){if(_0xa3038c){return _0xa3038c[_0x9acd('0x95')](_0x5ec909[_0x9acd('0x63')][_0x9acd('0x81')],_[_0x9acd('0x96')](_0x5ec909[_0x9acd('0x63')],[_0x9acd('0x81'),'id'])||{})[_0x9acd('0x97')](function(_0x514e24){for(var _0x3029ca=0x0;_0x3029ca<_0x5ec909['body'][_0x9acd('0x81')]['length'];_0x3029ca+=0x1){socket[_0x9acd('0x7e')](_0x9acd('0x7f'),{'UserId':Number(_0x5ec909[_0x9acd('0x63')][_0x9acd('0x81')][_0x3029ca]),'ChatQueueId':Number(_0x5ec909[_0x9acd('0x59')]['id'])});}return _0x514e24;});}})[_0x9acd('0x23')](respondWithResult(_0x5f1189,null))[_0x9acd('0x2d')](handleError(_0x5f1189,null));};exports['removeAgents']=function(_0x6b594,_0x2a5a83,_0x548bbf){return db[_0x9acd('0x3f')][_0x9acd('0x5a')]({'where':{'id':_0x6b594[_0x9acd('0x59')]['id']}})[_0x9acd('0x23')](handleEntityNotFound(_0x2a5a83,null))[_0x9acd('0x23')](function(_0x78ee31){if(_0x78ee31){return _0x78ee31['removeAgents'](_0x6b594[_0x9acd('0x45')][_0x9acd('0x81')])['then'](function(){if(_[_0x9acd('0x98')](_0x6b594[_0x9acd('0x45')]['ids'])){for(var _0x431ea3=0x0;_0x431ea3<_0x6b594[_0x9acd('0x45')][_0x9acd('0x81')][_0x9acd('0x4b')];_0x431ea3+=0x1){socket['emit'](_0x9acd('0x99'),{'UserId':Number(_0x6b594[_0x9acd('0x45')][_0x9acd('0x81')][_0x431ea3]),'ChatQueueId':Number(_0x6b594['params']['id'])});}}else{socket[_0x9acd('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x6b594[_0x9acd('0x45')][_0x9acd('0x81')]),'ChatQueueId':Number(_0x6b594[_0x9acd('0x59')]['id'])});}});}})[_0x9acd('0x23')](respondWithStatusCode(_0x2a5a83,null))[_0x9acd('0x2d')](handleError(_0x2a5a83,null));};exports[_0x9acd('0x9a')]=function(_0xc6dbac,_0x394970,_0x22a4cc){var _0x166ff5={};var _0x1b4420={};var _0x4d470f;var _0x2c3594;return db[_0x9acd('0x3f')][_0x9acd('0x66')]({'where':{'id':_0xc6dbac[_0x9acd('0x59')]['id']}})['then'](handleEntityNotFound(_0x394970,null))[_0x9acd('0x23')](function(_0x182edd){if(_0x182edd){_0x4d470f=_0x182edd;_0x1b4420[_0x9acd('0x44')]=_[_0x9acd('0x46')](db[_0x9acd('0x69')]['rawAttributes']);_0x1b4420[_0x9acd('0x45')]=_[_0x9acd('0x46')](_0xc6dbac[_0x9acd('0x45')]);_0x1b4420[_0x9acd('0x47')]=_['intersection'](_0x1b4420['model'],_0x1b4420[_0x9acd('0x45')]);_0x166ff5[_0x9acd('0x4a')]=_['intersection'](_0x1b4420[_0x9acd('0x44')],qs[_0x9acd('0x49')](_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x49')]));_0x166ff5[_0x9acd('0x4a')]=_0x166ff5[_0x9acd('0x4a')][_0x9acd('0x4b')]?_0x166ff5[_0x9acd('0x4a')]:_0x1b4420[_0x9acd('0x44')];_0x166ff5[_0x9acd('0x4e')]=qs['sort'](_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x4f')]);_0x166ff5[_0x9acd('0x50')]=qs[_0x9acd('0x47')](_['pick'](_0xc6dbac[_0x9acd('0x45')],_0x1b4420['filters']));if(_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x52')]){_0x166ff5[_0x9acd('0x50')]=_[_0x9acd('0x53')](_0x166ff5[_0x9acd('0x50')],{'$or':_['map'](_0x166ff5[_0x9acd('0x4a')],function(_0x1eafec){var _0x374cfe={};_0x374cfe[_0x1eafec]={'$like':'%'+_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x52')]+'%'};return _0x374cfe;})});}_0x166ff5=_[_0x9acd('0x53')]({},_0x166ff5,_0xc6dbac[_0x9acd('0x54')]);return _0x4d470f[_0x9acd('0x9a')](_0x166ff5);}})[_0x9acd('0x23')](function(_0x3e50a4){if(_0x3e50a4){_0x2c3594=_0x3e50a4[_0x9acd('0x4b')];if(!_0xc6dbac[_0x9acd('0x45')]['hasOwnProperty']('nolimit')){_0x166ff5[_0x9acd('0x33')]=qs[_0x9acd('0x33')](_0xc6dbac[_0x9acd('0x45')][_0x9acd('0x33')]);_0x166ff5[_0x9acd('0x31')]=qs['offset'](_0xc6dbac['query'][_0x9acd('0x31')]);}return _0x4d470f[_0x9acd('0x9a')](_0x166ff5);}})['then'](function(_0x1eb21c){if(_0x1eb21c){return _0x1eb21c?{'count':_0x2c3594,'rows':_0x1eb21c}:null;}})['then'](respondWithResult(_0x394970,null))['catch'](handleError(_0x394970,null));};
\ No newline at end of file
+var _0xf8db=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','options','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','describe','getMembers','findOne','UserChatQueue','length','hasOwnProperty','nolimit','ChatQueueId','findAll','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','SELECT','TeamId','includes','compact','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xf8db,0x11c));var _0xbf8d=function(_0x1d246a,_0x49be62){_0x1d246a=_0x1d246a-0x0;var _0x4f233b=_0xf8db[_0x1d246a];return _0x4f233b;};'use strict';var emlformat=require(_0xbf8d('0x0'));var rimraf=require(_0xbf8d('0x1'));var zipdir=require(_0xbf8d('0x2'));var jsonpatch=require(_0xbf8d('0x3'));var rp=require(_0xbf8d('0x4'));var moment=require(_0xbf8d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbf8d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbf8d('0x7'));var csv=require(_0xbf8d('0x8'));var ejs=require(_0xbf8d('0x9'));var fs=require('fs');var fs_extra=require(_0xbf8d('0xa'));var _=require(_0xbf8d('0xb'));var squel=require(_0xbf8d('0xc'));var crypto=require(_0xbf8d('0xd'));var jsforce=require(_0xbf8d('0xe'));var deskjs=require(_0xbf8d('0xf'));var toCsv=require(_0xbf8d('0x8'));var querystring=require(_0xbf8d('0x10'));var Papa=require(_0xbf8d('0x11'));var Redis=require(_0xbf8d('0x12'));var authService=require(_0xbf8d('0x13'));var qs=require(_0xbf8d('0x14'));var as=require(_0xbf8d('0x15'));var hardwareService=require(_0xbf8d('0x16'));var logger=require('../../config/logger')(_0xbf8d('0x17'));var utils=require('../../config/utils');var config=require(_0xbf8d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf8d('0x19'))['db'];config[_0xbf8d('0x1a')]=_[_0xbf8d('0x1b')](config[_0xbf8d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf8d('0x1c'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xbf8d('0x1d')](socket);var jayson=require(_0xbf8d('0x1e'));var client=jayson[_0xbf8d('0x1f')][_0xbf8d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x356a23,_0x551cba,_0x91408b,_0x1c67ef){return new BPromise(function(_0x448a68,_0x45a024){var _0x4e6e5f=_0x1c67ef||client;return _0x4e6e5f[_0xbf8d('0x21')](_0x356a23,_0x91408b)[_0xbf8d('0x22')](function(_0xae5f75){logger[_0xbf8d('0x23')](_0xbf8d('0x24'),_0x551cba,'request\x20sent');logger[_0xbf8d('0x25')](_0xbf8d('0x26'),_0x551cba,_0xbf8d('0x27'),JSON[_0xbf8d('0x28')](_0xae5f75));if(_0xae5f75['error']){if(_0xae5f75[_0xbf8d('0x29')][_0xbf8d('0x2a')]===0x1f4){logger[_0xbf8d('0x29')](_0xbf8d('0x24'),_0x551cba,_0xae5f75[_0xbf8d('0x29')][_0xbf8d('0x2b')]);return _0x45a024(_0xae5f75[_0xbf8d('0x29')][_0xbf8d('0x2b')]);}logger[_0xbf8d('0x29')](_0xbf8d('0x24'),_0x551cba,_0xae5f75[_0xbf8d('0x29')]['message']);return _0x448a68(_0xae5f75[_0xbf8d('0x29')][_0xbf8d('0x2b')]);}else{logger[_0xbf8d('0x23')]('ChatQueue,\x20%s,\x20%s',_0x551cba,'request\x20sent');_0x448a68(_0xae5f75[_0xbf8d('0x2c')][_0xbf8d('0x2b')]);}})[_0xbf8d('0x2d')](function(_0x1f0a17){logger[_0xbf8d('0x29')]('ChatQueue,\x20%s,\x20%s',_0x551cba,_0x1f0a17);_0x45a024(_0x1f0a17);});});}function respondWithStatusCode(_0x4356df,_0x79c3eb){_0x79c3eb=_0x79c3eb||0xcc;return function(_0x3da427){if(_0x3da427){return _0x4356df[_0xbf8d('0x2e')](_0x79c3eb);}return _0x4356df[_0xbf8d('0x2f')](_0x79c3eb)[_0xbf8d('0x30')]();};}function respondWithResult(_0x7aef2d,_0x33ab5a){_0x33ab5a=_0x33ab5a||0xc8;return function(_0x14d5a5){if(_0x14d5a5){return _0x7aef2d['status'](_0x33ab5a)[_0xbf8d('0x31')](_0x14d5a5);}};}function respondWithFilteredResult(_0x14ac7f,_0x16d673){return function(_0x38375b){if(_0x38375b){var _0x511f90=typeof _0x16d673[_0xbf8d('0x32')]===_0xbf8d('0x33')&&typeof _0x16d673[_0xbf8d('0x34')]===_0xbf8d('0x33');var _0x30c2f8=_0x38375b[_0xbf8d('0x35')];var _0x4504a3=_0x511f90?0x0:_0x16d673[_0xbf8d('0x32')];var _0x28d18d=_0x511f90?_0x38375b[_0xbf8d('0x35')]:_0x16d673['offset']+_0x16d673[_0xbf8d('0x34')];var _0x1bf02e;if(_0x28d18d>=_0x30c2f8){_0x28d18d=_0x30c2f8;_0x1bf02e=0xc8;}else{_0x1bf02e=0xce;}_0x14ac7f[_0xbf8d('0x2f')](_0x1bf02e);return _0x14ac7f['set']('Content-Range',_0x4504a3+'-'+_0x28d18d+'/'+_0x30c2f8)[_0xbf8d('0x31')](_0x38375b);}return null;};}function patchUpdates(_0x22cd4a){return function(_0x966091){try{jsonpatch[_0xbf8d('0x36')](_0x966091,_0x22cd4a,!![]);}catch(_0x282700){return BPromise[_0xbf8d('0x37')](_0x282700);}return _0x966091[_0xbf8d('0x38')]();};}function saveUpdates(_0x577dba,_0x510e57){return function(_0xa3bcf4){if(_0xa3bcf4){return _0xa3bcf4[_0xbf8d('0x39')](_0x577dba)[_0xbf8d('0x22')](function(_0x38c7f4){return _0x38c7f4;});}return null;};}function removeEntity(_0x4611dd,_0x1fa375){return function(_0x14b8b8){if(_0x14b8b8){return _0x14b8b8[_0xbf8d('0x3a')]()['then'](function(){var _0x2f661a=_0x14b8b8[_0xbf8d('0x3b')]({'plain':!![]});var _0x5f0fc7=_0xbf8d('0x3c');return db[_0xbf8d('0x3d')][_0xbf8d('0x3a')]({'where':{'type':_0x5f0fc7,'resourceId':_0x2f661a['id']}})[_0xbf8d('0x22')](function(){return _0x14b8b8;});})[_0xbf8d('0x22')](function(){_0x4611dd[_0xbf8d('0x2f')](0xcc)[_0xbf8d('0x30')]();});}};}function handleEntityNotFound(_0x2b4a71,_0x19b2c1){return function(_0x4ad14a){if(!_0x4ad14a){_0x2b4a71[_0xbf8d('0x2e')](0x194);}return _0x4ad14a;};}function handleError(_0x200777,_0x1fd08a){_0x1fd08a=_0x1fd08a||0x1f4;return function(_0x2df4f8){logger[_0xbf8d('0x29')](_0x2df4f8['stack']);if(_0x2df4f8[_0xbf8d('0x3e')]){delete _0x2df4f8['name'];}_0x200777[_0xbf8d('0x2f')](_0x1fd08a)[_0xbf8d('0x3f')](_0x2df4f8);};}exports[_0xbf8d('0x40')]=function(_0x30c8ec,_0x58e672){var _0x200ad7={},_0x5ea1d2={},_0x111034={'count':0x0,'rows':[]};var _0xc7e5d4=_[_0xbf8d('0x41')](db[_0xbf8d('0x42')][_0xbf8d('0x43')],function(_0x2c118b){return{'name':_0x2c118b['fieldName'],'type':_0x2c118b[_0xbf8d('0x44')][_0xbf8d('0x45')]};});_0x5ea1d2[_0xbf8d('0x46')]=_[_0xbf8d('0x41')](_0xc7e5d4,_0xbf8d('0x3e'));_0x5ea1d2[_0xbf8d('0x47')]=_[_0xbf8d('0x48')](_0x30c8ec['query']);_0x5ea1d2[_0xbf8d('0x49')]=_[_0xbf8d('0x4a')](_0x5ea1d2['model'],_0x5ea1d2[_0xbf8d('0x47')]);_0x200ad7[_0xbf8d('0x4b')]=_['intersection'](_0x5ea1d2[_0xbf8d('0x46')],qs[_0xbf8d('0x4c')](_0x30c8ec[_0xbf8d('0x47')]['fields']));_0x200ad7[_0xbf8d('0x4b')]=_0x200ad7[_0xbf8d('0x4b')]['length']?_0x200ad7[_0xbf8d('0x4b')]:_0x5ea1d2[_0xbf8d('0x46')];if(!_0x30c8ec[_0xbf8d('0x47')]['hasOwnProperty']('nolimit')){_0x200ad7[_0xbf8d('0x34')]=qs[_0xbf8d('0x34')](_0x30c8ec[_0xbf8d('0x47')][_0xbf8d('0x34')]);_0x200ad7[_0xbf8d('0x32')]=qs[_0xbf8d('0x32')](_0x30c8ec['query'][_0xbf8d('0x32')]);}_0x200ad7[_0xbf8d('0x4d')]=qs['sort'](_0x30c8ec['query'][_0xbf8d('0x4e')]);_0x200ad7[_0xbf8d('0x4f')]=qs['filters'](_[_0xbf8d('0x50')](_0x30c8ec[_0xbf8d('0x47')],_0x5ea1d2[_0xbf8d('0x49')]),_0xc7e5d4);if(_0x30c8ec[_0xbf8d('0x47')]['filter']){_0x200ad7[_0xbf8d('0x4f')]=_[_0xbf8d('0x51')](_0x200ad7[_0xbf8d('0x4f')],{'$or':_['map'](_0xc7e5d4,function(_0x431a29){if(_0x431a29['type']!==_0xbf8d('0x52')){var _0x117d1a={};_0x117d1a[_0x431a29['name']]={'$like':'%'+_0x30c8ec[_0xbf8d('0x47')][_0xbf8d('0x53')]+'%'};return _0x117d1a;}})});}_0x200ad7=_[_0xbf8d('0x51')]({},_0x200ad7,_0x30c8ec['options']);var _0x4a2641={'where':_0x200ad7[_0xbf8d('0x4f')]};return db[_0xbf8d('0x42')][_0xbf8d('0x35')](_0x4a2641)[_0xbf8d('0x22')](function(_0x1c6ac4){_0x111034['count']=_0x1c6ac4;if(_0x30c8ec[_0xbf8d('0x47')][_0xbf8d('0x54')]){_0x200ad7[_0xbf8d('0x55')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x200ad7);})[_0xbf8d('0x22')](function(_0x58d8e6){_0x111034[_0xbf8d('0x56')]=_0x58d8e6;return _0x111034;})[_0xbf8d('0x22')](respondWithFilteredResult(_0x58e672,_0x200ad7))[_0xbf8d('0x2d')](handleError(_0x58e672,null));};exports['show']=function(_0xbe2ffc,_0x24a9b6){var _0x5d4220={'raw':!![],'where':{'id':_0xbe2ffc['params']['id']}},_0x25cf83={};_0x25cf83[_0xbf8d('0x46')]=_['keys'](db[_0xbf8d('0x42')][_0xbf8d('0x43')]);_0x25cf83['query']=_['keys'](_0xbe2ffc[_0xbf8d('0x47')]);_0x25cf83['filters']=_['intersection'](_0x25cf83[_0xbf8d('0x46')],_0x25cf83[_0xbf8d('0x47')]);_0x5d4220[_0xbf8d('0x4b')]=_[_0xbf8d('0x4a')](_0x25cf83[_0xbf8d('0x46')],qs['fields'](_0xbe2ffc[_0xbf8d('0x47')][_0xbf8d('0x4c')]));_0x5d4220['attributes']=_0x5d4220[_0xbf8d('0x4b')]['length']?_0x5d4220['attributes']:_0x25cf83[_0xbf8d('0x46')];if(_0xbe2ffc[_0xbf8d('0x47')][_0xbf8d('0x54')]){_0x5d4220['include']=[{'all':!![]}];}_0x5d4220=_[_0xbf8d('0x51')]({},_0x5d4220,_0xbe2ffc[_0xbf8d('0x57')]);return db[_0xbf8d('0x42')]['find'](_0x5d4220)[_0xbf8d('0x22')](handleEntityNotFound(_0x24a9b6,null))[_0xbf8d('0x22')](respondWithResult(_0x24a9b6,null))[_0xbf8d('0x2d')](handleError(_0x24a9b6,null));};exports['create']=function(_0x5b5b60,_0x48f69f){return db[_0xbf8d('0x42')][_0xbf8d('0x58')](_0x5b5b60[_0xbf8d('0x59')],{})[_0xbf8d('0x22')](function(_0x20d024){var _0x372b18=_0x5b5b60[_0xbf8d('0x5a')][_0xbf8d('0x3b')]({'plain':!![]});if(!_0x372b18)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x372b18[_0xbf8d('0x5b')]===_0xbf8d('0x5a')){var _0x5b477a=_0x20d024[_0xbf8d('0x3b')]({'plain':!![]});var _0x142aef=_0xbf8d('0x3c');return db[_0xbf8d('0x5c')]['find']({'where':{'name':_0x142aef,'userProfileId':_0x372b18['userProfileId']},'raw':!![]})[_0xbf8d('0x22')](function(_0x368100){if(_0x368100&&_0x368100[_0xbf8d('0x5d')]===0x0){return db[_0xbf8d('0x3d')]['create']({'name':_0x5b477a[_0xbf8d('0x3e')],'resourceId':_0x5b477a['id'],'type':_0x368100['name'],'sectionId':_0x368100['id']},{})[_0xbf8d('0x22')](function(){return _0x20d024;});}else{return _0x20d024;}})['catch'](function(_0xc5317f){logger['error'](_0xbf8d('0x5e'),_0xc5317f);throw _0xc5317f;});}return _0x20d024;})['then'](respondWithResult(_0x48f69f,0xc9))[_0xbf8d('0x2d')](handleError(_0x48f69f,null));};exports['update']=function(_0x258951,_0x46f271){if(_0x258951[_0xbf8d('0x59')]['id']){delete _0x258951[_0xbf8d('0x59')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x258951[_0xbf8d('0x5f')]['id']}})[_0xbf8d('0x22')](handleEntityNotFound(_0x46f271,null))[_0xbf8d('0x22')](saveUpdates(_0x258951[_0xbf8d('0x59')],null))[_0xbf8d('0x22')](respondWithResult(_0x46f271,null))[_0xbf8d('0x2d')](handleError(_0x46f271,null));};exports[_0xbf8d('0x3a')]=function(_0x3433e9,_0x4aed1b){return db['ChatQueue'][_0xbf8d('0x60')]({'where':{'id':_0x3433e9[_0xbf8d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4aed1b,null))['then'](removeEntity(_0x4aed1b,null))[_0xbf8d('0x2d')](handleError(_0x4aed1b,null));};exports[_0xbf8d('0x61')]=function(_0x5e4b02,_0x584575){return db['ChatQueue'][_0xbf8d('0x61')]()[_0xbf8d('0x22')](respondWithResult(_0x584575,null))[_0xbf8d('0x2d')](handleError(_0x584575,null));};exports[_0xbf8d('0x62')]=function(_0x3d6d35,_0x31939c,_0x217a9d){var _0x480599={'raw':!![],'where':{}},_0x36c0c6={},_0x37b1f8;return db[_0xbf8d('0x42')][_0xbf8d('0x63')]({'where':{'id':_0x3d6d35[_0xbf8d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x31939c,null))[_0xbf8d('0x22')](function(_0x71ce4f){if(_0x71ce4f){_0x37b1f8=_0x71ce4f[_0xbf8d('0x3b')]({'plain':!![]});_0x36c0c6[_0xbf8d('0x46')]=_[_0xbf8d('0x48')](db[_0xbf8d('0x64')][_0xbf8d('0x43')]);_0x36c0c6[_0xbf8d('0x47')]=_[_0xbf8d('0x48')](_0x3d6d35[_0xbf8d('0x47')]);_0x36c0c6['filters']=_[_0xbf8d('0x4a')](_0x36c0c6[_0xbf8d('0x46')],_0x36c0c6[_0xbf8d('0x47')]);_0x480599[_0xbf8d('0x4b')]=_[_0xbf8d('0x4a')](_0x36c0c6[_0xbf8d('0x46')],qs[_0xbf8d('0x4c')](_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x4c')]));_0x480599[_0xbf8d('0x4b')]=_0x480599['attributes'][_0xbf8d('0x65')]?_0x480599[_0xbf8d('0x4b')]:_0x36c0c6['model'];if(!_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x66')](_0xbf8d('0x67'))){_0x480599[_0xbf8d('0x34')]=qs[_0xbf8d('0x34')](_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x34')]);_0x480599['offset']=qs[_0xbf8d('0x32')](_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x32')]);}_0x480599[_0xbf8d('0x4d')]=qs[_0xbf8d('0x4e')](_0x3d6d35[_0xbf8d('0x47')]['sort']);_0x480599[_0xbf8d('0x4f')]=qs['filters'](_[_0xbf8d('0x50')](_0x3d6d35[_0xbf8d('0x47')],_0x36c0c6['filters']));_0x480599[_0xbf8d('0x4f')][_0xbf8d('0x68')]=_0x71ce4f['id'];if(_0x3d6d35[_0xbf8d('0x47')][_0xbf8d('0x53')]){_0x480599['where']=_['merge'](_0x480599['where'],{'$or':_[_0xbf8d('0x41')](_0x480599['attributes'],function(_0x55f248){var _0x5ae4aa={};_0x5ae4aa[_0x55f248]={'$like':'%'+_0x3d6d35['query'][_0xbf8d('0x53')]+'%'};return _0x5ae4aa;})});}_0x480599=_['merge']({},_0x480599,_0x3d6d35['options']);return db[_0xbf8d('0x64')][_0xbf8d('0x69')](_0x480599);}})[_0xbf8d('0x22')](function(_0x434914){if(_0x434914){return db['User'][_0xbf8d('0x6a')]({'where':{'id':_[_0xbf8d('0x41')](_0x434914,_0xbf8d('0x6b')),'role':'agent'},'attributes':['id',_0xbf8d('0x3e'),_0xbf8d('0x6c'),_0xbf8d('0x6d'),_0xbf8d('0x6e')]});}})['then'](function(_0x4be0e5){if(_0x4be0e5){return{'count':_0x4be0e5[_0xbf8d('0x35')],'rows':_[_0xbf8d('0x41')](_0x4be0e5[_0xbf8d('0x56')],function(_0x2575e8){return{'membername':_0x2575e8[_0xbf8d('0x3e')],'UserId':_0x2575e8['id'],'queue_name':_0x37b1f8[_0xbf8d('0x3e')],'ChatQueueId':_0x37b1f8['id'],'interface':util[_0xbf8d('0x6f')]('%s/%s',_0xbf8d('0x70'),_0x2575e8[_0xbf8d('0x3e')]),'penalty':0x0,'paused':_0x2575e8['chatPause'],'createdAt':_0x2575e8[_0xbf8d('0x6e')],'updatedAt':_0x2575e8[_0xbf8d('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbf8d('0x22')](respondWithFilteredResult(_0x31939c,_0x480599))[_0xbf8d('0x2d')](handleError(_0x31939c,null));};exports[_0xbf8d('0x71')]=function(_0x450306,_0x12724b,_0x381bde){var _0x41f004={};var _0x4d17af={};var _0x3f2d59;var _0x5888ef;return db[_0xbf8d('0x42')][_0xbf8d('0x63')]({'where':{'id':_0x450306[_0xbf8d('0x5f')]['id']}})[_0xbf8d('0x22')](handleEntityNotFound(_0x12724b,null))['then'](function(_0x27f139){if(_0x27f139){_0x3f2d59=_0x27f139;_0x4d17af['model']=_[_0xbf8d('0x48')](db[_0xbf8d('0x72')]['rawAttributes']);_0x4d17af[_0xbf8d('0x47')]=_['keys'](_0x450306[_0xbf8d('0x47')]);_0x4d17af['filters']=_[_0xbf8d('0x4a')](_0x4d17af[_0xbf8d('0x46')],_0x4d17af[_0xbf8d('0x47')]);_0x41f004[_0xbf8d('0x4b')]=_[_0xbf8d('0x4a')](_0x4d17af[_0xbf8d('0x46')],qs['fields'](_0x450306[_0xbf8d('0x47')][_0xbf8d('0x4c')]));_0x41f004[_0xbf8d('0x4b')]=_0x41f004[_0xbf8d('0x4b')][_0xbf8d('0x65')]?_0x41f004[_0xbf8d('0x4b')]:_0x4d17af['model'];_0x41f004[_0xbf8d('0x4d')]=qs['sort'](_0x450306['query'][_0xbf8d('0x4e')]);_0x41f004[_0xbf8d('0x4f')]=qs[_0xbf8d('0x49')](_[_0xbf8d('0x50')](_0x450306[_0xbf8d('0x47')],_0x4d17af[_0xbf8d('0x49')]));if(_0x450306[_0xbf8d('0x47')]['filter']){_0x41f004[_0xbf8d('0x4f')]=_[_0xbf8d('0x51')](_0x41f004[_0xbf8d('0x4f')],{'$or':_['map'](_0x41f004[_0xbf8d('0x4b')],function(_0x52ec46){var _0x10cdf4={};_0x10cdf4[_0x52ec46]={'$like':'%'+_0x450306['query']['filter']+'%'};return _0x10cdf4;})});}_0x41f004=_['merge']({},_0x41f004,_0x450306[_0xbf8d('0x57')]);return _0x3f2d59[_0xbf8d('0x71')](_0x41f004);}})[_0xbf8d('0x22')](function(_0x504f5f){if(_0x504f5f){_0x5888ef=_0x504f5f[_0xbf8d('0x65')];if(!_0x450306['query']['hasOwnProperty'](_0xbf8d('0x67'))){_0x41f004['limit']=qs[_0xbf8d('0x34')](_0x450306[_0xbf8d('0x47')][_0xbf8d('0x34')]);_0x41f004[_0xbf8d('0x32')]=qs[_0xbf8d('0x32')](_0x450306['query'][_0xbf8d('0x32')]);}return _0x3f2d59['getTeams'](_0x41f004);}})[_0xbf8d('0x22')](function(_0x42ae61){if(_0x42ae61){return _0x42ae61?{'count':_0x5888ef,'rows':_0x42ae61}:null;}})['then'](respondWithResult(_0x12724b,null))['catch'](handleError(_0x12724b,null));};exports[_0xbf8d('0x73')]=function(_0x5810e5,_0x50afd9,_0xcf654e){var _0x367f5d=_0x5810e5['body'][_0xbf8d('0x74')];return db['Team'][_0xbf8d('0x69')]({'where':{'id':_0x367f5d},'attributes':['id'],'include':[{'model':db[_0xbf8d('0x75')],'as':_0xbf8d('0x76'),'attributes':['id',_0xbf8d('0x3e'),_0xbf8d('0x77'),_0xbf8d('0x78'),_0xbf8d('0x79')],'raw':!![]}]})['then'](function(_0x1ba170){if(_0x1ba170){var _0x153432=_['flatMap'](_0x1ba170,function(_0x44f83d){var _0x35c7fd=_0x44f83d[_0xbf8d('0x3b')]({'plain':!![]});return _0x35c7fd['Agents'];});return db[_0xbf8d('0x42')]['find']({'where':{'id':_0x5810e5[_0xbf8d('0x5f')]['id']}})['then'](function(_0x5ab875){return db[_0xbf8d('0x7a')][_0xbf8d('0x7b')](function(_0x46e517){return _0x5ab875[_0xbf8d('0x73')](_0x367f5d,{'transaction':_0x46e517})[_0xbf8d('0x22')](function(){return BPromise[_0xbf8d('0x7c')](_0x153432,function(_0x304085){return db[_0xbf8d('0x64')][_0xbf8d('0x7d')]({'where':{'UserId':_0x304085['id'],'ChatQueueId':_0x5810e5[_0xbf8d('0x5f')]['id']},'transaction':_0x46e517});});})[_0xbf8d('0x22')](function(){_0x153432[_0xbf8d('0x7e')](function(_0x3fe35f){socket[_0xbf8d('0x7f')]('userChatQueue:save',{'UserId':_0x3fe35f['id'],'ChatQueueId':_0x5ab875['id']});});});});});}})[_0xbf8d('0x22')](respondWithStatusCode(_0x50afd9,null))[_0xbf8d('0x2d')](handleError(_0x50afd9,null));};exports[_0xbf8d('0x80')]=function(_0x75b1c9,_0x58c941,_0x21d847){return db['Team'][_0xbf8d('0x69')]({'where':{'id':_0x75b1c9[_0xbf8d('0x47')][_0xbf8d('0x74')]},'attributes':['id'],'include':[{'model':db[_0xbf8d('0x75')],'as':_0xbf8d('0x76'),'attributes':['id'],'raw':!![]}]})[_0xbf8d('0x22')](handleEntityNotFound(_0x58c941,null))[_0xbf8d('0x22')](function(_0x4f5d3b){var _0x1ae52c=_[_0xbf8d('0x41')](_0x4f5d3b,'id');var _0x1f6afb=[];var _0x49b266=[];var _0x398ee0=squel[_0xbf8d('0x81')]();_0x398ee0['field'](_0xbf8d('0x82'))[_0xbf8d('0x83')](_0xbf8d('0x84'),'tq')['join']('user_has_teams','ut',_0xbf8d('0x85'))[_0xbf8d('0x4f')](_0xbf8d('0x86'),_0x75b1c9['params']['id']);for(var _0x394212=0x0;_0x394212<_0x4f5d3b[_0xbf8d('0x65')];_0x394212+=0x1){let _0x48dd10=_0x4f5d3b[_0x394212];for(var _0x44bfe9=0x0;_0x44bfe9<_0x48dd10[_0xbf8d('0x76')][_0xbf8d('0x65')];_0x44bfe9+=0x1){let _0xaad19b=_0x48dd10[_0xbf8d('0x76')][_0x44bfe9];var _0x80d5be=_0x398ee0[_0xbf8d('0x87')]();_0x80d5be[_0xbf8d('0x4f')]('ut.UserId\x20=\x20?',_0xaad19b['id']);_0x49b266[_0xbf8d('0x88')](db['sequelize'][_0xbf8d('0x47')](_0x80d5be[_0xbf8d('0x89')](),{'type':db['sequelize']['QueryTypes'][_0xbf8d('0x8a')]})[_0xbf8d('0x22')](function(_0x268107){if(_0x268107[_0xbf8d('0x65')]===0x1){return _0xaad19b['id'];}else{var _0x484cd3=_['every'](_[_0xbf8d('0x41')](_0x268107,_0xbf8d('0x8b')),function(_0x2af40c){return _[_0xbf8d('0x8c')](_0x1ae52c,_0x2af40c);});if(_0x484cd3){return _0xaad19b['id'];}}}));}}return BPromise['all'](_0x49b266)[_0xbf8d('0x22')](function(_0x3c8fbd){_0x1f6afb=_(_0x1f6afb)['union'](_0x3c8fbd)[_0xbf8d('0x8d')]()['value']();return db[_0xbf8d('0x42')][_0xbf8d('0x60')]({'where':{'id':_0x75b1c9[_0xbf8d('0x5f')]['id']}})['then'](function(_0x774d2a){return db[_0xbf8d('0x7a')][_0xbf8d('0x7b')](function(_0x624c81){return _0x774d2a[_0xbf8d('0x80')](_0x75b1c9[_0xbf8d('0x47')]['ids'],{'transaction':_0x624c81})[_0xbf8d('0x22')](function(){if(!_[_0xbf8d('0x8e')](_0x1f6afb)){return _0x774d2a[_0xbf8d('0x8f')](_0x1f6afb,{'transaction':_0x624c81});}})[_0xbf8d('0x22')](function(){_0x1f6afb[_0xbf8d('0x7e')](function(_0x37c616){socket[_0xbf8d('0x7f')]('userChatQueue:remove',{'UserId':_0x37c616,'ChatQueueId':_0x774d2a['id']});});});});});});})[_0xbf8d('0x22')](respondWithStatusCode(_0x58c941,null))[_0xbf8d('0x2d')](handleError(_0x58c941,null));};exports['addAgents']=function(_0x61346c,_0x209e4c,_0x3ff226){return db[_0xbf8d('0x42')]['find']({'where':{'id':_0x61346c[_0xbf8d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x209e4c,null))[_0xbf8d('0x22')](function(_0x379843){if(_0x379843){return _0x379843[_0xbf8d('0x90')](_0x61346c[_0xbf8d('0x59')][_0xbf8d('0x74')],_[_0xbf8d('0x91')](_0x61346c[_0xbf8d('0x59')],['ids','id'])||{})[_0xbf8d('0x92')](function(_0xf70e31){for(var _0x432ec5=0x0;_0x432ec5<_0x61346c[_0xbf8d('0x59')][_0xbf8d('0x74')][_0xbf8d('0x65')];_0x432ec5+=0x1){socket[_0xbf8d('0x7f')](_0xbf8d('0x93'),{'UserId':Number(_0x61346c[_0xbf8d('0x59')][_0xbf8d('0x74')][_0x432ec5]),'ChatQueueId':Number(_0x61346c[_0xbf8d('0x5f')]['id'])});}return _0xf70e31;});}})[_0xbf8d('0x22')](respondWithResult(_0x209e4c,null))[_0xbf8d('0x2d')](handleError(_0x209e4c,null));};exports[_0xbf8d('0x8f')]=function(_0x48e00b,_0x520cfc,_0x3a5899){return db[_0xbf8d('0x42')][_0xbf8d('0x60')]({'where':{'id':_0x48e00b[_0xbf8d('0x5f')]['id']}})[_0xbf8d('0x22')](handleEntityNotFound(_0x520cfc,null))['then'](function(_0x263a84){if(_0x263a84){return _0x263a84[_0xbf8d('0x8f')](_0x48e00b['query'][_0xbf8d('0x74')])[_0xbf8d('0x22')](function(){if(_['isArray'](_0x48e00b[_0xbf8d('0x47')]['ids'])){for(var _0x1489d7=0x0;_0x1489d7<_0x48e00b[_0xbf8d('0x47')]['ids'][_0xbf8d('0x65')];_0x1489d7+=0x1){socket[_0xbf8d('0x7f')](_0xbf8d('0x94'),{'UserId':Number(_0x48e00b[_0xbf8d('0x47')][_0xbf8d('0x74')][_0x1489d7]),'ChatQueueId':Number(_0x48e00b['params']['id'])});}}else{socket['emit'](_0xbf8d('0x94'),{'UserId':Number(_0x48e00b[_0xbf8d('0x47')][_0xbf8d('0x74')]),'ChatQueueId':Number(_0x48e00b[_0xbf8d('0x5f')]['id'])});}});}})[_0xbf8d('0x22')](respondWithStatusCode(_0x520cfc,null))[_0xbf8d('0x2d')](handleError(_0x520cfc,null));};exports[_0xbf8d('0x95')]=function(_0x2692f6,_0xc7f7b4,_0x261aeb){var _0x327fbb={};var _0x274411={};var _0x5cedf3;var _0x1e767e;return db[_0xbf8d('0x42')][_0xbf8d('0x63')]({'where':{'id':_0x2692f6[_0xbf8d('0x5f')]['id']}})[_0xbf8d('0x22')](handleEntityNotFound(_0xc7f7b4,null))[_0xbf8d('0x22')](function(_0x2e6e57){if(_0x2e6e57){_0x5cedf3=_0x2e6e57;_0x274411[_0xbf8d('0x46')]=_[_0xbf8d('0x48')](db[_0xbf8d('0x75')][_0xbf8d('0x43')]);_0x274411[_0xbf8d('0x47')]=_[_0xbf8d('0x48')](_0x2692f6['query']);_0x274411[_0xbf8d('0x49')]=_[_0xbf8d('0x4a')](_0x274411['model'],_0x274411[_0xbf8d('0x47')]);_0x327fbb[_0xbf8d('0x4b')]=_[_0xbf8d('0x4a')](_0x274411['model'],qs[_0xbf8d('0x4c')](_0x2692f6[_0xbf8d('0x47')][_0xbf8d('0x4c')]));_0x327fbb[_0xbf8d('0x4b')]=_0x327fbb[_0xbf8d('0x4b')][_0xbf8d('0x65')]?_0x327fbb['attributes']:_0x274411[_0xbf8d('0x46')];_0x327fbb[_0xbf8d('0x4d')]=qs[_0xbf8d('0x4e')](_0x2692f6[_0xbf8d('0x47')]['sort']);_0x327fbb[_0xbf8d('0x4f')]=qs['filters'](_['pick'](_0x2692f6[_0xbf8d('0x47')],_0x274411[_0xbf8d('0x49')]));if(_0x2692f6[_0xbf8d('0x47')][_0xbf8d('0x53')]){_0x327fbb['where']=_[_0xbf8d('0x51')](_0x327fbb[_0xbf8d('0x4f')],{'$or':_[_0xbf8d('0x41')](_0x327fbb[_0xbf8d('0x4b')],function(_0x5bed5d){var _0x5e0734={};_0x5e0734[_0x5bed5d]={'$like':'%'+_0x2692f6[_0xbf8d('0x47')][_0xbf8d('0x53')]+'%'};return _0x5e0734;})});}_0x327fbb=_[_0xbf8d('0x51')]({},_0x327fbb,_0x2692f6[_0xbf8d('0x57')]);return _0x5cedf3[_0xbf8d('0x95')](_0x327fbb);}})[_0xbf8d('0x22')](function(_0xc9e4e2){if(_0xc9e4e2){_0x1e767e=_0xc9e4e2[_0xbf8d('0x65')];if(!_0x2692f6[_0xbf8d('0x47')]['hasOwnProperty'](_0xbf8d('0x67'))){_0x327fbb[_0xbf8d('0x34')]=qs[_0xbf8d('0x34')](_0x2692f6[_0xbf8d('0x47')]['limit']);_0x327fbb[_0xbf8d('0x32')]=qs[_0xbf8d('0x32')](_0x2692f6[_0xbf8d('0x47')][_0xbf8d('0x32')]);}return _0x5cedf3[_0xbf8d('0x95')](_0x327fbb);}})[_0xbf8d('0x22')](function(_0x15aa32){if(_0x15aa32){return _0x15aa32?{'count':_0x1e767e,'rows':_0x15aa32}:null;}})[_0xbf8d('0x22')](respondWithResult(_0xc7f7b4,null))[_0xbf8d('0x2d')](handleError(_0xc7f7b4,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index eb1a52f..7382db6 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 _0xc9b7=['emit','exports','events','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x43bcbf,_0x4d6833){var _0x5af252=function(_0x97043b){while(--_0x97043b){_0x43bcbf['push'](_0x43bcbf['shift']());}};_0x5af252(++_0x4d6833);}(_0xc9b7,0x1f2));var _0x7c9b=function(_0x5459b0,_0x4d2ef8){_0x5459b0=_0x5459b0-0x0;var _0x675a35=_0xc9b7[_0x5459b0];return _0x675a35;};'use strict';var EventEmitter=require(_0x7c9b('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x7c9b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7c9b('0x2')](0x0);var events={'afterCreate':_0x7c9b('0x3'),'afterUpdate':_0x7c9b('0x4'),'afterDestroy':_0x7c9b('0x5')};function emitEvent(_0x7be78a){return function(_0x3077f3,_0x30ab65,_0x2118b9){ChatQueueEvents[_0x7c9b('0x6')](_0x7be78a+':'+_0x3077f3['id'],_0x3077f3);ChatQueueEvents[_0x7c9b('0x6')](_0x7be78a,_0x3077f3);_0x2118b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x7c9b('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x4a3f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0x4da5ed,_0x16ff89){var _0x48e8bd=function(_0x3cd060){while(--_0x3cd060){_0x4da5ed['push'](_0x4da5ed['shift']());}};_0x48e8bd(++_0x16ff89);}(_0x4a3f,0x101));var _0xf4a3=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x4a3f[_0x52666e];return _0x515330;};'use strict';var EventEmitter=require(_0xf4a3('0x0'));var ChatQueue=require(_0xf4a3('0x1'))['db'][_0xf4a3('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf4a3('0x3')](0x0);var events={'afterCreate':_0xf4a3('0x4'),'afterUpdate':_0xf4a3('0x5'),'afterDestroy':_0xf4a3('0x6')};function emitEvent(_0x38c500){return function(_0x4c54da,_0x99d2a4,_0x24b182){ChatQueueEvents[_0xf4a3('0x7')](_0x38c500+':'+_0x4c54da['id'],_0x4c54da);ChatQueueEvents[_0xf4a3('0x7')](_0x38c500,_0x4c54da);_0x24b182(null);};}for(var e in events){if(events[_0xf4a3('0x8')](e)){var event=events[e];ChatQueue[_0xf4a3('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index e070772..1647194 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 _0x506e=['chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','ChatQueue'];(function(_0x47fb85,_0xdc3d2e){var _0x26f4fe=function(_0x35cd1d){while(--_0x35cd1d){_0x47fb85['push'](_0x47fb85['shift']());}};_0x26f4fe(++_0xdc3d2e);}(_0x506e,0x85));var _0xe506=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x506e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xe506('0x0'));var util=require(_0xe506('0x1'));var logger=require(_0xe506('0x2'))('api');var moment=require(_0xe506('0x3'));var BPromise=require(_0xe506('0x4'));var rp=require(_0xe506('0x5'));var fs=require('fs');var path=require(_0xe506('0x6'));var rimraf=require(_0xe506('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module['exports']=function(_0x3ce62b,_0x3a7637){return _0x3ce62b[_0xe506('0x8')](_0xe506('0x9'),attributes,{'tableName':_0xe506('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0091=['api','moment','request-promise','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x0091,0x1e9));var _0x1009=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0091[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x1009('0x0'));var util=require(_0x1009('0x1'));var logger=require(_0x1009('0x2'))(_0x1009('0x3'));var moment=require(_0x1009('0x4'));var BPromise=require('bluebird');var rp=require(_0x1009('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1009('0x6'));var config=require(_0x1009('0x7'));var attributes=require('./chatQueue.attributes');module[_0x1009('0x8')]=function(_0x4c5934,_0x1bf095){return _0x4c5934[_0x1009('0x9')](_0x1009('0xa'),attributes,{'tableName':_0x1009('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 e2b3f00..ae9d9b3 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 _0x0cfa=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','catch','model','ShowChatQueue','lodash','util'];(function(_0x329389,_0x468c67){var _0x56182f=function(_0xe14c9){while(--_0xe14c9){_0x329389['push'](_0x329389['shift']());}};_0x56182f(++_0x468c67);}(_0x0cfa,0x73));var _0xa0cf=function(_0x2e6db3,_0xb1a20e){_0x2e6db3=_0x2e6db3-0x0;var _0x3d08e6=_0x0cfa[_0x2e6db3];return _0x3d08e6;};'use strict';var _=require(_0xa0cf('0x0'));var util=require(_0xa0cf('0x1'));var moment=require(_0xa0cf('0x2'));var BPromise=require(_0xa0cf('0x3'));var rs=require(_0xa0cf('0x4'));var fs=require('fs');var Redis=require(_0xa0cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0cf('0x6'));var logger=require('../../config/logger')(_0xa0cf('0x7'));var config=require(_0xa0cf('0x8'));var jayson=require(_0xa0cf('0x9'));var client=jayson[_0xa0cf('0xa')][_0xa0cf('0xb')]({'port':0x232a});config[_0xa0cf('0xc')]=_[_0xa0cf('0xd')](config[_0xa0cf('0xc')],{'host':_0xa0cf('0xe'),'port':0x18eb});var socket=require(_0xa0cf('0xf'))(new Redis(config[_0xa0cf('0xc')]));require(_0xa0cf('0x10'))[_0xa0cf('0x11')](socket);function respondWithRpcPromise(_0x369815,_0xdab099,_0x4e8490){return new BPromise(function(_0x21c01f,_0x2b2424){return client['request'](_0x369815,_0x4e8490)[_0xa0cf('0x12')](function(_0x434795){logger[_0xa0cf('0x13')](_0xa0cf('0x14'),_0xdab099,_0xa0cf('0x15'));logger[_0xa0cf('0x16')](_0xa0cf('0x17'),_0xdab099,_0xa0cf('0x15'),JSON[_0xa0cf('0x18')](_0x434795));if(_0x434795[_0xa0cf('0x19')]){if(_0x434795['error']['code']===0x1f4){logger[_0xa0cf('0x19')](_0xa0cf('0x14'),_0xdab099,_0x434795[_0xa0cf('0x19')][_0xa0cf('0x1a')]);return _0x2b2424(_0x434795[_0xa0cf('0x19')][_0xa0cf('0x1a')]);}logger[_0xa0cf('0x19')](_0xa0cf('0x14'),_0xdab099,_0x434795['error'][_0xa0cf('0x1a')]);return _0x21c01f(_0x434795['error']['message']);}else{logger[_0xa0cf('0x13')](_0xa0cf('0x14'),_0xdab099,_0xa0cf('0x15'));_0x21c01f(_0x434795['result'][_0xa0cf('0x1a')]);}})['catch'](function(_0x3732fb){logger[_0xa0cf('0x19')](_0xa0cf('0x14'),_0xdab099,_0x3732fb);_0x2b2424(_0x3732fb);});});}exports[_0xa0cf('0x1b')]=function(_0x213a6a){var _0x1837b3=this;return new Promise(function(_0x103600,_0x3fa556){return db['ChatQueue'][_0xa0cf('0x1c')]({'raw':_0x213a6a['options']?_0x213a6a[_0xa0cf('0x1d')][_0xa0cf('0x1e')]===undefined?!![]:![]:!![],'where':_0x213a6a[_0xa0cf('0x1d')]?_0x213a6a[_0xa0cf('0x1d')][_0xa0cf('0x1f')]||null:null,'attributes':_0x213a6a[_0xa0cf('0x1d')]?_0x213a6a['options'][_0xa0cf('0x20')]||null:null,'limit':_0x213a6a[_0xa0cf('0x1d')]?_0x213a6a['options'][_0xa0cf('0x21')]||null:null,'include':_0x213a6a[_0xa0cf('0x1d')]?_0x213a6a[_0xa0cf('0x1d')][_0xa0cf('0x22')]?_[_0xa0cf('0x23')](_0x213a6a['options'][_0xa0cf('0x22')],function(_0x5dc98c){return{'model':db[_0x5dc98c['model']],'as':_0x5dc98c['as'],'attributes':_0x5dc98c[_0xa0cf('0x20')],'include':_0x5dc98c[_0xa0cf('0x22')]?_[_0xa0cf('0x23')](_0x5dc98c['include'],function(_0x4d2aab){return{'model':db[_0x4d2aab['model']],'as':_0x4d2aab['as'],'attributes':_0x4d2aab[_0xa0cf('0x20')],'include':_0x4d2aab[_0xa0cf('0x22')]?_['map'](_0x4d2aab[_0xa0cf('0x22')],function(_0xf58a40){return{'model':db[_0xf58a40['model']],'as':_0xf58a40['as'],'attributes':_0xf58a40['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0cf('0x12')](function(_0x5d837d){logger[_0xa0cf('0x13')]('GetChatQueue',_0x213a6a);logger['debug'](_0xa0cf('0x1b'),_0x213a6a,JSON[_0xa0cf('0x18')](_0x5d837d));_0x103600(_0x5d837d);})[_0xa0cf('0x24')](function(_0x1c1770){logger[_0xa0cf('0x19')](_0xa0cf('0x1b'),_0x1c1770[_0xa0cf('0x1a')],_0x213a6a);_0x3fa556(_0x1837b3['error'](0x1f4,_0x1c1770[_0xa0cf('0x1a')]));});});};exports['ShowChatQueue']=function(_0x40764f){var _0x9b8f78=this;return new Promise(function(_0x493768,_0x109dd7){return db['ChatQueue']['find']({'raw':_0x40764f[_0xa0cf('0x1d')]?_0x40764f[_0xa0cf('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x40764f[_0xa0cf('0x1d')]?_0x40764f[_0xa0cf('0x1d')]['where']||null:null,'attributes':_0x40764f['options']?_0x40764f[_0xa0cf('0x1d')][_0xa0cf('0x20')]||null:null,'include':_0x40764f[_0xa0cf('0x1d')]?_0x40764f[_0xa0cf('0x1d')]['include']?_[_0xa0cf('0x23')](_0x40764f[_0xa0cf('0x1d')]['include'],function(_0x4cb083){return{'model':db[_0x4cb083[_0xa0cf('0x25')]],'as':_0x4cb083['as'],'attributes':_0x4cb083[_0xa0cf('0x20')],'include':_0x4cb083[_0xa0cf('0x22')]?_[_0xa0cf('0x23')](_0x4cb083[_0xa0cf('0x22')],function(_0x1bc4e9){return{'model':db[_0x1bc4e9[_0xa0cf('0x25')]],'as':_0x1bc4e9['as'],'attributes':_0x1bc4e9[_0xa0cf('0x20')],'include':_0x1bc4e9[_0xa0cf('0x22')]?_[_0xa0cf('0x23')](_0x1bc4e9[_0xa0cf('0x22')],function(_0x58c111){return{'model':db[_0x58c111[_0xa0cf('0x25')]],'as':_0x58c111['as'],'attributes':_0x58c111['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0cf('0x12')](function(_0x1bbec7){logger[_0xa0cf('0x13')](_0xa0cf('0x26'),_0x40764f);logger[_0xa0cf('0x16')](_0xa0cf('0x26'),_0x40764f,JSON[_0xa0cf('0x18')](_0x1bbec7));_0x493768(_0x1bbec7);})[_0xa0cf('0x24')](function(_0x42e51){logger['error']('ShowChatQueue',_0x42e51[_0xa0cf('0x1a')],_0x40764f);_0x109dd7(_0x9b8f78['error'](0x1f4,_0x42e51[_0xa0cf('0x1a')]));});});};
\ No newline at end of file
+var _0x9c9b=['include','map','model','debug','stringify','catch','find','ShowChatQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','GetChatQueue','ChatQueue','findAll','options','raw','attributes'];(function(_0x27faf3,_0x5bc98c){var _0x3a4167=function(_0x41a972){while(--_0x41a972){_0x27faf3['push'](_0x27faf3['shift']());}};_0x3a4167(++_0x5bc98c);}(_0x9c9b,0x194));var _0xb9c9=function(_0x1bd7ba,_0x648456){_0x1bd7ba=_0x1bd7ba-0x0;var _0x57bd66=_0x9c9b[_0x1bd7ba];return _0x57bd66;};'use strict';var _=require('lodash');var util=require(_0xb9c9('0x0'));var moment=require(_0xb9c9('0x1'));var BPromise=require(_0xb9c9('0x2'));var rs=require(_0xb9c9('0x3'));var fs=require('fs');var Redis=require(_0xb9c9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9c9('0x5'));var logger=require(_0xb9c9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb9c9('0x7')][_0xb9c9('0x8')]({'port':0x232a});config[_0xb9c9('0x9')]=_[_0xb9c9('0xa')](config[_0xb9c9('0x9')],{'host':_0xb9c9('0xb'),'port':0x18eb});var socket=require(_0xb9c9('0xc'))(new Redis(config[_0xb9c9('0x9')]));require(_0xb9c9('0xd'))[_0xb9c9('0xe')](socket);function respondWithRpcPromise(_0x286ad3,_0x2a70ad,_0xfe2780){return new BPromise(function(_0x5a2fb6,_0x490d67){return client[_0xb9c9('0xf')](_0x286ad3,_0xfe2780)[_0xb9c9('0x10')](function(_0x1e06a4){logger[_0xb9c9('0x11')](_0xb9c9('0x12'),_0x2a70ad,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2a70ad,_0xb9c9('0x13'),JSON['stringify'](_0x1e06a4));if(_0x1e06a4[_0xb9c9('0x14')]){if(_0x1e06a4[_0xb9c9('0x14')]['code']===0x1f4){logger['error'](_0xb9c9('0x12'),_0x2a70ad,_0x1e06a4[_0xb9c9('0x14')][_0xb9c9('0x15')]);return _0x490d67(_0x1e06a4['error'][_0xb9c9('0x15')]);}logger[_0xb9c9('0x14')](_0xb9c9('0x12'),_0x2a70ad,_0x1e06a4[_0xb9c9('0x14')][_0xb9c9('0x15')]);return _0x5a2fb6(_0x1e06a4['error'][_0xb9c9('0x15')]);}else{logger[_0xb9c9('0x11')](_0xb9c9('0x12'),_0x2a70ad,'request\x20sent');_0x5a2fb6(_0x1e06a4['result']['message']);}})['catch'](function(_0x9ff31e){logger[_0xb9c9('0x14')](_0xb9c9('0x12'),_0x2a70ad,_0x9ff31e);_0x490d67(_0x9ff31e);});});}exports[_0xb9c9('0x16')]=function(_0x155c29){var _0x2346e3=this;return new Promise(function(_0x1836b6,_0x2faa66){return db[_0xb9c9('0x17')][_0xb9c9('0x18')]({'raw':_0x155c29[_0xb9c9('0x19')]?_0x155c29[_0xb9c9('0x19')][_0xb9c9('0x1a')]===undefined?!![]:![]:!![],'where':_0x155c29['options']?_0x155c29[_0xb9c9('0x19')]['where']||null:null,'attributes':_0x155c29[_0xb9c9('0x19')]?_0x155c29[_0xb9c9('0x19')][_0xb9c9('0x1b')]||null:null,'limit':_0x155c29[_0xb9c9('0x19')]?_0x155c29[_0xb9c9('0x19')]['limit']||null:null,'include':_0x155c29[_0xb9c9('0x19')]?_0x155c29[_0xb9c9('0x19')][_0xb9c9('0x1c')]?_[_0xb9c9('0x1d')](_0x155c29['options'][_0xb9c9('0x1c')],function(_0x55abcf){return{'model':db[_0x55abcf['model']],'as':_0x55abcf['as'],'attributes':_0x55abcf['attributes'],'include':_0x55abcf[_0xb9c9('0x1c')]?_[_0xb9c9('0x1d')](_0x55abcf[_0xb9c9('0x1c')],function(_0x4e8152){return{'model':db[_0x4e8152[_0xb9c9('0x1e')]],'as':_0x4e8152['as'],'attributes':_0x4e8152[_0xb9c9('0x1b')],'include':_0x4e8152[_0xb9c9('0x1c')]?_[_0xb9c9('0x1d')](_0x4e8152[_0xb9c9('0x1c')],function(_0x3bfc70){return{'model':db[_0x3bfc70[_0xb9c9('0x1e')]],'as':_0x3bfc70['as'],'attributes':_0x3bfc70[_0xb9c9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb9c9('0x10')](function(_0x482cb1){logger[_0xb9c9('0x11')](_0xb9c9('0x16'),_0x155c29);logger[_0xb9c9('0x1f')]('GetChatQueue',_0x155c29,JSON[_0xb9c9('0x20')](_0x482cb1));_0x1836b6(_0x482cb1);})[_0xb9c9('0x21')](function(_0x46d421){logger[_0xb9c9('0x14')]('GetChatQueue',_0x46d421[_0xb9c9('0x15')],_0x155c29);_0x2faa66(_0x2346e3[_0xb9c9('0x14')](0x1f4,_0x46d421[_0xb9c9('0x15')]));});});};exports['ShowChatQueue']=function(_0x38bacd){var _0x225051=this;return new Promise(function(_0x58a8cc,_0x34ff7c){return db[_0xb9c9('0x17')][_0xb9c9('0x22')]({'raw':_0x38bacd[_0xb9c9('0x19')]?_0x38bacd[_0xb9c9('0x19')][_0xb9c9('0x1a')]===undefined?!![]:![]:!![],'where':_0x38bacd[_0xb9c9('0x19')]?_0x38bacd[_0xb9c9('0x19')]['where']||null:null,'attributes':_0x38bacd[_0xb9c9('0x19')]?_0x38bacd['options'][_0xb9c9('0x1b')]||null:null,'include':_0x38bacd['options']?_0x38bacd[_0xb9c9('0x19')][_0xb9c9('0x1c')]?_[_0xb9c9('0x1d')](_0x38bacd[_0xb9c9('0x19')][_0xb9c9('0x1c')],function(_0x56003f){return{'model':db[_0x56003f[_0xb9c9('0x1e')]],'as':_0x56003f['as'],'attributes':_0x56003f[_0xb9c9('0x1b')],'include':_0x56003f['include']?_[_0xb9c9('0x1d')](_0x56003f[_0xb9c9('0x1c')],function(_0x26d75b){return{'model':db[_0x26d75b[_0xb9c9('0x1e')]],'as':_0x26d75b['as'],'attributes':_0x26d75b[_0xb9c9('0x1b')],'include':_0x26d75b['include']?_[_0xb9c9('0x1d')](_0x26d75b[_0xb9c9('0x1c')],function(_0x304f69){return{'model':db[_0x304f69[_0xb9c9('0x1e')]],'as':_0x304f69['as'],'attributes':_0x304f69[_0xb9c9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb9c9('0x10')](function(_0x2b8ba3){logger[_0xb9c9('0x11')](_0xb9c9('0x23'),_0x38bacd);logger['debug'](_0xb9c9('0x23'),_0x38bacd,JSON[_0xb9c9('0x20')](_0x2b8ba3));_0x58a8cc(_0x2b8ba3);})[_0xb9c9('0x21')](function(_0x2774da){logger['error'](_0xb9c9('0x23'),_0x2774da[_0xb9c9('0x15')],_0x38bacd);_0x34ff7c(_0x225051['error'](0x1f4,_0x2774da['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 84bb570..e65f6a5 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 _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0x1a0054,_0x4f93b6){var _0x1b3084=function(_0x1b1efc){while(--_0x1b1efc){_0x1a0054['push'](_0x1a0054['shift']());}};_0x1b3084(++_0x4f93b6);}(_0x5089,0x1bb));var _0x9508=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x5089[_0x21af3a];return _0x268a49;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}};
\ No newline at end of file
+var _0x55e0=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x121350,_0x361f4d){var _0x2e21c7=function(_0x3b6d51){while(--_0x3b6d51){_0x121350['push'](_0x121350['shift']());}};_0x2e21c7(++_0x361f4d);}(_0x55e0,0xdc));var _0x055e=function(_0x36c5be,_0x1032d6){_0x36c5be=_0x36c5be-0x0;var _0x28d11e=_0x55e0[_0x36c5be];return _0x28d11e;};'use strict';var ChatQueueEvents=require(_0x055e('0x0'));var events=[_0x055e('0x1'),_0x055e('0x2'),_0x055e('0x3')];function createListener(_0x5b82b9,_0x578882){return function(_0x3a2ee6){_0x578882[_0x055e('0x4')](_0x5b82b9,_0x3a2ee6);};}function removeListener(_0x33cd7b,_0x2773e4){return function(){ChatQueueEvents[_0x055e('0x5')](_0x33cd7b,_0x2773e4);};}exports[_0x055e('0x6')]=function(_0x490ee1){for(var _0x5239f6=0x0,_0x4384ff=events['length'];_0x5239f6<_0x4384ff;_0x5239f6++){var _0x8e7824=events[_0x5239f6];var _0x3c4cf=createListener(_0x055e('0x7')+_0x8e7824,_0x490ee1);ChatQueueEvents['on'](_0x8e7824,_0x3c4cf);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index dd255e1..2bf65e9 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5d9df0,_0x5ee28f){var _0x446354=function(_0x24474f){while(--_0x24474f){_0x5d9df0['push'](_0x5d9df0['shift']());}};_0x446354(++_0x5ee28f);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'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('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+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(_0x5872f1,_0x5e9352){var _0x601f14=function(_0x3cea1b){while(--_0x3cea1b){_0x5872f1['push'](_0x5872f1['shift']());}};_0x601f14(++_0x5e9352);}(_0xe14b,0x93));var _0xbe14=function(_0x231962,_0x382414){_0x231962=_0x231962-0x0;var _0x40a960=_0xe14b[_0x231962];return _0x40a960;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 8e69ce3..42506e7 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 _0x43b0=['moment','sequelize','STRING','DATE'];(function(_0x339a72,_0x30e232){var _0xe76438=function(_0x1c42b3){while(--_0x1c42b3){_0x339a72['push'](_0x339a72['shift']());}};_0xe76438(++_0x30e232);}(_0x43b0,0x19c));var _0x043b=function(_0x6eb608,_0x4bfdcb){_0x6eb608=_0x6eb608-0x0;var _0x142f47=_0x43b0[_0x6eb608];return _0x142f47;};'use strict';var moment=require(_0x043b('0x0'));var Sequelize=require(_0x043b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x043b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x043b('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x043b('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7b17=['DATE','moment','sequelize','exports','STRING'];(function(_0x33499b,_0x21025b){var _0xec56b=function(_0x1680b2){while(--_0x1680b2){_0x33499b['push'](_0x33499b['shift']());}};_0xec56b(++_0x21025b);}(_0x7b17,0x9c));var _0x77b1=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7b17[_0x164eca];return _0x2ce562;};'use strict';var moment=require(_0x77b1('0x0'));var Sequelize=require(_0x77b1('0x1'));module[_0x77b1('0x2')]={'uniqueid':{'type':Sequelize[_0x77b1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x77b1('0x3')]},'joinAt':{'type':Sequelize[_0x77b1('0x4')]},'leaveAt':{'type':Sequelize[_0x77b1('0x4')]},'acceptAt':{'type':Sequelize[_0x77b1('0x4')]},'exitAt':{'type':Sequelize[_0x77b1('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 1f86ca2..d15b6a7 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 _0xaee6=['filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','destroy','describe','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x1f2b0e,_0xc804dc){var _0x23b334=function(_0x138ed9){while(--_0x138ed9){_0x1f2b0e['push'](_0x1f2b0e['shift']());}};_0x23b334(++_0xc804dc);}(_0xaee6,0x187));var _0x6aee=function(_0x4620e3,_0x1e0755){_0x4620e3=_0x4620e3-0x0;var _0xbbc011=_0xaee6[_0x4620e3];return _0xbbc011;};'use strict';var emlformat=require(_0x6aee('0x0'));var rimraf=require(_0x6aee('0x1'));var zipdir=require(_0x6aee('0x2'));var jsonpatch=require(_0x6aee('0x3'));var rp=require(_0x6aee('0x4'));var moment=require(_0x6aee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6aee('0x6'));var util=require(_0x6aee('0x7'));var path=require(_0x6aee('0x8'));var sox=require('sox');var csv=require(_0x6aee('0x9'));var ejs=require(_0x6aee('0xa'));var fs=require('fs');var fs_extra=require(_0x6aee('0xb'));var _=require(_0x6aee('0xc'));var squel=require(_0x6aee('0xd'));var crypto=require(_0x6aee('0xe'));var jsforce=require(_0x6aee('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6aee('0x10'));var Papa=require('papaparse');var Redis=require(_0x6aee('0x11'));var authService=require(_0x6aee('0x12'));var qs=require(_0x6aee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6aee('0x14'));var logger=require(_0x6aee('0x15'))(_0x6aee('0x16'));var utils=require(_0x6aee('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6aee('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b4551,_0x46e458){_0x46e458=_0x46e458||0xcc;return function(_0x25eddf){if(_0x25eddf){return _0x5b4551[_0x6aee('0x19')](_0x46e458);}return _0x5b4551[_0x6aee('0x1a')](_0x46e458)['end']();};}function respondWithResult(_0x2d13f5,_0x238b4d){_0x238b4d=_0x238b4d||0xc8;return function(_0x5a7fc5){if(_0x5a7fc5){return _0x2d13f5['status'](_0x238b4d)[_0x6aee('0x1b')](_0x5a7fc5);}};}function respondWithFilteredResult(_0x10a0c8,_0x658ef){return function(_0x18b259){if(_0x18b259){var _0x16cc61=typeof _0x658ef[_0x6aee('0x1c')]===_0x6aee('0x1d')&&typeof _0x658ef[_0x6aee('0x1e')]==='undefined';var _0x124794=_0x18b259[_0x6aee('0x1f')];var _0x511486=_0x16cc61?0x0:_0x658ef[_0x6aee('0x1c')];var _0x29f71c=_0x16cc61?_0x18b259['count']:_0x658ef[_0x6aee('0x1c')]+_0x658ef[_0x6aee('0x1e')];var _0x39a9c1;if(_0x29f71c>=_0x124794){_0x29f71c=_0x124794;_0x39a9c1=0xc8;}else{_0x39a9c1=0xce;}_0x10a0c8[_0x6aee('0x1a')](_0x39a9c1);return _0x10a0c8[_0x6aee('0x20')](_0x6aee('0x21'),_0x511486+'-'+_0x29f71c+'/'+_0x124794)[_0x6aee('0x1b')](_0x18b259);}return null;};}function patchUpdates(_0x5969b2){return function(_0x25c43f){try{jsonpatch['apply'](_0x25c43f,_0x5969b2,!![]);}catch(_0x495ec5){return BPromise[_0x6aee('0x22')](_0x495ec5);}return _0x25c43f[_0x6aee('0x23')]();};}function saveUpdates(_0x409295,_0x4619b1){return function(_0x2f9a08){if(_0x2f9a08){return _0x2f9a08[_0x6aee('0x24')](_0x409295)[_0x6aee('0x25')](function(_0x1ffa47){return _0x1ffa47;});}return null;};}function removeEntity(_0x57b997,_0xc1b66c){return function(_0x511ea6){if(_0x511ea6){return _0x511ea6['destroy']()[_0x6aee('0x25')](function(){_0x57b997[_0x6aee('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3445b1,_0x166dcd){return function(_0x56716f){if(!_0x56716f){_0x3445b1[_0x6aee('0x19')](0x194);}return _0x56716f;};}function handleError(_0x43f0bb,_0x1c110c){_0x1c110c=_0x1c110c||0x1f4;return function(_0x1f1b19){logger[_0x6aee('0x26')](_0x1f1b19[_0x6aee('0x27')]);if(_0x1f1b19[_0x6aee('0x28')]){delete _0x1f1b19[_0x6aee('0x28')];}_0x43f0bb[_0x6aee('0x1a')](_0x1c110c)[_0x6aee('0x29')](_0x1f1b19);};}exports[_0x6aee('0x2a')]=function(_0x3376d1,_0x3d06bb){var _0x7327d4={},_0x15e0db={},_0x2fc285={'count':0x0,'rows':[]};var _0x52244f=_['map'](db[_0x6aee('0x2b')][_0x6aee('0x2c')],function(_0x2822b9){return{'name':_0x2822b9[_0x6aee('0x2d')],'type':_0x2822b9['type'][_0x6aee('0x2e')]};});_0x15e0db['model']=_[_0x6aee('0x2f')](_0x52244f,_0x6aee('0x28'));_0x15e0db[_0x6aee('0x30')]=_[_0x6aee('0x31')](_0x3376d1[_0x6aee('0x30')]);_0x15e0db[_0x6aee('0x32')]=_[_0x6aee('0x33')](_0x15e0db[_0x6aee('0x34')],_0x15e0db[_0x6aee('0x30')]);_0x7327d4[_0x6aee('0x35')]=_[_0x6aee('0x33')](_0x15e0db[_0x6aee('0x34')],qs[_0x6aee('0x36')](_0x3376d1['query'][_0x6aee('0x36')]));_0x7327d4[_0x6aee('0x35')]=_0x7327d4[_0x6aee('0x35')][_0x6aee('0x37')]?_0x7327d4[_0x6aee('0x35')]:_0x15e0db[_0x6aee('0x34')];if(!_0x3376d1[_0x6aee('0x30')][_0x6aee('0x38')]('nolimit')){_0x7327d4[_0x6aee('0x1e')]=qs[_0x6aee('0x1e')](_0x3376d1[_0x6aee('0x30')][_0x6aee('0x1e')]);_0x7327d4[_0x6aee('0x1c')]=qs[_0x6aee('0x1c')](_0x3376d1[_0x6aee('0x30')][_0x6aee('0x1c')]);}_0x7327d4[_0x6aee('0x39')]=qs[_0x6aee('0x3a')](_0x3376d1[_0x6aee('0x30')]['sort']);_0x7327d4['where']=qs[_0x6aee('0x32')](_['pick'](_0x3376d1['query'],_0x15e0db[_0x6aee('0x32')]),_0x52244f);if(_0x3376d1[_0x6aee('0x30')][_0x6aee('0x3b')]){_0x7327d4['where']=_[_0x6aee('0x3c')](_0x7327d4[_0x6aee('0x3d')],{'$or':_[_0x6aee('0x2f')](_0x52244f,function(_0x39784e){if(_0x39784e['type']!==_0x6aee('0x3e')){var _0x3b8fda={};_0x3b8fda[_0x39784e[_0x6aee('0x28')]]={'$like':'%'+_0x3376d1[_0x6aee('0x30')][_0x6aee('0x3b')]+'%'};return _0x3b8fda;}})});}_0x7327d4=_['merge']({},_0x7327d4,_0x3376d1[_0x6aee('0x3f')]);var _0x43fbd={'where':_0x7327d4[_0x6aee('0x3d')]};return db[_0x6aee('0x2b')][_0x6aee('0x1f')](_0x43fbd)['then'](function(_0x3e01e1){_0x2fc285['count']=_0x3e01e1;if(_0x3376d1[_0x6aee('0x30')][_0x6aee('0x40')]){_0x7327d4[_0x6aee('0x41')]=[{'all':!![]}];}return db[_0x6aee('0x2b')][_0x6aee('0x42')](_0x7327d4);})[_0x6aee('0x25')](function(_0x5ba53b){_0x2fc285['rows']=_0x5ba53b;return _0x2fc285;})[_0x6aee('0x25')](respondWithFilteredResult(_0x3d06bb,_0x7327d4))['catch'](handleError(_0x3d06bb,null));};exports[_0x6aee('0x43')]=function(_0x2cfa2a,_0x285b9f){var _0x3c58a3={'raw':!![],'where':{'id':_0x2cfa2a[_0x6aee('0x44')]['id']}},_0x5029d3={};_0x5029d3['model']=_[_0x6aee('0x31')](db['ChatQueueReport'][_0x6aee('0x2c')]);_0x5029d3[_0x6aee('0x30')]=_[_0x6aee('0x31')](_0x2cfa2a[_0x6aee('0x30')]);_0x5029d3[_0x6aee('0x32')]=_[_0x6aee('0x33')](_0x5029d3[_0x6aee('0x34')],_0x5029d3[_0x6aee('0x30')]);_0x3c58a3['attributes']=_[_0x6aee('0x33')](_0x5029d3[_0x6aee('0x34')],qs['fields'](_0x2cfa2a['query'][_0x6aee('0x36')]));_0x3c58a3[_0x6aee('0x35')]=_0x3c58a3['attributes'][_0x6aee('0x37')]?_0x3c58a3['attributes']:_0x5029d3[_0x6aee('0x34')];if(_0x2cfa2a[_0x6aee('0x30')][_0x6aee('0x40')]){_0x3c58a3[_0x6aee('0x41')]=[{'all':!![]}];}_0x3c58a3=_['merge']({},_0x3c58a3,_0x2cfa2a['options']);return db[_0x6aee('0x2b')][_0x6aee('0x45')](_0x3c58a3)[_0x6aee('0x25')](handleEntityNotFound(_0x285b9f,null))[_0x6aee('0x25')](respondWithResult(_0x285b9f,null))['catch'](handleError(_0x285b9f,null));};exports[_0x6aee('0x46')]=function(_0x573005,_0x40ea5e){return db[_0x6aee('0x2b')][_0x6aee('0x46')](_0x573005[_0x6aee('0x47')],{})['then'](respondWithResult(_0x40ea5e,0xc9))[_0x6aee('0x48')](handleError(_0x40ea5e,null));};exports[_0x6aee('0x24')]=function(_0x316f51,_0x23a7ed){if(_0x316f51[_0x6aee('0x47')]['id']){delete _0x316f51[_0x6aee('0x47')]['id'];}return db[_0x6aee('0x2b')][_0x6aee('0x45')]({'where':{'id':_0x316f51['params']['id']}})[_0x6aee('0x25')](handleEntityNotFound(_0x23a7ed,null))[_0x6aee('0x25')](saveUpdates(_0x316f51['body'],null))[_0x6aee('0x25')](respondWithResult(_0x23a7ed,null))[_0x6aee('0x48')](handleError(_0x23a7ed,null));};exports[_0x6aee('0x49')]=function(_0x132aa9,_0x5b9036){return db['ChatQueueReport'][_0x6aee('0x45')]({'where':{'id':_0x132aa9[_0x6aee('0x44')]['id']}})[_0x6aee('0x25')](handleEntityNotFound(_0x5b9036,null))[_0x6aee('0x25')](removeEntity(_0x5b9036,null))['catch'](handleError(_0x5b9036,null));};exports[_0x6aee('0x4a')]=function(_0x56587e,_0x44e3ea){return db['ChatQueueReport'][_0x6aee('0x4a')]()[_0x6aee('0x25')](respondWithResult(_0x44e3ea,null))[_0x6aee('0x48')](handleError(_0x44e3ea,null));};
\ No newline at end of file
+var _0xcddb=['nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','save','then','destroy','end','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x1a91a6,_0x486ff7){_0x1a91a6=_0x1a91a6-0x0;var _0x21e0a=_0xcddb[_0x1a91a6];return _0x21e0a;};'use strict';var emlformat=require(_0xbcdd('0x0'));var rimraf=require(_0xbcdd('0x1'));var zipdir=require(_0xbcdd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbcdd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbcdd('0x4'));var util=require(_0xbcdd('0x5'));var path=require(_0xbcdd('0x6'));var sox=require(_0xbcdd('0x7'));var csv=require('to-csv');var ejs=require(_0xbcdd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbcdd('0x9'));var squel=require(_0xbcdd('0xa'));var crypto=require('crypto');var jsforce=require(_0xbcdd('0xb'));var deskjs=require(_0xbcdd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbcdd('0xd'));var Redis=require(_0xbcdd('0xe'));var authService=require(_0xbcdd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbcdd('0x10'));var hardwareService=require(_0xbcdd('0x11'));var logger=require(_0xbcdd('0x12'))(_0xbcdd('0x13'));var utils=require('../../config/utils');var config=require(_0xbcdd('0x14'));var licenseUtil=require(_0xbcdd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33cb85,_0x948ca6){_0x948ca6=_0x948ca6||0xcc;return function(_0x5a84c4){if(_0x5a84c4){return _0x33cb85[_0xbcdd('0x16')](_0x948ca6);}return _0x33cb85[_0xbcdd('0x17')](_0x948ca6)['end']();};}function respondWithResult(_0x59da7a,_0x3be98b){_0x3be98b=_0x3be98b||0xc8;return function(_0x34e4cb){if(_0x34e4cb){return _0x59da7a[_0xbcdd('0x17')](_0x3be98b)[_0xbcdd('0x18')](_0x34e4cb);}};}function respondWithFilteredResult(_0x377448,_0x5b66cb){return function(_0x87eb1e){if(_0x87eb1e){var _0x408055=typeof _0x5b66cb['offset']===_0xbcdd('0x19')&&typeof _0x5b66cb['limit']===_0xbcdd('0x19');var _0x2e7eeb=_0x87eb1e[_0xbcdd('0x1a')];var _0x47ae02=_0x408055?0x0:_0x5b66cb[_0xbcdd('0x1b')];var _0x39d865=_0x408055?_0x87eb1e[_0xbcdd('0x1a')]:_0x5b66cb[_0xbcdd('0x1b')]+_0x5b66cb[_0xbcdd('0x1c')];var _0x5ad171;if(_0x39d865>=_0x2e7eeb){_0x39d865=_0x2e7eeb;_0x5ad171=0xc8;}else{_0x5ad171=0xce;}_0x377448[_0xbcdd('0x17')](_0x5ad171);return _0x377448[_0xbcdd('0x1d')](_0xbcdd('0x1e'),_0x47ae02+'-'+_0x39d865+'/'+_0x2e7eeb)[_0xbcdd('0x18')](_0x87eb1e);}return null;};}function patchUpdates(_0x45ae83){return function(_0x1b8c70){try{jsonpatch['apply'](_0x1b8c70,_0x45ae83,!![]);}catch(_0x224a84){return BPromise['reject'](_0x224a84);}return _0x1b8c70[_0xbcdd('0x1f')]();};}function saveUpdates(_0x1d9e2d,_0x26798d){return function(_0x23bbd5){if(_0x23bbd5){return _0x23bbd5['update'](_0x1d9e2d)[_0xbcdd('0x20')](function(_0x2cd0dd){return _0x2cd0dd;});}return null;};}function removeEntity(_0x1e4db6,_0x19e183){return function(_0x527e71){if(_0x527e71){return _0x527e71[_0xbcdd('0x21')]()[_0xbcdd('0x20')](function(){_0x1e4db6[_0xbcdd('0x17')](0xcc)[_0xbcdd('0x22')]();});}};}function handleEntityNotFound(_0x3cfd0f,_0x5441a9){return function(_0x1f334d){if(!_0x1f334d){_0x3cfd0f[_0xbcdd('0x16')](0x194);}return _0x1f334d;};}function handleError(_0x14a34b,_0x3f57a5){_0x3f57a5=_0x3f57a5||0x1f4;return function(_0x37f2a9){logger['error'](_0x37f2a9[_0xbcdd('0x23')]);if(_0x37f2a9[_0xbcdd('0x24')]){delete _0x37f2a9['name'];}_0x14a34b[_0xbcdd('0x17')](_0x3f57a5)[_0xbcdd('0x25')](_0x37f2a9);};}exports[_0xbcdd('0x26')]=function(_0x18b13b,_0x3f6487){var _0x553e98={},_0x163a3e={},_0x485696={'count':0x0,'rows':[]};var _0x5d6234=_[_0xbcdd('0x27')](db[_0xbcdd('0x28')]['rawAttributes'],function(_0x2dc944){return{'name':_0x2dc944[_0xbcdd('0x29')],'type':_0x2dc944[_0xbcdd('0x2a')][_0xbcdd('0x2b')]};});_0x163a3e[_0xbcdd('0x2c')]=_[_0xbcdd('0x27')](_0x5d6234,_0xbcdd('0x24'));_0x163a3e[_0xbcdd('0x2d')]=_[_0xbcdd('0x2e')](_0x18b13b['query']);_0x163a3e[_0xbcdd('0x2f')]=_[_0xbcdd('0x30')](_0x163a3e['model'],_0x163a3e['query']);_0x553e98[_0xbcdd('0x31')]=_[_0xbcdd('0x30')](_0x163a3e['model'],qs[_0xbcdd('0x32')](_0x18b13b['query'][_0xbcdd('0x32')]));_0x553e98['attributes']=_0x553e98[_0xbcdd('0x31')]['length']?_0x553e98[_0xbcdd('0x31')]:_0x163a3e[_0xbcdd('0x2c')];if(!_0x18b13b['query'][_0xbcdd('0x33')](_0xbcdd('0x34'))){_0x553e98[_0xbcdd('0x1c')]=qs[_0xbcdd('0x1c')](_0x18b13b[_0xbcdd('0x2d')]['limit']);_0x553e98[_0xbcdd('0x1b')]=qs['offset'](_0x18b13b[_0xbcdd('0x2d')][_0xbcdd('0x1b')]);}_0x553e98['order']=qs['sort'](_0x18b13b[_0xbcdd('0x2d')]['sort']);_0x553e98[_0xbcdd('0x35')]=qs[_0xbcdd('0x2f')](_[_0xbcdd('0x36')](_0x18b13b['query'],_0x163a3e[_0xbcdd('0x2f')]),_0x5d6234);if(_0x18b13b[_0xbcdd('0x2d')][_0xbcdd('0x37')]){_0x553e98[_0xbcdd('0x35')]=_[_0xbcdd('0x38')](_0x553e98[_0xbcdd('0x35')],{'$or':_[_0xbcdd('0x27')](_0x5d6234,function(_0xd646d1){if(_0xd646d1[_0xbcdd('0x2a')]!==_0xbcdd('0x39')){var _0x40d4fd={};_0x40d4fd[_0xd646d1[_0xbcdd('0x24')]]={'$like':'%'+_0x18b13b['query'][_0xbcdd('0x37')]+'%'};return _0x40d4fd;}})});}_0x553e98=_[_0xbcdd('0x38')]({},_0x553e98,_0x18b13b[_0xbcdd('0x3a')]);var _0x2a9568={'where':_0x553e98[_0xbcdd('0x35')]};return db[_0xbcdd('0x28')]['count'](_0x2a9568)[_0xbcdd('0x20')](function(_0x57ab36){_0x485696[_0xbcdd('0x1a')]=_0x57ab36;if(_0x18b13b['query'][_0xbcdd('0x3b')]){_0x553e98[_0xbcdd('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xbcdd('0x3d')](_0x553e98);})[_0xbcdd('0x20')](function(_0x41721d){_0x485696[_0xbcdd('0x3e')]=_0x41721d;return _0x485696;})['then'](respondWithFilteredResult(_0x3f6487,_0x553e98))['catch'](handleError(_0x3f6487,null));};exports[_0xbcdd('0x3f')]=function(_0xd41482,_0x41fc62){var _0x4b184b={'raw':!![],'where':{'id':_0xd41482[_0xbcdd('0x40')]['id']}},_0x3e65ce={};_0x3e65ce['model']=_[_0xbcdd('0x2e')](db[_0xbcdd('0x28')][_0xbcdd('0x41')]);_0x3e65ce['query']=_[_0xbcdd('0x2e')](_0xd41482[_0xbcdd('0x2d')]);_0x3e65ce[_0xbcdd('0x2f')]=_['intersection'](_0x3e65ce[_0xbcdd('0x2c')],_0x3e65ce[_0xbcdd('0x2d')]);_0x4b184b[_0xbcdd('0x31')]=_[_0xbcdd('0x30')](_0x3e65ce[_0xbcdd('0x2c')],qs[_0xbcdd('0x32')](_0xd41482[_0xbcdd('0x2d')][_0xbcdd('0x32')]));_0x4b184b[_0xbcdd('0x31')]=_0x4b184b[_0xbcdd('0x31')][_0xbcdd('0x42')]?_0x4b184b[_0xbcdd('0x31')]:_0x3e65ce['model'];if(_0xd41482[_0xbcdd('0x2d')]['includeAll']){_0x4b184b[_0xbcdd('0x3c')]=[{'all':!![]}];}_0x4b184b=_[_0xbcdd('0x38')]({},_0x4b184b,_0xd41482['options']);return db[_0xbcdd('0x28')][_0xbcdd('0x43')](_0x4b184b)[_0xbcdd('0x20')](handleEntityNotFound(_0x41fc62,null))[_0xbcdd('0x20')](respondWithResult(_0x41fc62,null))[_0xbcdd('0x44')](handleError(_0x41fc62,null));};exports['create']=function(_0xb1f54d,_0x6f4939){return db['ChatQueueReport']['create'](_0xb1f54d[_0xbcdd('0x45')],{})[_0xbcdd('0x20')](respondWithResult(_0x6f4939,0xc9))[_0xbcdd('0x44')](handleError(_0x6f4939,null));};exports[_0xbcdd('0x46')]=function(_0x26535a,_0x6708f5){if(_0x26535a[_0xbcdd('0x45')]['id']){delete _0x26535a['body']['id'];}return db[_0xbcdd('0x28')][_0xbcdd('0x43')]({'where':{'id':_0x26535a['params']['id']}})[_0xbcdd('0x20')](handleEntityNotFound(_0x6708f5,null))['then'](saveUpdates(_0x26535a[_0xbcdd('0x45')],null))[_0xbcdd('0x20')](respondWithResult(_0x6708f5,null))[_0xbcdd('0x44')](handleError(_0x6708f5,null));};exports[_0xbcdd('0x21')]=function(_0x282450,_0x304966){return db[_0xbcdd('0x28')][_0xbcdd('0x43')]({'where':{'id':_0x282450['params']['id']}})['then'](handleEntityNotFound(_0x304966,null))[_0xbcdd('0x20')](removeEntity(_0x304966,null))[_0xbcdd('0x44')](handleError(_0x304966,null));};exports['describe']=function(_0x2242bd,_0x312832){return db[_0xbcdd('0x28')][_0xbcdd('0x47')]()[_0xbcdd('0x20')](respondWithResult(_0x312832,null))['catch'](handleError(_0x312832,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 16a881b..65483d5 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x156c49,_0x421fef){var _0x3fcf3f=function(_0x2dfd82){while(--_0x2dfd82){_0x156c49['push'](_0x156c49['shift']());}};_0x3fcf3f(++_0x421fef);}(_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
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2e983f,_0x40731b){var _0x296a34=function(_0x369bdb){while(--_0x369bdb){_0x2e983f['push'](_0x2e983f['shift']());}};_0x296a34(++_0x40731b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index ebe9229..c6edef4 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 _0xd4a4=['../../config/utils','jayson/promise','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x4756c7,_0x1e9983){var _0x59e006=function(_0x7d08ad){while(--_0x7d08ad){_0x4756c7['push'](_0x4756c7['shift']());}};_0x59e006(++_0x1e9983);}(_0xd4a4,0x112));var _0x4d4a=function(_0x549a81,_0x28f9c7){_0x549a81=_0x549a81-0x0;var _0x514df1=_0xd4a4[_0x549a81];return _0x514df1;};'use strict';var _=require(_0x4d4a('0x0'));var util=require('util');var moment=require(_0x4d4a('0x1'));var BPromise=require(_0x4d4a('0x2'));var rs=require(_0x4d4a('0x3'));var fs=require('fs');var Redis=require(_0x4d4a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d4a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4d4a('0x6'));var client=jayson['client'][_0x4d4a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34c2f0,_0x374dbf,_0x185c6c){return new BPromise(function(_0xccd933,_0x3f2621){return client[_0x4d4a('0x8')](_0x34c2f0,_0x185c6c)[_0x4d4a('0x9')](function(_0x438da5){logger[_0x4d4a('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x374dbf,_0x4d4a('0xb'));logger[_0x4d4a('0xc')](_0x4d4a('0xd'),_0x374dbf,_0x4d4a('0xb'),JSON['stringify'](_0x438da5));if(_0x438da5[_0x4d4a('0xe')]){if(_0x438da5['error'][_0x4d4a('0xf')]===0x1f4){logger[_0x4d4a('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x374dbf,_0x438da5[_0x4d4a('0xe')][_0x4d4a('0x10')]);return _0x3f2621(_0x438da5[_0x4d4a('0xe')][_0x4d4a('0x10')]);}logger[_0x4d4a('0xe')](_0x4d4a('0x11'),_0x374dbf,_0x438da5[_0x4d4a('0xe')][_0x4d4a('0x10')]);return _0xccd933(_0x438da5['error'][_0x4d4a('0x10')]);}else{logger[_0x4d4a('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x374dbf,'request\x20sent');_0xccd933(_0x438da5[_0x4d4a('0x12')][_0x4d4a('0x10')]);}})[_0x4d4a('0x13')](function(_0x4f2117){logger[_0x4d4a('0xe')](_0x4d4a('0x11'),_0x374dbf,_0x4f2117);_0x3f2621(_0x4f2117);});});}exports[_0x4d4a('0x14')]=function(_0x1b194a){var _0x4b721a=this;return new Promise(function(_0x16f543,_0x519c10){return db[_0x4d4a('0x15')][_0x4d4a('0x16')](_0x1b194a[_0x4d4a('0x17')],{'raw':_0x1b194a[_0x4d4a('0x18')]?_0x1b194a[_0x4d4a('0x18')][_0x4d4a('0x19')]===undefined?!![]:![]:!![]})[_0x4d4a('0x9')](function(_0xeb6656){logger[_0x4d4a('0xa')]('CreateChatQueueReport',_0x1b194a);logger[_0x4d4a('0xc')](_0x4d4a('0x14'),_0x1b194a,JSON[_0x4d4a('0x1a')](_0xeb6656));_0x16f543(_0xeb6656);})[_0x4d4a('0x13')](function(_0x1c0fa4){logger['error']('CreateChatQueueReport',_0x1c0fa4['message'],_0x1b194a);_0x519c10(_0x4b721a[_0x4d4a('0xe')](0x1f4,_0x1c0fa4[_0x4d4a('0x10')]));});});};exports[_0x4d4a('0x1b')]=function(_0x3f20e4){var _0xf625b8=this;return new Promise(function(_0x1e4859,_0x1707b8){return db[_0x4d4a('0x15')][_0x4d4a('0x1c')](_0x3f20e4[_0x4d4a('0x17')],{'raw':_0x3f20e4[_0x4d4a('0x18')]?_0x3f20e4[_0x4d4a('0x18')][_0x4d4a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f20e4['options']?_0x3f20e4['options'][_0x4d4a('0x1d')]||null:null,'attributes':_0x3f20e4[_0x4d4a('0x18')]?_0x3f20e4['options'][_0x4d4a('0x1e')]||null:null,'limit':_0x3f20e4[_0x4d4a('0x18')]?_0x3f20e4[_0x4d4a('0x18')]['limit']||null:null})[_0x4d4a('0x9')](function(_0x40c3b0){logger[_0x4d4a('0xa')](_0x4d4a('0x1b'),_0x3f20e4);logger[_0x4d4a('0xc')](_0x4d4a('0x1b'),_0x3f20e4,JSON[_0x4d4a('0x1a')](_0x40c3b0));_0x1e4859(_0x40c3b0);})[_0x4d4a('0x13')](function(_0x283b27){logger[_0x4d4a('0xe')](_0x4d4a('0x1b'),_0x283b27[_0x4d4a('0x10')],_0x3f20e4);_0x1707b8(_0xf625b8[_0x4d4a('0xe')](0x1f4,_0x283b27[_0x4d4a('0x10')]));});});};
\ No newline at end of file
+var _0x7462=['raw','info','update','body','where','attributes','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateChatQueueReport','create','options'];(function(_0x20f381,_0x31f26e){var _0x599f25=function(_0x35e69d){while(--_0x35e69d){_0x20f381['push'](_0x20f381['shift']());}};_0x599f25(++_0x31f26e);}(_0x7462,0x165));var _0x2746=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x7462[_0xcfd89f];return _0x59acd4;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2746('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2746('0x3'));var logger=require(_0x2746('0x4'))('rpc');var config=require(_0x2746('0x5'));var jayson=require(_0x2746('0x6'));var client=jayson[_0x2746('0x7')][_0x2746('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a2f42,_0x2940d8,_0x1447bc){return new BPromise(function(_0x40ad2b,_0x283327){return client['request'](_0x2a2f42,_0x1447bc)[_0x2746('0x9')](function(_0x2e4713){logger['info'](_0x2746('0xa'),_0x2940d8,_0x2746('0xb'));logger[_0x2746('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x2940d8,_0x2746('0xb'),JSON[_0x2746('0xd')](_0x2e4713));if(_0x2e4713[_0x2746('0xe')]){if(_0x2e4713[_0x2746('0xe')][_0x2746('0xf')]===0x1f4){logger[_0x2746('0xe')](_0x2746('0xa'),_0x2940d8,_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);return _0x283327(_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2940d8,_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);return _0x40ad2b(_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);}else{logger['info'](_0x2746('0xa'),_0x2940d8,_0x2746('0xb'));_0x40ad2b(_0x2e4713['result']['message']);}})[_0x2746('0x11')](function(_0x43f06c){logger[_0x2746('0xe')](_0x2746('0xa'),_0x2940d8,_0x43f06c);_0x283327(_0x43f06c);});});}exports[_0x2746('0x12')]=function(_0x232108){var _0x3556b5=this;return new Promise(function(_0x6102f3,_0x25c122){return db['ChatQueueReport'][_0x2746('0x13')](_0x232108['body'],{'raw':_0x232108[_0x2746('0x14')]?_0x232108[_0x2746('0x14')][_0x2746('0x15')]===undefined?!![]:![]:!![]})[_0x2746('0x9')](function(_0xa64e76){logger[_0x2746('0x16')](_0x2746('0x12'),_0x232108);logger[_0x2746('0xc')](_0x2746('0x12'),_0x232108,JSON['stringify'](_0xa64e76));_0x6102f3(_0xa64e76);})['catch'](function(_0x7390b3){logger[_0x2746('0xe')](_0x2746('0x12'),_0x7390b3['message'],_0x232108);_0x25c122(_0x3556b5[_0x2746('0xe')](0x1f4,_0x7390b3[_0x2746('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x2b4652){var _0x5cf1fb=this;return new Promise(function(_0x4bbe26,_0x5bc3c8){return db['ChatQueueReport'][_0x2746('0x17')](_0x2b4652[_0x2746('0x18')],{'raw':_0x2b4652['options']?_0x2b4652[_0x2746('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b4652[_0x2746('0x14')]?_0x2b4652[_0x2746('0x14')][_0x2746('0x19')]||null:null,'attributes':_0x2b4652[_0x2746('0x14')]?_0x2b4652[_0x2746('0x14')][_0x2746('0x1a')]||null:null,'limit':_0x2b4652[_0x2746('0x14')]?_0x2b4652[_0x2746('0x14')]['limit']||null:null})[_0x2746('0x9')](function(_0x6c2ef9){logger['info']('UpdateChatQueueReport',_0x2b4652);logger['debug']('UpdateChatQueueReport',_0x2b4652,JSON['stringify'](_0x6c2ef9));_0x4bbe26(_0x6c2ef9);})[_0x2746('0x11')](function(_0x1305b8){logger['error']('UpdateChatQueueReport',_0x1305b8[_0x2746('0x10')],_0x2b4652);_0x5bc3c8(_0x5cf1fb[_0x2746('0xe')](0x1f4,_0x1305b8['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 8e8aea7..b31757c 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 _0x9637=['isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x45ba02,_0x557589){var _0x176288=function(_0x43bcdd){while(--_0x43bcdd){_0x45ba02['push'](_0x45ba02['shift']());}};_0x176288(++_0x557589);}(_0x9637,0x6e));var _0x7963=function(_0xac6b8a,_0xe7f580){_0xac6b8a=_0xac6b8a-0x0;var _0x551ae7=_0x9637[_0xac6b8a];return _0x551ae7;};'use strict';var multer=require(_0x7963('0x0'));var util=require(_0x7963('0x1'));var path=require('path');var timeout=require(_0x7963('0x2'));var express=require(_0x7963('0x3'));var router=express[_0x7963('0x4')]();var fs_extra=require(_0x7963('0x5'));var auth=require(_0x7963('0x6'));var interaction=require(_0x7963('0x7'));var config=require(_0x7963('0x8'));var controller=require('./chatQueueReport.controller');router[_0x7963('0x9')]('/',auth[_0x7963('0xa')](),controller[_0x7963('0xb')]);router[_0x7963('0x9')](_0x7963('0xc'),auth[_0x7963('0xa')](),controller[_0x7963('0xd')]);router[_0x7963('0x9')](_0x7963('0xe'),auth[_0x7963('0xa')](),controller[_0x7963('0xf')]);router['post']('/',auth[_0x7963('0xa')](),controller['create']);router[_0x7963('0x10')](_0x7963('0xe'),auth[_0x7963('0xa')](),controller[_0x7963('0x11')]);router[_0x7963('0x12')](_0x7963('0xe'),auth[_0x7963('0xa')](),controller['destroy']);module[_0x7963('0x13')]=router;
\ No newline at end of file
+var _0xd176=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f4ee6,_0x309a2f){var _0x547538=function(_0x4c89f0){while(--_0x4c89f0){_0x1f4ee6['push'](_0x1f4ee6['shift']());}};_0x547538(++_0x309a2f);}(_0xd176,0x1c7));var _0x6d17=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xd176[_0x37cc52];return _0x2b4a90;};'use strict';var multer=require(_0x6d17('0x0'));var util=require(_0x6d17('0x1'));var path=require(_0x6d17('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d17('0x3'));var router=express[_0x6d17('0x4')]();var fs_extra=require(_0x6d17('0x5'));var auth=require(_0x6d17('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d17('0x7'));var controller=require('./chatQueueReport.controller');router[_0x6d17('0x8')]('/',auth[_0x6d17('0x9')](),controller[_0x6d17('0xa')]);router[_0x6d17('0x8')](_0x6d17('0xb'),auth['isAuthenticated'](),controller[_0x6d17('0xc')]);router[_0x6d17('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6d17('0xd')]);router[_0x6d17('0xe')]('/',auth['isAuthenticated'](),controller[_0x6d17('0xf')]);router['put'](_0x6d17('0x10'),auth[_0x6d17('0x9')](),controller[_0x6d17('0x11')]);router[_0x6d17('0x12')](_0x6d17('0x10'),auth['isAuthenticated'](),controller[_0x6d17('0x13')]);module[_0x6d17('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 2e38b03..17d5d20 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(_0x139a25,_0x1707d7){var _0x330a62=function(_0x3092b4){while(--_0x3092b4){_0x139a25['push'](_0x139a25['shift']());}};_0x330a62(++_0x1707d7);}(_0x008c,0x188));var _0xc008=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0x008c[_0x575a38];return _0x5a7bdd;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x34e8,0x12c));var _0x834e=function(_0x2cdad4,_0x212e48){_0x2cdad4=_0x2cdad4-0x0;var _0x41ad25=_0x34e8[_0x2cdad4];return _0x41ad25;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 5a10d00..dcefe98 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 _0xd6ff=['destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then'];(function(_0x37b23c,_0x33b39e){var _0x59dd00=function(_0x5dc82c){while(--_0x5dc82c){_0x37b23c['push'](_0x37b23c['shift']());}};_0x59dd00(++_0x33b39e);}(_0xd6ff,0xbf));var _0xfd6f=function(_0x4e69c6,_0x5878eb){_0x4e69c6=_0x4e69c6-0x0;var _0x2643ac=_0xd6ff[_0x4e69c6];return _0x2643ac;};'use strict';var emlformat=require(_0xfd6f('0x0'));var rimraf=require(_0xfd6f('0x1'));var zipdir=require(_0xfd6f('0x2'));var jsonpatch=require(_0xfd6f('0x3'));var rp=require(_0xfd6f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfd6f('0x5'));var path=require(_0xfd6f('0x6'));var sox=require(_0xfd6f('0x7'));var csv=require(_0xfd6f('0x8'));var ejs=require(_0xfd6f('0x9'));var fs=require('fs');var fs_extra=require(_0xfd6f('0xa'));var _=require(_0xfd6f('0xb'));var squel=require(_0xfd6f('0xc'));var crypto=require('crypto');var jsforce=require(_0xfd6f('0xd'));var deskjs=require(_0xfd6f('0xe'));var toCsv=require(_0xfd6f('0x8'));var querystring=require(_0xfd6f('0xf'));var Papa=require(_0xfd6f('0x10'));var Redis=require(_0xfd6f('0x11'));var authService=require(_0xfd6f('0x12'));var qs=require(_0xfd6f('0x13'));var as=require(_0xfd6f('0x14'));var hardwareService=require(_0xfd6f('0x15'));var logger=require(_0xfd6f('0x16'))(_0xfd6f('0x17'));var utils=require(_0xfd6f('0x18'));var config=require(_0xfd6f('0x19'));var licenseUtil=require(_0xfd6f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5185de,_0x559ecd){_0x559ecd=_0x559ecd||0xcc;return function(_0x5ec60c){if(_0x5ec60c){return _0x5185de['sendStatus'](_0x559ecd);}return _0x5185de['status'](_0x559ecd)[_0xfd6f('0x1b')]();};}function respondWithResult(_0x510adb,_0x312a38){_0x312a38=_0x312a38||0xc8;return function(_0x4169f7){if(_0x4169f7){return _0x510adb['status'](_0x312a38)[_0xfd6f('0x1c')](_0x4169f7);}};}function respondWithFilteredResult(_0x247a51,_0x134151){return function(_0x5202f5){if(_0x5202f5){var _0x161795=typeof _0x134151[_0xfd6f('0x1d')]===_0xfd6f('0x1e')&&typeof _0x134151[_0xfd6f('0x1f')]===_0xfd6f('0x1e');var _0x28d1f7=_0x5202f5[_0xfd6f('0x20')];var _0x5a3633=_0x161795?0x0:_0x134151[_0xfd6f('0x1d')];var _0x2e8dbf=_0x161795?_0x5202f5['count']:_0x134151[_0xfd6f('0x1d')]+_0x134151['limit'];var _0x4fd616;if(_0x2e8dbf>=_0x28d1f7){_0x2e8dbf=_0x28d1f7;_0x4fd616=0xc8;}else{_0x4fd616=0xce;}_0x247a51[_0xfd6f('0x21')](_0x4fd616);return _0x247a51[_0xfd6f('0x22')](_0xfd6f('0x23'),_0x5a3633+'-'+_0x2e8dbf+'/'+_0x28d1f7)['json'](_0x5202f5);}return null;};}function patchUpdates(_0x4e2561){return function(_0x2492ef){try{jsonpatch[_0xfd6f('0x24')](_0x2492ef,_0x4e2561,!![]);}catch(_0x49f145){return BPromise['reject'](_0x49f145);}return _0x2492ef[_0xfd6f('0x25')]();};}function saveUpdates(_0x367a5a,_0x25b23f){return function(_0x8bd20){if(_0x8bd20){return _0x8bd20[_0xfd6f('0x26')](_0x367a5a)[_0xfd6f('0x27')](function(_0xcbbfd3){return _0xcbbfd3;});}return null;};}function removeEntity(_0x5541c6,_0x363a61){return function(_0x527cb7){if(_0x527cb7){return _0x527cb7[_0xfd6f('0x28')]()['then'](function(){_0x5541c6[_0xfd6f('0x21')](0xcc)[_0xfd6f('0x1b')]();});}};}function handleEntityNotFound(_0x579971,_0x4baf41){return function(_0x1684f7){if(!_0x1684f7){_0x579971['sendStatus'](0x194);}return _0x1684f7;};}function handleError(_0x51edc6,_0x457035){_0x457035=_0x457035||0x1f4;return function(_0x3909ad){logger[_0xfd6f('0x29')](_0x3909ad[_0xfd6f('0x2a')]);if(_0x3909ad[_0xfd6f('0x2b')]){delete _0x3909ad[_0xfd6f('0x2b')];}_0x51edc6[_0xfd6f('0x21')](_0x457035)[_0xfd6f('0x2c')](_0x3909ad);};}exports[_0xfd6f('0x2d')]=function(_0x348a88,_0x5e532e){var _0x2587f9={},_0x24e139={},_0x200ce={'count':0x0,'rows':[]};var _0x3e0071=_[_0xfd6f('0x2e')](db[_0xfd6f('0x2f')]['rawAttributes'],function(_0x8d0c6b){return{'name':_0x8d0c6b[_0xfd6f('0x30')],'type':_0x8d0c6b[_0xfd6f('0x31')][_0xfd6f('0x32')]};});_0x24e139['model']=_[_0xfd6f('0x2e')](_0x3e0071,_0xfd6f('0x2b'));_0x24e139[_0xfd6f('0x33')]=_[_0xfd6f('0x34')](_0x348a88[_0xfd6f('0x33')]);_0x24e139[_0xfd6f('0x35')]=_[_0xfd6f('0x36')](_0x24e139['model'],_0x24e139['query']);_0x2587f9[_0xfd6f('0x37')]=_[_0xfd6f('0x36')](_0x24e139[_0xfd6f('0x38')],qs[_0xfd6f('0x39')](_0x348a88[_0xfd6f('0x33')]['fields']));_0x2587f9['attributes']=_0x2587f9[_0xfd6f('0x37')][_0xfd6f('0x3a')]?_0x2587f9['attributes']:_0x24e139[_0xfd6f('0x38')];if(!_0x348a88['query'][_0xfd6f('0x3b')](_0xfd6f('0x3c'))){_0x2587f9[_0xfd6f('0x1f')]=qs[_0xfd6f('0x1f')](_0x348a88[_0xfd6f('0x33')][_0xfd6f('0x1f')]);_0x2587f9[_0xfd6f('0x1d')]=qs['offset'](_0x348a88[_0xfd6f('0x33')][_0xfd6f('0x1d')]);}_0x2587f9[_0xfd6f('0x3d')]=qs[_0xfd6f('0x3e')](_0x348a88[_0xfd6f('0x33')][_0xfd6f('0x3e')]);_0x2587f9[_0xfd6f('0x3f')]=qs['filters'](_['pick'](_0x348a88[_0xfd6f('0x33')],_0x24e139[_0xfd6f('0x35')]),_0x3e0071);if(_0x348a88[_0xfd6f('0x33')]['filter']){_0x2587f9[_0xfd6f('0x3f')]=_[_0xfd6f('0x40')](_0x2587f9[_0xfd6f('0x3f')],{'$or':_[_0xfd6f('0x2e')](_0x3e0071,function(_0x259b6c){if(_0x259b6c[_0xfd6f('0x31')]!=='VIRTUAL'){var _0x4011f1={};_0x4011f1[_0x259b6c[_0xfd6f('0x2b')]]={'$like':'%'+_0x348a88[_0xfd6f('0x33')]['filter']+'%'};return _0x4011f1;}})});}_0x2587f9=_[_0xfd6f('0x40')]({},_0x2587f9,_0x348a88[_0xfd6f('0x41')]);var _0x40542b={'where':_0x2587f9[_0xfd6f('0x3f')]};return db['ChatTransferReport']['count'](_0x40542b)[_0xfd6f('0x27')](function(_0x5046c7){_0x200ce[_0xfd6f('0x20')]=_0x5046c7;if(_0x348a88[_0xfd6f('0x33')][_0xfd6f('0x42')]){_0x2587f9[_0xfd6f('0x43')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2587f9);})[_0xfd6f('0x27')](function(_0x2677b9){_0x200ce[_0xfd6f('0x44')]=_0x2677b9;return _0x200ce;})[_0xfd6f('0x27')](respondWithFilteredResult(_0x5e532e,_0x2587f9))[_0xfd6f('0x45')](handleError(_0x5e532e,null));};exports[_0xfd6f('0x46')]=function(_0x3eb2af,_0x2a89ec){var _0x2ed6b0={'raw':!![],'where':{'id':_0x3eb2af[_0xfd6f('0x47')]['id']}},_0x5122a0={};_0x5122a0[_0xfd6f('0x38')]=_['keys'](db['ChatTransferReport'][_0xfd6f('0x48')]);_0x5122a0['query']=_[_0xfd6f('0x34')](_0x3eb2af[_0xfd6f('0x33')]);_0x5122a0[_0xfd6f('0x35')]=_[_0xfd6f('0x36')](_0x5122a0[_0xfd6f('0x38')],_0x5122a0[_0xfd6f('0x33')]);_0x2ed6b0['attributes']=_['intersection'](_0x5122a0['model'],qs[_0xfd6f('0x39')](_0x3eb2af[_0xfd6f('0x33')][_0xfd6f('0x39')]));_0x2ed6b0[_0xfd6f('0x37')]=_0x2ed6b0[_0xfd6f('0x37')][_0xfd6f('0x3a')]?_0x2ed6b0['attributes']:_0x5122a0[_0xfd6f('0x38')];if(_0x3eb2af[_0xfd6f('0x33')][_0xfd6f('0x42')]){_0x2ed6b0[_0xfd6f('0x43')]=[{'all':!![]}];}_0x2ed6b0=_['merge']({},_0x2ed6b0,_0x3eb2af[_0xfd6f('0x41')]);return db[_0xfd6f('0x2f')][_0xfd6f('0x49')](_0x2ed6b0)['then'](handleEntityNotFound(_0x2a89ec,null))[_0xfd6f('0x27')](respondWithResult(_0x2a89ec,null))[_0xfd6f('0x45')](handleError(_0x2a89ec,null));};exports[_0xfd6f('0x4a')]=function(_0x1df252,_0x28ef06){return db[_0xfd6f('0x2f')][_0xfd6f('0x4a')](_0x1df252['body'],{})[_0xfd6f('0x27')](respondWithResult(_0x28ef06,0xc9))[_0xfd6f('0x45')](handleError(_0x28ef06,null));};exports[_0xfd6f('0x26')]=function(_0x4c0fcb,_0x288cb6){if(_0x4c0fcb[_0xfd6f('0x4b')]['id']){delete _0x4c0fcb[_0xfd6f('0x4b')]['id'];}return db[_0xfd6f('0x2f')][_0xfd6f('0x49')]({'where':{'id':_0x4c0fcb[_0xfd6f('0x47')]['id']}})[_0xfd6f('0x27')](handleEntityNotFound(_0x288cb6,null))[_0xfd6f('0x27')](saveUpdates(_0x4c0fcb[_0xfd6f('0x4b')],null))[_0xfd6f('0x27')](respondWithResult(_0x288cb6,null))[_0xfd6f('0x45')](handleError(_0x288cb6,null));};exports[_0xfd6f('0x28')]=function(_0x5d0328,_0x22fb78){return db[_0xfd6f('0x2f')][_0xfd6f('0x49')]({'where':{'id':_0x5d0328[_0xfd6f('0x47')]['id']}})[_0xfd6f('0x27')](handleEntityNotFound(_0x22fb78,null))[_0xfd6f('0x27')](removeEntity(_0x22fb78,null))[_0xfd6f('0x45')](handleError(_0x22fb78,null));};exports[_0xfd6f('0x4c')]=function(_0x2d3956,_0x394633){return db[_0xfd6f('0x2f')]['describe']()[_0xfd6f('0x27')](respondWithResult(_0x394633,null))[_0xfd6f('0x45')](handleError(_0x394633,null));};
\ No newline at end of file
+var _0x9c7c=['../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x119a2a,_0x52a94f){var _0x22d268=function(_0x40714c){while(--_0x40714c){_0x119a2a['push'](_0x119a2a['shift']());}};_0x22d268(++_0x52a94f);}(_0x9c7c,0x84));var _0xc9c7=function(_0x31378c,_0x19a853){_0x31378c=_0x31378c-0x0;var _0x11c9a6=_0x9c7c[_0x31378c];return _0x11c9a6;};'use strict';var emlformat=require(_0xc9c7('0x0'));var rimraf=require(_0xc9c7('0x1'));var zipdir=require(_0xc9c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9c7('0x3'));var moment=require('moment');var BPromise=require(_0xc9c7('0x4'));var Mustache=require(_0xc9c7('0x5'));var util=require(_0xc9c7('0x6'));var path=require(_0xc9c7('0x7'));var sox=require('sox');var csv=require(_0xc9c7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9c7('0x9'));var _=require(_0xc9c7('0xa'));var squel=require(_0xc9c7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc9c7('0xc'));var Papa=require(_0xc9c7('0xd'));var Redis=require(_0xc9c7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc9c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9c7('0x10'));var logger=require(_0xc9c7('0x11'))(_0xc9c7('0x12'));var utils=require(_0xc9c7('0x13'));var config=require(_0xc9c7('0x14'));var licenseUtil=require(_0xc9c7('0x15'));var db=require(_0xc9c7('0x16'))['db'];function respondWithStatusCode(_0x563c66,_0x2007eb){_0x2007eb=_0x2007eb||0xcc;return function(_0x1244af){if(_0x1244af){return _0x563c66['sendStatus'](_0x2007eb);}return _0x563c66[_0xc9c7('0x17')](_0x2007eb)['end']();};}function respondWithResult(_0x2420f2,_0x30142d){_0x30142d=_0x30142d||0xc8;return function(_0x371c12){if(_0x371c12){return _0x2420f2[_0xc9c7('0x17')](_0x30142d)[_0xc9c7('0x18')](_0x371c12);}};}function respondWithFilteredResult(_0xbab1d1,_0x4ea191){return function(_0x4d5a79){if(_0x4d5a79){var _0x2b3244=typeof _0x4ea191[_0xc9c7('0x19')]==='undefined'&&typeof _0x4ea191[_0xc9c7('0x1a')]===_0xc9c7('0x1b');var _0xf295cc=_0x4d5a79[_0xc9c7('0x1c')];var _0x3e1966=_0x2b3244?0x0:_0x4ea191[_0xc9c7('0x19')];var _0x526965=_0x2b3244?_0x4d5a79[_0xc9c7('0x1c')]:_0x4ea191[_0xc9c7('0x19')]+_0x4ea191[_0xc9c7('0x1a')];var _0x61f871;if(_0x526965>=_0xf295cc){_0x526965=_0xf295cc;_0x61f871=0xc8;}else{_0x61f871=0xce;}_0xbab1d1[_0xc9c7('0x17')](_0x61f871);return _0xbab1d1[_0xc9c7('0x1d')](_0xc9c7('0x1e'),_0x3e1966+'-'+_0x526965+'/'+_0xf295cc)[_0xc9c7('0x18')](_0x4d5a79);}return null;};}function patchUpdates(_0x92912e){return function(_0x2c2c74){try{jsonpatch[_0xc9c7('0x1f')](_0x2c2c74,_0x92912e,!![]);}catch(_0x2b08a8){return BPromise[_0xc9c7('0x20')](_0x2b08a8);}return _0x2c2c74[_0xc9c7('0x21')]();};}function saveUpdates(_0x47bbb4,_0x50d5a0){return function(_0x56ca34){if(_0x56ca34){return _0x56ca34[_0xc9c7('0x22')](_0x47bbb4)[_0xc9c7('0x23')](function(_0x596dc6){return _0x596dc6;});}return null;};}function removeEntity(_0x4deec1,_0x22e623){return function(_0x53659c){if(_0x53659c){return _0x53659c[_0xc9c7('0x24')]()['then'](function(){_0x4deec1[_0xc9c7('0x17')](0xcc)[_0xc9c7('0x25')]();});}};}function handleEntityNotFound(_0x168051,_0x10f202){return function(_0x1fa7af){if(!_0x1fa7af){_0x168051[_0xc9c7('0x26')](0x194);}return _0x1fa7af;};}function handleError(_0x2e897d,_0x174cb3){_0x174cb3=_0x174cb3||0x1f4;return function(_0x278987){logger['error'](_0x278987[_0xc9c7('0x27')]);if(_0x278987['name']){delete _0x278987['name'];}_0x2e897d[_0xc9c7('0x17')](_0x174cb3)['send'](_0x278987);};}exports[_0xc9c7('0x28')]=function(_0x3dfb7e,_0x5a6335){var _0x32dc9b={},_0x1389de={},_0x57fd30={'count':0x0,'rows':[]};var _0x3c3893=_[_0xc9c7('0x29')](db[_0xc9c7('0x2a')][_0xc9c7('0x2b')],function(_0x391120){return{'name':_0x391120[_0xc9c7('0x2c')],'type':_0x391120[_0xc9c7('0x2d')][_0xc9c7('0x2e')]};});_0x1389de[_0xc9c7('0x2f')]=_[_0xc9c7('0x29')](_0x3c3893,_0xc9c7('0x30'));_0x1389de[_0xc9c7('0x31')]=_['keys'](_0x3dfb7e['query']);_0x1389de[_0xc9c7('0x32')]=_[_0xc9c7('0x33')](_0x1389de[_0xc9c7('0x2f')],_0x1389de[_0xc9c7('0x31')]);_0x32dc9b[_0xc9c7('0x34')]=_[_0xc9c7('0x33')](_0x1389de[_0xc9c7('0x2f')],qs[_0xc9c7('0x35')](_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x35')]));_0x32dc9b['attributes']=_0x32dc9b[_0xc9c7('0x34')][_0xc9c7('0x36')]?_0x32dc9b[_0xc9c7('0x34')]:_0x1389de[_0xc9c7('0x2f')];if(!_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x37')](_0xc9c7('0x38'))){_0x32dc9b[_0xc9c7('0x1a')]=qs['limit'](_0x3dfb7e['query'][_0xc9c7('0x1a')]);_0x32dc9b[_0xc9c7('0x19')]=qs[_0xc9c7('0x19')](_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x19')]);}_0x32dc9b[_0xc9c7('0x39')]=qs[_0xc9c7('0x3a')](_0x3dfb7e[_0xc9c7('0x31')]['sort']);_0x32dc9b[_0xc9c7('0x3b')]=qs[_0xc9c7('0x32')](_[_0xc9c7('0x3c')](_0x3dfb7e[_0xc9c7('0x31')],_0x1389de[_0xc9c7('0x32')]),_0x3c3893);if(_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x3d')]){_0x32dc9b['where']=_[_0xc9c7('0x3e')](_0x32dc9b[_0xc9c7('0x3b')],{'$or':_['map'](_0x3c3893,function(_0x151c7d){if(_0x151c7d[_0xc9c7('0x2d')]!==_0xc9c7('0x3f')){var _0x1e85f2={};_0x1e85f2[_0x151c7d[_0xc9c7('0x30')]]={'$like':'%'+_0x3dfb7e[_0xc9c7('0x31')]['filter']+'%'};return _0x1e85f2;}})});}_0x32dc9b=_['merge']({},_0x32dc9b,_0x3dfb7e[_0xc9c7('0x40')]);var _0x1d6d27={'where':_0x32dc9b[_0xc9c7('0x3b')]};return db[_0xc9c7('0x2a')][_0xc9c7('0x1c')](_0x1d6d27)[_0xc9c7('0x23')](function(_0x275afb){_0x57fd30[_0xc9c7('0x1c')]=_0x275afb;if(_0x3dfb7e[_0xc9c7('0x31')][_0xc9c7('0x41')]){_0x32dc9b[_0xc9c7('0x42')]=[{'all':!![]}];}return db[_0xc9c7('0x2a')][_0xc9c7('0x43')](_0x32dc9b);})[_0xc9c7('0x23')](function(_0x4a09b3){_0x57fd30[_0xc9c7('0x44')]=_0x4a09b3;return _0x57fd30;})[_0xc9c7('0x23')](respondWithFilteredResult(_0x5a6335,_0x32dc9b))['catch'](handleError(_0x5a6335,null));};exports['show']=function(_0x467cb2,_0x1c2dc8){var _0x468b83={'raw':!![],'where':{'id':_0x467cb2[_0xc9c7('0x45')]['id']}},_0x26671a={};_0x26671a[_0xc9c7('0x2f')]=_[_0xc9c7('0x46')](db[_0xc9c7('0x2a')][_0xc9c7('0x2b')]);_0x26671a[_0xc9c7('0x31')]=_[_0xc9c7('0x46')](_0x467cb2[_0xc9c7('0x31')]);_0x26671a['filters']=_[_0xc9c7('0x33')](_0x26671a[_0xc9c7('0x2f')],_0x26671a['query']);_0x468b83['attributes']=_[_0xc9c7('0x33')](_0x26671a['model'],qs[_0xc9c7('0x35')](_0x467cb2[_0xc9c7('0x31')]['fields']));_0x468b83[_0xc9c7('0x34')]=_0x468b83[_0xc9c7('0x34')][_0xc9c7('0x36')]?_0x468b83[_0xc9c7('0x34')]:_0x26671a[_0xc9c7('0x2f')];if(_0x467cb2[_0xc9c7('0x31')]['includeAll']){_0x468b83[_0xc9c7('0x42')]=[{'all':!![]}];}_0x468b83=_[_0xc9c7('0x3e')]({},_0x468b83,_0x467cb2[_0xc9c7('0x40')]);return db['ChatTransferReport'][_0xc9c7('0x47')](_0x468b83)[_0xc9c7('0x23')](handleEntityNotFound(_0x1c2dc8,null))[_0xc9c7('0x23')](respondWithResult(_0x1c2dc8,null))['catch'](handleError(_0x1c2dc8,null));};exports[_0xc9c7('0x48')]=function(_0x3bf36a,_0x6b75b){return db[_0xc9c7('0x2a')][_0xc9c7('0x48')](_0x3bf36a[_0xc9c7('0x49')],{})['then'](respondWithResult(_0x6b75b,0xc9))[_0xc9c7('0x4a')](handleError(_0x6b75b,null));};exports[_0xc9c7('0x22')]=function(_0x54c9a8,_0x295507){if(_0x54c9a8[_0xc9c7('0x49')]['id']){delete _0x54c9a8[_0xc9c7('0x49')]['id'];}return db[_0xc9c7('0x2a')]['find']({'where':{'id':_0x54c9a8[_0xc9c7('0x45')]['id']}})[_0xc9c7('0x23')](handleEntityNotFound(_0x295507,null))[_0xc9c7('0x23')](saveUpdates(_0x54c9a8[_0xc9c7('0x49')],null))[_0xc9c7('0x23')](respondWithResult(_0x295507,null))[_0xc9c7('0x4a')](handleError(_0x295507,null));};exports[_0xc9c7('0x24')]=function(_0x23153a,_0x122348){return db[_0xc9c7('0x2a')][_0xc9c7('0x47')]({'where':{'id':_0x23153a['params']['id']}})['then'](handleEntityNotFound(_0x122348,null))['then'](removeEntity(_0x122348,null))['catch'](handleError(_0x122348,null));};exports[_0xc9c7('0x4b')]=function(_0x6f1cd8,_0x333c2b){return db['ChatTransferReport'][_0xc9c7('0x4b')]()['then'](respondWithResult(_0x333c2b,null))[_0xc9c7('0x4a')](handleError(_0x333c2b,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 85482b2..433fc6e 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 _0x8d74=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x11ac40,_0x375c63){var _0x45b544=function(_0x1e41c2){while(--_0x1e41c2){_0x11ac40['push'](_0x11ac40['shift']());}};_0x45b544(++_0x375c63);}(_0x8d74,0x152));var _0x48d7=function(_0x34b63b,_0x3601e0){_0x34b63b=_0x34b63b-0x0;var _0x3fc0b9=_0x8d74[_0x34b63b];return _0x3fc0b9;};'use strict';var _=require(_0x48d7('0x0'));var util=require(_0x48d7('0x1'));var logger=require(_0x48d7('0x2'))(_0x48d7('0x3'));var moment=require(_0x48d7('0x4'));var BPromise=require(_0x48d7('0x5'));var rp=require(_0x48d7('0x6'));var fs=require('fs');var path=require(_0x48d7('0x7'));var rimraf=require(_0x48d7('0x8'));var config=require(_0x48d7('0x9'));var attributes=require(_0x48d7('0xa'));module[_0x48d7('0xb')]=function(_0x5af388,_0x3ee7d6){return _0x5af388[_0x48d7('0xc')](_0x48d7('0xd'),attributes,{'tableName':_0x48d7('0xe'),'paranoid':![],'indexes':[{'name':_0x48d7('0xf'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e8d=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0x9e8d,0x103));var _0xd9e8=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x9e8d[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xd9e8('0x0'));var util=require(_0xd9e8('0x1'));var logger=require(_0xd9e8('0x2'))(_0xd9e8('0x3'));var moment=require(_0xd9e8('0x4'));var BPromise=require(_0xd9e8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9e8('0x6'));var rimraf=require(_0xd9e8('0x7'));var config=require(_0xd9e8('0x8'));var attributes=require(_0xd9e8('0x9'));module[_0xd9e8('0xa')]=function(_0x2467ce,_0x587b5c){return _0x2467ce[_0xd9e8('0xb')](_0xd9e8('0xc'),attributes,{'tableName':_0xd9e8('0xd'),'paranoid':![],'indexes':[{'name':_0xd9e8('0xe'),'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 43c57d8..cda7073 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 _0xa9ff=['jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x52af14,_0x450fa2){var _0x5068b0=function(_0x18a797){while(--_0x18a797){_0x52af14['push'](_0x52af14['shift']());}};_0x5068b0(++_0x450fa2);}(_0xa9ff,0x1f2));var _0xfa9f=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0xa9ff[_0x46a38b];return _0x346e75;};'use strict';var _=require(_0xfa9f('0x0'));var util=require(_0xfa9f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa9f('0x2'));var fs=require('fs');var Redis=require(_0xfa9f('0x3'));var db=require(_0xfa9f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfa9f('0x5'));var config=require('../../config/environment');var jayson=require(_0xfa9f('0x6'));var client=jayson[_0xfa9f('0x7')][_0xfa9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b5c3b,_0x42c426,_0x48cdc7){return new BPromise(function(_0x2ceefa,_0xdc8fb4){return client[_0xfa9f('0x9')](_0x2b5c3b,_0x48cdc7)[_0xfa9f('0xa')](function(_0x32d9fe){logger[_0xfa9f('0xb')](_0xfa9f('0xc'),_0x42c426,_0xfa9f('0xd'));logger[_0xfa9f('0xe')](_0xfa9f('0xf'),_0x42c426,'request\x20sent',JSON[_0xfa9f('0x10')](_0x32d9fe));if(_0x32d9fe['error']){if(_0x32d9fe['error'][_0xfa9f('0x11')]===0x1f4){logger[_0xfa9f('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x42c426,_0x32d9fe['error'][_0xfa9f('0x13')]);return _0xdc8fb4(_0x32d9fe[_0xfa9f('0x12')][_0xfa9f('0x13')]);}logger[_0xfa9f('0x12')](_0xfa9f('0xc'),_0x42c426,_0x32d9fe['error'][_0xfa9f('0x13')]);return _0x2ceefa(_0x32d9fe[_0xfa9f('0x12')][_0xfa9f('0x13')]);}else{logger[_0xfa9f('0xb')](_0xfa9f('0xc'),_0x42c426,'request\x20sent');_0x2ceefa(_0x32d9fe[_0xfa9f('0x14')][_0xfa9f('0x13')]);}})['catch'](function(_0x432c62){logger['error'](_0xfa9f('0xc'),_0x42c426,_0x432c62);_0xdc8fb4(_0x432c62);});});}
\ No newline at end of file
+var _0x8460=['request\x20sent','debug','error','message','ChatTransferReport,\x20%s,\x20%s','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x59e023,_0x4af4bf){var _0x4f561b=function(_0x11053b){while(--_0x11053b){_0x59e023['push'](_0x59e023['shift']());}};_0x4f561b(++_0x4af4bf);}(_0x8460,0x1da));var _0x0846=function(_0x5a1e40,_0x172118){_0x5a1e40=_0x5a1e40-0x0;var _0x494eec=_0x8460[_0x5a1e40];return _0x494eec;};'use strict';var _=require(_0x0846('0x0'));var util=require(_0x0846('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0846('0x2'));var fs=require('fs');var Redis=require(_0x0846('0x3'));var db=require(_0x0846('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0846('0x5'));var config=require(_0x0846('0x6'));var jayson=require(_0x0846('0x7'));var client=jayson[_0x0846('0x8')][_0x0846('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ab178,_0x208dd0,_0x194509){return new BPromise(function(_0x4f8c19,_0x4c3cf4){return client[_0x0846('0xa')](_0x4ab178,_0x194509)['then'](function(_0x134140){logger[_0x0846('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x208dd0,_0x0846('0xc'));logger[_0x0846('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x208dd0,'request\x20sent',JSON['stringify'](_0x134140));if(_0x134140[_0x0846('0xe')]){if(_0x134140[_0x0846('0xe')]['code']===0x1f4){logger[_0x0846('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x208dd0,_0x134140[_0x0846('0xe')][_0x0846('0xf')]);return _0x4c3cf4(_0x134140[_0x0846('0xe')][_0x0846('0xf')]);}logger[_0x0846('0xe')](_0x0846('0x10'),_0x208dd0,_0x134140[_0x0846('0xe')][_0x0846('0xf')]);return _0x4f8c19(_0x134140['error'][_0x0846('0xf')]);}else{logger[_0x0846('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x208dd0,_0x0846('0xc'));_0x4f8c19(_0x134140[_0x0846('0x11')][_0x0846('0xf')]);}})['catch'](function(_0x160404){logger[_0x0846('0xe')](_0x0846('0x10'),_0x208dd0,_0x160404);_0x4c3cf4(_0x160404);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 4d50dff..337eb1e 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 _0x038e=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','util','path'];(function(_0x1559ca,_0x3242fc){var _0x603f00=function(_0x3134cc){while(--_0x3134cc){_0x1559ca['push'](_0x1559ca['shift']());}};_0x603f00(++_0x3242fc);}(_0x038e,0x1ce));var _0xe038=function(_0x38ae35,_0x16c078){_0x38ae35=_0x38ae35-0x0;var _0x4b3e8f=_0x038e[_0x38ae35];return _0x4b3e8f;};'use strict';var multer=require('multer');var util=require(_0xe038('0x0'));var path=require(_0xe038('0x1'));var timeout=require('connect-timeout');var express=require(_0xe038('0x2'));var router=express[_0xe038('0x3')]();var fs_extra=require(_0xe038('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe038('0x5'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xe038('0x6')]('/',auth[_0xe038('0x7')](),controller[_0xe038('0x8')]);router['get'](_0xe038('0x9'),auth[_0xe038('0x7')](),controller[_0xe038('0xa')]);router[_0xe038('0x6')](_0xe038('0xb'),auth[_0xe038('0x7')](),controller[_0xe038('0xc')]);router[_0xe038('0xd')]('/',auth[_0xe038('0x7')](),controller['create']);router[_0xe038('0xe')](_0xe038('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe038('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xea3c=['/describe','describe','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index'];(function(_0x560623,_0x5c748a){var _0x2a9089=function(_0x565d41){while(--_0x565d41){_0x560623['push'](_0x560623['shift']());}};_0x2a9089(++_0x5c748a);}(_0xea3c,0x1ad));var _0xcea3=function(_0x319493,_0x7b9841){_0x319493=_0x319493-0x0;var _0x12e05a=_0xea3c[_0x319493];return _0x12e05a;};'use strict';var multer=require(_0xcea3('0x0'));var util=require(_0xcea3('0x1'));var path=require(_0xcea3('0x2'));var timeout=require(_0xcea3('0x3'));var express=require(_0xcea3('0x4'));var router=express[_0xcea3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcea3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcea3('0x7'));var controller=require(_0xcea3('0x8'));router[_0xcea3('0x9')]('/',auth['isAuthenticated'](),controller[_0xcea3('0xa')]);router['get'](_0xcea3('0xb'),auth['isAuthenticated'](),controller[_0xcea3('0xc')]);router[_0xcea3('0x9')](_0xcea3('0xd'),auth['isAuthenticated'](),controller[_0xcea3('0xe')]);router[_0xcea3('0xf')]('/',auth[_0xcea3('0x10')](),controller[_0xcea3('0x11')]);router[_0xcea3('0x12')](_0xcea3('0xd'),auth[_0xcea3('0x10')](),controller[_0xcea3('0x13')]);router[_0xcea3('0x14')](_0xcea3('0xd'),auth[_0xcea3('0x10')](),controller['destroy']);module[_0xcea3('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 5a609a8..9a80fd8 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 _0x2745=['TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','INTEGER','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','CHAT','System','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us'];(function(_0x243b84,_0x57739f){var _0x57ee61=function(_0x28db02){while(--_0x28db02){_0x243b84['push'](_0x243b84['shift']());}};_0x57ee61(++_0x57739f);}(_0x2745,0x13a));var _0x5274=function(_0x59d25d,_0x56affa){_0x59d25d=_0x59d25d-0x0;var _0x2f9508=_0x2745[_0x59d25d];return _0x2f9508;};'use strict';var Sequelize=require(_0x5274('0x0'));var rs=require(_0x5274('0x1'));module[_0x5274('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'unique':_0x5274('0x4')},'description':{'type':Sequelize[_0x5274('0x3')]},'mapKey':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x5')},'key':{'type':Sequelize[_0x5274('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x6')},'customerAlias':{'type':Sequelize[_0x5274('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':_0x5274('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':_0x5274('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5274('0x3')]},'animation':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5274('0x9')](_0x5274('0xa'),_0x5274('0xb')),'defaultValue':_0x5274('0xa')},'header_online':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0xc')},'start_chat_button':{'type':Sequelize[_0x5274('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0xe')},'download_transcript':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5274('0xf')]},'closingQuestion':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x5274('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x13')},'closingMessage':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0xd')},'skipMessageButton':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x16')},'ratingType':{'type':Sequelize[_0x5274('0x9')]('star','thumb'),'defaultValue':_0x5274('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x5274('0x18')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5274('0xf')],'defaultValue':function(){return JSON[_0x5274('0x19')]({'items':[{'type':_0x5274('0x1a'),'variable':null,'config':{'placeholder':_0x5274('0x1b'),'type':_0x5274('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x5274('0x1a'),'props':{'title':_0x5274('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5274('0x5'),'type':_0x5274('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5274('0x1d')](_0x5274('0x1e'))?JSON[_0x5274('0x1f')](this[_0x5274('0x1d')](_0x5274('0x1e'))):{};},'set':function(_0x3577ea){return this['setDataValue'](_0x5274('0x1e'),JSON[_0x5274('0x19')](_0x3577ea));}},'offlineForm':{'type':Sequelize[_0x5274('0xf')],'defaultValue':function(){return JSON[_0x5274('0x19')]({'items':[{'type':_0x5274('0x1a'),'props':{'title':_0x5274('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5274('0x5'),'type':_0x5274('0x5')},'variable':null},{'type':_0x5274('0x20'),'config':{'placeholder':_0x5274('0x21')},'props':{'title':_0x5274('0x21'),'helpText':_0x5274('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x5274('0x1d')](_0x5274('0x23'))?JSON[_0x5274('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x5dd222){return this[_0x5274('0x24')](_0x5274('0x23'),JSON[_0x5274('0x19')](_0x5dd222));}},'token':{'type':Sequelize[_0x5274('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5274('0x3')]},'forwardOffline':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5274('0x3')]},'waitingTitle':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x26')},'offlineMessageBody':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5274('0x15')},'sendUnmanaged':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5274('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5274('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x5274('0x18')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x2a')},'messagesAlignment':{'type':Sequelize[_0x5274('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x5274('0x3')]},'customerAvatar':{'type':Sequelize[_0x5274('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5274('0x18')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5274('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5274('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5274('0x3')],'defaultValue':_0x5274('0x2b')},'systemAvatar':{'type':Sequelize[_0x5274('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d9b49){if(!_0x2d9b49)this['setDataValue'](_0x5274('0x2c'),null);this[_0x5274('0x24')](_0x5274('0x2d'),_0x2d9b49);}},'vidaooEscalation':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5274('0x3')]},'vidaooTopic':{'type':Sequelize[_0x5274('0x3')],'allowNull':![],'defaultValue':_0x5274('0x2e')},'vidaooNote':{'type':Sequelize[_0x5274('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x5274('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5274('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5274('0xf')]}};
\ No newline at end of file
+var _0xb7de=['stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','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:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','INTEGER'];(function(_0xe3d5cb,_0x16d4c5){var _0x4f60f1=function(_0x641e89){while(--_0x641e89){_0xe3d5cb['push'](_0xe3d5cb['shift']());}};_0x4f60f1(++_0x16d4c5);}(_0xb7de,0x70));var _0xeb7d=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xb7de[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0xeb7d('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xeb7d('0x1')],'allowNull':![],'unique':_0xeb7d('0x2')},'description':{'type':Sequelize[_0xeb7d('0x1')]},'mapKey':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x3')},'mapKeyOffline':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x3')},'key':{'type':Sequelize[_0xeb7d('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x4')},'customerAlias':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xeb7d('0x1')],'allowNull':![],'defaultValue':_0xeb7d('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeb7d('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xeb7d('0x1')]},'animation':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xeb7d('0x8')]('rounded',_0xeb7d('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xa')},'header_offline':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xb')},'download_transcript':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xeb7d('0xd')]},'closingQuestion':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xe')},'noteTitle':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeb7d('0xf')},'closingMessageButton':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x10')},'conditionAgreement':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0xeb7d('0x11'),_0xeb7d('0x12')),'defaultValue':_0xeb7d('0x11')},'ratingStarsNumber':{'type':Sequelize[_0xeb7d('0x13')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xeb7d('0xd')],'defaultValue':function(){return JSON[_0xeb7d('0x14')]({'items':[{'type':_0xeb7d('0x15'),'variable':null,'config':{'placeholder':_0xeb7d('0x16'),'type':_0xeb7d('0x17'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xeb7d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xeb7d('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xeb7d('0x18')](_0xeb7d('0x19'))?JSON[_0xeb7d('0x1a')](this[_0xeb7d('0x18')](_0xeb7d('0x19'))):{};},'set':function(_0x127e47){return this[_0xeb7d('0x1b')](_0xeb7d('0x19'),JSON['stringify'](_0x127e47));}},'offlineForm':{'type':Sequelize[_0xeb7d('0xd')],'defaultValue':function(){return JSON[_0xeb7d('0x14')]({'items':[{'type':_0xeb7d('0x15'),'props':{'title':_0xeb7d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xeb7d('0x3'),'type':_0xeb7d('0x3')},'variable':null},{'type':_0xeb7d('0x1c'),'config':{'placeholder':_0xeb7d('0x1d')},'props':{'title':_0xeb7d('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xeb7d('0x18')](_0xeb7d('0x1e'))?JSON[_0xeb7d('0x1a')](this['getDataValue'](_0xeb7d('0x1e'))):{};},'set':function(_0x1a4163){return this['setDataValue'](_0xeb7d('0x1e'),JSON[_0xeb7d('0x14')](_0x1a4163));}},'token':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xeb7d('0x1')]},'forwardOffline':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xeb7d('0x1')]},'waitingTitle':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x1f')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xeb7d('0x20')},'offlineMessageBody':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x22')},'skipUnmanaged':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xeb7d('0xd')]},'showAgentAvatar':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xeb7d('0xd')],'defaultValue':function(){return _0xeb7d('0x23');}},'notificationSound':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x24')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x25')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xeb7d('0x13')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xeb7d('0x1')],'allowNull':![],'defaultValue':_0xeb7d('0x26'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeb7d('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeb7d('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':_0xeb7d('0x27')},'systemAvatar':{'type':Sequelize[_0xeb7d('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeb7d('0x13')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![],'comment':_0xeb7d('0x28'),'set':function(_0x39bee7){if(!_0x39bee7)this[_0xeb7d('0x1b')](_0xeb7d('0x29'),null);this[_0xeb7d('0x1b')](_0xeb7d('0x2a'),_0x39bee7);}},'vidaooEscalation':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xeb7d('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xeb7d('0x1')],'defaultValue':function(){return _0xeb7d('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0xeb7d('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xeb7d('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xeb7d('0xd')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index a66ae81..73ad0ec 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 _0x00b8=['ids','addAnswer','getAnswers','CannedAnswer','options','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','notify','offline','files','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','Owner','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','readFileSync','remote','x-real-ip','remoteAddress','replace','labelText','color_button','backgroundColor','IntervalId','addApplications','transaction','Transaction','READ_COMMITTED','findAndCountAll','getApplications','chatProactiveAction','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','stack','name','send','Pause','ChatWebsite','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','rows','catch','params','mandatoryDispositionPause','keys','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','describe','addDisposition','ChatWebsiteId','Disposition','findOne','findAll','removeDispositions'];(function(_0x2c3b7f,_0x4e448a){var _0x22d6b6=function(_0x179b98){while(--_0x179b98){_0x2c3b7f['push'](_0x2c3b7f['shift']());}};_0x22d6b6(++_0x4e448a);}(_0x00b8,0x1e0));var _0x800b=function(_0x16a25e,_0x500f8c){_0x16a25e=_0x16a25e-0x0;var _0x342478=_0x00b8[_0x16a25e];return _0x342478;};'use strict';var BPromise=require(_0x800b('0x0'));var Mustache=require(_0x800b('0x1'));var util=require(_0x800b('0x2'));var path=require(_0x800b('0x3'));var ejs=require(_0x800b('0x4'));var fs=require('fs');var fs_extra=require(_0x800b('0x5'));var _=require('lodash');var querystring=require(_0x800b('0x6'));var Redis=require('ioredis');var qs=require(_0x800b('0x7'));var logger=require(_0x800b('0x8'))(_0x800b('0x9'));var config=require(_0x800b('0xa'));var db=require(_0x800b('0xb'))['db'];config[_0x800b('0xc')]=_[_0x800b('0xd')](config[_0x800b('0xc')],{'host':_0x800b('0xe'),'port':0x18eb});var socket=require(_0x800b('0xf'))(new Redis(config[_0x800b('0xc')]));require(_0x800b('0x10'))[_0x800b('0x11')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x800b('0x12'));var client=jayson[_0x800b('0x13')][_0x800b('0x14')]({'port':0x232c});var client9002=jayson[_0x800b('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x800b('0x13')][_0x800b('0x14')]({'port':0x232b});var client9001=jayson[_0x800b('0x13')][_0x800b('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x355ed8,_0x471316,_0x363ec0,_0x1512e8){return new BPromise(function(_0x1d7520,_0x1e6964){var _0x149764=_0x1512e8||client;return _0x149764[_0x800b('0x15')](_0x355ed8,_0x363ec0)[_0x800b('0x16')](function(_0x1c4546){logger[_0x800b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x471316,_0x800b('0x18'));logger[_0x800b('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x471316,_0x800b('0x18'),JSON[_0x800b('0x1a')](_0x1c4546));if(_0x1c4546[_0x800b('0x1b')]){if(_0x1c4546[_0x800b('0x1b')][_0x800b('0x1c')]===0x1f4){logger[_0x800b('0x1b')](_0x800b('0x1d'),_0x471316,_0x1c4546['error'][_0x800b('0x1e')]);return _0x1e6964(_0x1c4546[_0x800b('0x1b')]['message']);}logger[_0x800b('0x1b')](_0x800b('0x1d'),_0x471316,_0x1c4546[_0x800b('0x1b')][_0x800b('0x1e')]);return _0x1d7520(_0x1c4546['error'][_0x800b('0x1e')]);}else{logger[_0x800b('0x17')](_0x800b('0x1d'),_0x471316,_0x800b('0x18'));_0x1d7520(_0x1c4546['result']['message']);}})['catch'](function(_0x78dbff){logger[_0x800b('0x1b')](_0x800b('0x1d'),_0x471316,_0x78dbff);_0x1e6964(_0x78dbff);});});}function respondWithStatusCode(_0x4611e5,_0x1d1bd7){_0x1d1bd7=_0x1d1bd7||0xcc;return function(_0x279dd9){if(_0x279dd9){return _0x4611e5[_0x800b('0x1f')](_0x1d1bd7);}return _0x4611e5[_0x800b('0x20')](_0x1d1bd7)[_0x800b('0x21')]();};}function respondWithResult(_0xcde909,_0x2713f4){_0x2713f4=_0x2713f4||0xc8;return function(_0x252c96){if(_0x252c96){return _0xcde909['status'](_0x2713f4)[_0x800b('0x22')](_0x252c96);}};}function respondWithFilteredResult(_0x52d4cd,_0x1aa519){return function(_0x59ea97){if(_0x59ea97){var _0xa0e7e5=typeof _0x1aa519[_0x800b('0x23')]===_0x800b('0x24')&&typeof _0x1aa519['limit']===_0x800b('0x24');var _0x3fa609=_0x59ea97[_0x800b('0x25')];var _0x26e23b=_0xa0e7e5?0x0:_0x1aa519[_0x800b('0x23')];var _0x447b2e=_0xa0e7e5?_0x59ea97[_0x800b('0x25')]:_0x1aa519['offset']+_0x1aa519['limit'];var _0x5dcd20;if(_0x447b2e>=_0x3fa609){_0x447b2e=_0x3fa609;_0x5dcd20=0xc8;}else{_0x5dcd20=0xce;}_0x52d4cd['status'](_0x5dcd20);return _0x52d4cd[_0x800b('0x26')](_0x800b('0x27'),_0x26e23b+'-'+_0x447b2e+'/'+_0x3fa609)['json'](_0x59ea97);}return null;};}function saveUpdates(_0x5d560a){return function(_0x3e3d8e){if(_0x3e3d8e){return _0x3e3d8e[_0x800b('0x28')](_0x5d560a)[_0x800b('0x16')](function(_0x1cad56){return _0x1cad56;});}return null;};}function removeEntity(_0x1a57bd){return function(_0x1072c2){if(_0x1072c2){return _0x1072c2[_0x800b('0x29')]()['then'](function(){var _0x43d0f9=_0x1072c2[_0x800b('0x2a')]({'plain':!![]});var _0x5dd92e=_0x800b('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x5dd92e,'resourceId':_0x43d0f9['id']}})[_0x800b('0x16')](function(){return _0x1072c2;});})[_0x800b('0x16')](function(){_0x1a57bd[_0x800b('0x20')](0xcc)[_0x800b('0x21')]();});}};}function handleEntityNotFound(_0x2c72d0){return function(_0x5445c1){if(!_0x5445c1){_0x2c72d0[_0x800b('0x1f')](0x194);}return _0x5445c1;};}function handleError(_0x2afe8c,_0x408d9a){_0x408d9a=_0x408d9a||0x1f4;return function(_0x238108){logger[_0x800b('0x1b')](_0x238108[_0x800b('0x2c')]);if(_0x238108[_0x800b('0x2d')]){delete _0x238108[_0x800b('0x2d')];}_0x2afe8c[_0x800b('0x20')](_0x408d9a)[_0x800b('0x2e')](_0x238108);};}exports['index']=function(_0x48d20b,_0x55dc33){var _0x3e24a4={'include':[{'model':db[_0x800b('0x2f')],'as':'mandatoryDispositionPause'}]},_0x357fa={},_0x94f0eb={'count':0x0,'rows':[]};var _0xf462d3=_['map'](db[_0x800b('0x30')][_0x800b('0x31')],function(_0x780563){return{'name':_0x780563[_0x800b('0x32')],'type':_0x780563['type'][_0x800b('0x33')]};});_0x357fa[_0x800b('0x34')]=_['map'](_0xf462d3,_0x800b('0x2d'));_0x357fa[_0x800b('0x35')]=_['keys'](_0x48d20b[_0x800b('0x35')]);_0x357fa[_0x800b('0x36')]=_[_0x800b('0x37')](_0x357fa[_0x800b('0x34')],_0x357fa[_0x800b('0x35')]);_0x3e24a4['attributes']=_[_0x800b('0x37')](_0x357fa[_0x800b('0x34')],qs[_0x800b('0x38')](_0x48d20b[_0x800b('0x35')]['fields']));_0x3e24a4[_0x800b('0x39')]=_0x3e24a4[_0x800b('0x39')][_0x800b('0x3a')]?_0x3e24a4['attributes']:_0x357fa[_0x800b('0x34')];if(!_0x48d20b[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x3e24a4[_0x800b('0x3d')]=qs[_0x800b('0x3d')](_0x48d20b['query'][_0x800b('0x3d')]);_0x3e24a4['offset']=qs['offset'](_0x48d20b[_0x800b('0x35')][_0x800b('0x23')]);}_0x3e24a4[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x48d20b[_0x800b('0x35')][_0x800b('0x3f')]);_0x3e24a4[_0x800b('0x40')]=qs['filters'](_[_0x800b('0x41')](_0x48d20b[_0x800b('0x35')],_0x357fa[_0x800b('0x36')]),_0xf462d3);if(_0x48d20b[_0x800b('0x35')][_0x800b('0x42')]){_0x3e24a4[_0x800b('0x40')]=_[_0x800b('0x43')](_0x3e24a4[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0xf462d3,function(_0x410599){if(_0x410599[_0x800b('0x45')]!==_0x800b('0x46')){var _0x4e7db2={};_0x4e7db2[_0x410599[_0x800b('0x2d')]]={'$like':'%'+_0x48d20b[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x4e7db2;}})});}_0x3e24a4=_['merge']({},_0x3e24a4,_0x48d20b['options']);var _0x24cd57={'where':_0x3e24a4[_0x800b('0x40')]};return db['ChatWebsite'][_0x800b('0x25')](_0x24cd57)[_0x800b('0x16')](function(_0x5c2f40){_0x94f0eb[_0x800b('0x25')]=_0x5c2f40;if(_0x48d20b[_0x800b('0x35')]['includeAll']){_0x3e24a4['include']=[{'all':!![]}];}return db[_0x800b('0x30')]['findAll'](_0x3e24a4);})['then'](function(_0x2482a4){_0x94f0eb[_0x800b('0x47')]=_0x2482a4;return _0x94f0eb;})[_0x800b('0x16')](respondWithFilteredResult(_0x55dc33,_0x3e24a4))[_0x800b('0x48')](handleError(_0x55dc33,null));};exports['show']=function(_0x5b89d9,_0x3837fc){var _0x2b799f={'raw':![],'where':{'id':_0x5b89d9[_0x800b('0x49')]['id']},'include':[{'model':db[_0x800b('0x2f')],'as':_0x800b('0x4a')}]},_0x314d45={};_0x314d45[_0x800b('0x34')]=_[_0x800b('0x4b')](db['ChatWebsite']['rawAttributes']);_0x314d45['query']=_['keys'](_0x5b89d9['query']);_0x314d45[_0x800b('0x36')]=_[_0x800b('0x37')](_0x314d45[_0x800b('0x34')],_0x314d45[_0x800b('0x35')]);_0x2b799f[_0x800b('0x39')]=_[_0x800b('0x37')](_0x314d45[_0x800b('0x34')],qs[_0x800b('0x38')](_0x5b89d9[_0x800b('0x35')][_0x800b('0x38')]));_0x2b799f['attributes']=_0x2b799f[_0x800b('0x39')][_0x800b('0x3a')]?_0x2b799f[_0x800b('0x39')]:_0x314d45['model'];if(_0x5b89d9[_0x800b('0x35')][_0x800b('0x4c')]){_0x2b799f[_0x800b('0x4d')]=[{'all':!![]}];}_0x2b799f=_[_0x800b('0x43')]({},_0x2b799f,_0x5b89d9['options']);return db['ChatWebsite']['find'](_0x2b799f)['then'](handleEntityNotFound(_0x3837fc,null))[_0x800b('0x16')](respondWithResult(_0x3837fc,null))['catch'](handleError(_0x3837fc,null));};exports['create']=function(_0x432e2d,_0x5e8ae3){return db[_0x800b('0x30')][_0x800b('0x4e')](_0x432e2d[_0x800b('0x4f')],{})['then'](function(_0x5d02c5){var _0x3aa513=_0x432e2d['user'][_0x800b('0x2a')]({'plain':!![]});if(!_0x3aa513)throw new Error(_0x800b('0x50'));if(_0x3aa513[_0x800b('0x51')]==='user'){var _0x2b13fd=_0x5d02c5['get']({'plain':!![]});var _0x56ca50=_0x800b('0x2b');return db['UserProfileSection'][_0x800b('0x52')]({'where':{'name':_0x56ca50,'userProfileId':_0x3aa513['userProfileId']},'raw':!![]})[_0x800b('0x16')](function(_0x2e7d96){if(_0x2e7d96&&_0x2e7d96[_0x800b('0x53')]===0x0){return db[_0x800b('0x54')][_0x800b('0x4e')]({'name':_0x2b13fd[_0x800b('0x2d')],'resourceId':_0x2b13fd['id'],'type':_0x2e7d96[_0x800b('0x2d')],'sectionId':_0x2e7d96['id']},{})['then'](function(){return _0x5d02c5;});}else{return _0x5d02c5;}})[_0x800b('0x48')](function(_0x29dd3d){logger[_0x800b('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29dd3d);throw _0x29dd3d;});}return _0x5d02c5;})[_0x800b('0x16')](respondWithResult(_0x5e8ae3,0xc9))[_0x800b('0x48')](handleError(_0x5e8ae3,null));};exports[_0x800b('0x28')]=function(_0x5dea28,_0x33311c){if(_0x5dea28[_0x800b('0x4f')]['id']){delete _0x5dea28[_0x800b('0x4f')]['id'];}return db[_0x800b('0x30')]['find']({'where':{'id':_0x5dea28['params']['id']},'include':[{'model':db['Pause'],'as':_0x800b('0x4a')}]})[_0x800b('0x16')](handleEntityNotFound(_0x33311c,null))[_0x800b('0x16')](saveUpdates(_0x5dea28[_0x800b('0x4f')],null))[_0x800b('0x16')](respondWithResult(_0x33311c,null))[_0x800b('0x48')](handleError(_0x33311c,null));};exports[_0x800b('0x29')]=function(_0x4e3d93,_0xbc2ae){return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x4e3d93[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0xbc2ae,null))['then'](removeEntity(_0xbc2ae,null))['catch'](handleError(_0xbc2ae,null));};exports[_0x800b('0x55')]=function(_0x514c0d,_0x3cc55e){return db[_0x800b('0x30')][_0x800b('0x55')]()[_0x800b('0x16')](respondWithResult(_0x3cc55e,null))['catch'](handleError(_0x3cc55e,null));};exports[_0x800b('0x56')]=function(_0x1cce6b,_0x18fc10){if(_0x1cce6b[_0x800b('0x4f')]['id']){delete _0x1cce6b[_0x800b('0x4f')]['id'];}return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x1cce6b['params']['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x18fc10,null))[_0x800b('0x16')](function(_0x18d4d8){if(_0x18d4d8){_0x1cce6b[_0x800b('0x4f')][_0x800b('0x57')]=_0x18d4d8['id'];return db[_0x800b('0x58')][_0x800b('0x4e')](_0x1cce6b[_0x800b('0x4f')]);}})[_0x800b('0x16')](respondWithResult(_0x18fc10,null))[_0x800b('0x48')](handleError(_0x18fc10,null));};exports['getDispositions']=function(_0x5a12da,_0xe5f554){var _0x5a7041={'raw':![],'where':{}};var _0x4c2ec6={};var _0x1b20a1={'count':0x0,'rows':[]};return db[_0x800b('0x30')][_0x800b('0x59')]({'where':{'id':_0x5a12da[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0xe5f554,null))[_0x800b('0x16')](function(_0x4291a5){if(_0x4291a5){_0x4c2ec6[_0x800b('0x34')]=_[_0x800b('0x4b')](db['Disposition']['rawAttributes']);_0x4c2ec6['query']=_[_0x800b('0x4b')](_0x5a12da[_0x800b('0x35')]);_0x4c2ec6[_0x800b('0x36')]=_[_0x800b('0x37')](_0x4c2ec6['model'],_0x4c2ec6[_0x800b('0x35')]);_0x5a7041[_0x800b('0x39')]=_[_0x800b('0x37')](_0x4c2ec6['model'],qs[_0x800b('0x38')](_0x5a12da[_0x800b('0x35')][_0x800b('0x38')]));_0x5a7041[_0x800b('0x39')]=_0x5a7041[_0x800b('0x39')][_0x800b('0x3a')]?_0x5a7041[_0x800b('0x39')]:_0x4c2ec6[_0x800b('0x34')];if(!_0x5a12da[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x5a7041[_0x800b('0x3d')]=qs['limit'](_0x5a12da[_0x800b('0x35')]['limit']);_0x5a7041['offset']=qs[_0x800b('0x23')](_0x5a12da[_0x800b('0x35')][_0x800b('0x23')]);}_0x5a7041[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x5a12da[_0x800b('0x35')][_0x800b('0x3f')]);_0x5a7041[_0x800b('0x40')]=qs[_0x800b('0x36')](_[_0x800b('0x41')](_0x5a12da[_0x800b('0x35')],_0x4c2ec6['filters']));_0x5a7041[_0x800b('0x40')][_0x800b('0x57')]=_0x4291a5['id'];if(_0x5a12da[_0x800b('0x35')]['filter']){_0x5a7041['where']=_['merge'](_0x5a7041['where'],{'$or':_[_0x800b('0x44')](_0x5a7041['attributes'],function(_0x3dbd96){var _0x1723e4={};_0x1723e4[_0x3dbd96]={'$like':'%'+_0x5a12da[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x1723e4;})});}_0x5a7041=_[_0x800b('0x43')]({},_0x5a7041,_0x5a12da['options']);return db[_0x800b('0x58')]['count']({'where':_0x5a7041[_0x800b('0x40')]})[_0x800b('0x16')](function(_0x27ae64){_0x1b20a1[_0x800b('0x25')]=_0x27ae64;if(_0x5a12da['query'][_0x800b('0x4c')]){_0x5a7041[_0x800b('0x4d')]=[{'all':!![]}];}return db[_0x800b('0x58')][_0x800b('0x5a')](_0x5a7041);})[_0x800b('0x16')](function(_0x131a55){_0x1b20a1[_0x800b('0x47')]=_0x131a55;return _0x1b20a1;});}})[_0x800b('0x16')](respondWithFilteredResult(_0xe5f554,_0x5a7041))[_0x800b('0x48')](handleError(_0xe5f554,null));};exports[_0x800b('0x5b')]=function(_0x85c124,_0x24545e){return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x85c124[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x24545e,null))[_0x800b('0x16')](function(_0xe9497c){if(_0xe9497c){return _0xe9497c[_0x800b('0x5b')](_0x85c124['query'][_0x800b('0x5c')]);}})[_0x800b('0x16')](respondWithStatusCode(_0x24545e,null))[_0x800b('0x48')](handleError(_0x24545e,null));};exports[_0x800b('0x5d')]=function(_0xa90ce1,_0x1d906b){if(_0xa90ce1[_0x800b('0x4f')]['id']){delete _0xa90ce1['body']['id'];}return db['ChatWebsite'][_0x800b('0x52')]({'where':{'id':_0xa90ce1[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d906b,null))[_0x800b('0x16')](function(_0x393cb7){if(_0x393cb7){_0xa90ce1['body'][_0x800b('0x57')]=_0x393cb7['id'];return db['CannedAnswer'][_0x800b('0x4e')](_0xa90ce1[_0x800b('0x4f')]);}})[_0x800b('0x16')](respondWithResult(_0x1d906b,null))[_0x800b('0x48')](handleError(_0x1d906b,null));};exports[_0x800b('0x5e')]=function(_0x1c1dda,_0x586e27){var _0x26e3fa={'raw':![],'where':{}};var _0x2495ea={};var _0x2caff3={'count':0x0,'rows':[]};return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x1c1dda[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x586e27,null))['then'](function(_0x5adb08){if(_0x5adb08){_0x2495ea[_0x800b('0x34')]=_['keys'](db[_0x800b('0x5f')][_0x800b('0x31')]);_0x2495ea[_0x800b('0x35')]=_[_0x800b('0x4b')](_0x1c1dda[_0x800b('0x35')]);_0x2495ea[_0x800b('0x36')]=_[_0x800b('0x37')](_0x2495ea[_0x800b('0x34')],_0x2495ea['query']);_0x26e3fa['attributes']=_[_0x800b('0x37')](_0x2495ea[_0x800b('0x34')],qs['fields'](_0x1c1dda[_0x800b('0x35')][_0x800b('0x38')]));_0x26e3fa[_0x800b('0x39')]=_0x26e3fa[_0x800b('0x39')]['length']?_0x26e3fa[_0x800b('0x39')]:_0x2495ea[_0x800b('0x34')];if(!_0x1c1dda[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x26e3fa['limit']=qs['limit'](_0x1c1dda[_0x800b('0x35')][_0x800b('0x3d')]);_0x26e3fa['offset']=qs[_0x800b('0x23')](_0x1c1dda[_0x800b('0x35')][_0x800b('0x23')]);}_0x26e3fa[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x1c1dda['query']['sort']);_0x26e3fa[_0x800b('0x40')]=qs['filters'](_['pick'](_0x1c1dda['query'],_0x2495ea[_0x800b('0x36')]));_0x26e3fa['where'][_0x800b('0x57')]=_0x5adb08['id'];if(_0x1c1dda[_0x800b('0x35')][_0x800b('0x42')]){_0x26e3fa['where']=_['merge'](_0x26e3fa[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0x26e3fa['attributes'],function(_0x16014b){var _0x2a6e8d={};_0x2a6e8d[_0x16014b]={'$like':'%'+_0x1c1dda['query'][_0x800b('0x42')]+'%'};return _0x2a6e8d;})});}_0x26e3fa=_[_0x800b('0x43')]({},_0x26e3fa,_0x1c1dda[_0x800b('0x60')]);return db[_0x800b('0x5f')][_0x800b('0x25')]({'where':_0x26e3fa[_0x800b('0x40')]})[_0x800b('0x16')](function(_0x250ae7){_0x2caff3[_0x800b('0x25')]=_0x250ae7;if(_0x1c1dda[_0x800b('0x35')]['includeAll']){_0x26e3fa[_0x800b('0x4d')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x26e3fa);})[_0x800b('0x16')](function(_0x14f713){_0x2caff3['rows']=_0x14f713;return _0x2caff3;});}})[_0x800b('0x16')](respondWithFilteredResult(_0x586e27,_0x26e3fa))[_0x800b('0x48')](handleError(_0x586e27,null));};exports[_0x800b('0x61')]=function(_0x231a0d,_0x558bcb){return db['ChatWebsite'][_0x800b('0x52')]({'where':{'id':_0x231a0d['params']['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x558bcb,null))[_0x800b('0x16')](function(_0x3081dd){if(_0x3081dd){return _0x3081dd['removeAnswers'](_0x231a0d[_0x800b('0x35')]['ids']);}})[_0x800b('0x16')](respondWithStatusCode(_0x558bcb,null))[_0x800b('0x48')](handleError(_0x558bcb,null));};exports['addLogo']=function(_0x3df3c3,_0x804ef7){_0x3df3c3['body'][_0x800b('0x62')]=_0x3df3c3[_0x800b('0x63')][_0x800b('0x64')];return db[_0x800b('0x30')]['find']({'where':{'id':_0x3df3c3[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x804ef7,null))[_0x800b('0x16')](saveUpdates(_0x3df3c3[_0x800b('0x4f')],null))[_0x800b('0x16')](respondWithResult(_0x804ef7,null))[_0x800b('0x48')](handleError(_0x804ef7,null));};exports[_0x800b('0x65')]=function(_0x48d37f,_0x3f654b){_0x48d37f[_0x800b('0x4f')][_0x800b('0x66')]=_0x48d37f[_0x800b('0x63')][_0x800b('0x64')];return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x48d37f[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x3f654b,null))['then'](saveUpdates(_0x48d37f[_0x800b('0x4f')],null))[_0x800b('0x16')](respondWithResult(_0x3f654b,null))['catch'](handleError(_0x3f654b,null));};exports[_0x800b('0x67')]=function(_0xd53d86,_0xc111d3){_0xd53d86['body']['customerAvatar']=_0xd53d86[_0x800b('0x63')]['filename'];return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0xd53d86[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0xc111d3,null))[_0x800b('0x16')](saveUpdates(_0xd53d86['body'],null))[_0x800b('0x16')](respondWithResult(_0xc111d3,null))[_0x800b('0x48')](handleError(_0xc111d3,null));};exports[_0x800b('0x68')]=function(_0x387cef,_0x38e24e){_0x387cef[_0x800b('0x4f')][_0x800b('0x69')]=_0x387cef[_0x800b('0x63')]['filename'];return db[_0x800b('0x30')]['find']({'where':{'id':_0x387cef['params']['id']}})['then'](handleEntityNotFound(_0x38e24e,null))[_0x800b('0x16')](saveUpdates(_0x387cef[_0x800b('0x4f')],null))[_0x800b('0x16')](respondWithResult(_0x38e24e,null))[_0x800b('0x48')](handleError(_0x38e24e,null));};exports['getLogo']=function(_0x49208c,_0x7c31eb){var _0x5cf398=path['join'](config[_0x800b('0x6a')],_0x800b('0x6b'));var _0x513b8a={'where':{'id':_0x49208c[_0x800b('0x49')]['id']},'attributes':['id',_0x800b('0x62')],'raw':!![]};var _0x50e641=![];return require(_0x800b('0x6c'))[_0x800b('0x6d')]()['then'](function(_0x46c24d){if(_0x46c24d){_0x50e641=_0x46c24d['custom'];}})[_0x800b('0x16')](function(){return db['ChatWebsite'][_0x800b('0x52')](_0x513b8a);})[_0x800b('0x16')](handleEntityNotFound(_0x7c31eb,null))[_0x800b('0x16')](function(_0x22baf4){if(_0x22baf4){if(!_[_0x800b('0x6e')](_0x22baf4[_0x800b('0x62')])){if(fs['existsSync'](path[_0x800b('0x6f')](config[_0x800b('0x6a')],'server/files/images/logos/',_0x22baf4[_0x800b('0x62')]))&&_0x50e641){_0x5cf398=path['join'](config[_0x800b('0x6a')],_0x800b('0x70'),_0x22baf4['sitepic']);}}return _0x7c31eb[_0x800b('0x71')](_0x5cf398);}})[_0x800b('0x48')](handleError(_0x7c31eb,null));};exports['getAvatar']=function(_0x84b1ef,_0x18c365){var _0x3cfe61=path[_0x800b('0x6f')](config['root'],_0x800b('0x72'));var _0x2ead07={'where':{'id':_0x84b1ef[_0x800b('0x49')]['id']},'attributes':['id',_0x800b('0x66')],'raw':!![]};return db['ChatWebsite'][_0x800b('0x52')](_0x2ead07)[_0x800b('0x16')](handleEntityNotFound(_0x18c365,null))['then'](function(_0x4dc27b){if(_0x4dc27b){if(!_[_0x800b('0x6e')](_0x4dc27b[_0x800b('0x66')])){if(fs['existsSync'](path['join'](config[_0x800b('0x6a')],_0x800b('0x73'),_0x4dc27b['agentAvatar']))){_0x3cfe61=path[_0x800b('0x6f')](config['root'],_0x800b('0x73'),_0x4dc27b['agentAvatar']);}}return _0x18c365[_0x800b('0x71')](_0x3cfe61);}})[_0x800b('0x48')](handleError(_0x18c365,null));};exports[_0x800b('0x74')]=function(_0x506d0d,_0x1b0503){var _0x24c25a=path[_0x800b('0x6f')](config[_0x800b('0x6a')],_0x800b('0x75'));var _0x9068a2={'where':{'id':_0x506d0d[_0x800b('0x49')]['id']},'attributes':['id',_0x800b('0x76'),_0x800b('0x77')],'raw':!![]};return db['ChatWebsite'][_0x800b('0x52')](_0x9068a2)[_0x800b('0x16')](handleEntityNotFound(_0x1b0503,null))[_0x800b('0x16')](function(_0x62c5c6){if(_0x62c5c6){if(!_[_0x800b('0x6e')](_0x62c5c6[_0x800b('0x76')])){if(fs[_0x800b('0x78')](path[_0x800b('0x6f')](config[_0x800b('0x6a')],'server/files/images/avatars/',_0x62c5c6['customerAvatar']))&&_0x62c5c6[_0x800b('0x77')]){_0x24c25a=path[_0x800b('0x6f')](config[_0x800b('0x6a')],_0x800b('0x73'),_0x62c5c6[_0x800b('0x76')]);}}return _0x1b0503[_0x800b('0x71')](_0x24c25a);}})['catch'](handleError(_0x1b0503,null));};exports[_0x800b('0x79')]=function(_0x211ac,_0x150e42){var _0x537fb7=path['join'](config[_0x800b('0x6a')],_0x800b('0x7a'));var _0x38c053={'where':{'id':_0x211ac[_0x800b('0x49')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x800b('0x30')]['find'](_0x38c053)['then'](handleEntityNotFound(_0x150e42,null))[_0x800b('0x16')](function(_0x1bc8e1){if(_0x1bc8e1){if(!_[_0x800b('0x6e')](_0x1bc8e1['systemAvatar'])){if(fs[_0x800b('0x78')](path[_0x800b('0x6f')](config['root'],_0x800b('0x73'),_0x1bc8e1['systemAvatar']))){_0x537fb7=path[_0x800b('0x6f')](config['root'],_0x800b('0x73'),_0x1bc8e1[_0x800b('0x69')]);}}return _0x150e42[_0x800b('0x71')](_0x537fb7);}})[_0x800b('0x48')](handleError(_0x150e42,null));};exports['notify']=function(_0x271716,_0x281807){var _0x7e8e95=require(_0x800b('0x7b'));var _0x4afd16=new _0x7e8e95();var _0x6f6ac=_0x4afd16[_0x800b('0x7c')](_0x271716[_0x800b('0x7d')]['user-agent'])[_0x800b('0x7e')]();var _0x3c8349={'body':_0x271716[_0x800b('0x4f')],'channel':'chat'};var _0x8f246c=[];var _0x5d949e=[];var _0x1e9505={};var _0x1aa349=![];return db[_0x800b('0x7f')][_0x800b('0x55')]()['then'](function(_0x21ea27){if(!_0x21ea27){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))]('no\x20available\x20attributes');}_0x8f246c=_[_0x800b('0x82')](_[_0x800b('0x4b')](_0x21ea27),[_0x800b('0x83'),_0x800b('0x84')]);_0x5d949e=_[_0x800b('0x82')](_[_0x800b('0x4b')](_0x21ea27),[_0x800b('0x83'),'updatedAt',_0x800b('0x85'),_0x800b('0x86')]);if(_0x271716[_0x800b('0x4f')]['id']){delete _0x271716[_0x800b('0x4f')]['id'];}if(_[_0x800b('0x6e')](_0x271716[_0x800b('0x4f')]['from'])){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))](_0x800b('0x87'));}if(_[_0x800b('0x6e')](_0x271716[_0x800b('0x4f')]['body'])||_0x271716[_0x800b('0x4f')][_0x800b('0x4f')]===''){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x800b('0x6e')](_0x271716[_0x800b('0x4f')][_0x800b('0x88')])){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))](_0x800b('0x89')+_0x5d949e);}if(!_['includes'](_0x5d949e,_0x271716[_0x800b('0x4f')][_0x800b('0x88')])){throw new db[(_0x800b('0x80'))][(_0x800b('0x81'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d949e);}_0x1e9505[_0x271716['body'][_0x800b('0x88')]]=_0x271716[_0x800b('0x4f')][_0x800b('0x8a')];})['then'](function(){return db[_0x800b('0x30')]['find']({'where':{'id':_0x271716['params']['id']},'include':[{'model':db[_0x800b('0x8b')],'as':'List','include':[{'model':db[_0x800b('0x7f')],'as':_0x800b('0x8c'),'where':_0x1e9505,'limit':0x1,'order':[[_0x800b('0x84'),_0x800b('0x8d')]]}]},{'model':db[_0x800b('0x8e')],'as':_0x800b('0x8f')}]});})[_0x800b('0x16')](handleEntityNotFound(_0x281807,null))[_0x800b('0x16')](function(_0x4d0812){if(_0x4d0812&&_0x4d0812[_0x800b('0x90')]){_0x3c8349[_0x800b('0x91')]=_0x4d0812;_0x3c8349[_0x800b('0x92')]=_0x4d0812[_0x800b('0x8f')];_0x3c8349[_0x800b('0x93')]=_0x4d0812[_0x800b('0x90')];_0x3c8349['applications']=_[_0x800b('0x94')](_0x3c8349[_0x800b('0x92')],[_0x800b('0x95')],[_0x800b('0x96')]);if(_0x3c8349['account'][_0x800b('0x8f')]){delete _0x3c8349['account']['Applications'];}if(_0x3c8349[_0x800b('0x91')][_0x800b('0x90')]&&_0x3c8349[_0x800b('0x91')]['List'][_0x800b('0x8c')][_0x800b('0x3a')]){return _0x3c8349[_0x800b('0x91')]['List'][_0x800b('0x8c')][0x0];}var _0x3c4705=_[_0x800b('0xd')](_0x271716[_0x800b('0x4f')],{'firstName':_0x271716[_0x800b('0x4f')][_0x800b('0x8a')],'ListId':_0x4d0812[_0x800b('0x86')]});_0x3c4705[_0x271716[_0x800b('0x4f')][_0x800b('0x88')]]=_0x271716[_0x800b('0x4f')][_0x800b('0x8a')];return db[_0x800b('0x7f')][_0x800b('0x4e')](_0x3c4705,{'fields':_0x8f246c,'raw':!![]});}})[_0x800b('0x16')](handleEntityNotFound(_0x281807,null))[_0x800b('0x16')](function(_0x54ae6d){_0x3c8349[_0x800b('0x97')]=_0x54ae6d;var _0x268e0a=_0x271716[_0x800b('0x4f')][_0x800b('0x98')];if(_0x271716[_0x800b('0x7d')][_0x800b('0x99')]){_0x268e0a=_0x271716[_0x800b('0x7d')][_0x800b('0x99')];}else if(_0x271716[_0x800b('0x7d')][_0x800b('0x9a')]){_0x268e0a=_['first'](_0x271716[_0x800b('0x7d')]['x-forwarded-for']['split'](','));}if(_0x54ae6d){var _0xb696d4={'ContactId':_0x54ae6d['id'],'ChatWebsiteId':_0x271716[_0x800b('0x49')]['id'],'from':(_0x54ae6d[_0x800b('0x9b')]||'')+'\x20'+(_0x54ae6d[_0x800b('0x9c')]||''),'customerIp':_0x268e0a,'customerPort':_0x271716[_0x800b('0x7d')][_0x800b('0x9d')]?_0x271716[_0x800b('0x7d')][_0x800b('0x9d')]:null,'referer':_0x271716[_0x800b('0x4f')][_0x800b('0x9e')],'browserName':_0x6f6ac[_0x800b('0x9f')][_0x800b('0x2d')]&&_0x6f6ac[_0x800b('0x9f')]['version']?util[_0x800b('0xa0')]('%s\x20%s',_0x6f6ac['browser'][_0x800b('0x2d')],_0x6f6ac['browser'][_0x800b('0xa1')]):'unknown','browserVersion':_0x6f6ac[_0x800b('0x9f')]['version']||_0x800b('0xa2'),'osName':util[_0x800b('0xa0')](_0x800b('0xa3'),_0x6f6ac['os'][_0x800b('0x2d')],_0x6f6ac['os'][_0x800b('0xa1')]),'osVersion':_0x6f6ac['os'][_0x800b('0xa1')],'deviceModel':_0x6f6ac[_0x800b('0xa4')]['model']&&_0x6f6ac[_0x800b('0xa4')][_0x800b('0xa5')]?util[_0x800b('0xa0')]('%s\x20%s\x20%s',_0x6f6ac['device']['model'],_0x6f6ac[_0x800b('0xa4')][_0x800b('0xa5')],_0x6f6ac['device'][_0x800b('0x45')]):null,'deviceVendor':_0x6f6ac[_0x800b('0xa4')][_0x800b('0xa5')],'deviceType':_0x6f6ac[_0x800b('0xa4')][_0x800b('0x45')],'formData':JSON[_0x800b('0x1a')](_0x271716['body'])};var _0x5dc1a3={'ChatWebsiteId':_0x271716[_0x800b('0x49')]['id'],'closed':![]};if(_0x271716[_0x800b('0x4f')][_0x800b('0xa6')]){_0x5dc1a3[_0x800b('0xa6')]=_0x271716[_0x800b('0x4f')][_0x800b('0xa6')];return db['ChatInteraction'][_0x800b('0x52')]({'where':_0x5dc1a3})[_0x800b('0x16')](function(_0x468c6b){if(_0x468c6b){return[_0x468c6b,![]];}_0xb696d4['threadId']=_0x271716[_0x800b('0x4f')][_0x800b('0xa6')];_0xb696d4['externalUrl']=_0x271716['body'][_0x800b('0xa7')];return db[_0x800b('0xa8')][_0x800b('0x4e')](_0xb696d4)['then'](function(_0x39b323){return[_0x39b323,!![]];});});}_0x5dc1a3[_0x800b('0xa9')]=_0x54ae6d['id'];if(_0x271716['body']['interaction']&&_0x271716[_0x800b('0x4f')][_0x800b('0xaa')]['id']){_0x5dc1a3['id']=_0x271716[_0x800b('0x4f')][_0x800b('0xaa')]['id'];return db[_0x800b('0xa8')]['find']({'where':_0x5dc1a3})[_0x800b('0x16')](function(_0x5217d7){if(_0x5217d7){return[_0x5217d7,![]];}return db[_0x800b('0xa8')][_0x800b('0x4e')](_0xb696d4)[_0x800b('0x16')](function(_0x1f58e4){return[_0x1f58e4,!![]];});});}return db[_0x800b('0xa8')][_0x800b('0x4e')](_0xb696d4)[_0x800b('0x16')](function(_0x4b12b4){return[_0x4b12b4,!![]];});}})[_0x800b('0xab')](function(_0x4e2b1c,_0x6ede9f){if(_0x4e2b1c){_0x1aa349=_0x6ede9f;if(!_0x6ede9f){var _0x221634={'from':(_0x3c8349[_0x800b('0x97')]['firstName']||'')+'\x20'+(_0x3c8349[_0x800b('0x97')][_0x800b('0x9c')]||'')};if(_0x271716[_0x800b('0x4f')][_0x800b('0xa6')]&&_0x271716[_0x800b('0x4f')][_0x800b('0xac')]&&_0x271716[_0x800b('0x4f')]['threadId']!=_0x271716[_0x800b('0x4f')][_0x800b('0xac')]){_0x221634[_0x800b('0xa6')]=_0x271716[_0x800b('0x4f')][_0x800b('0xac')];}return _0x4e2b1c[_0x800b('0x28')](_0x221634);}else{return _0x4e2b1c;}}})[_0x800b('0x16')](function(_0x41a1c7){_0x3c8349[_0x800b('0xaa')]=_0x41a1c7['get']({'plain':!![]});_0x3c8349[_0x800b('0xaa')][_0x800b('0xad')]=_0x1aa349;if(_0x3c8349[_0x800b('0xaa')]['created']){if(_0x3c8349['account'][_0x800b('0xae')]){_0x3c8349[_0x800b('0x92')][_0x800b('0xaf')]({'id':0x0,'priority':_0x3c8349[_0x800b('0x92')][_0x800b('0x3a')]+0x1,'app':'close','appdata':_0x800b('0xb0'),'interval':_0x800b('0xb1')});}}return db['ChatMessage'][_0x800b('0x4e')]({'body':_0x271716[_0x800b('0x4f')][_0x800b('0x4f')],'ChatWebsiteId':_0x271716[_0x800b('0x49')]['id'],'ChatInteractionId':_0x41a1c7['id'],'direction':'in','ContactId':_0x3c8349[_0x800b('0x97')]['id'],'AttachmentId':_0x271716[_0x800b('0x4f')][_0x800b('0xb2')]});})[_0x800b('0x16')](function(_0x2d2a15){_0x3c8349['message']=_0x2d2a15;if(_0x3c8349[_0x800b('0xaa')][_0x800b('0xb3')]){return db[_0x800b('0xb4')][_0x800b('0x52')]({'attributes':['id',_0x800b('0x2d')],'where':{'id':_0x3c8349[_0x800b('0xaa')]['UserId']}})[_0x800b('0x16')](function(_0x3fd231){if(_0x3fd231){_0x3c8349[_0x800b('0x92')][_0x800b('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3fd231['name']+','+(_0x3c8349[_0x800b('0x91')][_0x800b('0xb6')]||0xa),'interval':_0x800b('0xb1')});_0x3c8349[_0x800b('0xb7')]=!![];}return respondWithRpcPromise(_0x800b('0xb8'),'startRouting',_0x3c8349);});}return respondWithRpcPromise(_0x800b('0xb8'),'startRouting',_0x3c8349);})[_0x800b('0x16')](function(_0x1feef3){respondWithRpcPromise(_0x800b('0xb9'),'EventManager',{'event':_0x800b('0xba'),'message':_0x1feef3},client9002);return _0x1feef3;})[_0x800b('0x16')](respondWithResult(_0x281807,null))['catch'](handleError(_0x281807,null));};exports[_0x800b('0xbb')]=function(_0x4b680c,_0x366fe9){var _0x10b52d,_0x53cc76,_0x56f939;var _0x46ce6f=[];var _0x5accf8={};var _0x27a628=_0x4b680c[_0x800b('0xbc')]||[];var _0xe92df1=[];var _0x3554cb;return db[_0x800b('0x7f')][_0x800b('0x55')]()['then'](function(_0xf50179){if(!_0xf50179){throw new db['Sequelize'][(_0x800b('0x81'))](_0x800b('0xbd'));}_0x46ce6f=_[_0x800b('0x82')](_[_0x800b('0x4b')](_0xf50179),[_0x800b('0x83'),'updatedAt','CompanyId',_0x800b('0x86')]);if(_0x4b680c[_0x800b('0x4f')]['id']){delete _0x4b680c[_0x800b('0x4f')]['id'];}if(_[_0x800b('0x6e')](_0x4b680c[_0x800b('0x4f')]['from'])){throw _0x366fe9['status'](0x1f4)[_0x800b('0x2e')](new db[(_0x800b('0x80'))][(_0x800b('0x81'))](_0x800b('0x87')));}if(_[_0x800b('0x6e')](_0x4b680c[_0x800b('0x4f')][_0x800b('0x4f')])||_0x4b680c[_0x800b('0x4f')][_0x800b('0x4f')]===''){throw _0x366fe9[_0x800b('0x20')](0x1f4)[_0x800b('0x2e')](new db[(_0x800b('0x80'))]['ValidationError'](_0x800b('0xbe')));}if(_[_0x800b('0x6e')](_0x4b680c[_0x800b('0x4f')]['mapKeyOffline'])){throw _0x366fe9[_0x800b('0x20')](0x1f4)[_0x800b('0x2e')](new db[(_0x800b('0x80'))][(_0x800b('0x81'))](_0x800b('0xbf')+_0x46ce6f));}if(!_[_0x800b('0xc0')](_0x46ce6f,_0x4b680c[_0x800b('0x4f')][_0x800b('0xc1')])){throw _0x366fe9[_0x800b('0x20')](0x1f4)[_0x800b('0x2e')](new db['Sequelize'][(_0x800b('0x81'))](_0x800b('0xc2')+_0x46ce6f));}_0x5accf8[_0x4b680c[_0x800b('0x4f')][_0x800b('0xc1')]]=_0x4b680c[_0x800b('0x4f')][_0x800b('0x8a')];})[_0x800b('0x16')](function(){return db[_0x800b('0x30')]['find']({'where':{'id':_0x4b680c[_0x800b('0x49')]['id']},'include':[{'model':db[_0x800b('0x8b')],'as':_0x800b('0x90')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x800b('0x16')](handleEntityNotFound(_0x366fe9,null))[_0x800b('0x16')](function(_0x2a282c){if(_0x2a282c&&_0x2a282c[_0x800b('0x90')]){_0x53cc76=_0x2a282c;var _0x3971d9=_['defaults'](_0x4b680c['body'],{'firstName':_0x4b680c['body'][_0x800b('0x8a')],'phone':_0x4b680c[_0x800b('0x4f')][_0x800b('0x8a')],'ListId':_0x2a282c[_0x800b('0x86')]});_0x3971d9[_0x4b680c[_0x800b('0x4f')]['mapKeyOffline']]=_0x4b680c[_0x800b('0x4f')][_0x800b('0x8a')];return db[_0x800b('0x7f')][_0x800b('0xc3')]({'where':_0x5accf8,'defaults':_0x3971d9});}})['spread'](function(_0x3b2517){if(_0x3b2517){_0x56f939=_0x3b2517;var _0x2af5b9=fs['readFileSync'](path['join'](config['root'],_0x800b('0xc4')),_0x800b('0xc5'));var _0x21c93f=ejs[_0x800b('0xc6')](_0x2af5b9,{'body':_[_0x800b('0xc7')](_0x4b680c[_0x800b('0x4f')][_0x800b('0x4f')]),'bodyTitle':_0x53cc76[_0x800b('0xc8')]});return db['ChatOfflineMessage'][_0x800b('0x4e')]({'body':_0x21c93f,'plainBody':htmlToText['fromString'](_0x21c93f),'ContactId':_0x3b2517['id'],'ChatWebsiteId':_0x53cc76['id']});}})[_0x800b('0x16')](function(_0x2a9f39){_0x3554cb=_0x2a9f39;if(_0x27a628['length']){var _0x1e05cb=_0x27a628[_0x800b('0x44')](function(_0x15bf69){return{'name':_0x15bf69[_0x800b('0xc9')],'basename':_0x15bf69[_0x800b('0x64')],'type':_0x15bf69[_0x800b('0xca')],'ChatOfflineMessageId':_0x2a9f39['id']};});_0xe92df1=_0x1e05cb[_0x800b('0x44')](_0x209c20=>{var _0xc8519c={'filename':_0x209c20[_0x800b('0x2d')],'path':path['join'](config[_0x800b('0x6a')],_0x800b('0xcb'),_0x800b('0xbc'),_0x800b('0xcc'),_0x800b('0xcd'),_0x209c20[_0x800b('0xce')])};return _0xc8519c;});if(!_0x53cc76[_0x800b('0xcf')]){return db[_0x800b('0xd0')]['transaction'](function(_0x19b1c7){return db[_0x800b('0xd1')][_0x800b('0xd2')](_0x1e05cb,{'transaction':_0x19b1c7});});}}})[_0x800b('0x16')](function(){if(_0x3554cb){_0x10b52d=_0x3554cb;return db[_0x800b('0xd3')][_0x800b('0x59')]({'where':{'active':!![]},'include':[{'model':db[_0x800b('0xd4')],'as':_0x800b('0xd5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0x800b('0x16')](function(_0x20de10){if(_0x20de10&&_0x20de10['Smtp']&&_0x53cc76[_0x800b('0xd6')]&&_0x53cc76[_0x800b('0xd7')]){var _0x35feae=_0x20de10[_0x800b('0xd8')]();return respondWithRpcPromise('SendMail',_0x800b('0xd9'),{'account':_0x35feae,'message':{'from':util[_0x800b('0xa0')](_0x800b('0xda'),_0x20de10[_0x800b('0x2d')],_0x20de10[_0x800b('0xdb')]||_0x20de10[_0x800b('0xd5')][_0x800b('0xdc')]),'to':_0x53cc76[_0x800b('0xd7')],'subject':_0x53cc76[_0x800b('0xdd')],'html':_0x10b52d['body'],'attachments':_0xe92df1}},client9003)[_0x800b('0x16')](function(){return _0x10b52d;})[_0x800b('0x48')](function(_0x597348){logger[_0x800b('0x1b')](_0x597348);});}})[_0x800b('0x16')](function(){if(_0x53cc76&&_0x53cc76[_0x800b('0xcf')]&&_0x53cc76[_0x800b('0xde')]){var _0x3538ef=[];if(_0x27a628['length']){_0x3538ef=_0x27a628[_0x800b('0x44')](function(_0x1a5426){return{'name':_0x1a5426[_0x800b('0xc9')],'basename':_0x1a5426['filename'],'type':_0x1a5426[_0x800b('0xca')],'ChatOfflineMessageId':_0x3554cb['id']};});}var _0x37c33e;if(!_[_0x800b('0x6e')](_0x53cc76[_0x800b('0xdf')])){var _0x435b0d=_['map'](_0x4b680c[_0x800b('0x4f')],function(_0x3b5279){return _0x3b5279;});var _0x1a5c6f=_[_0x800b('0xe0')](_0x435b0d)[0x0];var _0x155b35=_[_0x800b('0xe1')](_0x1a5c6f,function(_0x460709){return _0x460709;});_0x37c33e=_0x155b35[0x1][_0x53cc76[_0x800b('0xdf')]];}var _0x895c26={'from':_0x56f939['email'],'firstName':_0x56f939[_0x800b('0x9b')],'lastName':_0x56f939[_0x800b('0x9c')],'mapKey':'email','message':{'from':_0x56f939[_0x800b('0xdb')],'to':_0x53cc76[_0x800b('0xd3')][_0x800b('0xdb')],'cc':'','subject':_['isNil'](_0x37c33e)?_0x53cc76[_0x800b('0xdd')]:_0x37c33e,'messageId':'','sentAt':new Date(),'attach':_0x3538ef[_0x800b('0x3a')],'attachments':_0x3538ef,'originChannel':'Chat','ChatWebsiteId':_0x53cc76['id'],'ChatOfflineMessageId':_0x10b52d['id'],'originTo':_0x53cc76[_0x800b('0xd3')][_0x800b('0xdb')]},'body':_0x10b52d[_0x800b('0x4f')]};var _0x106dd6={'account':{'id':_0x53cc76[_0x800b('0xde')]},'body':_0x895c26,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x800b('0xe2'),_0x800b('0xe3'),_0x106dd6,client9001)['then'](function(){return _0x10b52d;})[_0x800b('0x48')](function(_0x4c3435){logger['error'](_0x4c3435);});}return;})['then'](function(){if(_0x10b52d){return _0x10b52d;}})[_0x800b('0x16')](respondWithResult(_0x366fe9,null))[_0x800b('0x48')](function(_0x3175a7){logger[_0x800b('0x1b')]('catch',_0x3175a7);for(var _0x35d5db of _0x27a628){var _0x49f18b=path[_0x800b('0x6f')](config[_0x800b('0x6a')],'server',_0x800b('0xbc'),'attachments',_0x800b('0xcd'),_0x35d5db['filename']);fs_extra['remove'](_0x49f18b)[_0x800b('0x48')](function(_0x453c2e){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x49f18b,_0x453c2e);});}});};exports[_0x800b('0xe4')]=function(_0x35424d,_0x3c4c51){return db['ChatInteraction'][_0x800b('0x52')]({'where':{'id':_0x35424d[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x3c4c51,null))[_0x800b('0x16')](function(_0x3d823f){if(_0x3d823f){return _0x3d823f[_0x800b('0xe4')](_0x35424d[_0x800b('0x4f')][_0x800b('0x5c')],_[_0x800b('0xe5')](_0x35424d[_0x800b('0x4f')],[_0x800b('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x3c4c51,null))['catch'](handleError(_0x3c4c51,null));};exports[_0x800b('0xe6')]=function(_0x53de7f,_0x2b2ded){var _0x164164={'raw':![],'where':{}};var _0x4e1c21={};var _0x6c616={'count':0x0,'rows':[]};return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x53de7f['params']['id']}})['then'](handleEntityNotFound(_0x2b2ded,null))[_0x800b('0x16')](function(_0xe674b7){if(_0xe674b7){_0x4e1c21['model']=_[_0x800b('0x4b')](db['ChatInteraction'][_0x800b('0x31')]);_0x4e1c21[_0x800b('0x35')]=_[_0x800b('0x4b')](_0x53de7f[_0x800b('0x35')]);_0x4e1c21['filters']=_[_0x800b('0x37')](_0x4e1c21[_0x800b('0x34')],_0x4e1c21[_0x800b('0x35')]);_0x164164[_0x800b('0x39')]=_[_0x800b('0x37')](_0x4e1c21[_0x800b('0x34')],qs[_0x800b('0x38')](_0x53de7f[_0x800b('0x35')][_0x800b('0x38')]));_0x164164['attributes']=_0x164164[_0x800b('0x39')][_0x800b('0x3a')]?_0x164164[_0x800b('0x39')]:_0x4e1c21[_0x800b('0x34')];if(!_0x53de7f[_0x800b('0x35')]['hasOwnProperty'](_0x800b('0x3c'))){_0x164164['limit']=qs['limit'](_0x53de7f['query'][_0x800b('0x3d')]);_0x164164['offset']=qs[_0x800b('0x23')](_0x53de7f[_0x800b('0x35')][_0x800b('0x23')]);}_0x164164[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x53de7f[_0x800b('0x35')]['sort']);_0x164164[_0x800b('0x40')]=qs['filters'](_[_0x800b('0x41')](_0x53de7f[_0x800b('0x35')],_0x4e1c21['filters']));_0x164164[_0x800b('0x40')][_0x800b('0x57')]=_0xe674b7['id'];if(_0x53de7f[_0x800b('0x35')][_0x800b('0x42')]){_0x164164[_0x800b('0x40')]=_[_0x800b('0x43')](_0x164164[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0x164164['attributes'],function(_0xadbc1c){var _0x57bea8={};_0x57bea8[_0xadbc1c]={'$like':'%'+_0x53de7f[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x57bea8;})});}_0x164164=_[_0x800b('0x43')]({},_0x164164,_0x53de7f[_0x800b('0x60')]);return db[_0x800b('0xa8')]['count']({'where':_0x164164[_0x800b('0x40')]})[_0x800b('0x16')](function(_0x1d4e07){_0x6c616[_0x800b('0x25')]=_0x1d4e07;if(_0x53de7f[_0x800b('0x35')]['includeAll']){_0x164164[_0x800b('0x4d')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x800b('0xb4')],'as':_0x800b('0xe7'),'attributes':[_0x800b('0x2d'),'fullname','internal'],'required':![]},{'model':db[_0x800b('0xe8')],'as':_0x800b('0xe9'),'attributes':['id',_0x800b('0x2d'),_0x800b('0xea')],'where':_0x53de7f['query'][_0x800b('0xeb')]?{'id':_0x53de7f[_0x800b('0x35')]['tag']}:undefined,'required':_0x53de7f[_0x800b('0x35')][_0x800b('0xeb')]?!![]:![]}];}return db[_0x800b('0xa8')][_0x800b('0x5a')](_0x164164);})[_0x800b('0x16')](function(_0x11dd48){_0x6c616[_0x800b('0x47')]=_0x11dd48;return _0x6c616;});}})[_0x800b('0x16')](respondWithFilteredResult(_0x2b2ded,_0x164164))[_0x800b('0x48')](handleError(_0x2b2ded,null));};function iftimePromise(_0x31cb03,_0x537cab){return respondWithRpcPromise('Command',_0x800b('0xec'),{'command':_0x537cab[_0x800b('0xed')]?util['format'](_0x800b('0xee'),_0x31cb03[_0x800b('0xef')],_0x537cab[_0x800b('0xed')]):util[_0x800b('0xa0')](_0x800b('0xf0'),_0x31cb03[_0x800b('0xef')])},client9002)[_0x800b('0x16')](function(_0x578892){var _0x476d90=_0x578892&&_0x578892['indexOf'](_0x800b('0xf1'))>=0x0?!![]:![];logger[_0x800b('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x537cab['id'],_0x31cb03['id'],_0x31cb03['interval'],_0x476d90?_0x800b('0xf2'):_0x800b('0xf3'),_0x537cab[_0x800b('0xed')]?_0x537cab['timezone']:_0x800b('0xf4'));return _0x476d90;})['catch'](function(_0x5b51b9){logger[_0x800b('0x1b')](_0x800b('0xf5'),_0x537cab['id'],_0x31cb03['id'],_0x31cb03[_0x800b('0xef')],util[_0x800b('0xf6')](_0x5b51b9,{'showHidden':![],'depth':null}),_0x537cab['timezone']?_0x537cab[_0x800b('0xed')]:_0x800b('0xf4'));return![];});}exports[_0x800b('0xec')]=function(_0x6113f7,_0x593408){var _0x5e6064=0x0;var _0x319f5d=0x0;var _0x1c5a0f=![];var _0x5a677f;var _0x504b94;return db[_0x800b('0x30')][_0x800b('0x52')]({'where':{'id':_0x6113f7[_0x800b('0x49')]['id']},'include':[{'model':db[_0x800b('0xf7')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x800b('0xf8'),'attributes':['id',_0x800b('0xef')],'raw':!![]}]}]})[_0x800b('0x16')](handleEntityNotFound(_0x593408,null))[_0x800b('0x16')](function(_0x588e6c){if(_0x588e6c){_0x5a677f=_0x588e6c;return _0x588e6c[_0x800b('0xf9')]({'raw':!![]});}})[_0x800b('0x16')](function(_0x1db454){if(_0x5a677f){if(_0x1db454){_0x504b94=_0x1db454;}}return require(_0x800b('0x6c'))[_0x800b('0x6d')]();})['then'](function(_0x3e4e68){if(_0x3e4e68){_0x319f5d=_0x3e4e68[_0x800b('0xfa')];_0x1c5a0f=_0x3e4e68['custom'];}})[_0x800b('0x16')](function(){return db[_0x800b('0xa8')]['count']({'where':{'closed':![]}});})[_0x800b('0x16')](function(_0x1d0e75){_0x5e6064=_0x1d0e75;if(_0x319f5d&&_0x1d0e75>_0x319f5d){return db[_0x800b('0xfb')][_0x800b('0x59')]({'where':{'id':0x1}})[_0x800b('0x16')](function(_0x16e7f2){if(_0x16e7f2){_0x16e7f2[_0x800b('0xfc')](_0x800b('0xfd'));}});}})[_0x800b('0x16')](function(){if(_0x5a677f[_0x800b('0xf7')]&&_0x5a677f[_0x800b('0xf7')][_0x800b('0xf8')]){var _0x554d34=[];for(var _0x3c0888=0x0;_0x3c0888<_0x5a677f[_0x800b('0xf7')]['Intervals'][_0x800b('0x3a')];_0x3c0888++){var _0x28ed30=_0x5a677f['Interval'][_0x800b('0xf8')][_0x3c0888][_0x800b('0x2a')]({'plain':!![]});_0x554d34[_0x800b('0xaf')](iftimePromise(_0x28ed30,_0x5a677f));}return BPromise[_0x800b('0xfe')](_0x554d34)[_0x800b('0x16')](function(_0x7c427f){return _['some'](_0x7c427f);});}else{return!![];}})[_0x800b('0x16')](function(_0x12fa53){var _0x44077c=fs[_0x800b('0xff')](path[_0x800b('0x6f')](config[_0x800b('0x6a')],'server/files/chat/iframe.ejs'),'utf8');var _0x199d52={'remote':_0x5a677f[_0x800b('0x100')],'query':querystring[_0x800b('0x1a')](_[_0x800b('0x43')](_0x5a677f[_0x800b('0x2a')]({'plain':!![]}),{'customerIp':_0x6113f7[_0x800b('0x7d')][_0x800b('0x9a')]||_0x6113f7[_0x800b('0x7d')][_0x800b('0x101')]||_0x6113f7['connection'][_0x800b('0x102')]||_0x6113f7['ip'],'referer':_0x6113f7['headers'][_0x800b('0x9e')],'openedInteractions':_0x5e6064,'maxInteractions':_0x319f5d,'virtual':_0x1c5a0f[_0x800b('0xfa')],'online':_0x12fa53,'custom':_0x1c5a0f}))[_0x800b('0x103')](/'/g,'\x5c\x27')};_0x593408[_0x800b('0x2e')](ejs['render'](Mustache[_0x800b('0xc6')](_0x44077c,_0x199d52),{'proactiveActions':_0x504b94,'alignment':_0x5a677f['alignment'],'verticalAlignment':_0x5a677f['verticalAlignment'],'div_color':_0x5a677f[_0x800b('0xea')],'labelText':_0x5a677f[_0x800b('0x104')],'text_color':_0x5a677f['textColor'],'button_color':_0x5a677f[_0x800b('0x105')],'background_color':_0x5a677f[_0x800b('0x106')],'hideWhenOffline':_0x5a677f['hideWhenOffline'],'interval':_0x5a677f[_0x800b('0x107')]}));})[_0x800b('0x48')](handleError(_0x593408,null));};exports[_0x800b('0x108')]=function(_0x1f213c,_0x4d5288){var _0x353ecc=_0x1f213c['params']['id'];var _0x2e5301=_0x1f213c['body'];var _0x1fed60=0xc8;var _0x5220d7=null;return db[_0x800b('0xd0')][_0x800b('0x109')]({'isolationLevel':db[_0x800b('0xd0')][_0x800b('0x10a')]['ISOLATION_LEVELS'][_0x800b('0x10b')]},function(_0x46d4b6){return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x353ecc},'transaction':_0x46d4b6})[_0x800b('0x16')](function(_0x3af3db){if(_0x3af3db){return db['ChatApplication'][_0x800b('0x29')]({'where':{'ChatWebsiteId':_0x353ecc},'transaction':_0x46d4b6})[_0x800b('0x16')](function(){var _0x19d9d7=_['map'](_0x2e5301,function(_0x3529ee){_0x3529ee[_0x800b('0x57')]=_0x353ecc;return _0x3529ee;});return db[_0x800b('0x8e')]['bulkCreate'](_0x19d9d7,{'transaction':_0x46d4b6});});}else{_0x1fed60=0x194;_0x5220d7=[];}});})[_0x800b('0x16')](function(){if(_0x1fed60!==0x194){return db[_0x800b('0x8e')][_0x800b('0x10c')]({'where':{'ChatWebsiteId':_0x353ecc},'order':_0x800b('0x95')})[_0x800b('0x16')](function(_0x1fbfe5){_0x5220d7=_0x1fbfe5;});}})[_0x800b('0x48')](function(_0x1e36f9){_0x1fed60=0x1f4;logger[_0x800b('0x1b')](_0x1e36f9[_0x800b('0x2c')]);if(_0x1e36f9[_0x800b('0x2d')]){delete _0x1e36f9['name'];}_0x5220d7=_0x1e36f9;})['finally'](function(){if(_0x5220d7===null){_0x4d5288[_0x800b('0x1f')](_0x1fed60);}else{if(_0x1fed60===0x1f4){_0x4d5288[_0x800b('0x20')](_0x1fed60)[_0x800b('0x2e')](_0x5220d7);}else{_0x4d5288['status'](_0x1fed60)[_0x800b('0x22')](_0x5220d7);}}});};exports[_0x800b('0x10d')]=function(_0xde8e90,_0xf0a301){var _0x2bbe9e={};var _0x1786b0={};var _0x341030;var _0x1472a8;return db[_0x800b('0x30')][_0x800b('0x59')]({'where':{'id':_0xde8e90[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0xf0a301,null))[_0x800b('0x16')](function(_0xf575a2){if(_0xf575a2){_0x341030=_0xf575a2;_0x1786b0['model']=_['keys'](db[_0x800b('0x8e')][_0x800b('0x31')]);_0x1786b0[_0x800b('0x35')]=_['keys'](_0xde8e90[_0x800b('0x35')]);_0x1786b0[_0x800b('0x36')]=_['intersection'](_0x1786b0[_0x800b('0x34')],_0x1786b0['query']);_0x2bbe9e[_0x800b('0x39')]=_['intersection'](_0x1786b0[_0x800b('0x34')],qs[_0x800b('0x38')](_0xde8e90[_0x800b('0x35')][_0x800b('0x38')]));_0x2bbe9e[_0x800b('0x39')]=_0x2bbe9e[_0x800b('0x39')][_0x800b('0x3a')]?_0x2bbe9e[_0x800b('0x39')]:_0x1786b0[_0x800b('0x34')];_0x2bbe9e[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0xde8e90[_0x800b('0x35')]['sort']);_0x2bbe9e['where']=qs[_0x800b('0x36')](_[_0x800b('0x41')](_0xde8e90[_0x800b('0x35')],_0x1786b0[_0x800b('0x36')]));if(_0xde8e90[_0x800b('0x35')][_0x800b('0x42')]){_0x2bbe9e[_0x800b('0x40')]=_[_0x800b('0x43')](_0x2bbe9e[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0x2bbe9e[_0x800b('0x39')],function(_0x3a9c9c){var _0x3de1fa={};_0x3de1fa[_0x3a9c9c]={'$like':'%'+_0xde8e90[_0x800b('0x35')]['filter']+'%'};return _0x3de1fa;})});}_0x2bbe9e=_[_0x800b('0x43')]({},_0x2bbe9e,_0xde8e90[_0x800b('0x60')]);return _0x341030[_0x800b('0x10d')](_0x2bbe9e);}})[_0x800b('0x16')](function(_0x389f97){if(_0x389f97){_0x1472a8=_0x389f97[_0x800b('0x3a')];if(!_0xde8e90['query'][_0x800b('0x3b')](_0x800b('0x3c'))){_0x2bbe9e[_0x800b('0x3d')]=qs['limit'](_0xde8e90[_0x800b('0x35')][_0x800b('0x3d')]);_0x2bbe9e[_0x800b('0x23')]=qs['offset'](_0xde8e90[_0x800b('0x35')][_0x800b('0x23')]);}return _0x341030['getApplications'](_0x2bbe9e);}})[_0x800b('0x16')](function(_0x64fbd5){if(_0x64fbd5){return _0x64fbd5?{'count':_0x1472a8,'rows':_0x64fbd5}:null;}})[_0x800b('0x16')](respondWithResult(_0xf0a301,null))[_0x800b('0x48')](handleError(_0xf0a301,null));};exports['addProactiveActions']=function(_0x1e99e6,_0xbfbf63){return db[_0x800b('0x10e')]['find']({'where':{'id':_0x1e99e6[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0xbfbf63,null))['then'](function(_0x33b434){if(_0x33b434){return _0x33b434['addProactiveActions'](_0x1e99e6['body']['ids'],_[_0x800b('0xe5')](_0x1e99e6[_0x800b('0x4f')],['ids','id'])||{});}})[_0x800b('0x16')](respondWithResult(_0xbfbf63,null))['catch'](handleError(_0xbfbf63,null));};exports[_0x800b('0xf9')]=function(_0x7d912,_0x4346a5){var _0x1708f8={};var _0x47e662={};var _0x464897;var _0x588e41;return db['ChatWebsite']['findOne']({'where':{'id':_0x7d912['params']['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x4346a5,null))['then'](function(_0x31dc89){if(_0x31dc89){_0x464897=_0x31dc89;_0x47e662['model']=_[_0x800b('0x4b')](db['ChatProactiveAction']['rawAttributes']);_0x47e662['query']=_[_0x800b('0x4b')](_0x7d912[_0x800b('0x35')]);_0x47e662[_0x800b('0x36')]=_[_0x800b('0x37')](_0x47e662[_0x800b('0x34')],_0x47e662[_0x800b('0x35')]);_0x1708f8[_0x800b('0x39')]=_[_0x800b('0x37')](_0x47e662['model'],qs['fields'](_0x7d912[_0x800b('0x35')][_0x800b('0x38')]));_0x1708f8['attributes']=_0x1708f8[_0x800b('0x39')][_0x800b('0x3a')]?_0x1708f8[_0x800b('0x39')]:_0x47e662[_0x800b('0x34')];_0x1708f8['order']=qs[_0x800b('0x3f')](_0x7d912[_0x800b('0x35')][_0x800b('0x3f')]);_0x1708f8[_0x800b('0x40')]=qs['filters'](_['pick'](_0x7d912['query'],_0x47e662[_0x800b('0x36')]));if(_0x7d912['query'][_0x800b('0x42')]){_0x1708f8[_0x800b('0x40')]=_[_0x800b('0x43')](_0x1708f8[_0x800b('0x40')],{'$or':_[_0x800b('0x44')](_0x1708f8['attributes'],function(_0x41c20e){var _0x2af076={};_0x2af076[_0x41c20e]={'$like':'%'+_0x7d912[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x2af076;})});}_0x1708f8=_[_0x800b('0x43')]({},_0x1708f8,_0x7d912[_0x800b('0x60')]);return _0x464897['getProactiveActions'](_0x1708f8);}})[_0x800b('0x16')](function(_0x1c4138){if(_0x1c4138){_0x588e41=_0x1c4138[_0x800b('0x3a')];if(!_0x7d912[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x1708f8['limit']=qs[_0x800b('0x3d')](_0x7d912[_0x800b('0x35')]['limit']);_0x1708f8['offset']=qs[_0x800b('0x23')](_0x7d912[_0x800b('0x35')][_0x800b('0x23')]);}return _0x464897['getProactiveActions'](_0x1708f8);}})[_0x800b('0x16')](function(_0x27b428){if(_0x27b428){return _0x27b428?{'count':_0x588e41,'rows':_0x27b428}:null;}})[_0x800b('0x16')](respondWithResult(_0x4346a5,null))[_0x800b('0x48')](handleError(_0x4346a5,null));};exports['getFields']=function(_0x156804,_0x2f8253){var _0x5c5f70=_0x156804['query'][_0x800b('0x10f')]===_0x800b('0x110')?'offlineForm':_0x800b('0x111');return db['ChatWebsite'][_0x800b('0x52')]({'attributes':['id',_0x5c5f70],'where':{'id':_0x156804[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0x2f8253,null))[_0x800b('0x16')](function(_0x516777){if(_0x516777){var _0x15e5f0=_0x516777[_0x5c5f70];var _0x45385d=_0x15e5f0&&_0x15e5f0[_0x800b('0x112')]?_0x15e5f0['items']:[];_0x2f8253[_0x800b('0x2e')]({'fromKey':_['isNil'](_0x15e5f0['fromKey'])?undefined:_0x15e5f0[_0x800b('0x113')],'count':_0x45385d[_0x800b('0x3a')],'rows':_0x45385d});}})[_0x800b('0x48')](handleError(_0x2f8253,null));};exports[_0x800b('0x114')]=function(_0x527ede,_0x1c9860){var _0x102f61={'raw':![],'where':{}};var _0x1dcd7a={};var _0x1e5e34={'count':0x0,'rows':[]};return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x527ede[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c9860,null))[_0x800b('0x16')](function(_0x309b52){if(_0x309b52){_0x1dcd7a[_0x800b('0x34')]=_[_0x800b('0x4b')](db[_0x800b('0x115')]['rawAttributes']);_0x1dcd7a[_0x800b('0x35')]=_[_0x800b('0x4b')](_0x527ede[_0x800b('0x35')]);_0x1dcd7a[_0x800b('0x36')]=_['intersection'](_0x1dcd7a[_0x800b('0x34')],_0x1dcd7a[_0x800b('0x35')]);_0x102f61['attributes']=_[_0x800b('0x37')](_0x1dcd7a[_0x800b('0x34')],qs[_0x800b('0x38')](_0x527ede[_0x800b('0x35')]['fields']));_0x102f61['attributes']=_0x102f61['attributes'][_0x800b('0x3a')]?_0x102f61[_0x800b('0x39')]:_0x1dcd7a[_0x800b('0x34')];if(!_0x527ede[_0x800b('0x35')][_0x800b('0x3b')](_0x800b('0x3c'))){_0x102f61['limit']=qs['limit'](_0x527ede[_0x800b('0x35')]['limit']);_0x102f61[_0x800b('0x23')]=qs[_0x800b('0x23')](_0x527ede[_0x800b('0x35')][_0x800b('0x23')]);}_0x102f61[_0x800b('0x3e')]=qs[_0x800b('0x3f')](_0x527ede['query'][_0x800b('0x3f')]);_0x102f61[_0x800b('0x40')]=qs[_0x800b('0x36')](_['pick'](_0x527ede['query'],_0x1dcd7a[_0x800b('0x36')]));_0x102f61[_0x800b('0x40')]['ChatWebsiteId']=_0x309b52['id'];if(_0x527ede['query']['filter']){_0x102f61[_0x800b('0x40')]=_[_0x800b('0x43')](_0x102f61[_0x800b('0x40')],{'$or':_['map'](_0x102f61[_0x800b('0x39')],function(_0xc5e418){var _0x3c9ec7={};_0x3c9ec7[_0xc5e418]={'$like':'%'+_0x527ede['query'][_0x800b('0x42')]+'%'};return _0x3c9ec7;})});}_0x102f61=_[_0x800b('0x43')]({},_0x102f61,_0x527ede[_0x800b('0x60')]);return db[_0x800b('0x115')][_0x800b('0x25')]({'where':_0x102f61[_0x800b('0x40')]})[_0x800b('0x16')](function(_0x558f51){_0x1e5e34[_0x800b('0x25')]=_0x558f51;if(_0x527ede[_0x800b('0x35')][_0x800b('0x4c')]){_0x102f61[_0x800b('0x4d')]=[{'all':!![]}];}else{_0x102f61['include']=[{'model':db[_0x800b('0x7f')],'as':_0x800b('0x116'),'required':![]},{'model':db[_0x800b('0xd1')],'as':_0x800b('0x117'),'required':![]}];}return db[_0x800b('0x115')][_0x800b('0x5a')](_0x102f61);})['then'](function(_0x5dce72){_0x1e5e34[_0x800b('0x47')]=_0x5dce72;return _0x1e5e34;});}})['then'](respondWithFilteredResult(_0x1c9860,_0x102f61))[_0x800b('0x48')](handleError(_0x1c9860,null));};exports[_0x800b('0x118')]=function(_0x4e615b,_0x205bb7){return db[_0x800b('0x30')]['find']({'where':{'id':_0x4e615b[_0x800b('0x49')]['id']}})['then'](handleEntityNotFound(_0x205bb7,null))[_0x800b('0x16')](function(_0x125970){if(_0x125970){return _0x125970[_0x800b('0x118')](_0x4e615b[_0x800b('0x4f')][_0x800b('0x5c')],_[_0x800b('0xe5')](_0x4e615b[_0x800b('0x4f')],['ids','id'])||{})[_0x800b('0xab')](function(_0xd974c5){for(var _0x40d1a2=0x0;_0x40d1a2<_0x4e615b[_0x800b('0x4f')]['ids'][_0x800b('0x3a')];_0x40d1a2+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x4e615b['body'][_0x800b('0x5c')][_0x40d1a2]),'ChatWebsiteId':Number(_0x4e615b[_0x800b('0x49')]['id'])});}return _0xd974c5;});}})[_0x800b('0x16')](respondWithResult(_0x205bb7,null))[_0x800b('0x48')](handleError(_0x205bb7,null));};exports[_0x800b('0x119')]=function(_0x372429,_0xaa5ee5){return db['ChatWebsite'][_0x800b('0x52')]({'where':{'id':_0x372429[_0x800b('0x49')]['id']}})[_0x800b('0x16')](handleEntityNotFound(_0xaa5ee5,null))[_0x800b('0x16')](function(_0x272535){if(_0x272535){return _0x272535[_0x800b('0x119')](_0x372429[_0x800b('0x35')][_0x800b('0x5c')])['then'](function(){if(_[_0x800b('0x11a')](_0x372429['query'][_0x800b('0x5c')])){for(var _0x3ee256=0x0;_0x3ee256<_0x372429['query'][_0x800b('0x5c')][_0x800b('0x3a')];_0x3ee256+=0x1){socket[_0x800b('0x11b')](_0x800b('0x11c'),{'UserId':Number(_0x372429[_0x800b('0x35')][_0x800b('0x5c')][_0x3ee256]),'ChatWebsiteId':Number(_0x372429[_0x800b('0x49')]['id'])});}}else{socket[_0x800b('0x11b')](_0x800b('0x11c'),{'UserId':Number(_0x372429['query'][_0x800b('0x5c')]),'ChatWebsiteId':Number(_0x372429[_0x800b('0x49')]['id'])});}});}})[_0x800b('0x16')](respondWithStatusCode(_0xaa5ee5,null))['catch'](handleError(_0xaa5ee5,null));};exports[_0x800b('0x11d')]=function(_0x55c699,_0x337e8e){var _0x437c59={};var _0x171303={};var _0x3056d9;var _0x290889;return db[_0x800b('0x30')]['findOne']({'where':{'id':_0x55c699['params']['id']}})['then'](handleEntityNotFound(_0x337e8e,null))[_0x800b('0x16')](function(_0x20f8c8){if(_0x20f8c8){_0x3056d9=_0x20f8c8;_0x171303['model']=_[_0x800b('0x4b')](db['User'][_0x800b('0x31')]);_0x171303[_0x800b('0x35')]=_[_0x800b('0x4b')](_0x55c699[_0x800b('0x35')]);_0x171303['filters']=_[_0x800b('0x37')](_0x171303[_0x800b('0x34')],_0x171303['query']);_0x437c59[_0x800b('0x39')]=_[_0x800b('0x37')](_0x171303[_0x800b('0x34')],qs[_0x800b('0x38')](_0x55c699[_0x800b('0x35')][_0x800b('0x38')]));_0x437c59[_0x800b('0x39')]=_0x437c59[_0x800b('0x39')][_0x800b('0x3a')]?_0x437c59[_0x800b('0x39')]:_0x171303[_0x800b('0x34')];_0x437c59['order']=qs[_0x800b('0x3f')](_0x55c699[_0x800b('0x35')][_0x800b('0x3f')]);_0x437c59['where']=qs[_0x800b('0x36')](_[_0x800b('0x41')](_0x55c699[_0x800b('0x35')],_0x171303[_0x800b('0x36')]));if(_0x55c699['query'][_0x800b('0x42')]){_0x437c59[_0x800b('0x40')]=_[_0x800b('0x43')](_0x437c59['where'],{'$or':_[_0x800b('0x44')](_0x437c59[_0x800b('0x39')],function(_0x4e7d4f){var _0x5e60ad={};_0x5e60ad[_0x4e7d4f]={'$like':'%'+_0x55c699[_0x800b('0x35')][_0x800b('0x42')]+'%'};return _0x5e60ad;})});}_0x437c59=_[_0x800b('0x43')]({},_0x437c59,_0x55c699[_0x800b('0x60')]);return _0x3056d9[_0x800b('0x11d')](_0x437c59);}})[_0x800b('0x16')](function(_0x59224d){if(_0x59224d){_0x290889=_0x59224d[_0x800b('0x3a')];if(!_0x55c699['query'][_0x800b('0x3b')](_0x800b('0x3c'))){_0x437c59['limit']=qs[_0x800b('0x3d')](_0x55c699[_0x800b('0x35')][_0x800b('0x3d')]);_0x437c59['offset']=qs['offset'](_0x55c699[_0x800b('0x35')][_0x800b('0x23')]);}return _0x3056d9[_0x800b('0x11d')](_0x437c59);}})[_0x800b('0x16')](function(_0x1c7f7e){if(_0x1c7f7e){return _0x1c7f7e?{'count':_0x290889,'rows':_0x1c7f7e}:null;}})['then'](respondWithResult(_0x337e8e,null))[_0x800b('0x48')](handleError(_0x337e8e,null));};
\ No newline at end of file
+var _0x73e9=['priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','html-to-text','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','include','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','Pause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','ChatApplication','Applications','account','applications','List','orderBy','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','x-real-port','browser','version','%s\x20%s','device','format','%s\x20%s\x20%s','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','close','unmanaged','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','fromString','mimetype','server','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','virtual','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS'];(function(_0x1885d3,_0x538bd0){var _0x14d4d1=function(_0x4cb895){while(--_0x4cb895){_0x1885d3['push'](_0x1885d3['shift']());}};_0x14d4d1(++_0x538bd0);}(_0x73e9,0x13e));var _0x973e=function(_0x64bbb9,_0x909c76){_0x64bbb9=_0x64bbb9-0x0;var _0x5c3707=_0x73e9[_0x64bbb9];return _0x5c3707;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x973e('0x0'));var util=require('util');var path=require(_0x973e('0x1'));var ejs=require(_0x973e('0x2'));var fs=require('fs');var fs_extra=require(_0x973e('0x3'));var _=require(_0x973e('0x4'));var querystring=require(_0x973e('0x5'));var Redis=require(_0x973e('0x6'));var qs=require(_0x973e('0x7'));var logger=require(_0x973e('0x8'))('api');var config=require(_0x973e('0x9'));var db=require(_0x973e('0xa'))['db'];config[_0x973e('0xb')]=_[_0x973e('0xc')](config[_0x973e('0xb')],{'host':_0x973e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x973e('0xe')](socket);var htmlToText=require(_0x973e('0xf'));var jayson=require(_0x973e('0x10'));var client=jayson[_0x973e('0x11')][_0x973e('0x12')]({'port':0x232c});var client9002=jayson['client'][_0x973e('0x12')]({'port':0x232a});var client9003=jayson['client'][_0x973e('0x12')]({'port':0x232b});var client9001=jayson[_0x973e('0x11')][_0x973e('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x2d3399,_0x2e31b4,_0x286bc3,_0x3ce85c){return new BPromise(function(_0x52b7f3,_0x406e73){var _0x1c26bf=_0x3ce85c||client;return _0x1c26bf[_0x973e('0x13')](_0x2d3399,_0x286bc3)['then'](function(_0x39ddc2){logger[_0x973e('0x14')](_0x973e('0x15'),_0x2e31b4,'request\x20sent');logger[_0x973e('0x16')](_0x973e('0x17'),_0x2e31b4,'request\x20sent',JSON['stringify'](_0x39ddc2));if(_0x39ddc2[_0x973e('0x18')]){if(_0x39ddc2[_0x973e('0x18')][_0x973e('0x19')]===0x1f4){logger[_0x973e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x2e31b4,_0x39ddc2[_0x973e('0x18')][_0x973e('0x1a')]);return _0x406e73(_0x39ddc2[_0x973e('0x18')]['message']);}logger['error'](_0x973e('0x15'),_0x2e31b4,_0x39ddc2[_0x973e('0x18')]['message']);return _0x52b7f3(_0x39ddc2[_0x973e('0x18')][_0x973e('0x1a')]);}else{logger[_0x973e('0x14')](_0x973e('0x15'),_0x2e31b4,_0x973e('0x1b'));_0x52b7f3(_0x39ddc2[_0x973e('0x1c')][_0x973e('0x1a')]);}})['catch'](function(_0x19f4f5){logger[_0x973e('0x18')](_0x973e('0x15'),_0x2e31b4,_0x19f4f5);_0x406e73(_0x19f4f5);});});}function respondWithStatusCode(_0x5c5d38,_0xe762c8){_0xe762c8=_0xe762c8||0xcc;return function(_0x552ce7){if(_0x552ce7){return _0x5c5d38[_0x973e('0x1d')](_0xe762c8);}return _0x5c5d38[_0x973e('0x1e')](_0xe762c8)[_0x973e('0x1f')]();};}function respondWithResult(_0x3aa99f,_0xf7d091){_0xf7d091=_0xf7d091||0xc8;return function(_0x3b6b3e){if(_0x3b6b3e){return _0x3aa99f[_0x973e('0x1e')](_0xf7d091)[_0x973e('0x20')](_0x3b6b3e);}};}function respondWithFilteredResult(_0x15bf3b,_0x38d7e4){return function(_0x26f28b){if(_0x26f28b){var _0x43d91c=typeof _0x38d7e4[_0x973e('0x21')]===_0x973e('0x22')&&typeof _0x38d7e4[_0x973e('0x23')]===_0x973e('0x22');var _0x194075=_0x26f28b['count'];var _0x1f7cf7=_0x43d91c?0x0:_0x38d7e4[_0x973e('0x21')];var _0x41c930=_0x43d91c?_0x26f28b[_0x973e('0x24')]:_0x38d7e4[_0x973e('0x21')]+_0x38d7e4['limit'];var _0xc4f7c8;if(_0x41c930>=_0x194075){_0x41c930=_0x194075;_0xc4f7c8=0xc8;}else{_0xc4f7c8=0xce;}_0x15bf3b[_0x973e('0x1e')](_0xc4f7c8);return _0x15bf3b[_0x973e('0x25')](_0x973e('0x26'),_0x1f7cf7+'-'+_0x41c930+'/'+_0x194075)['json'](_0x26f28b);}return null;};}function saveUpdates(_0x1c2207){return function(_0x5262b3){if(_0x5262b3){return _0x5262b3[_0x973e('0x27')](_0x1c2207)[_0x973e('0x28')](function(_0x14f6a3){return _0x14f6a3;});}return null;};}function removeEntity(_0x51392c){return function(_0x1b3f0f){if(_0x1b3f0f){return _0x1b3f0f[_0x973e('0x29')]()[_0x973e('0x28')](function(){var _0x3ee27b=_0x1b3f0f[_0x973e('0x2a')]({'plain':!![]});var _0x16fb7a='ChatWebsites';return db['UserProfileResource'][_0x973e('0x29')]({'where':{'type':_0x16fb7a,'resourceId':_0x3ee27b['id']}})[_0x973e('0x28')](function(){return _0x1b3f0f;});})['then'](function(){_0x51392c['status'](0xcc)[_0x973e('0x1f')]();});}};}function handleEntityNotFound(_0x3e00e3){return function(_0x53f931){if(!_0x53f931){_0x3e00e3[_0x973e('0x1d')](0x194);}return _0x53f931;};}function handleError(_0x485e75,_0x25da5f){_0x25da5f=_0x25da5f||0x1f4;return function(_0x323d7c){logger[_0x973e('0x18')](_0x323d7c[_0x973e('0x2b')]);if(_0x323d7c['name']){delete _0x323d7c[_0x973e('0x2c')];}_0x485e75[_0x973e('0x1e')](_0x25da5f)[_0x973e('0x2d')](_0x323d7c);};}exports[_0x973e('0x2e')]=function(_0x5c1fa0,_0x1480ad){var _0x3dee98={'include':[{'model':db['Pause'],'as':_0x973e('0x2f')}]},_0x268d96={},_0x32f2a1={'count':0x0,'rows':[]};var _0xf3e928=_[_0x973e('0x30')](db[_0x973e('0x31')][_0x973e('0x32')],function(_0x127efe){return{'name':_0x127efe['fieldName'],'type':_0x127efe[_0x973e('0x33')][_0x973e('0x34')]};});_0x268d96[_0x973e('0x35')]=_[_0x973e('0x30')](_0xf3e928,_0x973e('0x2c'));_0x268d96[_0x973e('0x36')]=_[_0x973e('0x37')](_0x5c1fa0[_0x973e('0x36')]);_0x268d96[_0x973e('0x38')]=_[_0x973e('0x39')](_0x268d96[_0x973e('0x35')],_0x268d96[_0x973e('0x36')]);_0x3dee98[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x268d96[_0x973e('0x35')],qs[_0x973e('0x3b')](_0x5c1fa0['query'][_0x973e('0x3b')]));_0x3dee98[_0x973e('0x3a')]=_0x3dee98[_0x973e('0x3a')][_0x973e('0x3c')]?_0x3dee98[_0x973e('0x3a')]:_0x268d96[_0x973e('0x35')];if(!_0x5c1fa0[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0x3dee98[_0x973e('0x23')]=qs[_0x973e('0x23')](_0x5c1fa0[_0x973e('0x36')][_0x973e('0x23')]);_0x3dee98[_0x973e('0x21')]=qs[_0x973e('0x21')](_0x5c1fa0[_0x973e('0x36')][_0x973e('0x21')]);}_0x3dee98[_0x973e('0x3f')]=qs['sort'](_0x5c1fa0[_0x973e('0x36')][_0x973e('0x40')]);_0x3dee98['where']=qs[_0x973e('0x38')](_['pick'](_0x5c1fa0[_0x973e('0x36')],_0x268d96['filters']),_0xf3e928);if(_0x5c1fa0[_0x973e('0x36')][_0x973e('0x41')]){_0x3dee98[_0x973e('0x42')]=_[_0x973e('0x43')](_0x3dee98[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0xf3e928,function(_0x36c917){if(_0x36c917[_0x973e('0x33')]!==_0x973e('0x44')){var _0x5bbe6f={};_0x5bbe6f[_0x36c917[_0x973e('0x2c')]]={'$like':'%'+_0x5c1fa0[_0x973e('0x36')]['filter']+'%'};return _0x5bbe6f;}})});}_0x3dee98=_[_0x973e('0x43')]({},_0x3dee98,_0x5c1fa0['options']);var _0x14b7ab={'where':_0x3dee98[_0x973e('0x42')]};return db[_0x973e('0x31')]['count'](_0x14b7ab)[_0x973e('0x28')](function(_0x4e7e20){_0x32f2a1[_0x973e('0x24')]=_0x4e7e20;if(_0x5c1fa0['query']['includeAll']){_0x3dee98[_0x973e('0x45')]=[{'all':!![]}];}return db[_0x973e('0x31')]['findAll'](_0x3dee98);})[_0x973e('0x28')](function(_0x50bc46){_0x32f2a1['rows']=_0x50bc46;return _0x32f2a1;})[_0x973e('0x28')](respondWithFilteredResult(_0x1480ad,_0x3dee98))['catch'](handleError(_0x1480ad,null));};exports['show']=function(_0x71d11c,_0x4e86e7){var _0xb7a268={'raw':![],'where':{'id':_0x71d11c['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x35ef49={};_0x35ef49[_0x973e('0x35')]=_[_0x973e('0x37')](db['ChatWebsite'][_0x973e('0x32')]);_0x35ef49[_0x973e('0x36')]=_[_0x973e('0x37')](_0x71d11c[_0x973e('0x36')]);_0x35ef49['filters']=_[_0x973e('0x39')](_0x35ef49[_0x973e('0x35')],_0x35ef49[_0x973e('0x36')]);_0xb7a268[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x35ef49[_0x973e('0x35')],qs[_0x973e('0x3b')](_0x71d11c[_0x973e('0x36')][_0x973e('0x3b')]));_0xb7a268[_0x973e('0x3a')]=_0xb7a268['attributes'][_0x973e('0x3c')]?_0xb7a268[_0x973e('0x3a')]:_0x35ef49[_0x973e('0x35')];if(_0x71d11c['query'][_0x973e('0x46')]){_0xb7a268[_0x973e('0x45')]=[{'all':!![]}];}_0xb7a268=_[_0x973e('0x43')]({},_0xb7a268,_0x71d11c[_0x973e('0x47')]);return db['ChatWebsite'][_0x973e('0x48')](_0xb7a268)['then'](handleEntityNotFound(_0x4e86e7,null))[_0x973e('0x28')](respondWithResult(_0x4e86e7,null))[_0x973e('0x49')](handleError(_0x4e86e7,null));};exports[_0x973e('0x4a')]=function(_0x390d1e,_0x1b0a1b){return db['ChatWebsite'][_0x973e('0x4a')](_0x390d1e[_0x973e('0x4b')],{})[_0x973e('0x28')](function(_0x3f3ccb){var _0x45484a=_0x390d1e[_0x973e('0x4c')]['get']({'plain':!![]});if(!_0x45484a)throw new Error(_0x973e('0x4d'));if(_0x45484a[_0x973e('0x4e')]===_0x973e('0x4c')){var _0x33140d=_0x3f3ccb[_0x973e('0x2a')]({'plain':!![]});var _0x335a05=_0x973e('0x4f');return db[_0x973e('0x50')][_0x973e('0x48')]({'where':{'name':_0x335a05,'userProfileId':_0x45484a[_0x973e('0x51')]},'raw':!![]})['then'](function(_0x48627b){if(_0x48627b&&_0x48627b[_0x973e('0x52')]===0x0){return db[_0x973e('0x53')]['create']({'name':_0x33140d['name'],'resourceId':_0x33140d['id'],'type':_0x48627b[_0x973e('0x2c')],'sectionId':_0x48627b['id']},{})[_0x973e('0x28')](function(){return _0x3f3ccb;});}else{return _0x3f3ccb;}})[_0x973e('0x49')](function(_0x52396e){logger[_0x973e('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52396e);throw _0x52396e;});}return _0x3f3ccb;})[_0x973e('0x28')](respondWithResult(_0x1b0a1b,0xc9))[_0x973e('0x49')](handleError(_0x1b0a1b,null));};exports[_0x973e('0x27')]=function(_0x262e11,_0x2da4a4){if(_0x262e11[_0x973e('0x4b')]['id']){delete _0x262e11[_0x973e('0x4b')]['id'];}return db['ChatWebsite'][_0x973e('0x48')]({'where':{'id':_0x262e11[_0x973e('0x54')]['id']},'include':[{'model':db[_0x973e('0x55')],'as':_0x973e('0x2f')}]})['then'](handleEntityNotFound(_0x2da4a4,null))[_0x973e('0x28')](saveUpdates(_0x262e11[_0x973e('0x4b')],null))[_0x973e('0x28')](respondWithResult(_0x2da4a4,null))['catch'](handleError(_0x2da4a4,null));};exports[_0x973e('0x29')]=function(_0x5a5032,_0x126710){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x5a5032[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x126710,null))['then'](removeEntity(_0x126710,null))[_0x973e('0x49')](handleError(_0x126710,null));};exports[_0x973e('0x56')]=function(_0x4a65ee,_0x21ad9e){return db[_0x973e('0x31')][_0x973e('0x56')]()['then'](respondWithResult(_0x21ad9e,null))[_0x973e('0x49')](handleError(_0x21ad9e,null));};exports[_0x973e('0x57')]=function(_0x5bf4e0,_0x51f069){if(_0x5bf4e0[_0x973e('0x4b')]['id']){delete _0x5bf4e0[_0x973e('0x4b')]['id'];}return db[_0x973e('0x31')]['find']({'where':{'id':_0x5bf4e0[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x51f069,null))[_0x973e('0x28')](function(_0x2d9026){if(_0x2d9026){_0x5bf4e0[_0x973e('0x4b')][_0x973e('0x58')]=_0x2d9026['id'];return db[_0x973e('0x59')][_0x973e('0x4a')](_0x5bf4e0[_0x973e('0x4b')]);}})[_0x973e('0x28')](respondWithResult(_0x51f069,null))['catch'](handleError(_0x51f069,null));};exports[_0x973e('0x5a')]=function(_0x15282d,_0x128729){var _0x20ed23={'raw':![],'where':{}};var _0xd64b35={};var _0x551fd7={'count':0x0,'rows':[]};return db[_0x973e('0x31')]['findOne']({'where':{'id':_0x15282d[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x128729,null))['then'](function(_0x388f00){if(_0x388f00){_0xd64b35['model']=_['keys'](db[_0x973e('0x59')][_0x973e('0x32')]);_0xd64b35['query']=_[_0x973e('0x37')](_0x15282d['query']);_0xd64b35[_0x973e('0x38')]=_[_0x973e('0x39')](_0xd64b35[_0x973e('0x35')],_0xd64b35[_0x973e('0x36')]);_0x20ed23[_0x973e('0x3a')]=_[_0x973e('0x39')](_0xd64b35[_0x973e('0x35')],qs['fields'](_0x15282d['query'][_0x973e('0x3b')]));_0x20ed23['attributes']=_0x20ed23[_0x973e('0x3a')][_0x973e('0x3c')]?_0x20ed23[_0x973e('0x3a')]:_0xd64b35[_0x973e('0x35')];if(!_0x15282d[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0x20ed23['limit']=qs[_0x973e('0x23')](_0x15282d[_0x973e('0x36')][_0x973e('0x23')]);_0x20ed23['offset']=qs['offset'](_0x15282d[_0x973e('0x36')][_0x973e('0x21')]);}_0x20ed23['order']=qs['sort'](_0x15282d[_0x973e('0x36')][_0x973e('0x40')]);_0x20ed23[_0x973e('0x42')]=qs[_0x973e('0x38')](_[_0x973e('0x5b')](_0x15282d[_0x973e('0x36')],_0xd64b35[_0x973e('0x38')]));_0x20ed23['where'][_0x973e('0x58')]=_0x388f00['id'];if(_0x15282d[_0x973e('0x36')][_0x973e('0x41')]){_0x20ed23[_0x973e('0x42')]=_[_0x973e('0x43')](_0x20ed23[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x20ed23['attributes'],function(_0x186e6a){var _0x23df2e={};_0x23df2e[_0x186e6a]={'$like':'%'+_0x15282d['query'][_0x973e('0x41')]+'%'};return _0x23df2e;})});}_0x20ed23=_[_0x973e('0x43')]({},_0x20ed23,_0x15282d[_0x973e('0x47')]);return db['Disposition'][_0x973e('0x24')]({'where':_0x20ed23[_0x973e('0x42')]})[_0x973e('0x28')](function(_0xdc7001){_0x551fd7[_0x973e('0x24')]=_0xdc7001;if(_0x15282d[_0x973e('0x36')][_0x973e('0x46')]){_0x20ed23['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x20ed23);})[_0x973e('0x28')](function(_0x1f42c2){_0x551fd7[_0x973e('0x5c')]=_0x1f42c2;return _0x551fd7;});}})[_0x973e('0x28')](respondWithFilteredResult(_0x128729,_0x20ed23))[_0x973e('0x49')](handleError(_0x128729,null));};exports['removeDispositions']=function(_0x591869,_0x24f9d1){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x591869[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x24f9d1,null))['then'](function(_0x109e56){if(_0x109e56){return _0x109e56[_0x973e('0x5d')](_0x591869[_0x973e('0x36')][_0x973e('0x5e')]);}})[_0x973e('0x28')](respondWithStatusCode(_0x24f9d1,null))[_0x973e('0x49')](handleError(_0x24f9d1,null));};exports[_0x973e('0x5f')]=function(_0x42ad54,_0x5c2f80){if(_0x42ad54[_0x973e('0x4b')]['id']){delete _0x42ad54[_0x973e('0x4b')]['id'];}return db['ChatWebsite'][_0x973e('0x48')]({'where':{'id':_0x42ad54[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x5c2f80,null))[_0x973e('0x28')](function(_0x5bf337){if(_0x5bf337){_0x42ad54['body'][_0x973e('0x58')]=_0x5bf337['id'];return db[_0x973e('0x60')]['create'](_0x42ad54['body']);}})[_0x973e('0x28')](respondWithResult(_0x5c2f80,null))[_0x973e('0x49')](handleError(_0x5c2f80,null));};exports[_0x973e('0x61')]=function(_0x15ccb9,_0x16a311){var _0x4a275b={'raw':![],'where':{}};var _0x213826={};var _0x13be66={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x973e('0x62')]({'where':{'id':_0x15ccb9[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x16a311,null))[_0x973e('0x28')](function(_0x537e0e){if(_0x537e0e){_0x213826[_0x973e('0x35')]=_[_0x973e('0x37')](db[_0x973e('0x60')][_0x973e('0x32')]);_0x213826[_0x973e('0x36')]=_[_0x973e('0x37')](_0x15ccb9[_0x973e('0x36')]);_0x213826['filters']=_[_0x973e('0x39')](_0x213826[_0x973e('0x35')],_0x213826[_0x973e('0x36')]);_0x4a275b['attributes']=_['intersection'](_0x213826['model'],qs[_0x973e('0x3b')](_0x15ccb9['query'][_0x973e('0x3b')]));_0x4a275b[_0x973e('0x3a')]=_0x4a275b[_0x973e('0x3a')]['length']?_0x4a275b['attributes']:_0x213826[_0x973e('0x35')];if(!_0x15ccb9['query']['hasOwnProperty'](_0x973e('0x3e'))){_0x4a275b['limit']=qs[_0x973e('0x23')](_0x15ccb9[_0x973e('0x36')][_0x973e('0x23')]);_0x4a275b['offset']=qs[_0x973e('0x21')](_0x15ccb9[_0x973e('0x36')]['offset']);}_0x4a275b['order']=qs['sort'](_0x15ccb9[_0x973e('0x36')][_0x973e('0x40')]);_0x4a275b['where']=qs[_0x973e('0x38')](_['pick'](_0x15ccb9[_0x973e('0x36')],_0x213826['filters']));_0x4a275b['where'][_0x973e('0x58')]=_0x537e0e['id'];if(_0x15ccb9[_0x973e('0x36')][_0x973e('0x41')]){_0x4a275b['where']=_['merge'](_0x4a275b[_0x973e('0x42')],{'$or':_['map'](_0x4a275b[_0x973e('0x3a')],function(_0x3eca70){var _0x3880b7={};_0x3880b7[_0x3eca70]={'$like':'%'+_0x15ccb9[_0x973e('0x36')]['filter']+'%'};return _0x3880b7;})});}_0x4a275b=_['merge']({},_0x4a275b,_0x15ccb9[_0x973e('0x47')]);return db[_0x973e('0x60')][_0x973e('0x24')]({'where':_0x4a275b['where']})[_0x973e('0x28')](function(_0x3b4ba6){_0x13be66[_0x973e('0x24')]=_0x3b4ba6;if(_0x15ccb9[_0x973e('0x36')][_0x973e('0x46')]){_0x4a275b[_0x973e('0x45')]=[{'all':!![]}];}return db[_0x973e('0x60')][_0x973e('0x63')](_0x4a275b);})[_0x973e('0x28')](function(_0x2f2a22){_0x13be66['rows']=_0x2f2a22;return _0x13be66;});}})['then'](respondWithFilteredResult(_0x16a311,_0x4a275b))[_0x973e('0x49')](handleError(_0x16a311,null));};exports['removeAnswers']=function(_0x559298,_0x3ed8e7){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x559298['params']['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x3ed8e7,null))[_0x973e('0x28')](function(_0x95f65){if(_0x95f65){return _0x95f65[_0x973e('0x64')](_0x559298[_0x973e('0x36')][_0x973e('0x5e')]);}})['then'](respondWithStatusCode(_0x3ed8e7,null))[_0x973e('0x49')](handleError(_0x3ed8e7,null));};exports[_0x973e('0x65')]=function(_0x5ca247,_0x127bd4){_0x5ca247[_0x973e('0x4b')][_0x973e('0x66')]=_0x5ca247[_0x973e('0x67')][_0x973e('0x68')];return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x5ca247[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x127bd4,null))[_0x973e('0x28')](saveUpdates(_0x5ca247[_0x973e('0x4b')],null))[_0x973e('0x28')](respondWithResult(_0x127bd4,null))['catch'](handleError(_0x127bd4,null));};exports[_0x973e('0x69')]=function(_0x2d3819,_0x123da2){_0x2d3819[_0x973e('0x4b')]['agentAvatar']=_0x2d3819[_0x973e('0x67')][_0x973e('0x68')];return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x2d3819[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x123da2,null))['then'](saveUpdates(_0x2d3819[_0x973e('0x4b')],null))[_0x973e('0x28')](respondWithResult(_0x123da2,null))[_0x973e('0x49')](handleError(_0x123da2,null));};exports[_0x973e('0x6a')]=function(_0xba73b9,_0x9e17f8){_0xba73b9[_0x973e('0x4b')][_0x973e('0x6b')]=_0xba73b9[_0x973e('0x67')][_0x973e('0x68')];return db['ChatWebsite']['find']({'where':{'id':_0xba73b9[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x9e17f8,null))['then'](saveUpdates(_0xba73b9[_0x973e('0x4b')],null))['then'](respondWithResult(_0x9e17f8,null))['catch'](handleError(_0x9e17f8,null));};exports['addSystemAvatar']=function(_0xae8b1a,_0x62af6b){_0xae8b1a[_0x973e('0x4b')][_0x973e('0x6c')]=_0xae8b1a[_0x973e('0x67')][_0x973e('0x68')];return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0xae8b1a[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x62af6b,null))[_0x973e('0x28')](saveUpdates(_0xae8b1a[_0x973e('0x4b')],null))[_0x973e('0x28')](respondWithResult(_0x62af6b,null))[_0x973e('0x49')](handleError(_0x62af6b,null));};exports[_0x973e('0x6d')]=function(_0x36d412,_0x3288e8){var _0xd1e0d5=path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/logos/default_logo.svg');var _0x1d6bcb={'where':{'id':_0x36d412[_0x973e('0x54')]['id']},'attributes':['id',_0x973e('0x66')],'raw':!![]};var _0x23ab3c=![];return require(_0x973e('0x70'))[_0x973e('0x71')]()[_0x973e('0x28')](function(_0x1997ff){if(_0x1997ff){_0x23ab3c=_0x1997ff[_0x973e('0x72')];}})['then'](function(){return db['ChatWebsite']['find'](_0x1d6bcb);})[_0x973e('0x28')](handleEntityNotFound(_0x3288e8,null))['then'](function(_0x40f670){if(_0x40f670){if(!_[_0x973e('0x73')](_0x40f670[_0x973e('0x66')])){if(fs[_0x973e('0x74')](path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/logos/',_0x40f670[_0x973e('0x66')]))&&_0x23ab3c){_0xd1e0d5=path['join'](config[_0x973e('0x6f')],'server/files/images/logos/',_0x40f670[_0x973e('0x66')]);}}return _0x3288e8[_0x973e('0x75')](_0xd1e0d5);}})[_0x973e('0x49')](handleError(_0x3288e8,null));};exports[_0x973e('0x76')]=function(_0x1ec7e6,_0x5a70fa){var _0x3c2ac0=path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0x77'));var _0x13c15d={'where':{'id':_0x1ec7e6[_0x973e('0x54')]['id']},'attributes':['id',_0x973e('0x78')],'raw':!![]};return db[_0x973e('0x31')][_0x973e('0x48')](_0x13c15d)[_0x973e('0x28')](handleEntityNotFound(_0x5a70fa,null))[_0x973e('0x28')](function(_0x30e8a3){if(_0x30e8a3){if(!_['isNil'](_0x30e8a3[_0x973e('0x78')])){if(fs[_0x973e('0x74')](path[_0x973e('0x6e')](config['root'],_0x973e('0x79'),_0x30e8a3['agentAvatar']))){_0x3c2ac0=path['join'](config['root'],_0x973e('0x79'),_0x30e8a3[_0x973e('0x78')]);}}return _0x5a70fa[_0x973e('0x75')](_0x3c2ac0);}})[_0x973e('0x49')](handleError(_0x5a70fa,null));};exports[_0x973e('0x7a')]=function(_0x141d0a,_0x1790b9){var _0x357c00=path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/avatars/customer_avatar.png');var _0x364cb2={'where':{'id':_0x141d0a[_0x973e('0x54')]['id']},'attributes':['id',_0x973e('0x6b'),_0x973e('0x7b')],'raw':!![]};return db['ChatWebsite'][_0x973e('0x48')](_0x364cb2)[_0x973e('0x28')](handleEntityNotFound(_0x1790b9,null))[_0x973e('0x28')](function(_0x3836eb){if(_0x3836eb){if(!_['isNil'](_0x3836eb[_0x973e('0x6b')])){if(fs[_0x973e('0x74')](path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/avatars/',_0x3836eb[_0x973e('0x6b')]))&&_0x3836eb[_0x973e('0x7b')]){_0x357c00=path['join'](config[_0x973e('0x6f')],_0x973e('0x79'),_0x3836eb[_0x973e('0x6b')]);}}return _0x1790b9[_0x973e('0x75')](_0x357c00);}})[_0x973e('0x49')](handleError(_0x1790b9,null));};exports[_0x973e('0x7c')]=function(_0x3db24c,_0x591d81){var _0x504c4c=path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0x7d'));var _0x1f07e4={'where':{'id':_0x3db24c['params']['id']},'attributes':['id',_0x973e('0x6c')],'raw':!![]};return db[_0x973e('0x31')][_0x973e('0x48')](_0x1f07e4)['then'](handleEntityNotFound(_0x591d81,null))[_0x973e('0x28')](function(_0x1891bd){if(_0x1891bd){if(!_[_0x973e('0x73')](_0x1891bd[_0x973e('0x6c')])){if(fs[_0x973e('0x74')](path[_0x973e('0x6e')](config[_0x973e('0x6f')],'server/files/images/avatars/',_0x1891bd['systemAvatar']))){_0x504c4c=path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0x79'),_0x1891bd[_0x973e('0x6c')]);}}return _0x591d81[_0x973e('0x75')](_0x504c4c);}})['catch'](handleError(_0x591d81,null));};exports[_0x973e('0x7e')]=function(_0xf6f22,_0x3423fb){var _0x2e80f9=require(_0x973e('0x7f'));var _0x541a76=new _0x2e80f9();var _0x439b08=_0x541a76[_0x973e('0x80')](_0xf6f22[_0x973e('0x81')]['user-agent'])['getResult']();var _0x57d5e8={'body':_0xf6f22[_0x973e('0x4b')],'channel':_0x973e('0x82')};var _0x14a693=[];var _0x1f5a33=[];var _0x4ea6c7={};var _0x349d2d=![];return db[_0x973e('0x83')]['describe']()[_0x973e('0x28')](function(_0x10efcf){if(!_0x10efcf){throw new db[(_0x973e('0x84'))][(_0x973e('0x85'))]('no\x20available\x20attributes');}_0x14a693=_[_0x973e('0x86')](_['keys'](_0x10efcf),['createdAt',_0x973e('0x87')]);_0x1f5a33=_['difference'](_[_0x973e('0x37')](_0x10efcf),[_0x973e('0x88'),_0x973e('0x87'),'CompanyId',_0x973e('0x89')]);if(_0xf6f22[_0x973e('0x4b')]['id']){delete _0xf6f22[_0x973e('0x4b')]['id'];}if(_[_0x973e('0x73')](_0xf6f22['body'][_0x973e('0x8a')])){throw new db[(_0x973e('0x84'))]['ValidationError'](_0x973e('0x8b'));}if(_['isNil'](_0xf6f22[_0x973e('0x4b')][_0x973e('0x4b')])||_0xf6f22[_0x973e('0x4b')]['body']===''){throw new db[(_0x973e('0x84'))][(_0x973e('0x85'))](_0x973e('0x8c'));}if(_[_0x973e('0x73')](_0xf6f22[_0x973e('0x4b')][_0x973e('0x8d')])){throw new db['Sequelize'][(_0x973e('0x85'))](_0x973e('0x8e')+_0x1f5a33);}if(!_[_0x973e('0x8f')](_0x1f5a33,_0xf6f22[_0x973e('0x4b')]['mapKey'])){throw new db[(_0x973e('0x84'))][(_0x973e('0x85'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f5a33);}_0x4ea6c7[_0xf6f22[_0x973e('0x4b')][_0x973e('0x8d')]]=_0xf6f22[_0x973e('0x4b')]['from'];})[_0x973e('0x28')](function(){return db[_0x973e('0x31')]['find']({'where':{'id':_0xf6f22['params']['id']},'include':[{'model':db[_0x973e('0x90')],'as':'List','include':[{'model':db[_0x973e('0x83')],'as':_0x973e('0x91'),'where':_0x4ea6c7,'limit':0x1,'order':[[_0x973e('0x87'),_0x973e('0x92')]]}]},{'model':db[_0x973e('0x93')],'as':_0x973e('0x94')}]});})[_0x973e('0x28')](handleEntityNotFound(_0x3423fb,null))[_0x973e('0x28')](function(_0x452635){if(_0x452635&&_0x452635['List']){_0x57d5e8[_0x973e('0x95')]=_0x452635;_0x57d5e8[_0x973e('0x96')]=_0x452635[_0x973e('0x94')];_0x57d5e8['list']=_0x452635[_0x973e('0x97')];_0x57d5e8[_0x973e('0x96')]=_[_0x973e('0x98')](_0x57d5e8[_0x973e('0x96')],['priority'],[_0x973e('0x99')]);if(_0x57d5e8[_0x973e('0x95')]['Applications']){delete _0x57d5e8[_0x973e('0x95')][_0x973e('0x94')];}if(_0x57d5e8['account'][_0x973e('0x97')]&&_0x57d5e8['account'][_0x973e('0x97')]['Contacts'][_0x973e('0x3c')]){return _0x57d5e8[_0x973e('0x95')][_0x973e('0x97')][_0x973e('0x91')][0x0];}var _0x2d3ee5=_[_0x973e('0xc')](_0xf6f22[_0x973e('0x4b')],{'firstName':_0xf6f22[_0x973e('0x4b')][_0x973e('0x8a')],'ListId':_0x452635[_0x973e('0x89')]});_0x2d3ee5[_0xf6f22[_0x973e('0x4b')][_0x973e('0x8d')]]=_0xf6f22[_0x973e('0x4b')]['from'];return db['CmContact'][_0x973e('0x4a')](_0x2d3ee5,{'fields':_0x14a693,'raw':!![]});}})[_0x973e('0x28')](handleEntityNotFound(_0x3423fb,null))['then'](function(_0x87a746){_0x57d5e8[_0x973e('0x9a')]=_0x87a746;var _0x2f8185=_0xf6f22[_0x973e('0x4b')][_0x973e('0x9b')];if(_0xf6f22['headers']['cf-connecting-ip']){_0x2f8185=_0xf6f22[_0x973e('0x81')][_0x973e('0x9c')];}else if(_0xf6f22['headers'][_0x973e('0x9d')]){_0x2f8185=_['first'](_0xf6f22[_0x973e('0x81')]['x-forwarded-for'][_0x973e('0x9e')](','));}if(_0x87a746){var _0x4bc92a={'ContactId':_0x87a746['id'],'ChatWebsiteId':_0xf6f22['params']['id'],'from':(_0x87a746['firstName']||'')+'\x20'+(_0x87a746['lastName']||''),'customerIp':_0x2f8185,'customerPort':_0xf6f22[_0x973e('0x81')]['x-real-port']?_0xf6f22['headers'][_0x973e('0x9f')]:null,'referer':_0xf6f22[_0x973e('0x4b')]['referer'],'browserName':_0x439b08['browser'][_0x973e('0x2c')]&&_0x439b08[_0x973e('0xa0')][_0x973e('0xa1')]?util['format']('%s\x20%s',_0x439b08[_0x973e('0xa0')][_0x973e('0x2c')],_0x439b08['browser'][_0x973e('0xa1')]):'unknown','browserVersion':_0x439b08[_0x973e('0xa0')][_0x973e('0xa1')]||'unknown','osName':util['format'](_0x973e('0xa2'),_0x439b08['os']['name'],_0x439b08['os'][_0x973e('0xa1')]),'osVersion':_0x439b08['os'][_0x973e('0xa1')],'deviceModel':_0x439b08[_0x973e('0xa3')][_0x973e('0x35')]&&_0x439b08[_0x973e('0xa3')]['vendor']?util[_0x973e('0xa4')](_0x973e('0xa5'),_0x439b08[_0x973e('0xa3')][_0x973e('0x35')],_0x439b08[_0x973e('0xa3')][_0x973e('0xa6')],_0x439b08[_0x973e('0xa3')][_0x973e('0x33')]):null,'deviceVendor':_0x439b08['device'][_0x973e('0xa6')],'deviceType':_0x439b08[_0x973e('0xa3')][_0x973e('0x33')],'formData':JSON[_0x973e('0xa7')](_0xf6f22[_0x973e('0x4b')])};var _0xe99b76={'ChatWebsiteId':_0xf6f22[_0x973e('0x54')]['id'],'closed':![]};if(_0xf6f22['body'][_0x973e('0xa8')]){_0xe99b76[_0x973e('0xa8')]=_0xf6f22['body']['threadId'];return db[_0x973e('0xa9')][_0x973e('0x48')]({'where':_0xe99b76})[_0x973e('0x28')](function(_0x314f07){if(_0x314f07){return[_0x314f07,![]];}_0x4bc92a[_0x973e('0xa8')]=_0xf6f22[_0x973e('0x4b')][_0x973e('0xa8')];_0x4bc92a[_0x973e('0xaa')]=_0xf6f22[_0x973e('0x4b')][_0x973e('0xaa')];return db['ChatInteraction'][_0x973e('0x4a')](_0x4bc92a)['then'](function(_0x1f87ab){return[_0x1f87ab,!![]];});});}_0xe99b76[_0x973e('0xab')]=_0x87a746['id'];if(_0xf6f22['body'][_0x973e('0xac')]&&_0xf6f22[_0x973e('0x4b')][_0x973e('0xac')]['id']){_0xe99b76['id']=_0xf6f22[_0x973e('0x4b')][_0x973e('0xac')]['id'];return db[_0x973e('0xa9')][_0x973e('0x48')]({'where':_0xe99b76})[_0x973e('0x28')](function(_0x12c162){if(_0x12c162){return[_0x12c162,![]];}return db[_0x973e('0xa9')]['create'](_0x4bc92a)['then'](function(_0x5b36ad){return[_0x5b36ad,!![]];});});}return db['ChatInteraction'][_0x973e('0x4a')](_0x4bc92a)[_0x973e('0x28')](function(_0x286d9a){return[_0x286d9a,!![]];});}})[_0x973e('0xad')](function(_0x31d39d,_0x408b33){if(_0x31d39d){_0x349d2d=_0x408b33;if(!_0x408b33){var _0x44e500={'from':(_0x57d5e8[_0x973e('0x9a')][_0x973e('0xae')]||'')+'\x20'+(_0x57d5e8['contact']['lastName']||'')};if(_0xf6f22[_0x973e('0x4b')][_0x973e('0xa8')]&&_0xf6f22['body'][_0x973e('0xaf')]&&_0xf6f22['body']['threadId']!=_0xf6f22[_0x973e('0x4b')][_0x973e('0xaf')]){_0x44e500[_0x973e('0xa8')]=_0xf6f22['body'][_0x973e('0xaf')];}return _0x31d39d[_0x973e('0x27')](_0x44e500);}else{return _0x31d39d;}}})[_0x973e('0x28')](function(_0x1df3fd){_0x57d5e8['interaction']=_0x1df3fd[_0x973e('0x2a')]({'plain':!![]});_0x57d5e8[_0x973e('0xac')][_0x973e('0xb0')]=_0x349d2d;if(_0x57d5e8[_0x973e('0xac')][_0x973e('0xb0')]){if(_0x57d5e8[_0x973e('0x95')][_0x973e('0xb1')]){_0x57d5e8[_0x973e('0x96')]['push']({'id':0x0,'priority':_0x57d5e8[_0x973e('0x96')]['length']+0x1,'app':_0x973e('0xb2'),'appdata':_0x973e('0xb3'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x973e('0x4a')]({'body':_0xf6f22[_0x973e('0x4b')]['body'],'ChatWebsiteId':_0xf6f22[_0x973e('0x54')]['id'],'ChatInteractionId':_0x1df3fd['id'],'direction':'in','ContactId':_0x57d5e8[_0x973e('0x9a')]['id'],'AttachmentId':_0xf6f22[_0x973e('0x4b')][_0x973e('0xb4')]});})[_0x973e('0x28')](function(_0x2babf4){_0x57d5e8['message']=_0x2babf4;if(_0x57d5e8[_0x973e('0xac')]['UserId']){return db[_0x973e('0xb5')]['find']({'attributes':['id','name'],'where':{'id':_0x57d5e8['interaction'][_0x973e('0xb6')]}})['then'](function(_0x5d62b3){if(_0x5d62b3){_0x57d5e8['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x973e('0xb7'),'appdata':_0x5d62b3[_0x973e('0x2c')]+','+(_0x57d5e8['account'][_0x973e('0xb8')]||0xa),'interval':_0x973e('0xb9')});_0x57d5e8[_0x973e('0xba')]=!![];}return respondWithRpcPromise(_0x973e('0xbb'),_0x973e('0xbc'),_0x57d5e8);});}return respondWithRpcPromise(_0x973e('0xbb'),_0x973e('0xbc'),_0x57d5e8);})['then'](function(_0x24ab80){respondWithRpcPromise(_0x973e('0xbd'),_0x973e('0xbd'),{'event':_0x973e('0x7e'),'message':_0x24ab80},client9002);return _0x24ab80;})[_0x973e('0x28')](respondWithResult(_0x3423fb,null))[_0x973e('0x49')](handleError(_0x3423fb,null));};exports[_0x973e('0xbe')]=function(_0x240a35,_0x1cb4b9){var _0x359cd3,_0x296b0a,_0x186f21;var _0x52851f=[];var _0x217fef={};var _0x344ed7=_0x240a35[_0x973e('0xbf')]||[];var _0x2dfdc7=[];var _0x3ec6db;return db[_0x973e('0x83')][_0x973e('0x56')]()[_0x973e('0x28')](function(_0x3d72d4){if(!_0x3d72d4){throw new db['Sequelize']['ValidationError'](_0x973e('0xc0'));}_0x52851f=_[_0x973e('0x86')](_[_0x973e('0x37')](_0x3d72d4),[_0x973e('0x88'),_0x973e('0x87'),_0x973e('0xc1'),_0x973e('0x89')]);if(_0x240a35['body']['id']){delete _0x240a35[_0x973e('0x4b')]['id'];}if(_[_0x973e('0x73')](_0x240a35[_0x973e('0x4b')][_0x973e('0x8a')])){throw _0x1cb4b9[_0x973e('0x1e')](0x1f4)[_0x973e('0x2d')](new db[(_0x973e('0x84'))][(_0x973e('0x85'))](_0x973e('0x8b')));}if(_['isNil'](_0x240a35[_0x973e('0x4b')][_0x973e('0x4b')])||_0x240a35[_0x973e('0x4b')]['body']===''){throw _0x1cb4b9[_0x973e('0x1e')](0x1f4)[_0x973e('0x2d')](new db[(_0x973e('0x84'))]['ValidationError'](_0x973e('0x8c')));}if(_[_0x973e('0x73')](_0x240a35['body'][_0x973e('0xc2')])){throw _0x1cb4b9[_0x973e('0x1e')](0x1f4)[_0x973e('0x2d')](new db[(_0x973e('0x84'))]['ValidationError'](_0x973e('0xc3')+_0x52851f));}if(!_[_0x973e('0x8f')](_0x52851f,_0x240a35['body']['mapKeyOffline'])){throw _0x1cb4b9[_0x973e('0x1e')](0x1f4)[_0x973e('0x2d')](new db[(_0x973e('0x84'))][(_0x973e('0x85'))](_0x973e('0xc4')+_0x52851f));}_0x217fef[_0x240a35[_0x973e('0x4b')][_0x973e('0xc2')]]=_0x240a35[_0x973e('0x4b')]['from'];})[_0x973e('0x28')](function(){return db[_0x973e('0x31')]['find']({'where':{'id':_0x240a35['params']['id']},'include':[{'model':db[_0x973e('0x90')],'as':_0x973e('0x97')},{'model':db[_0x973e('0xc5')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x1cb4b9,null))['then'](function(_0x4ffae0){if(_0x4ffae0&&_0x4ffae0['List']){_0x296b0a=_0x4ffae0;var _0x40ff19=_[_0x973e('0xc')](_0x240a35['body'],{'firstName':_0x240a35[_0x973e('0x4b')][_0x973e('0x8a')],'phone':_0x240a35[_0x973e('0x4b')]['from'],'ListId':_0x4ffae0[_0x973e('0x89')]});_0x40ff19[_0x240a35[_0x973e('0x4b')][_0x973e('0xc2')]]=_0x240a35[_0x973e('0x4b')][_0x973e('0x8a')];return db[_0x973e('0x83')][_0x973e('0xc6')]({'where':_0x217fef,'defaults':_0x40ff19});}})[_0x973e('0xad')](function(_0x2c38ed){if(_0x2c38ed){_0x186f21=_0x2c38ed;var _0x5d219f=fs[_0x973e('0xc7')](path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0xc8')),'utf8');var _0x2445c3=ejs[_0x973e('0xc9')](_0x5d219f,{'body':_[_0x973e('0xca')](_0x240a35[_0x973e('0x4b')][_0x973e('0x4b')]),'bodyTitle':_0x296b0a[_0x973e('0xcb')]});return db['ChatOfflineMessage'][_0x973e('0x4a')]({'body':_0x2445c3,'plainBody':htmlToText[_0x973e('0xcc')](_0x2445c3),'ContactId':_0x2c38ed['id'],'ChatWebsiteId':_0x296b0a['id']});}})['then'](function(_0x51f478){_0x3ec6db=_0x51f478;if(_0x344ed7['length']){var _0x88ac1=_0x344ed7[_0x973e('0x30')](function(_0x23d994){return{'name':_0x23d994['originalname'],'basename':_0x23d994[_0x973e('0x68')],'type':_0x23d994[_0x973e('0xcd')],'ChatOfflineMessageId':_0x51f478['id']};});_0x2dfdc7=_0x88ac1[_0x973e('0x30')](_0x407e9b=>{var _0x19fb14={'filename':_0x407e9b[_0x973e('0x2c')],'path':path[_0x973e('0x6e')](config[_0x973e('0x6f')],_0x973e('0xce'),_0x973e('0xbf'),'attachments',_0x973e('0xcf'),_0x407e9b['basename'])};return _0x19fb14;});if(!_0x296b0a[_0x973e('0xd0')]){return db[_0x973e('0xd1')][_0x973e('0xd2')](function(_0x3ebfe5){return db[_0x973e('0xd3')][_0x973e('0xd4')](_0x88ac1,{'transaction':_0x3ebfe5});});}}})[_0x973e('0x28')](function(){if(_0x3ec6db){_0x359cd3=_0x3ec6db;return db[_0x973e('0xc5')][_0x973e('0x62')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x973e('0xd5'),'raw':!![],'include':[{'model':db[_0x973e('0xd6')],'as':_0x973e('0xd6'),'raw':!![]}]}]});}})[_0x973e('0x28')](function(_0x2ddc96){if(_0x2ddc96&&_0x2ddc96[_0x973e('0xd5')]&&_0x296b0a[_0x973e('0xd7')]&&_0x296b0a['forwardOfflineAddress']){var _0x5dc443=_0x2ddc96[_0x973e('0xd8')]();return respondWithRpcPromise(_0x973e('0xd9'),_0x973e('0xda'),{'account':_0x5dc443,'message':{'from':util['format'](_0x973e('0xdb'),_0x2ddc96[_0x973e('0x2c')],_0x2ddc96[_0x973e('0xdc')]||_0x2ddc96['Smtp'][_0x973e('0x4c')]),'to':_0x296b0a[_0x973e('0xdd')],'subject':_0x296b0a['offlineMessageSubject'],'html':_0x359cd3[_0x973e('0x4b')],'attachments':_0x2dfdc7}},client9003)[_0x973e('0x28')](function(){return _0x359cd3;})[_0x973e('0x49')](function(_0x2bed03){logger[_0x973e('0x18')](_0x2bed03);});}})[_0x973e('0x28')](function(){if(_0x296b0a&&_0x296b0a[_0x973e('0xd0')]&&_0x296b0a[_0x973e('0xde')]){var _0x1630a3=[];if(_0x344ed7['length']){_0x1630a3=_0x344ed7[_0x973e('0x30')](function(_0x498c7b){return{'name':_0x498c7b[_0x973e('0xdf')],'basename':_0x498c7b['filename'],'type':_0x498c7b[_0x973e('0xcd')],'ChatOfflineMessageId':_0x3ec6db['id']};});}var _0x4a5744;if(!_[_0x973e('0x73')](_0x296b0a[_0x973e('0xe0')])){var _0x361608=_[_0x973e('0x30')](_0x240a35[_0x973e('0x4b')],function(_0x5e0237){return _0x5e0237;});var _0x7ad4ed=_[_0x973e('0xe1')](_0x361608)[0x0];var _0x2529cf=_[_0x973e('0xe2')](_0x7ad4ed,function(_0x538205){return _0x538205;});_0x4a5744=_0x2529cf[0x1][_0x296b0a[_0x973e('0xe0')]];}var _0x3c406b={'from':_0x186f21[_0x973e('0xdc')],'firstName':_0x186f21[_0x973e('0xae')],'lastName':_0x186f21['lastName'],'mapKey':_0x973e('0xdc'),'message':{'from':_0x186f21[_0x973e('0xdc')],'to':_0x296b0a[_0x973e('0xc5')][_0x973e('0xdc')],'cc':'','subject':_['isNil'](_0x4a5744)?_0x296b0a['offlineMessageSubject']:_0x4a5744,'messageId':'','sentAt':new Date(),'attach':_0x1630a3[_0x973e('0x3c')],'attachments':_0x1630a3,'originChannel':_0x973e('0xe3'),'ChatWebsiteId':_0x296b0a['id'],'ChatOfflineMessageId':_0x359cd3['id'],'originTo':_0x296b0a['MailAccount']['email']},'body':_0x359cd3['body']};var _0x24bbe0={'account':{'id':_0x296b0a[_0x973e('0xde')]},'body':_0x3c406b,'log':_0x973e('0xe4')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x24bbe0,client9001)[_0x973e('0x28')](function(){return _0x359cd3;})[_0x973e('0x49')](function(_0x142de8){logger[_0x973e('0x18')](_0x142de8);});}return;})['then'](function(){if(_0x359cd3){return _0x359cd3;}})[_0x973e('0x28')](respondWithResult(_0x1cb4b9,null))[_0x973e('0x49')](function(_0x3c53f1){logger['error']('catch',_0x3c53f1);for(var _0xe2e15a of _0x344ed7){var _0x1a9a4d=path['join'](config[_0x973e('0x6f')],_0x973e('0xce'),_0x973e('0xbf'),'attachments',_0x973e('0xcf'),_0xe2e15a[_0x973e('0x68')]);fs_extra[_0x973e('0xe5')](_0x1a9a4d)[_0x973e('0x49')](function(_0x29ec58){logger[_0x973e('0x18')](_0x973e('0xe6'),_0x1a9a4d,_0x29ec58);});}});};exports[_0x973e('0xe7')]=function(_0x2e8361,_0x45dced){return db[_0x973e('0xa9')][_0x973e('0x48')]({'where':{'id':_0x2e8361[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x45dced,null))[_0x973e('0x28')](function(_0x102561){if(_0x102561){return _0x102561[_0x973e('0xe7')](_0x2e8361[_0x973e('0x4b')][_0x973e('0x5e')],_['omit'](_0x2e8361[_0x973e('0x4b')],[_0x973e('0x5e'),'id'])||{});}})[_0x973e('0x28')](respondWithResult(_0x45dced,null))[_0x973e('0x49')](handleError(_0x45dced,null));};exports[_0x973e('0xe8')]=function(_0xd29d5a,_0x34436b){var _0x3d3a3a={'raw':![],'where':{}};var _0xc56ba9={};var _0x17c897={'count':0x0,'rows':[]};return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0xd29d5a['params']['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x34436b,null))[_0x973e('0x28')](function(_0x468491){if(_0x468491){_0xc56ba9['model']=_[_0x973e('0x37')](db[_0x973e('0xa9')][_0x973e('0x32')]);_0xc56ba9[_0x973e('0x36')]=_[_0x973e('0x37')](_0xd29d5a[_0x973e('0x36')]);_0xc56ba9[_0x973e('0x38')]=_[_0x973e('0x39')](_0xc56ba9['model'],_0xc56ba9[_0x973e('0x36')]);_0x3d3a3a['attributes']=_[_0x973e('0x39')](_0xc56ba9['model'],qs[_0x973e('0x3b')](_0xd29d5a[_0x973e('0x36')][_0x973e('0x3b')]));_0x3d3a3a[_0x973e('0x3a')]=_0x3d3a3a['attributes']['length']?_0x3d3a3a[_0x973e('0x3a')]:_0xc56ba9['model'];if(!_0xd29d5a[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0x3d3a3a[_0x973e('0x23')]=qs[_0x973e('0x23')](_0xd29d5a['query'][_0x973e('0x23')]);_0x3d3a3a[_0x973e('0x21')]=qs[_0x973e('0x21')](_0xd29d5a[_0x973e('0x36')]['offset']);}_0x3d3a3a[_0x973e('0x3f')]=qs[_0x973e('0x40')](_0xd29d5a['query'][_0x973e('0x40')]);_0x3d3a3a[_0x973e('0x42')]=qs['filters'](_[_0x973e('0x5b')](_0xd29d5a[_0x973e('0x36')],_0xc56ba9[_0x973e('0x38')]));_0x3d3a3a[_0x973e('0x42')][_0x973e('0x58')]=_0x468491['id'];if(_0xd29d5a[_0x973e('0x36')][_0x973e('0x41')]){_0x3d3a3a['where']=_[_0x973e('0x43')](_0x3d3a3a[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x3d3a3a[_0x973e('0x3a')],function(_0x371c71){var _0x3b66b1={};_0x3b66b1[_0x371c71]={'$like':'%'+_0xd29d5a[_0x973e('0x36')]['filter']+'%'};return _0x3b66b1;})});}_0x3d3a3a=_[_0x973e('0x43')]({},_0x3d3a3a,_0xd29d5a[_0x973e('0x47')]);return db[_0x973e('0xa9')][_0x973e('0x24')]({'where':_0x3d3a3a[_0x973e('0x42')]})['then'](function(_0x15abaf){_0x17c897['count']=_0x15abaf;if(_0xd29d5a[_0x973e('0x36')][_0x973e('0x46')]){_0x3d3a3a[_0x973e('0x45')]=[{'model':db[_0x973e('0x83')],'as':_0x973e('0xe9'),'required':![]},{'model':db[_0x973e('0xb5')],'as':'Owner','attributes':[_0x973e('0x2c'),_0x973e('0xea'),_0x973e('0xeb')],'required':![]},{'model':db[_0x973e('0xec')],'as':_0x973e('0xed'),'attributes':['id',_0x973e('0x2c'),_0x973e('0xee')],'where':_0xd29d5a[_0x973e('0x36')][_0x973e('0xef')]?{'id':_0xd29d5a[_0x973e('0x36')]['tag']}:undefined,'required':_0xd29d5a['query'][_0x973e('0xef')]?!![]:![]}];}return db[_0x973e('0xa9')][_0x973e('0x63')](_0x3d3a3a);})[_0x973e('0x28')](function(_0xc3191a){_0x17c897['rows']=_0xc3191a;return _0x17c897;});}})[_0x973e('0x28')](respondWithFilteredResult(_0x34436b,_0x3d3a3a))['catch'](handleError(_0x34436b,null));};function iftimePromise(_0x8c695f,_0x445012){return respondWithRpcPromise('Command',_0x973e('0xf0'),{'command':_0x445012[_0x973e('0xf1')]?util[_0x973e('0xa4')]('iftime\x20%s,%s',_0x8c695f[_0x973e('0xf2')],_0x445012[_0x973e('0xf1')]):util[_0x973e('0xa4')](_0x973e('0xf3'),_0x8c695f[_0x973e('0xf2')])},client9002)['then'](function(_0x14609d){var _0x2d1686=_0x14609d&&_0x14609d[_0x973e('0xf4')]('true')>=0x0?!![]:![];logger[_0x973e('0x14')](_0x973e('0xf5'),_0x445012['id'],_0x8c695f['id'],_0x8c695f[_0x973e('0xf2')],_0x2d1686?_0x973e('0xf6'):_0x973e('0xf7'),_0x445012[_0x973e('0xf1')]?_0x445012['timezone']:_0x973e('0xf8'));return _0x2d1686;})[_0x973e('0x49')](function(_0x18ce43){logger['error'](_0x973e('0xf5'),_0x445012['id'],_0x8c695f['id'],_0x8c695f[_0x973e('0xf2')],util[_0x973e('0xf9')](_0x18ce43,{'showHidden':![],'depth':null}),_0x445012[_0x973e('0xf1')]?_0x445012['timezone']:_0x973e('0xf8'));return![];});}exports[_0x973e('0xf0')]=function(_0x4f61c9,_0x110b9a){var _0x78ef25=0x0;var _0x3f8a2f=0x0;var _0x30e961=![];var _0xd0ff5c;var _0x406de3;return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x4f61c9[_0x973e('0x54')]['id']},'include':[{'model':db[_0x973e('0xfa')],'as':_0x973e('0xfa'),'include':[{'model':db[_0x973e('0xfa')],'as':_0x973e('0xfb'),'attributes':['id',_0x973e('0xf2')],'raw':!![]}]}]})[_0x973e('0x28')](handleEntityNotFound(_0x110b9a,null))['then'](function(_0x15bb20){if(_0x15bb20){_0xd0ff5c=_0x15bb20;return _0x15bb20[_0x973e('0xfc')]({'raw':!![]});}})['then'](function(_0x445a49){if(_0xd0ff5c){if(_0x445a49){_0x406de3=_0x445a49;}}return require(_0x973e('0x70'))['getLicense']();})[_0x973e('0x28')](function(_0x2f26c0){if(_0x2f26c0){_0x3f8a2f=_0x2f26c0['virtual'];_0x30e961=_0x2f26c0['custom'];}})[_0x973e('0x28')](function(){return db[_0x973e('0xa9')][_0x973e('0x24')]({'where':{'closed':![]}});})[_0x973e('0x28')](function(_0x17a96d){_0x78ef25=_0x17a96d;if(_0x3f8a2f&&_0x17a96d>_0x3f8a2f){return db[_0x973e('0xfd')]['findOne']({'where':{'id':0x1}})[_0x973e('0x28')](function(_0x5b1db5){if(_0x5b1db5){_0x5b1db5[_0x973e('0xfe')](_0x973e('0xff'));}});}})['then'](function(){if(_0xd0ff5c[_0x973e('0xfa')]&&_0xd0ff5c[_0x973e('0xfa')][_0x973e('0xfb')]){var _0x1a6240=[];for(var _0x59d3a0=0x0;_0x59d3a0<_0xd0ff5c[_0x973e('0xfa')][_0x973e('0xfb')]['length'];_0x59d3a0++){var _0x5b82b8=_0xd0ff5c['Interval'][_0x973e('0xfb')][_0x59d3a0]['get']({'plain':!![]});_0x1a6240['push'](iftimePromise(_0x5b82b8,_0xd0ff5c));}return BPromise[_0x973e('0x100')](_0x1a6240)['then'](function(_0x3f2099){return _[_0x973e('0x101')](_0x3f2099);});}else{return!![];}})[_0x973e('0x28')](function(_0x553139){var _0x53163c=fs[_0x973e('0xc7')](path['join'](config[_0x973e('0x6f')],_0x973e('0x102')),_0x973e('0x103'));var _0x4a76a9={'remote':_0xd0ff5c['remote'],'query':querystring[_0x973e('0xa7')](_[_0x973e('0x43')](_0xd0ff5c[_0x973e('0x2a')]({'plain':!![]}),{'customerIp':_0x4f61c9[_0x973e('0x81')][_0x973e('0x9d')]||_0x4f61c9['headers']['x-real-ip']||_0x4f61c9['connection']['remoteAddress']||_0x4f61c9['ip'],'referer':_0x4f61c9[_0x973e('0x81')]['referer'],'openedInteractions':_0x78ef25,'maxInteractions':_0x3f8a2f,'virtual':_0x30e961[_0x973e('0x104')],'online':_0x553139,'custom':_0x30e961}))[_0x973e('0x105')](/'/g,'\x5c\x27')};_0x110b9a[_0x973e('0x2d')](ejs[_0x973e('0xc9')](Mustache['render'](_0x53163c,_0x4a76a9),{'proactiveActions':_0x406de3,'alignment':_0xd0ff5c[_0x973e('0x106')],'verticalAlignment':_0xd0ff5c[_0x973e('0x107')],'div_color':_0xd0ff5c['color'],'labelText':_0xd0ff5c[_0x973e('0x108')],'text_color':_0xd0ff5c[_0x973e('0x109')],'button_color':_0xd0ff5c[_0x973e('0x10a')],'background_color':_0xd0ff5c[_0x973e('0x10b')],'hideWhenOffline':_0xd0ff5c['hideWhenOffline'],'interval':_0xd0ff5c[_0x973e('0x10c')]}));})[_0x973e('0x49')](handleError(_0x110b9a,null));};exports[_0x973e('0x10d')]=function(_0x4cc435,_0x4b808d){var _0xb4202e=_0x4cc435[_0x973e('0x54')]['id'];var _0x29b058=_0x4cc435['body'];var _0x81080a=0xc8;var _0x3da563=null;return db[_0x973e('0xd1')][_0x973e('0xd2')]({'isolationLevel':db[_0x973e('0xd1')][_0x973e('0x10e')][_0x973e('0x10f')]['READ_COMMITTED']},function(_0xb2ab7b){return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0xb4202e},'transaction':_0xb2ab7b})[_0x973e('0x28')](function(_0x2b64c7){if(_0x2b64c7){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0xb4202e},'transaction':_0xb2ab7b})[_0x973e('0x28')](function(){var _0x3f68aa=_['map'](_0x29b058,function(_0x1637c0){_0x1637c0[_0x973e('0x58')]=_0xb4202e;return _0x1637c0;});return db[_0x973e('0x93')]['bulkCreate'](_0x3f68aa,{'transaction':_0xb2ab7b});});}else{_0x81080a=0x194;_0x3da563=[];}});})['then'](function(){if(_0x81080a!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0xb4202e},'order':_0x973e('0x110')})['then'](function(_0x531c86){_0x3da563=_0x531c86;});}})['catch'](function(_0x241bf6){_0x81080a=0x1f4;logger[_0x973e('0x18')](_0x241bf6[_0x973e('0x2b')]);if(_0x241bf6['name']){delete _0x241bf6[_0x973e('0x2c')];}_0x3da563=_0x241bf6;})[_0x973e('0x111')](function(){if(_0x3da563===null){_0x4b808d[_0x973e('0x1d')](_0x81080a);}else{if(_0x81080a===0x1f4){_0x4b808d['status'](_0x81080a)['send'](_0x3da563);}else{_0x4b808d[_0x973e('0x1e')](_0x81080a)[_0x973e('0x20')](_0x3da563);}}});};exports[_0x973e('0x112')]=function(_0x1146af,_0x3e675c){var _0x48f673={};var _0x2f5eb4={};var _0x44fdf5;var _0x50e0a9;return db['ChatWebsite'][_0x973e('0x62')]({'where':{'id':_0x1146af['params']['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x3e675c,null))[_0x973e('0x28')](function(_0xf37d31){if(_0xf37d31){_0x44fdf5=_0xf37d31;_0x2f5eb4[_0x973e('0x35')]=_['keys'](db[_0x973e('0x93')]['rawAttributes']);_0x2f5eb4[_0x973e('0x36')]=_[_0x973e('0x37')](_0x1146af[_0x973e('0x36')]);_0x2f5eb4[_0x973e('0x38')]=_[_0x973e('0x39')](_0x2f5eb4[_0x973e('0x35')],_0x2f5eb4[_0x973e('0x36')]);_0x48f673[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x2f5eb4[_0x973e('0x35')],qs['fields'](_0x1146af[_0x973e('0x36')]['fields']));_0x48f673[_0x973e('0x3a')]=_0x48f673[_0x973e('0x3a')]['length']?_0x48f673[_0x973e('0x3a')]:_0x2f5eb4['model'];_0x48f673[_0x973e('0x3f')]=qs[_0x973e('0x40')](_0x1146af[_0x973e('0x36')][_0x973e('0x40')]);_0x48f673[_0x973e('0x42')]=qs[_0x973e('0x38')](_['pick'](_0x1146af[_0x973e('0x36')],_0x2f5eb4[_0x973e('0x38')]));if(_0x1146af[_0x973e('0x36')]['filter']){_0x48f673[_0x973e('0x42')]=_['merge'](_0x48f673[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x48f673[_0x973e('0x3a')],function(_0x119bd8){var _0x17c7d6={};_0x17c7d6[_0x119bd8]={'$like':'%'+_0x1146af[_0x973e('0x36')]['filter']+'%'};return _0x17c7d6;})});}_0x48f673=_[_0x973e('0x43')]({},_0x48f673,_0x1146af['options']);return _0x44fdf5['getApplications'](_0x48f673);}})[_0x973e('0x28')](function(_0x2ad9d9){if(_0x2ad9d9){_0x50e0a9=_0x2ad9d9[_0x973e('0x3c')];if(!_0x1146af['query'][_0x973e('0x3d')](_0x973e('0x3e'))){_0x48f673[_0x973e('0x23')]=qs[_0x973e('0x23')](_0x1146af[_0x973e('0x36')][_0x973e('0x23')]);_0x48f673[_0x973e('0x21')]=qs[_0x973e('0x21')](_0x1146af[_0x973e('0x36')][_0x973e('0x21')]);}return _0x44fdf5[_0x973e('0x112')](_0x48f673);}})[_0x973e('0x28')](function(_0x120258){if(_0x120258){return _0x120258?{'count':_0x50e0a9,'rows':_0x120258}:null;}})['then'](respondWithResult(_0x3e675c,null))['catch'](handleError(_0x3e675c,null));};exports[_0x973e('0x113')]=function(_0x3f8dae,_0x31e4eb){return db[_0x973e('0x114')][_0x973e('0x48')]({'where':{'id':_0x3f8dae[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x31e4eb,null))[_0x973e('0x28')](function(_0x5f8737){if(_0x5f8737){return _0x5f8737[_0x973e('0x113')](_0x3f8dae['body'][_0x973e('0x5e')],_['omit'](_0x3f8dae[_0x973e('0x4b')],[_0x973e('0x5e'),'id'])||{});}})[_0x973e('0x28')](respondWithResult(_0x31e4eb,null))['catch'](handleError(_0x31e4eb,null));};exports['getProactiveActions']=function(_0xac15c9,_0x2e08cf){var _0x4ebaa4={};var _0x315670={};var _0x1c4fba;var _0x17c83b;return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0xac15c9[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x2e08cf,null))['then'](function(_0x35f4f9){if(_0x35f4f9){_0x1c4fba=_0x35f4f9;_0x315670[_0x973e('0x35')]=_[_0x973e('0x37')](db[_0x973e('0x115')][_0x973e('0x32')]);_0x315670[_0x973e('0x36')]=_[_0x973e('0x37')](_0xac15c9[_0x973e('0x36')]);_0x315670[_0x973e('0x38')]=_[_0x973e('0x39')](_0x315670[_0x973e('0x35')],_0x315670['query']);_0x4ebaa4[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x315670[_0x973e('0x35')],qs[_0x973e('0x3b')](_0xac15c9[_0x973e('0x36')][_0x973e('0x3b')]));_0x4ebaa4[_0x973e('0x3a')]=_0x4ebaa4[_0x973e('0x3a')]['length']?_0x4ebaa4[_0x973e('0x3a')]:_0x315670['model'];_0x4ebaa4[_0x973e('0x3f')]=qs[_0x973e('0x40')](_0xac15c9['query'][_0x973e('0x40')]);_0x4ebaa4[_0x973e('0x42')]=qs['filters'](_['pick'](_0xac15c9['query'],_0x315670['filters']));if(_0xac15c9[_0x973e('0x36')][_0x973e('0x41')]){_0x4ebaa4[_0x973e('0x42')]=_[_0x973e('0x43')](_0x4ebaa4[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x4ebaa4['attributes'],function(_0x17e925){var _0xa511df={};_0xa511df[_0x17e925]={'$like':'%'+_0xac15c9['query'][_0x973e('0x41')]+'%'};return _0xa511df;})});}_0x4ebaa4=_[_0x973e('0x43')]({},_0x4ebaa4,_0xac15c9[_0x973e('0x47')]);return _0x1c4fba[_0x973e('0xfc')](_0x4ebaa4);}})['then'](function(_0x3bd1af){if(_0x3bd1af){_0x17c83b=_0x3bd1af['length'];if(!_0xac15c9[_0x973e('0x36')]['hasOwnProperty'](_0x973e('0x3e'))){_0x4ebaa4[_0x973e('0x23')]=qs[_0x973e('0x23')](_0xac15c9[_0x973e('0x36')]['limit']);_0x4ebaa4[_0x973e('0x21')]=qs[_0x973e('0x21')](_0xac15c9[_0x973e('0x36')][_0x973e('0x21')]);}return _0x1c4fba[_0x973e('0xfc')](_0x4ebaa4);}})[_0x973e('0x28')](function(_0x5a9aae){if(_0x5a9aae){return _0x5a9aae?{'count':_0x17c83b,'rows':_0x5a9aae}:null;}})[_0x973e('0x28')](respondWithResult(_0x2e08cf,null))['catch'](handleError(_0x2e08cf,null));};exports[_0x973e('0x116')]=function(_0x2818cb,_0x942d82){var _0xcea677=_0x2818cb[_0x973e('0x36')]['online']===_0x973e('0x117')?_0x973e('0x118'):_0x973e('0x119');return db[_0x973e('0x31')][_0x973e('0x48')]({'attributes':['id',_0xcea677],'where':{'id':_0x2818cb[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x942d82,null))[_0x973e('0x28')](function(_0x1b88e1){if(_0x1b88e1){var _0x307e48=_0x1b88e1[_0xcea677];var _0xf64f23=_0x307e48&&_0x307e48['items']?_0x307e48[_0x973e('0x11a')]:[];_0x942d82[_0x973e('0x2d')]({'fromKey':_[_0x973e('0x73')](_0x307e48['fromKey'])?undefined:_0x307e48[_0x973e('0x11b')],'count':_0xf64f23['length'],'rows':_0xf64f23});}})[_0x973e('0x49')](handleError(_0x942d82,null));};exports[_0x973e('0x11c')]=function(_0x368b96,_0x5f2862){var _0xc80d8c={'raw':![],'where':{}};var _0x5c6153={};var _0x4ad7ec={'count':0x0,'rows':[]};return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0x368b96[_0x973e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f2862,null))[_0x973e('0x28')](function(_0x5ed665){if(_0x5ed665){_0x5c6153[_0x973e('0x35')]=_[_0x973e('0x37')](db[_0x973e('0x11d')][_0x973e('0x32')]);_0x5c6153[_0x973e('0x36')]=_['keys'](_0x368b96[_0x973e('0x36')]);_0x5c6153['filters']=_[_0x973e('0x39')](_0x5c6153['model'],_0x5c6153[_0x973e('0x36')]);_0xc80d8c[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x5c6153['model'],qs[_0x973e('0x3b')](_0x368b96[_0x973e('0x36')][_0x973e('0x3b')]));_0xc80d8c[_0x973e('0x3a')]=_0xc80d8c[_0x973e('0x3a')]['length']?_0xc80d8c[_0x973e('0x3a')]:_0x5c6153['model'];if(!_0x368b96[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0xc80d8c[_0x973e('0x23')]=qs[_0x973e('0x23')](_0x368b96['query'][_0x973e('0x23')]);_0xc80d8c[_0x973e('0x21')]=qs[_0x973e('0x21')](_0x368b96[_0x973e('0x36')]['offset']);}_0xc80d8c['order']=qs[_0x973e('0x40')](_0x368b96[_0x973e('0x36')]['sort']);_0xc80d8c['where']=qs['filters'](_['pick'](_0x368b96['query'],_0x5c6153['filters']));_0xc80d8c[_0x973e('0x42')]['ChatWebsiteId']=_0x5ed665['id'];if(_0x368b96[_0x973e('0x36')][_0x973e('0x41')]){_0xc80d8c[_0x973e('0x42')]=_[_0x973e('0x43')](_0xc80d8c[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0xc80d8c[_0x973e('0x3a')],function(_0x3506fc){var _0x101537={};_0x101537[_0x3506fc]={'$like':'%'+_0x368b96[_0x973e('0x36')]['filter']+'%'};return _0x101537;})});}_0xc80d8c=_[_0x973e('0x43')]({},_0xc80d8c,_0x368b96['options']);return db['ChatOfflineMessage'][_0x973e('0x24')]({'where':_0xc80d8c[_0x973e('0x42')]})[_0x973e('0x28')](function(_0x8cc3ac){_0x4ad7ec[_0x973e('0x24')]=_0x8cc3ac;if(_0x368b96[_0x973e('0x36')][_0x973e('0x46')]){_0xc80d8c[_0x973e('0x45')]=[{'all':!![]}];}else{_0xc80d8c['include']=[{'model':db['CmContact'],'as':_0x973e('0xe9'),'required':![]},{'model':db[_0x973e('0xd3')],'as':_0x973e('0x11e'),'required':![]}];}return db[_0x973e('0x11d')][_0x973e('0x63')](_0xc80d8c);})['then'](function(_0x229730){_0x4ad7ec[_0x973e('0x5c')]=_0x229730;return _0x4ad7ec;});}})[_0x973e('0x28')](respondWithFilteredResult(_0x5f2862,_0xc80d8c))['catch'](handleError(_0x5f2862,null));};exports['addAgents']=function(_0x13c59b,_0x2b696b){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x13c59b['params']['id']}})['then'](handleEntityNotFound(_0x2b696b,null))[_0x973e('0x28')](function(_0x8e2b38){if(_0x8e2b38){return _0x8e2b38[_0x973e('0x11f')](_0x13c59b[_0x973e('0x4b')]['ids'],_[_0x973e('0x120')](_0x13c59b[_0x973e('0x4b')],[_0x973e('0x5e'),'id'])||{})[_0x973e('0xad')](function(_0x366962){for(var _0x5b0763=0x0;_0x5b0763<_0x13c59b[_0x973e('0x4b')][_0x973e('0x5e')]['length'];_0x5b0763+=0x1){socket[_0x973e('0x121')](_0x973e('0x122'),{'UserId':Number(_0x13c59b[_0x973e('0x4b')]['ids'][_0x5b0763]),'ChatWebsiteId':Number(_0x13c59b[_0x973e('0x54')]['id'])});}return _0x366962;});}})[_0x973e('0x28')](respondWithResult(_0x2b696b,null))[_0x973e('0x49')](handleError(_0x2b696b,null));};exports[_0x973e('0x123')]=function(_0x2ac3af,_0x5eae14){return db[_0x973e('0x31')][_0x973e('0x48')]({'where':{'id':_0x2ac3af[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x5eae14,null))[_0x973e('0x28')](function(_0x1e8a4e){if(_0x1e8a4e){return _0x1e8a4e[_0x973e('0x123')](_0x2ac3af[_0x973e('0x36')][_0x973e('0x5e')])['then'](function(){if(_[_0x973e('0x124')](_0x2ac3af[_0x973e('0x36')]['ids'])){for(var _0x2dee3c=0x0;_0x2dee3c<_0x2ac3af[_0x973e('0x36')]['ids'][_0x973e('0x3c')];_0x2dee3c+=0x1){socket[_0x973e('0x121')](_0x973e('0x125'),{'UserId':Number(_0x2ac3af[_0x973e('0x36')]['ids'][_0x2dee3c]),'ChatWebsiteId':Number(_0x2ac3af['params']['id'])});}}else{socket['emit'](_0x973e('0x125'),{'UserId':Number(_0x2ac3af[_0x973e('0x36')][_0x973e('0x5e')]),'ChatWebsiteId':Number(_0x2ac3af[_0x973e('0x54')]['id'])});}});}})[_0x973e('0x28')](respondWithStatusCode(_0x5eae14,null))['catch'](handleError(_0x5eae14,null));};exports[_0x973e('0x126')]=function(_0x30eb8c,_0x4f5816){var _0x5c4717={};var _0x43277e={};var _0x3a276a;var _0x5d8bc8;return db[_0x973e('0x31')][_0x973e('0x62')]({'where':{'id':_0x30eb8c[_0x973e('0x54')]['id']}})[_0x973e('0x28')](handleEntityNotFound(_0x4f5816,null))[_0x973e('0x28')](function(_0xa5e65e){if(_0xa5e65e){_0x3a276a=_0xa5e65e;_0x43277e[_0x973e('0x35')]=_[_0x973e('0x37')](db[_0x973e('0xb5')][_0x973e('0x32')]);_0x43277e['query']=_[_0x973e('0x37')](_0x30eb8c['query']);_0x43277e[_0x973e('0x38')]=_[_0x973e('0x39')](_0x43277e[_0x973e('0x35')],_0x43277e[_0x973e('0x36')]);_0x5c4717[_0x973e('0x3a')]=_[_0x973e('0x39')](_0x43277e[_0x973e('0x35')],qs[_0x973e('0x3b')](_0x30eb8c[_0x973e('0x36')][_0x973e('0x3b')]));_0x5c4717[_0x973e('0x3a')]=_0x5c4717[_0x973e('0x3a')][_0x973e('0x3c')]?_0x5c4717[_0x973e('0x3a')]:_0x43277e[_0x973e('0x35')];_0x5c4717[_0x973e('0x3f')]=qs['sort'](_0x30eb8c[_0x973e('0x36')]['sort']);_0x5c4717[_0x973e('0x42')]=qs[_0x973e('0x38')](_[_0x973e('0x5b')](_0x30eb8c[_0x973e('0x36')],_0x43277e[_0x973e('0x38')]));if(_0x30eb8c['query']['filter']){_0x5c4717[_0x973e('0x42')]=_[_0x973e('0x43')](_0x5c4717[_0x973e('0x42')],{'$or':_[_0x973e('0x30')](_0x5c4717[_0x973e('0x3a')],function(_0x17190f){var _0x35d0da={};_0x35d0da[_0x17190f]={'$like':'%'+_0x30eb8c[_0x973e('0x36')][_0x973e('0x41')]+'%'};return _0x35d0da;})});}_0x5c4717=_[_0x973e('0x43')]({},_0x5c4717,_0x30eb8c[_0x973e('0x47')]);return _0x3a276a[_0x973e('0x126')](_0x5c4717);}})[_0x973e('0x28')](function(_0x2d510a){if(_0x2d510a){_0x5d8bc8=_0x2d510a[_0x973e('0x3c')];if(!_0x30eb8c[_0x973e('0x36')][_0x973e('0x3d')](_0x973e('0x3e'))){_0x5c4717[_0x973e('0x23')]=qs[_0x973e('0x23')](_0x30eb8c[_0x973e('0x36')]['limit']);_0x5c4717[_0x973e('0x21')]=qs['offset'](_0x30eb8c[_0x973e('0x36')][_0x973e('0x21')]);}return _0x3a276a[_0x973e('0x126')](_0x5c4717);}})[_0x973e('0x28')](function(_0x2220bb){if(_0x2220bb){return _0x2220bb?{'count':_0x5d8bc8,'rows':_0x2220bb}:null;}})[_0x973e('0x28')](respondWithResult(_0x4f5816,null))['catch'](handleError(_0x4f5816,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 7dbeff7..e96c38d 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 _0xd5b2=['update','remove','hasOwnProperty','exports','../../mysqldb','ChatWebsite','save'];(function(_0x29afc6,_0x37118f){var _0x23fb71=function(_0x2f435c){while(--_0x2f435c){_0x29afc6['push'](_0x29afc6['shift']());}};_0x23fb71(++_0x37118f);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd5b2[_0x24061a];return _0x82054e;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x2d5b('0x0'))['db'][_0x2d5b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d5b('0x2'),'afterUpdate':_0x2d5b('0x3'),'afterDestroy':_0x2d5b('0x4')};function emitEvent(_0x2846a3){return function(_0x5c31d3,_0x39ef3,_0x4f4491){ChatWebsiteEvents['emit'](_0x2846a3+':'+_0x5c31d3['id'],_0x5c31d3);ChatWebsiteEvents['emit'](_0x2846a3,_0x5c31d3);_0x4f4491(null);};}for(var e in events){if(events[_0x2d5b('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x2d5b('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8b2d=['update','emit','hasOwnProperty','hook','exports','ChatWebsite','save'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0x8b2d[_0x1c2f29];return _0x258465;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xd8b2('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd8b2('0x1'),'afterUpdate':_0xd8b2('0x2'),'afterDestroy':'remove'};function emitEvent(_0x273310){return function(_0x3a7304,_0x55a03c,_0x2ad404){ChatWebsiteEvents[_0xd8b2('0x3')](_0x273310+':'+_0x3a7304['id'],_0x3a7304);ChatWebsiteEvents[_0xd8b2('0x3')](_0x273310,_0x3a7304);_0x2ad404(null);};}for(var e in events){if(events[_0xd8b2('0x4')](e)){var event=events[e];ChatWebsite[_0xd8b2('0x5')](e,emitEvent(event));}}module[_0xd8b2('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 28c0ff2..4c2adcf 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 _0x2912=['ChatWebsite','chat_websites','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define'];(function(_0x5cda82,_0x9b5ed5){var _0x2115c3=function(_0x4f0126){while(--_0x4f0126){_0x5cda82['push'](_0x5cda82['shift']());}};_0x2115c3(++_0x9b5ed5);}(_0x2912,0xac));var _0x2291=function(_0x32e717,_0x303a61){_0x32e717=_0x32e717-0x0;var _0xb3c72=_0x2912[_0x32e717];return _0xb3c72;};'use strict';var _=require('lodash');var util=require(_0x2291('0x0'));var logger=require(_0x2291('0x1'))(_0x2291('0x2'));var moment=require(_0x2291('0x3'));var BPromise=require('bluebird');var rp=require(_0x2291('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2291('0x5'));var config=require(_0x2291('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x1167fd,_0x545468){return _0x1167fd[_0x2291('0x7')](_0x2291('0x8'),attributes,{'tableName':_0x2291('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66b3=['lodash','util','../../config/logger','api','moment','bluebird','path','./chatWebsite.attributes','ChatWebsite','chat_websites'];(function(_0x8cf101,_0xc97822){var _0x129dfc=function(_0x9c0f29){while(--_0x9c0f29){_0x8cf101['push'](_0x8cf101['shift']());}};_0x129dfc(++_0xc97822);}(_0x66b3,0x118));var _0x366b=function(_0x5b559e,_0x159258){_0x5b559e=_0x5b559e-0x0;var _0x27ddb7=_0x66b3[_0x5b559e];return _0x27ddb7;};'use strict';var _=require(_0x366b('0x0'));var util=require(_0x366b('0x1'));var logger=require(_0x366b('0x2'))(_0x366b('0x3'));var moment=require(_0x366b('0x4'));var BPromise=require(_0x366b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x366b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x366b('0x7'));module['exports']=function(_0x3abd12,_0x463f5f){return _0x3abd12['define'](_0x366b('0x8'),attributes,{'tableName':_0x366b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index ca69290..04bdca8 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 _0x0c38=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x1ae78f,_0x122ed2){var _0x5baf80=function(_0x28a303){while(--_0x28a303){_0x1ae78f['push'](_0x1ae78f['shift']());}};_0x5baf80(++_0x122ed2);}(_0x0c38,0x145));var _0x80c3=function(_0x56aba9,_0x1f0f43){_0x56aba9=_0x56aba9-0x0;var _0x5746a0=_0x0c38[_0x56aba9];return _0x5746a0;};'use strict';var _=require(_0x80c3('0x0'));var util=require(_0x80c3('0x1'));var moment=require(_0x80c3('0x2'));var BPromise=require(_0x80c3('0x3'));var rs=require(_0x80c3('0x4'));var fs=require('fs');var Redis=require(_0x80c3('0x5'));var db=require(_0x80c3('0x6'))['db'];var utils=require(_0x80c3('0x7'));var logger=require(_0x80c3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x80c3('0x9'));var client=jayson['client'][_0x80c3('0xa')]({'port':0x232a});config[_0x80c3('0xb')]=_[_0x80c3('0xc')](config[_0x80c3('0xb')],{'host':_0x80c3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x80c3('0xe'))[_0x80c3('0xf')](socket);function respondWithRpcPromise(_0x106a93,_0x50716e,_0x550454){return new BPromise(function(_0x48bf81,_0x1ed6e0){return client[_0x80c3('0x10')](_0x106a93,_0x550454)['then'](function(_0x59b701){logger[_0x80c3('0x11')](_0x80c3('0x12'),_0x50716e,'request\x20sent');logger[_0x80c3('0x13')](_0x80c3('0x14'),_0x50716e,_0x80c3('0x15'),JSON['stringify'](_0x59b701));if(_0x59b701[_0x80c3('0x16')]){if(_0x59b701['error'][_0x80c3('0x17')]===0x1f4){logger[_0x80c3('0x16')](_0x80c3('0x12'),_0x50716e,_0x59b701['error'][_0x80c3('0x18')]);return _0x1ed6e0(_0x59b701[_0x80c3('0x16')][_0x80c3('0x18')]);}logger[_0x80c3('0x16')](_0x80c3('0x12'),_0x50716e,_0x59b701[_0x80c3('0x16')]['message']);return _0x48bf81(_0x59b701[_0x80c3('0x16')][_0x80c3('0x18')]);}else{logger[_0x80c3('0x11')](_0x80c3('0x12'),_0x50716e,_0x80c3('0x15'));_0x48bf81(_0x59b701[_0x80c3('0x19')][_0x80c3('0x18')]);}})[_0x80c3('0x1a')](function(_0x5a4771){logger[_0x80c3('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x50716e,_0x5a4771);_0x1ed6e0(_0x5a4771);});});}
\ No newline at end of file
+var _0x391f=['./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','defaults','localhost'];(function(_0x2e738d,_0x4c5d8a){var _0x760f9d=function(_0x414065){while(--_0x414065){_0x2e738d['push'](_0x2e738d['shift']());}};_0x760f9d(++_0x4c5d8a);}(_0x391f,0xfe));var _0xf391=function(_0x5a50cb,_0x5e507c){_0x5a50cb=_0x5a50cb-0x0;var _0x17189f=_0x391f[_0x5a50cb];return _0x17189f;};'use strict';var _=require('lodash');var util=require(_0xf391('0x0'));var moment=require('moment');var BPromise=require(_0xf391('0x1'));var rs=require(_0xf391('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf391('0x3'))['db'];var utils=require(_0xf391('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf391('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf391('0x6')][_0xf391('0x7')]({'port':0x232a});config['redis']=_[_0xf391('0x8')](config['redis'],{'host':_0xf391('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf391('0xa'))[_0xf391('0xb')](socket);function respondWithRpcPromise(_0x5988a2,_0xae796b,_0x412617){return new BPromise(function(_0x2721d3,_0x2ff15b){return client[_0xf391('0xc')](_0x5988a2,_0x412617)['then'](function(_0x3f00b4){logger[_0xf391('0xd')](_0xf391('0xe'),_0xae796b,_0xf391('0xf'));logger[_0xf391('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xae796b,_0xf391('0xf'),JSON[_0xf391('0x11')](_0x3f00b4));if(_0x3f00b4[_0xf391('0x12')]){if(_0x3f00b4['error'][_0xf391('0x13')]===0x1f4){logger['error'](_0xf391('0xe'),_0xae796b,_0x3f00b4[_0xf391('0x12')][_0xf391('0x14')]);return _0x2ff15b(_0x3f00b4[_0xf391('0x12')][_0xf391('0x14')]);}logger['error'](_0xf391('0xe'),_0xae796b,_0x3f00b4[_0xf391('0x12')]['message']);return _0x2721d3(_0x3f00b4['error'][_0xf391('0x14')]);}else{logger[_0xf391('0xd')](_0xf391('0xe'),_0xae796b,_0xf391('0xf'));_0x2721d3(_0x3f00b4[_0xf391('0x15')]['message']);}})['catch'](function(_0x325c5e){logger['error'](_0xf391('0xe'),_0xae796b,_0x325c5e);_0x2ff15b(_0x325c5e);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 4f674a9..a5ff4fc 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 _0x652f=['register','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x652f,0x1c9));var _0xf652=function(_0x1c28e6,_0x2e3710){_0x1c28e6=_0x1c28e6-0x0;var _0x6727cb=_0x652f[_0x1c28e6];return _0x6727cb;};'use strict';var ChatWebsiteEvents=require(_0xf652('0x0'));var events=[_0xf652('0x1'),_0xf652('0x2'),'update'];function createListener(_0x35bbdb,_0x1d0be3){return function(_0x10d5b5){_0x1d0be3[_0xf652('0x3')](_0x35bbdb,_0x10d5b5);};}function removeListener(_0x578a0b,_0x582c85){return function(){ChatWebsiteEvents[_0xf652('0x4')](_0x578a0b,_0x582c85);};}exports[_0xf652('0x5')]=function(_0x2e7353){for(var _0x38f765=0x0,_0x105092=events['length'];_0x38f765<_0x105092;_0x38f765++){var _0xfc3733=events[_0x38f765];var _0x117741=createListener(_0xf652('0x6')+_0xfc3733,_0x2e7353);ChatWebsiteEvents['on'](_0xfc3733,_0x117741);}};
\ No newline at end of file
+var _0xf209=['update','emit','removeListener','register','length','chatWebsite:','save','remove'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xf209,0xf6));var _0x9f20=function(_0x90e9ab,_0x426802){_0x90e9ab=_0x90e9ab-0x0;var _0xdfa58b=_0xf209[_0x90e9ab];return _0xdfa58b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x9f20('0x0'),_0x9f20('0x1'),_0x9f20('0x2')];function createListener(_0x1941c7,_0x35f48e){return function(_0x1fd162){_0x35f48e[_0x9f20('0x3')](_0x1941c7,_0x1fd162);};}function removeListener(_0x12e29f,_0x98d256){return function(){ChatWebsiteEvents[_0x9f20('0x4')](_0x12e29f,_0x98d256);};}exports[_0x9f20('0x5')]=function(_0x2ef7a2){for(var _0x1140a9=0x0,_0x4af607=events[_0x9f20('0x6')];_0x1140a9<_0x4af607;_0x1140a9++){var _0x337ad1=events[_0x1140a9];var _0x50dac6=createListener(_0x9f20('0x7')+_0x337ad1,_0x2ef7a2);ChatWebsiteEvents['on'](_0x337ad1,_0x50dac6);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 97748fc..148b192 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 _0x8e9f=['addApplications','addProactiveActions','put','update','delete','/:id','destroy','removeAnswers','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/dispositions','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','file','addLogo','server/files/images/avatars/','%s-%s','single','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e9f,0x1d3));var _0xf8e9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x8e9f[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0xf8e9('0x0'));var util=require(_0xf8e9('0x1'));var path=require('path');var timeout=require(_0xf8e9('0x2'));var express=require(_0xf8e9('0x3'));var router=express[_0xf8e9('0x4')]();var fs_extra=require(_0xf8e9('0x5'));var auth=require(_0xf8e9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf8e9('0x7'));router[_0xf8e9('0x8')]('/',auth[_0xf8e9('0x9')](),controller['index']);router[_0xf8e9('0x8')]('/describe',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0xa')]);router[_0xf8e9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf8e9('0xb')]);router[_0xf8e9('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf8e9('0xc')]);router[_0xf8e9('0x8')](_0xf8e9('0xd'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0xe')]);router[_0xf8e9('0x8')](_0xf8e9('0xf'),controller[_0xf8e9('0x10')]);router[_0xf8e9('0x8')](_0xf8e9('0x11'),controller[_0xf8e9('0x12')]);router[_0xf8e9('0x8')](_0xf8e9('0x13'),controller[_0xf8e9('0x14')]);router[_0xf8e9('0x8')](_0xf8e9('0x15'),controller[_0xf8e9('0x16')]);router[_0xf8e9('0x8')](_0xf8e9('0x17'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x18')]);router[_0xf8e9('0x8')](_0xf8e9('0x19'),controller[_0xf8e9('0x1a')]);router[_0xf8e9('0x8')](_0xf8e9('0x1b'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x1c')]);router[_0xf8e9('0x8')](_0xf8e9('0x1d'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x1e')]);router['get'](_0xf8e9('0x1f'),controller[_0xf8e9('0x20')]);router['get'](_0xf8e9('0x21'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x22')]);router[_0xf8e9('0x8')]('/:id/users',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x23')]);router[_0xf8e9('0x24')]('/',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x25')]);router['post'](_0xf8e9('0x26'),auth[_0xf8e9('0x9')](),controller['addDisposition']);router[_0xf8e9('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf8e9('0x27')]);var upload=multer({'storage':multer[_0xf8e9('0x28')]({'destination':function(_0x4af8ca,_0x2ea766,_0x4545f6){_0x4545f6(null,path[_0xf8e9('0x29')](config[_0xf8e9('0x2a')],_0xf8e9('0x2b')));},'filename':function(_0x38fc96,_0x3d0952,_0x3324b1){_0x3324b1(null,util[_0xf8e9('0x2c')]('%s-%s',Date[_0xf8e9('0x2d')](),_0x3d0952['originalname']));}})});router['post'](_0xf8e9('0xf'),upload['single'](_0xf8e9('0x2e')),controller[_0xf8e9('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bb55f,_0x2c9a74,_0x45467a){_0x45467a(null,path[_0xf8e9('0x29')](config[_0xf8e9('0x2a')],_0xf8e9('0x30')));},'filename':function(_0x265f72,_0x763d92,_0x8f739d){_0x8f739d(null,util[_0xf8e9('0x2c')](_0xf8e9('0x31'),Date[_0xf8e9('0x2d')](),_0x763d92['originalname']));}})});router['post'](_0xf8e9('0x11'),upload[_0xf8e9('0x32')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5dcf8c,_0x5b5956,_0xdf7ce1){_0xdf7ce1(null,path[_0xf8e9('0x29')](config[_0xf8e9('0x2a')],_0xf8e9('0x30')));},'filename':function(_0x406a37,_0x80f1ca,_0x411fd9){_0x411fd9(null,util[_0xf8e9('0x2c')]('%s-%s',Date[_0xf8e9('0x2d')](),_0x80f1ca[_0xf8e9('0x33')]));}})});router[_0xf8e9('0x24')](_0xf8e9('0x13'),upload[_0xf8e9('0x32')](_0xf8e9('0x2e')),controller[_0xf8e9('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3694fd,_0x439552,_0x203df8){_0x203df8(null,path[_0xf8e9('0x29')](config['root'],_0xf8e9('0x30')));},'filename':function(_0x27ffa5,_0x8848fd,_0x67f7e4){_0x67f7e4(null,util['format'](_0xf8e9('0x31'),Date[_0xf8e9('0x2d')](),_0x8848fd[_0xf8e9('0x33')]));}})});router[_0xf8e9('0x24')]('/:id/system_avatar',upload[_0xf8e9('0x32')](_0xf8e9('0x2e')),controller[_0xf8e9('0x35')]);router[_0xf8e9('0x24')](_0xf8e9('0x36'),controller[_0xf8e9('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xf8e9('0x28')]({'destination':function(_0x1b29fc,_0x58981a,_0x258fc3){const _0x5d797b=path[_0xf8e9('0x29')](config[_0xf8e9('0x2a')],_0xf8e9('0x38'),_0xf8e9('0x39'),_0xf8e9('0x3a'));fs_extra[_0xf8e9('0x3b')](_0x5d797b,function(){_0x258fc3(null,_0x5d797b);});},'filename':function(_0x2440da,_0x3a69d0,_0x14607a){const _0x57ac21=_0x3a69d0[_0xf8e9('0x33')][_0xf8e9('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4a4774=path['extname'](_0x57ac21);const _0x59aa07=Date[_0xf8e9('0x2d')]()+'-'+_0x57ac21[_0xf8e9('0x3c')](_0x4a4774,'')+_0x4a4774;_0x14607a(null,_0x59aa07);}})});router['post'](_0xf8e9('0x3d'),offlineUploadMulter[_0xf8e9('0x3e')](),controller[_0xf8e9('0x3f')]);router[_0xf8e9('0x24')](_0xf8e9('0x17'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x40')]);router['post']('/:id/applications',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x41')]);router[_0xf8e9('0x24')](_0xf8e9('0x1d'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x42')]);router['post']('/:id/users',auth[_0xf8e9('0x9')](),controller['addAgents']);router[_0xf8e9('0x43')]('/:id',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x44')]);router[_0xf8e9('0x45')](_0xf8e9('0x46'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x47')]);router[_0xf8e9('0x45')](_0xf8e9('0x26'),auth[_0xf8e9('0x9')](),controller['removeDispositions']);router[_0xf8e9('0x45')](_0xf8e9('0xd'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x48')]);router[_0xf8e9('0x45')](_0xf8e9('0x49'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x4a')]);module[_0xf8e9('0x4b')]=router;
\ No newline at end of file
+var _0x2d52=['/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','create','addDisposition','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','now','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','extname','replace','/:id/offline','any','addProactiveActions','addAgents','update','delete','/:id','destroy','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2d52,0x198));var _0x22d5=function(_0xf3d3d,_0x18c710){_0xf3d3d=_0xf3d3d-0x0;var _0x1e5511=_0x2d52[_0xf3d3d];return _0x1e5511;};'use strict';var multer=require(_0x22d5('0x0'));var util=require('util');var path=require(_0x22d5('0x1'));var timeout=require(_0x22d5('0x2'));var express=require(_0x22d5('0x3'));var router=express[_0x22d5('0x4')]();var fs_extra=require(_0x22d5('0x5'));var auth=require(_0x22d5('0x6'));var interaction=require(_0x22d5('0x7'));var config=require(_0x22d5('0x8'));var controller=require(_0x22d5('0x9'));router['get']('/',auth[_0x22d5('0xa')](),controller[_0x22d5('0xb')]);router['get'](_0x22d5('0xc'),auth[_0x22d5('0xa')](),controller[_0x22d5('0xd')]);router['get']('/:id',auth[_0x22d5('0xa')](),controller[_0x22d5('0xe')]);router['get'](_0x22d5('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x22d5('0x10'),auth[_0x22d5('0xa')](),controller['getAnswers']);router[_0x22d5('0x11')](_0x22d5('0x12'),controller[_0x22d5('0x13')]);router['get'](_0x22d5('0x14'),controller[_0x22d5('0x15')]);router[_0x22d5('0x11')]('/:id/customer_avatar',controller[_0x22d5('0x16')]);router['get'](_0x22d5('0x17'),controller[_0x22d5('0x18')]);router['get']('/:id/interactions',auth[_0x22d5('0xa')](),controller[_0x22d5('0x19')]);router['get'](_0x22d5('0x1a'),controller[_0x22d5('0x1b')]);router[_0x22d5('0x11')](_0x22d5('0x1c'),auth[_0x22d5('0xa')](),controller['getApplications']);router[_0x22d5('0x11')](_0x22d5('0x1d'),auth[_0x22d5('0xa')](),controller[_0x22d5('0x1e')]);router[_0x22d5('0x11')](_0x22d5('0x1f'),controller[_0x22d5('0x20')]);router[_0x22d5('0x11')]('/:id/offline_messages',auth[_0x22d5('0xa')](),controller[_0x22d5('0x21')]);router[_0x22d5('0x11')](_0x22d5('0x22'),auth['isAuthenticated'](),controller[_0x22d5('0x23')]);router['post']('/',auth[_0x22d5('0xa')](),controller[_0x22d5('0x24')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x22d5('0x25')]);router[_0x22d5('0x26')]('/:id/canned_answers',auth[_0x22d5('0xa')](),controller[_0x22d5('0x27')]);var upload=multer({'storage':multer[_0x22d5('0x28')]({'destination':function(_0x32b6e0,_0x36a7c8,_0x3a41fd){_0x3a41fd(null,path[_0x22d5('0x29')](config[_0x22d5('0x2a')],_0x22d5('0x2b')));},'filename':function(_0x488d1b,_0x3d0d9a,_0x1c64b5){_0x1c64b5(null,util[_0x22d5('0x2c')]('%s-%s',Date['now'](),_0x3d0d9a[_0x22d5('0x2d')]));}})});router[_0x22d5('0x26')](_0x22d5('0x12'),upload[_0x22d5('0x2e')](_0x22d5('0x2f')),controller[_0x22d5('0x30')]);var upload=multer({'storage':multer[_0x22d5('0x28')]({'destination':function(_0x2ce81b,_0x3a633c,_0x4b8e1e){_0x4b8e1e(null,path[_0x22d5('0x29')](config[_0x22d5('0x2a')],_0x22d5('0x31')));},'filename':function(_0x289d34,_0x25cdea,_0x43c09e){_0x43c09e(null,util[_0x22d5('0x2c')](_0x22d5('0x32'),Date['now'](),_0x25cdea[_0x22d5('0x2d')]));}})});router[_0x22d5('0x26')](_0x22d5('0x14'),upload[_0x22d5('0x2e')](_0x22d5('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer[_0x22d5('0x28')]({'destination':function(_0x24472d,_0x56b27b,_0x1ee9f5){_0x1ee9f5(null,path[_0x22d5('0x29')](config[_0x22d5('0x2a')],_0x22d5('0x31')));},'filename':function(_0x2fe42e,_0x4ef1b4,_0x4a5836){_0x4a5836(null,util[_0x22d5('0x2c')](_0x22d5('0x32'),Date[_0x22d5('0x33')](),_0x4ef1b4['originalname']));}})});router[_0x22d5('0x26')](_0x22d5('0x34'),upload['single']('file'),controller[_0x22d5('0x35')]);var upload=multer({'storage':multer[_0x22d5('0x28')]({'destination':function(_0x319678,_0x369742,_0x346c8b){_0x346c8b(null,path[_0x22d5('0x29')](config[_0x22d5('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x22a16b,_0x540e2d,_0x13129b){_0x13129b(null,util[_0x22d5('0x2c')](_0x22d5('0x32'),Date[_0x22d5('0x33')](),_0x540e2d[_0x22d5('0x2d')]));}})});router[_0x22d5('0x26')](_0x22d5('0x17'),upload[_0x22d5('0x2e')](_0x22d5('0x2f')),controller[_0x22d5('0x36')]);router[_0x22d5('0x26')]('/:id/notify',controller[_0x22d5('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x4f0654,_0x2d5935,_0x2530d5){const _0x4eee99=path['join'](config['root'],_0x22d5('0x38'),'attachments',_0x22d5('0x39'));fs_extra['ensureDir'](_0x4eee99,function(){_0x2530d5(null,_0x4eee99);});},'filename':function(_0x5e3359,_0x1e0e1e,_0x224692){const _0x18e261=_0x1e0e1e[_0x22d5('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x14b31b=path[_0x22d5('0x3a')](_0x18e261);const _0x3f6606=Date[_0x22d5('0x33')]()+'-'+_0x18e261[_0x22d5('0x3b')](_0x14b31b,'')+_0x14b31b;_0x224692(null,_0x3f6606);}})});router[_0x22d5('0x26')](_0x22d5('0x3c'),offlineUploadMulter[_0x22d5('0x3d')](),controller['offline']);router['post']('/:id/interactions',auth[_0x22d5('0xa')](),controller['addInteraction']);router[_0x22d5('0x26')](_0x22d5('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x22d5('0x26')](_0x22d5('0x1d'),auth[_0x22d5('0xa')](),controller[_0x22d5('0x3e')]);router[_0x22d5('0x26')](_0x22d5('0x22'),auth['isAuthenticated'](),controller[_0x22d5('0x3f')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x22d5('0x40')]);router[_0x22d5('0x41')](_0x22d5('0x42'),auth[_0x22d5('0xa')](),controller[_0x22d5('0x43')]);router[_0x22d5('0x41')](_0x22d5('0xf'),auth[_0x22d5('0xa')](),controller['removeDispositions']);router[_0x22d5('0x41')](_0x22d5('0x10'),auth['isAuthenticated'](),controller[_0x22d5('0x44')]);router[_0x22d5('0x41')](_0x22d5('0x22'),auth[_0x22d5('0xa')](),controller[_0x22d5('0x45')]);module[_0x22d5('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 846ccdd..41f30ed 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x22ef=['/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x3de9ad,_0x2a0d99){var _0x3b7676=function(_0x541c88){while(--_0x541c88){_0x3de9ad['push'](_0x3de9ad['shift']());}};_0x3b7676(++_0x2a0d99);}(_0x22ef,0x1e4));var _0xf22e=function(_0x3af98d,_0x5822e5){_0x3af98d=_0x3af98d-0x0;var _0x491d90=_0x22ef[_0x3af98d];return _0x491d90;};var beaverLogger=require(_0xf22e('0x0'));var express=require(_0xf22e('0x1'));var auth=require(_0xf22e('0x2'));var config=require(_0xf22e('0x3'));var router=express[_0xf22e('0x4')]();var isProduction=config[_0xf22e('0x5')]===_0xf22e('0x6')||![];function clientSideLogs(_0x182234,_0x339591,_0x16929c){var _0x3f72f5=_0x182234[_0xf22e('0x7')][_0xf22e('0x8')](_0xf22e('0x9'));if(!_0x3f72f5){throw new Error(_0xf22e('0xa'));}return beaverLogger['expressEndpoint']({'uri':_0xf22e('0xb'),'logger':_0x3f72f5,'enableCors':!isProduction})(_0x182234,_0x339591,_0x16929c);}router[_0xf22e('0xc')](auth[_0xf22e('0xd')](),clientSideLogs);module[_0xf22e('0xe')]=router;
\ No newline at end of file
+var _0xfd33=['Client-Side\x20logger\x20not\x20found!','/client-logs','exports','beaver-logger/server','express','env','app','client-side-logger'];(function(_0x18ec3f,_0x4d62cf){var _0x538f79=function(_0x6c0930){while(--_0x6c0930){_0x18ec3f['push'](_0x18ec3f['shift']());}};_0x538f79(++_0x4d62cf);}(_0xfd33,0x173));var _0x3fd3=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xfd33[_0x1b349a];return _0x5d1f7c;};var beaverLogger=require(_0x3fd3('0x0'));var express=require(_0x3fd3('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x3fd3('0x2')]==='production'||![];function clientSideLogs(_0x3598e8,_0x2db99c,_0x16d5d7){var _0x188949=_0x3598e8[_0x3fd3('0x3')]['get'](_0x3fd3('0x4'));if(!_0x188949){throw new Error(_0x3fd3('0x5'));}return beaverLogger['expressEndpoint']({'uri':_0x3fd3('0x6'),'logger':_0x188949,'enableCors':!isProduction})(_0x3598e8,_0x2db99c,_0x16d5d7);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x3fd3('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 0639ad4..aa31b71 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 _0x432a=['ENUM','AmazonAWS','Google','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x432a,0x1c5));var _0xa432=function(_0x4ec15e,_0x3040d8){_0x4ec15e=_0x4ec15e-0x0;var _0x408b47=_0x432a[_0x4ec15e];return _0x408b47;};'use strict';var Sequelize=require(_0xa432('0x0'));module['exports']={'name':{'type':Sequelize[_0xa432('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa432('0x2')](_0xa432('0x3'),_0xa432('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa432('0x2')](_0xa432('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xa432('0x1')],'comment':_0xa432('0x6')},'data2':{'type':Sequelize[_0xa432('0x1')],'comment':_0xa432('0x7')},'data3':{'type':Sequelize[_0xa432('0x1')],'comment':_0xa432('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0xa432('0x9')},'data5':{'type':Sequelize[_0xa432('0xa')],'comment':_0xa432('0xb')},'data6':{'type':Sequelize[_0xa432('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xa432('0xa')],'comment':_0xa432('0xc')}};
\ No newline at end of file
+var _0xb920=['Google','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb920,0x17b));var _0x0b92=function(_0x2e2910,_0x3b06e0){_0x2e2910=_0x2e2910-0x0;var _0x22e05c=_0xb920[_0x2e2910];return _0x22e05c;};'use strict';var Sequelize=require(_0x0b92('0x0'));module[_0x0b92('0x1')]={'name':{'type':Sequelize[_0x0b92('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0b92('0x3')](_0x0b92('0x4'),_0x0b92('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x0b92('0x2')],'comment':_0x0b92('0x6')},'data2':{'type':Sequelize[_0x0b92('0x2')],'comment':_0x0b92('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0x0b92('0x8')},'data4':{'type':Sequelize[_0x0b92('0x2')],'comment':_0x0b92('0x9')},'data5':{'type':Sequelize[_0x0b92('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x0b92('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x0b92('0xa')],'comment':_0x0b92('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 9aa6c97..62d84d3 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 _0x9b7b=['oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','parse','from','state','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','stringify','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','slice','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','decryptString','data3','show','find','service','MicrosoftAzure','catch','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','body','encryptString','create','params'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x9b7b,0x76));var _0xb9b7=function(_0x21cdee,_0x4301e4){_0x21cdee=_0x21cdee-0x0;var _0x994295=_0x9b7b[_0x21cdee];return _0x994295;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xb9b7('0x0'));var config=require(_0xb9b7('0x1'));var logger=require(_0xb9b7('0x2'))(_0xb9b7('0x3'));var db=require(_0xb9b7('0x4'))['db'];var oauth=require(_0xb9b7('0x5'));config[_0xb9b7('0x6')]=_[_0xb9b7('0x7')](config['redis'],{'host':_0xb9b7('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9b7('0x6')]));var redis=new Redis(config[_0xb9b7('0x6')]);function respondWithStatusCode(_0x31c918,_0x174ddc){_0x174ddc=_0x174ddc||0xcc;return function(_0x2ab90f){if(_0x2ab90f){return _0x31c918[_0xb9b7('0x9')](_0x174ddc);}return _0x31c918[_0xb9b7('0xa')](_0x174ddc)[_0xb9b7('0xb')]();};}function respondWithResult(_0x457f1f,_0x5726c5){_0x5726c5=_0x5726c5||0xc8;return function(_0x245389){if(_0x245389){return _0x457f1f['status'](_0x5726c5)[_0xb9b7('0xc')](_0x245389);}};}function respondWithFilteredResult(_0xcd7b53,_0x250000){return function(_0x77a6a3){if(_0x77a6a3){var _0x22e13a=typeof _0x250000[_0xb9b7('0xd')]==='undefined'&&typeof _0x250000[_0xb9b7('0xe')]===_0xb9b7('0xf');var _0x3016e0=_0x77a6a3['count'];var _0x47eba0=_0x22e13a?0x0:_0x250000[_0xb9b7('0xd')];var _0x93d644=_0x22e13a?_0x77a6a3[_0xb9b7('0x10')]:_0x250000[_0xb9b7('0xd')]+_0x250000[_0xb9b7('0xe')];var _0x5c9dd9;if(_0x93d644>=_0x3016e0){_0x93d644=_0x3016e0;_0x5c9dd9=0xc8;}else{_0x5c9dd9=0xce;}_0xcd7b53[_0xb9b7('0xa')](_0x5c9dd9);return _0xcd7b53[_0xb9b7('0x11')](_0xb9b7('0x12'),_0x47eba0+'-'+_0x93d644+'/'+_0x3016e0)[_0xb9b7('0xc')](_0x77a6a3);}return null;};}function saveUpdates(_0x21f055){return function(_0x8bdd94){if(_0x8bdd94){return _0x8bdd94[_0xb9b7('0x13')](_0x21f055)[_0xb9b7('0x14')](function(_0x26bd10){return _0x26bd10;});}return null;};}function removeEntity(_0x185d34){return function(_0x2294ea){if(_0x2294ea){return _0x2294ea['destroy']()[_0xb9b7('0x14')](function(){_0x185d34[_0xb9b7('0xa')](0xcc)[_0xb9b7('0xb')]();});}};}function handleEntityNotFound(_0x32efa3){return function(_0x2eb177){if(!_0x2eb177){_0x32efa3['sendStatus'](0x194);}return _0x2eb177;};}function handleError(_0x6af412,_0x27a7d2){_0x27a7d2=_0x27a7d2||0x1f4;return function(_0x404fc4){logger[_0xb9b7('0x15')](_0x404fc4[_0xb9b7('0x16')]);if(_0x404fc4['name']){delete _0x404fc4[_0xb9b7('0x17')];}_0x6af412[_0xb9b7('0xa')](_0x27a7d2)[_0xb9b7('0x18')](_0x404fc4);};}function maskClientSecret(_0x282851){return _['padEnd'](_0x282851[_0xb9b7('0x19')](0x0,0x3),0x14,'*');}exports[_0xb9b7('0x1a')]=function(_0x41eb6c,_0x17368f){var _0x5f4e7c={},_0x2c678f={},_0x110e5e={'count':0x0,'rows':[]};var _0x3f923d=_[_0xb9b7('0x1b')](db['CloudProvider'][_0xb9b7('0x1c')],function(_0x22f9dd){return{'name':_0x22f9dd[_0xb9b7('0x1d')],'type':_0x22f9dd[_0xb9b7('0x1e')][_0xb9b7('0x1f')]};});_0x2c678f[_0xb9b7('0x20')]=_[_0xb9b7('0x1b')](_0x3f923d,_0xb9b7('0x17'));_0x2c678f[_0xb9b7('0x21')]=_[_0xb9b7('0x22')](_0x41eb6c['query']);_0x2c678f[_0xb9b7('0x23')]=_['intersection'](_0x2c678f[_0xb9b7('0x20')],_0x2c678f['query']);_0x5f4e7c[_0xb9b7('0x24')]=_[_0xb9b7('0x25')](_0x2c678f[_0xb9b7('0x20')],qs['fields'](_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x26')]));_0x5f4e7c[_0xb9b7('0x24')]=_0x5f4e7c['attributes'][_0xb9b7('0x27')]?_0x5f4e7c[_0xb9b7('0x24')]:_0x2c678f[_0xb9b7('0x20')];if(!_0x41eb6c['query'][_0xb9b7('0x28')](_0xb9b7('0x29'))){_0x5f4e7c['limit']=qs['limit'](_0x41eb6c['query']['limit']);_0x5f4e7c['offset']=qs[_0xb9b7('0xd')](_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0xd')]);}_0x5f4e7c[_0xb9b7('0x2a')]=qs[_0xb9b7('0x2b')](_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x2b')]);_0x5f4e7c[_0xb9b7('0x2c')]=qs[_0xb9b7('0x23')](_[_0xb9b7('0x2d')](_0x41eb6c['query'],_0x2c678f[_0xb9b7('0x23')]),_0x3f923d);if(_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x2e')]){_0x5f4e7c[_0xb9b7('0x2c')]=_[_0xb9b7('0x2f')](_0x5f4e7c['where'],{'$or':_[_0xb9b7('0x1b')](_0x3f923d,function(_0x1f6d8a){if(_0x1f6d8a[_0xb9b7('0x1e')]!==_0xb9b7('0x30')){var _0x3dc48a={};_0x3dc48a[_0x1f6d8a['name']]={'$like':'%'+_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x2e')]+'%'};return _0x3dc48a;}})});}_0x5f4e7c=_[_0xb9b7('0x2f')]({},_0x5f4e7c,_0x41eb6c[_0xb9b7('0x31')]);var _0x4af2e8={'where':_0x5f4e7c[_0xb9b7('0x2c')]};return db[_0xb9b7('0x32')][_0xb9b7('0x10')](_0x4af2e8)['then'](function(_0x1c726a){_0x110e5e['count']=_0x1c726a;if(_0x41eb6c[_0xb9b7('0x21')][_0xb9b7('0x33')]){_0x5f4e7c[_0xb9b7('0x34')]=[{'all':!![]}];}return db[_0xb9b7('0x32')][_0xb9b7('0x35')](_0x5f4e7c);})['then'](function(_0x36b33f){_0x110e5e[_0xb9b7('0x36')]=_[_0xb9b7('0x1b')](_0x36b33f,function(_0x868f85){if(_0x868f85['service']==='MicrosoftAzure'){var _0x48bf1e=encryptor[_0xb9b7('0x37')](_0x868f85[_0xb9b7('0x38')]);_0x868f85[_0xb9b7('0x38')]=maskClientSecret(_0x48bf1e);}return _0x868f85;});return _0x110e5e;})[_0xb9b7('0x14')](respondWithFilteredResult(_0x17368f,_0x5f4e7c))['catch'](handleError(_0x17368f,null));};exports[_0xb9b7('0x39')]=function(_0x970060,_0x5583ce){var _0x5e92bd={'raw':!![],'where':{'id':_0x970060['params']['id']}},_0x15ad80={};_0x15ad80[_0xb9b7('0x20')]=_[_0xb9b7('0x22')](db[_0xb9b7('0x32')]['rawAttributes']);_0x15ad80[_0xb9b7('0x21')]=_[_0xb9b7('0x22')](_0x970060[_0xb9b7('0x21')]);_0x15ad80[_0xb9b7('0x23')]=_[_0xb9b7('0x25')](_0x15ad80[_0xb9b7('0x20')],_0x15ad80[_0xb9b7('0x21')]);_0x5e92bd[_0xb9b7('0x24')]=_[_0xb9b7('0x25')](_0x15ad80[_0xb9b7('0x20')],qs['fields'](_0x970060[_0xb9b7('0x21')][_0xb9b7('0x26')]));_0x5e92bd[_0xb9b7('0x24')]=_0x5e92bd[_0xb9b7('0x24')]['length']?_0x5e92bd[_0xb9b7('0x24')]:_0x15ad80[_0xb9b7('0x20')];if(_0x970060['query'][_0xb9b7('0x33')]){_0x5e92bd['include']=[{'all':!![]}];}_0x5e92bd=_[_0xb9b7('0x2f')]({},_0x5e92bd,_0x970060[_0xb9b7('0x31')]);return db[_0xb9b7('0x32')][_0xb9b7('0x3a')](_0x5e92bd)[_0xb9b7('0x14')](handleEntityNotFound(_0x5583ce,null))[_0xb9b7('0x14')](function(_0x2689cd){if(_0x2689cd[_0xb9b7('0x3b')]===_0xb9b7('0x3c')){var _0x430ddc=encryptor[_0xb9b7('0x37')](_0x2689cd[_0xb9b7('0x38')]);_0x2689cd['data3']=maskClientSecret(_0x430ddc);}return _0x2689cd;})[_0xb9b7('0x14')](respondWithResult(_0x5583ce,null))[_0xb9b7('0x3d')](handleError(_0x5583ce,null));};exports['create']=function(_0x2b8cca,_0x14e2ca){if(!_0x2b8cca['body'][_0xb9b7('0x17')])throw new Error(_0xb9b7('0x3e'));if(!_0x2b8cca['body'][_0xb9b7('0x3b')])throw new Error(_0xb9b7('0x3f'));var _0x125498=db[_0xb9b7('0x32')][_0xb9b7('0x1c')]['service'][_0xb9b7('0x40')];if(!_0x125498[_0xb9b7('0x41')](_0x2b8cca['body']['service']))throw new Error(_0xb9b7('0x42')+_0x125498[_0xb9b7('0x43')](',\x20'));if(_0x2b8cca[_0xb9b7('0x44')]['service']===_0xb9b7('0x3c')&&_0x2b8cca[_0xb9b7('0x44')][_0xb9b7('0x38')]){_0x2b8cca[_0xb9b7('0x44')][_0xb9b7('0x38')]=encryptor[_0xb9b7('0x45')](_0x2b8cca[_0xb9b7('0x44')][_0xb9b7('0x38')]);}return db[_0xb9b7('0x32')][_0xb9b7('0x46')](_0x2b8cca[_0xb9b7('0x44')],{})[_0xb9b7('0x14')](respondWithResult(_0x14e2ca,0xc9))[_0xb9b7('0x3d')](handleError(_0x14e2ca,null));};exports['update']=function(_0x57fe34,_0x2b09d0){if(_0x57fe34['body']['id']){delete _0x57fe34[_0xb9b7('0x44')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x57fe34[_0xb9b7('0x47')]['id']}})[_0xb9b7('0x14')](handleEntityNotFound(_0x2b09d0,null))[_0xb9b7('0x14')](function(_0x34026f){if(_0x34026f['service']===_0xb9b7('0x3c')&&_0x57fe34['body'][_0xb9b7('0x38')]){_0x57fe34[_0xb9b7('0x44')][_0xb9b7('0x38')]=encryptor['encryptString'](_0x57fe34['body'][_0xb9b7('0x38')]);}return _0x34026f;})['then'](saveUpdates(_0x57fe34[_0xb9b7('0x44')],null))['then'](respondWithResult(_0x2b09d0,null))['catch'](handleError(_0x2b09d0,null));};exports['destroy']=function(_0x5974c,_0x31a414){return db[_0xb9b7('0x32')]['find']({'where':{'id':_0x5974c[_0xb9b7('0x47')]['id']}})[_0xb9b7('0x14')](handleEntityNotFound(_0x31a414,null))[_0xb9b7('0x14')](removeEntity(_0x31a414,null))[_0xb9b7('0x3d')](handleError(_0x31a414,null));};exports[_0xb9b7('0x48')]=function(_0x490d3c,_0x1bbddf){return db['CloudProvider']['findOne']({'where':{'id':_0x490d3c[_0xb9b7('0x47')]['id']},'raw':!![]})[_0xb9b7('0x14')](function(_0x23c21e){if(!_0x23c21e)return _0x1bbddf[_0xb9b7('0x9')](0x194);return{'url':oauth[_0xb9b7('0x49')](_0x23c21e,_0x490d3c['user']['id'])};})[_0xb9b7('0x14')](respondWithResult(_0x1bbddf,null))['catch'](handleError(_0x1bbddf,null));};exports[_0xb9b7('0x4a')]=function(_0x412ee8,_0x33229d){var _0x427d48=_0x412ee8[_0xb9b7('0x44')];var _0xc450be;var _0x5ec404;if(_0x427d48[_0xb9b7('0x15')])throw _0x427d48;redis[_0xb9b7('0x4b')](_0x427d48['state'])[_0xb9b7('0x14')](function(_0x1ed5bd){if(!_0x1ed5bd)throw new Error('Invalid\x20state\x20parameter');_0xc450be=JSON[_0xb9b7('0x4c')](_0x1ed5bd);var _0x1d46e7=Buffer[_0xb9b7('0x4d')](_0x427d48[_0xb9b7('0x4e')],'base64')[_0xb9b7('0x4f')]('ascii');_0x5ec404=JSON[_0xb9b7('0x4c')](_0x1d46e7);if(!oauth[_0xb9b7('0x50')](_0x427d48[_0xb9b7('0x51')],_0xc450be[_0xb9b7('0x52')]))throw new Error(_0xb9b7('0x53'));redis[_0xb9b7('0x54')](_0x427d48[_0xb9b7('0x4e')]);return oauth[_0xb9b7('0x55')](_0x427d48[_0xb9b7('0x56')],_0xc450be);})['then'](function(_0x37b342){_0xc450be[_0xb9b7('0x57')]=_0x37b342[_0xb9b7('0x58')];_0xc450be[_0xb9b7('0x59')]=_0x37b342['refresh_token'];return db[_0xb9b7('0x32')]['update']({'data5':_0xc450be[_0xb9b7('0x57')],'data6':_0xc450be['data6']},{'where':{'id':_0xc450be['id']}});})[_0xb9b7('0x14')](function(){oauth[_0xb9b7('0x5a')](_0xc450be);socket[_0xb9b7('0x5b')](_0xb9b7('0x5c'),{'id':_0x5ec404['id']});return;})[_0xb9b7('0x14')](respondWithStatusCode(_0x33229d,null))[_0xb9b7('0x3d')](function(_0x4db7a9){if(_0x5ec404){socket[_0xb9b7('0x5b')]('microsoftAuthorization:error',{'id':_0x5ec404['id']});}if(!_0xc450be){logger[_0xb9b7('0x15')](_0xb9b7('0x5d'),_0x4db7a9);return _0x33229d['status'](0x1f4)['send'](_0x4db7a9['message']);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0xc450be['id'],JSON[_0xb9b7('0x5e')](_0x4db7a9));});};
\ No newline at end of file
+var _0xb275=['sort','pick','filter','where','type','merge','options','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','keys','include','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','find','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','startRefreshInterval','emit','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x179af7,_0x4bca78){var _0x4f16e1=function(_0x484cf5){while(--_0x484cf5){_0x179af7['push'](_0x179af7['shift']());}};_0x4f16e1(++_0x4bca78);}(_0xb275,0xf2));var _0x5b27=function(_0x9b40b3,_0x514ab4){_0x9b40b3=_0x9b40b3-0x0;var _0x2526c3=_0xb275[_0x9b40b3];return _0x2526c3;};'use strict';var _=require(_0x5b27('0x0'));var Redis=require(_0x5b27('0x1'));var qs=require(_0x5b27('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x5b27('0x3'));var logger=require(_0x5b27('0x4'))(_0x5b27('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x5b27('0x6'));config[_0x5b27('0x7')]=_[_0x5b27('0x8')](config[_0x5b27('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b27('0x9'))(new Redis(config[_0x5b27('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0xfeb267,_0x732ce){_0x732ce=_0x732ce||0xcc;return function(_0x29e510){if(_0x29e510){return _0xfeb267[_0x5b27('0xa')](_0x732ce);}return _0xfeb267[_0x5b27('0xb')](_0x732ce)[_0x5b27('0xc')]();};}function respondWithResult(_0x37b935,_0xbd1e8e){_0xbd1e8e=_0xbd1e8e||0xc8;return function(_0x54cbad){if(_0x54cbad){return _0x37b935[_0x5b27('0xb')](_0xbd1e8e)[_0x5b27('0xd')](_0x54cbad);}};}function respondWithFilteredResult(_0x30771f,_0x51d103){return function(_0x52c399){if(_0x52c399){var _0x1d3a75=typeof _0x51d103[_0x5b27('0xe')]===_0x5b27('0xf')&&typeof _0x51d103['limit']===_0x5b27('0xf');var _0x127d06=_0x52c399[_0x5b27('0x10')];var _0x881e5a=_0x1d3a75?0x0:_0x51d103['offset'];var _0x3fcbe6=_0x1d3a75?_0x52c399[_0x5b27('0x10')]:_0x51d103['offset']+_0x51d103['limit'];var _0x5a0df6;if(_0x3fcbe6>=_0x127d06){_0x3fcbe6=_0x127d06;_0x5a0df6=0xc8;}else{_0x5a0df6=0xce;}_0x30771f[_0x5b27('0xb')](_0x5a0df6);return _0x30771f[_0x5b27('0x11')](_0x5b27('0x12'),_0x881e5a+'-'+_0x3fcbe6+'/'+_0x127d06)[_0x5b27('0xd')](_0x52c399);}return null;};}function saveUpdates(_0x129a27){return function(_0x469e73){if(_0x469e73){return _0x469e73[_0x5b27('0x13')](_0x129a27)[_0x5b27('0x14')](function(_0x5cdf9d){return _0x5cdf9d;});}return null;};}function removeEntity(_0x1723b5){return function(_0x1b18fe){if(_0x1b18fe){return _0x1b18fe[_0x5b27('0x15')]()[_0x5b27('0x14')](function(){_0x1723b5[_0x5b27('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5fed){return function(_0x149a25){if(!_0x149a25){_0x2d5fed[_0x5b27('0xa')](0x194);}return _0x149a25;};}function handleError(_0x4c8cb5,_0x2165e7){_0x2165e7=_0x2165e7||0x1f4;return function(_0x124fda){logger[_0x5b27('0x16')](_0x124fda[_0x5b27('0x17')]);if(_0x124fda['name']){delete _0x124fda[_0x5b27('0x18')];}_0x4c8cb5[_0x5b27('0xb')](_0x2165e7)[_0x5b27('0x19')](_0x124fda);};}function maskClientSecret(_0x18ee4c){return _[_0x5b27('0x1a')](_0x18ee4c[_0x5b27('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x5657bf,_0x9b91c2){var _0x4c3876={},_0x6dd0f1={},_0xaf61ed={'count':0x0,'rows':[]};var _0x15cc81=_[_0x5b27('0x1c')](db[_0x5b27('0x1d')][_0x5b27('0x1e')],function(_0xd52fca){return{'name':_0xd52fca[_0x5b27('0x1f')],'type':_0xd52fca['type']['key']};});_0x6dd0f1[_0x5b27('0x20')]=_['map'](_0x15cc81,_0x5b27('0x18'));_0x6dd0f1[_0x5b27('0x21')]=_['keys'](_0x5657bf[_0x5b27('0x21')]);_0x6dd0f1[_0x5b27('0x22')]=_[_0x5b27('0x23')](_0x6dd0f1[_0x5b27('0x20')],_0x6dd0f1[_0x5b27('0x21')]);_0x4c3876[_0x5b27('0x24')]=_[_0x5b27('0x23')](_0x6dd0f1['model'],qs[_0x5b27('0x25')](_0x5657bf[_0x5b27('0x21')][_0x5b27('0x25')]));_0x4c3876[_0x5b27('0x24')]=_0x4c3876[_0x5b27('0x24')][_0x5b27('0x26')]?_0x4c3876[_0x5b27('0x24')]:_0x6dd0f1[_0x5b27('0x20')];if(!_0x5657bf[_0x5b27('0x21')][_0x5b27('0x27')](_0x5b27('0x28'))){_0x4c3876[_0x5b27('0x29')]=qs[_0x5b27('0x29')](_0x5657bf[_0x5b27('0x21')][_0x5b27('0x29')]);_0x4c3876[_0x5b27('0xe')]=qs['offset'](_0x5657bf[_0x5b27('0x21')][_0x5b27('0xe')]);}_0x4c3876[_0x5b27('0x2a')]=qs[_0x5b27('0x2b')](_0x5657bf[_0x5b27('0x21')][_0x5b27('0x2b')]);_0x4c3876['where']=qs['filters'](_[_0x5b27('0x2c')](_0x5657bf[_0x5b27('0x21')],_0x6dd0f1[_0x5b27('0x22')]),_0x15cc81);if(_0x5657bf[_0x5b27('0x21')][_0x5b27('0x2d')]){_0x4c3876['where']=_['merge'](_0x4c3876[_0x5b27('0x2e')],{'$or':_['map'](_0x15cc81,function(_0x22b168){if(_0x22b168[_0x5b27('0x2f')]!=='VIRTUAL'){var _0x72d07d={};_0x72d07d[_0x22b168[_0x5b27('0x18')]]={'$like':'%'+_0x5657bf[_0x5b27('0x21')][_0x5b27('0x2d')]+'%'};return _0x72d07d;}})});}_0x4c3876=_[_0x5b27('0x30')]({},_0x4c3876,_0x5657bf[_0x5b27('0x31')]);var _0x1e083a={'where':_0x4c3876[_0x5b27('0x2e')]};return db[_0x5b27('0x1d')][_0x5b27('0x10')](_0x1e083a)[_0x5b27('0x14')](function(_0x3a0136){_0xaf61ed[_0x5b27('0x10')]=_0x3a0136;if(_0x5657bf[_0x5b27('0x21')][_0x5b27('0x32')]){_0x4c3876['include']=[{'all':!![]}];}return db[_0x5b27('0x1d')][_0x5b27('0x33')](_0x4c3876);})[_0x5b27('0x14')](function(_0x61c654){_0xaf61ed[_0x5b27('0x34')]=_[_0x5b27('0x1c')](_0x61c654,function(_0x34ede3){if(_0x34ede3[_0x5b27('0x35')]===_0x5b27('0x36')){var _0x3973d8=encryptor[_0x5b27('0x37')](_0x34ede3[_0x5b27('0x38')]);_0x34ede3[_0x5b27('0x38')]=maskClientSecret(_0x3973d8);}return _0x34ede3;});return _0xaf61ed;})[_0x5b27('0x14')](respondWithFilteredResult(_0x9b91c2,_0x4c3876))[_0x5b27('0x39')](handleError(_0x9b91c2,null));};exports[_0x5b27('0x3a')]=function(_0x39271d,_0x2666ea){var _0x2bf017={'raw':!![],'where':{'id':_0x39271d['params']['id']}},_0x338bb6={};_0x338bb6[_0x5b27('0x20')]=_['keys'](db['CloudProvider'][_0x5b27('0x1e')]);_0x338bb6[_0x5b27('0x21')]=_[_0x5b27('0x3b')](_0x39271d[_0x5b27('0x21')]);_0x338bb6[_0x5b27('0x22')]=_[_0x5b27('0x23')](_0x338bb6[_0x5b27('0x20')],_0x338bb6[_0x5b27('0x21')]);_0x2bf017[_0x5b27('0x24')]=_['intersection'](_0x338bb6[_0x5b27('0x20')],qs['fields'](_0x39271d[_0x5b27('0x21')][_0x5b27('0x25')]));_0x2bf017['attributes']=_0x2bf017[_0x5b27('0x24')]['length']?_0x2bf017[_0x5b27('0x24')]:_0x338bb6[_0x5b27('0x20')];if(_0x39271d[_0x5b27('0x21')][_0x5b27('0x32')]){_0x2bf017[_0x5b27('0x3c')]=[{'all':!![]}];}_0x2bf017=_['merge']({},_0x2bf017,_0x39271d['options']);return db[_0x5b27('0x1d')]['find'](_0x2bf017)[_0x5b27('0x14')](handleEntityNotFound(_0x2666ea,null))['then'](function(_0x46cebb){if(_0x46cebb[_0x5b27('0x35')]===_0x5b27('0x36')){var _0x3f2c6a=encryptor[_0x5b27('0x37')](_0x46cebb[_0x5b27('0x38')]);_0x46cebb[_0x5b27('0x38')]=maskClientSecret(_0x3f2c6a);}return _0x46cebb;})[_0x5b27('0x14')](respondWithResult(_0x2666ea,null))['catch'](handleError(_0x2666ea,null));};exports['create']=function(_0x24ea2d,_0x2efa7a){if(!_0x24ea2d[_0x5b27('0x3d')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x24ea2d[_0x5b27('0x3d')]['service'])throw new Error(_0x5b27('0x3e'));var _0x508536=db[_0x5b27('0x1d')][_0x5b27('0x1e')]['service'][_0x5b27('0x3f')];if(!_0x508536[_0x5b27('0x40')](_0x24ea2d[_0x5b27('0x3d')][_0x5b27('0x35')]))throw new Error(_0x5b27('0x41')+_0x508536[_0x5b27('0x42')](',\x20'));if(_0x24ea2d[_0x5b27('0x3d')][_0x5b27('0x35')]==='MicrosoftAzure'&&_0x24ea2d[_0x5b27('0x3d')][_0x5b27('0x38')]){_0x24ea2d[_0x5b27('0x3d')][_0x5b27('0x38')]=encryptor[_0x5b27('0x43')](_0x24ea2d['body'][_0x5b27('0x38')]);}return db[_0x5b27('0x1d')][_0x5b27('0x44')](_0x24ea2d['body'],{})[_0x5b27('0x14')](respondWithResult(_0x2efa7a,0xc9))[_0x5b27('0x39')](handleError(_0x2efa7a,null));};exports[_0x5b27('0x13')]=function(_0x2a87a2,_0x551777){if(_0x2a87a2[_0x5b27('0x3d')]['id']){delete _0x2a87a2[_0x5b27('0x3d')]['id'];}return db[_0x5b27('0x1d')][_0x5b27('0x45')]({'where':{'id':_0x2a87a2[_0x5b27('0x46')]['id']}})[_0x5b27('0x14')](handleEntityNotFound(_0x551777,null))[_0x5b27('0x14')](function(_0x4b7b5e){if(_0x4b7b5e[_0x5b27('0x35')]===_0x5b27('0x36')&&_0x2a87a2[_0x5b27('0x3d')][_0x5b27('0x38')]){_0x2a87a2[_0x5b27('0x3d')][_0x5b27('0x38')]=encryptor['encryptString'](_0x2a87a2['body'][_0x5b27('0x38')]);}return _0x4b7b5e;})[_0x5b27('0x14')](saveUpdates(_0x2a87a2[_0x5b27('0x3d')],null))[_0x5b27('0x14')](respondWithResult(_0x551777,null))[_0x5b27('0x39')](handleError(_0x551777,null));};exports[_0x5b27('0x15')]=function(_0x844374,_0x194f33){return db['CloudProvider'][_0x5b27('0x45')]({'where':{'id':_0x844374[_0x5b27('0x46')]['id']}})[_0x5b27('0x14')](handleEntityNotFound(_0x194f33,null))[_0x5b27('0x14')](removeEntity(_0x194f33,null))['catch'](handleError(_0x194f33,null));};exports[_0x5b27('0x47')]=function(_0x220a25,_0x150384){return db['CloudProvider'][_0x5b27('0x48')]({'where':{'id':_0x220a25['params']['id']},'raw':!![]})['then'](function(_0x110f33){if(!_0x110f33)return _0x150384['sendStatus'](0x194);return{'url':oauth[_0x5b27('0x49')](_0x110f33,_0x220a25[_0x5b27('0x4a')]['id'])};})[_0x5b27('0x14')](respondWithResult(_0x150384,null))['catch'](handleError(_0x150384,null));};exports[_0x5b27('0x4b')]=function(_0x414367,_0x5bdd27){var _0x49b2e1=_0x414367[_0x5b27('0x3d')];var _0x4da8da;var _0x2d4d3d;if(_0x49b2e1[_0x5b27('0x16')])throw _0x49b2e1;redis['get'](_0x49b2e1[_0x5b27('0x4c')])[_0x5b27('0x14')](function(_0x4cd281){if(!_0x4cd281)throw new Error(_0x5b27('0x4d'));_0x4da8da=JSON['parse'](_0x4cd281);var _0x520e49=Buffer['from'](_0x49b2e1[_0x5b27('0x4c')],_0x5b27('0x4e'))[_0x5b27('0x4f')](_0x5b27('0x50'));_0x2d4d3d=JSON[_0x5b27('0x51')](_0x520e49);if(!oauth['isValidIdToken'](_0x49b2e1[_0x5b27('0x52')],_0x4da8da[_0x5b27('0x53')]))throw new Error(_0x5b27('0x54'));redis[_0x5b27('0x55')](_0x49b2e1['state']);return oauth[_0x5b27('0x56')](_0x49b2e1['code'],_0x4da8da);})[_0x5b27('0x14')](function(_0x73de73){_0x4da8da[_0x5b27('0x57')]=_0x73de73[_0x5b27('0x58')];_0x4da8da[_0x5b27('0x59')]=_0x73de73['refresh_token'];return db[_0x5b27('0x1d')][_0x5b27('0x13')]({'data5':_0x4da8da[_0x5b27('0x57')],'data6':_0x4da8da[_0x5b27('0x59')]},{'where':{'id':_0x4da8da['id']}});})['then'](function(){oauth[_0x5b27('0x5a')](_0x4da8da);socket[_0x5b27('0x5b')]('microsoftAuthorization:success',{'id':_0x2d4d3d['id']});return;})[_0x5b27('0x14')](respondWithStatusCode(_0x5bdd27,null))[_0x5b27('0x39')](function(_0x4d95ad){if(_0x2d4d3d){socket[_0x5b27('0x5b')]('microsoftAuthorization:error',{'id':_0x2d4d3d['id']});}if(!_0x4da8da){logger[_0x5b27('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x4d95ad);return _0x5bdd27[_0x5b27('0xb')](0x1f4)['send'](_0x4d95ad[_0x5b27('0x5c')]);}logger[_0x5b27('0x16')](_0x5b27('0x5d'),_0x4da8da['id'],JSON[_0x5b27('0x5e')](_0x4d95ad));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index c50a442..882344c 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 _0xba00=['exports','define','cloud_providers','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x16528b,_0xcf7f9d){var _0x38f906=function(_0x1c4350){while(--_0x1c4350){_0x16528b['push'](_0x16528b['shift']());}};_0x38f906(++_0xcf7f9d);}(_0xba00,0xd2));var _0x0ba0=function(_0x114c42,_0x1c03a9){_0x114c42=_0x114c42-0x0;var _0x4b7f93=_0xba00[_0x114c42];return _0x4b7f93;};'use strict';var _=require('lodash');var util=require(_0x0ba0('0x0'));var logger=require(_0x0ba0('0x1'))(_0x0ba0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ba0('0x3'));var rimraf=require(_0x0ba0('0x4'));var config=require(_0x0ba0('0x5'));var attributes=require('./cloudProvider.attributes');module[_0x0ba0('0x6')]=function(_0x3c692d,_0x44d63b){return _0x3c692d[_0x0ba0('0x7')]('CloudProvider',attributes,{'tableName':_0x0ba0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x963d=['api','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','lodash','util','../../config/logger'];(function(_0x450200,_0x191325){var _0x375fbe=function(_0x559ee1){while(--_0x559ee1){_0x450200['push'](_0x450200['shift']());}};_0x375fbe(++_0x191325);}(_0x963d,0x1d3));var _0xd963=function(_0x589267,_0x3770ce){_0x589267=_0x589267-0x0;var _0x12ebb7=_0x963d[_0x589267];return _0x12ebb7;};'use strict';var _=require(_0xd963('0x0'));var util=require(_0xd963('0x1'));var logger=require(_0xd963('0x2'))(_0xd963('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd963('0x4'));var fs=require('fs');var path=require(_0xd963('0x5'));var rimraf=require(_0xd963('0x6'));var config=require(_0xd963('0x7'));var attributes=require(_0xd963('0x8'));module['exports']=function(_0x55ec15,_0x8c3985){return _0x55ec15['define'](_0xd963('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 6406afd..90cb0ef 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbd5=['[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/token','map','type','Dynamics365','push','join','Outlook365','/.default','replace','data2','code','id_token','stringify','toString','base64','randomBytes','hex','response_type','redirect_uri','data4','response_mode','state','key','value','oauth2Claims','oauth2/','data1','set','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','data5','access_token','update','catch','error','intervals','bind','findAll','all'];(function(_0x57ebb0,_0x3e878f){var _0x87cffd=function(_0x50b110){while(--_0x50b110){_0x57ebb0['push'](_0x57ebb0['shift']());}};_0x87cffd(++_0x3e878f);}(_0xdbd5,0xa0));var _0x5dbd=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xdbd5[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0x5dbd('0x0'));var crypto=require('crypto');var jwt=require(_0x5dbd('0x1'));var moment=require(_0x5dbd('0x2'));var Redis=require('ioredis');var rp=require(_0x5dbd('0x3'));var util=require('util');var encryptor=require(_0x5dbd('0x4'));var config=require(_0x5dbd('0x5'));var logger=require(_0x5dbd('0x6'))('api');var schedule=require(_0x5dbd('0x7'));var db=require(_0x5dbd('0x8'))['db'];config[_0x5dbd('0x9')]=_[_0x5dbd('0xa')](config[_0x5dbd('0x9')],{'host':_0x5dbd('0xb'),'port':0x18eb});var redis=new Redis(config[_0x5dbd('0x9')]);var MICROSOFT_AUTH_URL=_0x5dbd('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x5dbd('0xd'),_0x5dbd('0xe'),'offline_access',_0x5dbd('0xf'),_0x5dbd('0x10'),_0x5dbd('0x11')],'Dynamics365':[_0x5dbd('0x12'),_0x5dbd('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x5dbd('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x183a82){var _0x1afcdd=_[_0x5dbd('0x15')](AZURE_AUTH_SCOPES[_0x183a82['type']]);if(_0x183a82[_0x5dbd('0x16')]===_0x5dbd('0x17'))_0x1afcdd[_0x5dbd('0x18')](_0x183a82['data7']+'/.default');return _0x1afcdd[_0x5dbd('0x19')]('\x20');}function getAccessTokenScope(_0x50279d){if(_0x50279d[_0x5dbd('0x16')]===_0x5dbd('0x1a'))return _0x5dbd('0xf');if(_0x50279d['type']===_0x5dbd('0x17'))return _0x50279d['data7']+_0x5dbd('0x1b');}function generateMicrosoftAuthorizationUrl(_0x30f28f,_0x5a9354){var _0x4e199d=MICROSOFT_AUTH_URL[_0x5dbd('0x1c')]('{TENANT_ID}',_0x30f28f[_0x5dbd('0x1d')]);var _0x328fc6=[_0x5dbd('0x1e'),_0x5dbd('0x1f')];var _0xd902d8=Buffer['from'](JSON[_0x5dbd('0x20')]({'id':_0x5a9354}))[_0x5dbd('0x21')](_0x5dbd('0x22'));var _0x1e88eb=crypto[_0x5dbd('0x23')](0x10)[_0x5dbd('0x21')](_0x5dbd('0x24'));var _0x5e677e=getAuthorizationScopes(_0x30f28f);var _0x395fe5=[{'key':'client_id','value':_0x30f28f['data1']},{'key':_0x5dbd('0x25'),'value':encodeURIComponent(_0x328fc6[_0x5dbd('0x19')]('\x20'))},{'key':_0x5dbd('0x26'),'value':_0x30f28f[_0x5dbd('0x27')]},{'key':_0x5dbd('0x28'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x5e677e)},{'key':_0x5dbd('0x29'),'value':_0xd902d8},{'key':'nonce','value':_0x1e88eb},{'key':'prompt','value':'login'}];var _0x3df714=_0x4e199d+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x395fe5,function(_0xaca15d){return _0xaca15d[_0x5dbd('0x2a')]+'='+_0xaca15d[_0x5dbd('0x2b')];})[_0x5dbd('0x19')]('&');_0x30f28f[_0x5dbd('0x2c')]={'issuer':_0x4e199d[_0x5dbd('0x1c')](_0x5dbd('0x2d'),''),'audience':_0x30f28f[_0x5dbd('0x2e')],'state':_0xd902d8,'nonce':_0x1e88eb};redis[_0x5dbd('0x2f')](_0xd902d8,JSON[_0x5dbd('0x20')](_0x30f28f));return _0x3df714;}function isValidIdToken(_0x5d7e39,_0x3a37e1){try{var _0x3a2466=jwt[_0x5dbd('0x30')](_0x5d7e39,{'complete':!![]});var _0x709e88=_0x3a2466[_0x5dbd('0x31')];if(_0x709e88[_0x5dbd('0x32')]!==_0x3a37e1[_0x5dbd('0x33')])return![];if(_0x709e88[_0x5dbd('0x34')]!==_0x3a37e1[_0x5dbd('0x35')])return![];if(_0x709e88[_0x5dbd('0x36')]!==_0x3a37e1[_0x5dbd('0x36')])return![];if(moment()[_0x5dbd('0x37')](moment[_0x5dbd('0x38')](_0x709e88[_0x5dbd('0x39')])))return![];return!![];}catch(_0x6ff3ad){throw _0x6ff3ad;}}function refreshOauth2MicrosoftAccessToken(_0x321632){return Promise[_0x5dbd('0x3a')]()[_0x5dbd('0x3b')](function(){if(_0x321632[_0x5dbd('0x3c')])return _0x321632;return db[_0x5dbd('0x3d')][_0x5dbd('0x3e')]({'where':{'id':_0x321632['id']},'raw':!![]});})[_0x5dbd('0x3b')](function(_0x42ef3d){var _0x2159d2={'grant_type':_0x5dbd('0x3f'),'refresh_token':_0x42ef3d[_0x5dbd('0x40')],'scope':getAccessTokenScope(_0x42ef3d),'redirect_uri':_0x42ef3d[_0x5dbd('0x27')],'client_id':_0x42ef3d[_0x5dbd('0x2e')],'client_secret':encryptor[_0x5dbd('0x41')](_0x42ef3d[_0x5dbd('0x3c')])};var _0x1eb87d={'method':_0x5dbd('0x42'),'uri':MICROSOFT_AUTH_URL[_0x5dbd('0x1c')](_0x5dbd('0x43'),_0x42ef3d[_0x5dbd('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2159d2,'json':!![]};return rp(_0x1eb87d);})[_0x5dbd('0x3b')](function(_0xcdfd92){_0x321632[_0x5dbd('0x44')]=_0xcdfd92[_0x5dbd('0x45')];_0x321632[_0x5dbd('0x40')]=_0xcdfd92['refresh_token'];return db[_0x5dbd('0x3d')][_0x5dbd('0x46')]({'data5':_0x321632[_0x5dbd('0x44')],'data6':_0x321632['data6']},{'where':{'id':_0x321632['id']}});})[_0x5dbd('0x3b')](function(){return _0x321632;})[_0x5dbd('0x47')](function(_0x309568){logger[_0x5dbd('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x321632['id'],_0x309568);});}function getOauth2MicrosoftAccessToken(_0x5caef8,_0x13dda7){var _0x1b41b2={'grant_type':'authorization_code','code':_0x5caef8,'scope':getAccessTokenScope(_0x13dda7),'redirect_uri':_0x13dda7[_0x5dbd('0x27')],'client_id':_0x13dda7[_0x5dbd('0x2e')],'client_secret':encryptor[_0x5dbd('0x41')](_0x13dda7['data3'])};var _0x34ffa2={'method':_0x5dbd('0x42'),'uri':MICROSOFT_AUTH_URL[_0x5dbd('0x1c')](_0x5dbd('0x43'),_0x13dda7[_0x5dbd('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1b41b2,'json':!![]};return rp(_0x34ffa2);}function startRefreshInterval(_0xf71e55){var _0x410e93=schedule[_0x5dbd('0x49')];if(_0x410e93[_0xf71e55['id']])clearInterval(_0x410e93[_0xf71e55['id']]);_0x410e93[_0xf71e55['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x5dbd('0x4a')](this,{'id':_0xf71e55['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x410e93;}function startAllRefreshIntervals(){return db[_0x5dbd('0x3d')][_0x5dbd('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5dbd('0x3b')](function(_0x15ab83){var _0xebed1f=_0x15ab83[_0x5dbd('0x15')](function(_0x5df020){return refreshOauth2MicrosoftAccessToken(_0x5df020)[_0x5dbd('0x3b')](function(_0x14f0e9){startRefreshInterval(_0x14f0e9);});});return Promise[_0x5dbd('0x4c')](_0xebed1f);})['catch'](function(_0x14e752){var _0x3b73ff=_0x14e752?util['inspect'](_0x14e752,{'showHidden':![],'depth':null}):'';logger['error'](_0x5dbd('0x4d'),_0x3b73ff);});}module[_0x5dbd('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x76e8=['../../components/encryptor','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','type','Dynamics365','push','data7','join','Outlook365','/.default','replace','{TENANT_ID}','code','id_token','from','stringify','toString','randomBytes','client_id','data1','data4','form_post','scope','state','nonce','prompt','login','map','key','value','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','resolve','then','data3','findOne','refresh_token','data6','decryptString','POST','CloudProvider','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data2','findAll','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util'];(function(_0x12ea92,_0x1d72cf){var _0xb8c223=function(_0x7bd6bd){while(--_0x7bd6bd){_0x12ea92['push'](_0x12ea92['shift']());}};_0xb8c223(++_0x1d72cf);}(_0x76e8,0x8e));var _0x876e=function(_0x160ea1,_0x1bba4b){_0x160ea1=_0x160ea1-0x0;var _0x36364e=_0x76e8[_0x160ea1];return _0x36364e;};'use strict';var _=require('lodash');var crypto=require(_0x876e('0x0'));var jwt=require(_0x876e('0x1'));var moment=require(_0x876e('0x2'));var Redis=require(_0x876e('0x3'));var rp=require(_0x876e('0x4'));var util=require(_0x876e('0x5'));var encryptor=require(_0x876e('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x876e('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x876e('0x8')]=_[_0x876e('0x9')](config[_0x876e('0x8')],{'host':_0x876e('0xa'),'port':0x18eb});var redis=new Redis(config[_0x876e('0x8')]);var MICROSOFT_AUTH_URL=_0x876e('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x876e('0xc'),_0x876e('0xd'),_0x876e('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x876e('0xf'),_0x876e('0x10')],'Dynamics365':[_0x876e('0x11'),_0x876e('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x876e('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x209988){var _0x13255b=_['map'](AZURE_AUTH_SCOPES[_0x209988['type']]);if(_0x209988[_0x876e('0x13')]===_0x876e('0x14'))_0x13255b[_0x876e('0x15')](_0x209988[_0x876e('0x16')]+'/.default');return _0x13255b[_0x876e('0x17')]('\x20');}function getAccessTokenScope(_0x2708d2){if(_0x2708d2[_0x876e('0x13')]===_0x876e('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2708d2[_0x876e('0x13')]===_0x876e('0x14'))return _0x2708d2[_0x876e('0x16')]+_0x876e('0x19');}function generateMicrosoftAuthorizationUrl(_0x1c04c4,_0x59e57f){var _0x43ea7e=MICROSOFT_AUTH_URL[_0x876e('0x1a')](_0x876e('0x1b'),_0x1c04c4['data2']);var _0x4b40c0=[_0x876e('0x1c'),_0x876e('0x1d')];var _0x13f07f=Buffer[_0x876e('0x1e')](JSON[_0x876e('0x1f')]({'id':_0x59e57f}))[_0x876e('0x20')]('base64');var _0x29cc17=crypto[_0x876e('0x21')](0x10)[_0x876e('0x20')]('hex');var _0x5b28b8=getAuthorizationScopes(_0x1c04c4);var _0x2a0bd6=[{'key':_0x876e('0x22'),'value':_0x1c04c4[_0x876e('0x23')]},{'key':'response_type','value':encodeURIComponent(_0x4b40c0['join']('\x20'))},{'key':'redirect_uri','value':_0x1c04c4[_0x876e('0x24')]},{'key':'response_mode','value':_0x876e('0x25')},{'key':_0x876e('0x26'),'value':encodeURIComponent(_0x5b28b8)},{'key':_0x876e('0x27'),'value':_0x13f07f},{'key':_0x876e('0x28'),'value':_0x29cc17},{'key':_0x876e('0x29'),'value':_0x876e('0x2a')}];var _0x15c44e=_0x43ea7e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x876e('0x2b')](_0x2a0bd6,function(_0x2bf635){return _0x2bf635[_0x876e('0x2c')]+'='+_0x2bf635[_0x876e('0x2d')];})[_0x876e('0x17')]('&');_0x1c04c4['oauth2Claims']={'issuer':_0x43ea7e[_0x876e('0x1a')](_0x876e('0x2e'),''),'audience':_0x1c04c4['data1'],'state':_0x13f07f,'nonce':_0x29cc17};redis['set'](_0x13f07f,JSON[_0x876e('0x1f')](_0x1c04c4));return _0x15c44e;}function isValidIdToken(_0x29c498,_0x4518ff){try{var _0x3d486a=jwt[_0x876e('0x2f')](_0x29c498,{'complete':!![]});var _0xaf9c7=_0x3d486a[_0x876e('0x30')];if(_0xaf9c7[_0x876e('0x31')]!==_0x4518ff[_0x876e('0x32')])return![];if(_0xaf9c7[_0x876e('0x33')]!==_0x4518ff[_0x876e('0x34')])return![];if(_0xaf9c7['nonce']!==_0x4518ff[_0x876e('0x28')])return![];if(moment()[_0x876e('0x35')](moment[_0x876e('0x36')](_0xaf9c7['exp'])))return![];return!![];}catch(_0x319d91){throw _0x319d91;}}function refreshOauth2MicrosoftAccessToken(_0x38d254){return Promise[_0x876e('0x37')]()[_0x876e('0x38')](function(){if(_0x38d254[_0x876e('0x39')])return _0x38d254;return db['CloudProvider'][_0x876e('0x3a')]({'where':{'id':_0x38d254['id']},'raw':!![]});})['then'](function(_0x2810f0){var _0x385019={'grant_type':_0x876e('0x3b'),'refresh_token':_0x2810f0[_0x876e('0x3c')],'scope':getAccessTokenScope(_0x2810f0),'redirect_uri':_0x2810f0[_0x876e('0x24')],'client_id':_0x2810f0[_0x876e('0x23')],'client_secret':encryptor[_0x876e('0x3d')](_0x2810f0[_0x876e('0x39')])};var _0x1bab4b={'method':_0x876e('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x876e('0x1a')]('{TENANT_ID}',_0x2810f0['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x385019,'json':!![]};return rp(_0x1bab4b);})[_0x876e('0x38')](function(_0x55ec40){_0x38d254['data5']=_0x55ec40['access_token'];_0x38d254[_0x876e('0x3c')]=_0x55ec40[_0x876e('0x3b')];return db[_0x876e('0x3f')][_0x876e('0x40')]({'data5':_0x38d254[_0x876e('0x41')],'data6':_0x38d254[_0x876e('0x3c')]},{'where':{'id':_0x38d254['id']}});})[_0x876e('0x38')](function(){return _0x38d254;})[_0x876e('0x42')](function(_0x3e1cf6){logger[_0x876e('0x43')](_0x876e('0x44'),_0x38d254['id'],_0x3e1cf6);});}function getOauth2MicrosoftAccessToken(_0x379f54,_0x24bbac){var _0x2adb7d={'grant_type':_0x876e('0x45'),'code':_0x379f54,'scope':getAccessTokenScope(_0x24bbac),'redirect_uri':_0x24bbac[_0x876e('0x24')],'client_id':_0x24bbac[_0x876e('0x23')],'client_secret':encryptor[_0x876e('0x3d')](_0x24bbac[_0x876e('0x39')])};var _0x4dbbcd={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x876e('0x1a')](_0x876e('0x1b'),_0x24bbac[_0x876e('0x46')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2adb7d,'json':!![]};return rp(_0x4dbbcd);}function startRefreshInterval(_0x50eb85){var _0x4295ac=schedule['intervals'];if(_0x4295ac[_0x50eb85['id']])clearInterval(_0x4295ac[_0x50eb85['id']]);_0x4295ac[_0x50eb85['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x50eb85['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4295ac;}function startAllRefreshIntervals(){return db[_0x876e('0x3f')][_0x876e('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x876e('0x38')](function(_0x23aa69){var _0x20ee91=_0x23aa69[_0x876e('0x2b')](function(_0x39a6eb){return refreshOauth2MicrosoftAccessToken(_0x39a6eb)[_0x876e('0x38')](function(_0x8c53c3){startRefreshInterval(_0x8c53c3);});});return Promise['all'](_0x20ee91);})[_0x876e('0x42')](function(_0x47e271){var _0x2a2dd9=_0x47e271?util['inspect'](_0x47e271,{'showHidden':![],'depth':null}):'';logger['error'](_0x876e('0x48'),_0x2a2dd9);});}module[_0x876e('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 46d4cce..5aa3dfe 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 _0x6ac2=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6ac2,0x184));var _0x26ac=function(_0xa348e,_0xed07dc){_0xa348e=_0xa348e-0x0;var _0x10a57e=_0x6ac2[_0xa348e];return _0x10a57e;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});}
\ No newline at end of file
+var _0x6257=['info','request\x20sent','debug','code','message','error','CloudProvider,\x20%s,\x20%s','result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x15c1eb,_0x3c8cb8){var _0x630e54=function(_0x2b9e54){while(--_0x2b9e54){_0x15c1eb['push'](_0x15c1eb['shift']());}};_0x630e54(++_0x3c8cb8);}(_0x6257,0x1d4));var _0x7625=function(_0x429c1f,_0x4cb6e7){_0x429c1f=_0x429c1f-0x0;var _0x5cad29=_0x6257[_0x429c1f];return _0x5cad29;};'use strict';var _=require(_0x7625('0x0'));var util=require('util');var moment=require(_0x7625('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7625('0x2'));var db=require(_0x7625('0x3'))['db'];var utils=require(_0x7625('0x4'));var logger=require(_0x7625('0x5'))(_0x7625('0x6'));var config=require(_0x7625('0x7'));var jayson=require(_0x7625('0x8'));var client=jayson[_0x7625('0x9')][_0x7625('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x427050,_0x5cf7a8,_0x4b790d){return new BPromise(function(_0x287434,_0x1a02de){return client['request'](_0x427050,_0x4b790d)[_0x7625('0xb')](function(_0x2a2625){logger[_0x7625('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5cf7a8,_0x7625('0xd'));logger[_0x7625('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5cf7a8,_0x7625('0xd'),JSON['stringify'](_0x2a2625));if(_0x2a2625['error']){if(_0x2a2625['error'][_0x7625('0xf')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5cf7a8,_0x2a2625['error'][_0x7625('0x10')]);return _0x1a02de(_0x2a2625[_0x7625('0x11')][_0x7625('0x10')]);}logger[_0x7625('0x11')](_0x7625('0x12'),_0x5cf7a8,_0x2a2625[_0x7625('0x11')]['message']);return _0x287434(_0x2a2625['error'][_0x7625('0x10')]);}else{logger['info'](_0x7625('0x12'),_0x5cf7a8,_0x7625('0xd'));_0x287434(_0x2a2625[_0x7625('0x13')]['message']);}})['catch'](function(_0x43206e){logger[_0x7625('0x11')](_0x7625('0x12'),_0x5cf7a8,_0x43206e);_0x1a02de(_0x43206e);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index bfdd361..1d3044f 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2b93e1,_0x10e1d3){_0x2b93e1=_0x2b93e1-0x0;var _0x40f612=_0x5f2f[_0x2b93e1];return _0x40f612;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0xa9e9b4,_0x45edee){_0xa9e9b4=_0xa9e9b4-0x0;var _0x45dd5c=_0x7a54[_0xa9e9b4];return _0x45dd5c;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index cb62ac5..cd1ae20 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 _0x38ca=['STRING','name','sequelize'];(function(_0x128ee7,_0xbfbe00){var _0x38450a=function(_0x570931){while(--_0x570931){_0x128ee7['push'](_0x128ee7['shift']());}};_0x38450a(++_0xbfbe00);}(_0x38ca,0xb0));var _0xa38c=function(_0xa46cc9,_0x327f7d){_0xa46cc9=_0xa46cc9-0x0;var _0x5683ed=_0x38ca[_0xa46cc9];return _0x5683ed;};'use strict';var Sequelize=require(_0xa38c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa38c('0x1')],'unique':_0xa38c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa38c('0x1')]},'companyId':{'type':Sequelize[_0xa38c('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa38c('0x1')]},'fax':{'type':Sequelize[_0xa38c('0x1')]},'type':{'type':Sequelize[_0xa38c('0x1')]},'street':{'type':Sequelize[_0xa38c('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa38c('0x1')]},'country':{'type':Sequelize[_0xa38c('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xa38c('0x1')]},'sPostalCode':{'type':Sequelize[_0xa38c('0x1')]},'sCity':{'type':Sequelize[_0xa38c('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa38c('0x1')]}};
\ No newline at end of file
+var _0x1a9d=['name','sequelize','exports','STRING'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x1a9d,0x161));var _0xd1a9=function(_0x2dff7e,_0x3666b2){_0x2dff7e=_0x2dff7e-0x0;var _0x3548e0=_0x1a9d[_0x2dff7e];return _0x3548e0;};'use strict';var Sequelize=require(_0xd1a9('0x0'));module[_0xd1a9('0x1')]={'name':{'type':Sequelize[_0xd1a9('0x2')],'unique':_0xd1a9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd1a9('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xd1a9('0x2')]},'phone':{'type':Sequelize[_0xd1a9('0x2')]},'fax':{'type':Sequelize[_0xd1a9('0x2')]},'type':{'type':Sequelize[_0xd1a9('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd1a9('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd1a9('0x2')]},'email':{'type':Sequelize[_0xd1a9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd1a9('0x2')]},'sStreet':{'type':Sequelize[_0xd1a9('0x2')]},'sPostalCode':{'type':Sequelize[_0xd1a9('0x2')]},'sCity':{'type':Sequelize[_0xd1a9('0x2')]},'sCountry':{'type':Sequelize[_0xd1a9('0x2')]},'description':{'type':Sequelize[_0xd1a9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 48c5328..dfa0f00 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 _0xc9e7=['moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','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','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addContacts','CmContact','ids','omit','getContacts','findOne','order','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1599a0,_0x34b3f8){var _0x4f57ed=function(_0x1822d8){while(--_0x1822d8){_0x1599a0['push'](_0x1599a0['shift']());}};_0x4f57ed(++_0x34b3f8);}(_0xc9e7,0xb5));var _0x7c9e=function(_0x1ddcbe,_0x203dfb){_0x1ddcbe=_0x1ddcbe-0x0;var _0x29741d=_0xc9e7[_0x1ddcbe];return _0x29741d;};'use strict';var emlformat=require(_0x7c9e('0x0'));var rimraf=require(_0x7c9e('0x1'));var zipdir=require(_0x7c9e('0x2'));var jsonpatch=require(_0x7c9e('0x3'));var rp=require(_0x7c9e('0x4'));var moment=require(_0x7c9e('0x5'));var BPromise=require(_0x7c9e('0x6'));var Mustache=require(_0x7c9e('0x7'));var util=require(_0x7c9e('0x8'));var path=require('path');var sox=require(_0x7c9e('0x9'));var csv=require('to-csv');var ejs=require(_0x7c9e('0xa'));var fs=require('fs');var fs_extra=require(_0x7c9e('0xb'));var _=require(_0x7c9e('0xc'));var squel=require('squel');var crypto=require(_0x7c9e('0xd'));var jsforce=require(_0x7c9e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7c9e('0xf'));var querystring=require(_0x7c9e('0x10'));var Papa=require('papaparse');var Redis=require(_0x7c9e('0x11'));var authService=require(_0x7c9e('0x12'));var qs=require(_0x7c9e('0x13'));var as=require(_0x7c9e('0x14'));var hardwareService=require(_0x7c9e('0x15'));var logger=require(_0x7c9e('0x16'))(_0x7c9e('0x17'));var utils=require(_0x7c9e('0x18'));var config=require(_0x7c9e('0x19'));var licenseUtil=require(_0x7c9e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337582,_0x563893){_0x563893=_0x563893||0xcc;return function(_0xaba2e8){if(_0xaba2e8){return _0x337582['sendStatus'](_0x563893);}return _0x337582['status'](_0x563893)[_0x7c9e('0x1b')]();};}function respondWithResult(_0x5a2188,_0x434eee){_0x434eee=_0x434eee||0xc8;return function(_0x12c6e3){if(_0x12c6e3){return _0x5a2188[_0x7c9e('0x1c')](_0x434eee)[_0x7c9e('0x1d')](_0x12c6e3);}};}function respondWithFilteredResult(_0x56aa79,_0x106391){return function(_0x289638){if(_0x289638){var _0x4ff7ea=typeof _0x106391['offset']===_0x7c9e('0x1e')&&typeof _0x106391[_0x7c9e('0x1f')]==='undefined';var _0x5ae28e=_0x289638[_0x7c9e('0x20')];var _0x4c32a2=_0x4ff7ea?0x0:_0x106391['offset'];var _0x41e69a=_0x4ff7ea?_0x289638['count']:_0x106391[_0x7c9e('0x21')]+_0x106391[_0x7c9e('0x1f')];var _0x49f445;if(_0x41e69a>=_0x5ae28e){_0x41e69a=_0x5ae28e;_0x49f445=0xc8;}else{_0x49f445=0xce;}_0x56aa79[_0x7c9e('0x1c')](_0x49f445);return _0x56aa79[_0x7c9e('0x22')](_0x7c9e('0x23'),_0x4c32a2+'-'+_0x41e69a+'/'+_0x5ae28e)[_0x7c9e('0x1d')](_0x289638);}return null;};}function patchUpdates(_0x62e2b8){return function(_0x50c1ca){try{jsonpatch[_0x7c9e('0x24')](_0x50c1ca,_0x62e2b8,!![]);}catch(_0x1f26ec){return BPromise[_0x7c9e('0x25')](_0x1f26ec);}return _0x50c1ca[_0x7c9e('0x26')]();};}function saveUpdates(_0xb527f,_0x3d8217){return function(_0x36365c){if(_0x36365c){return _0x36365c[_0x7c9e('0x27')](_0xb527f)[_0x7c9e('0x28')](function(_0x54075a){return _0x54075a;});}return null;};}function removeEntity(_0x31fb6b,_0x4d0c6a){return function(_0xe4e1a8){if(_0xe4e1a8){return _0xe4e1a8['destroy']()[_0x7c9e('0x28')](function(){var _0x40bd2b=_0xe4e1a8[_0x7c9e('0x29')]({'plain':!![]});var _0x316f31=_0x7c9e('0x2a');return db[_0x7c9e('0x2b')]['destroy']({'where':{'type':_0x316f31,'resourceId':_0x40bd2b['id']}})['then'](function(){return _0xe4e1a8;});})[_0x7c9e('0x28')](function(){_0x31fb6b[_0x7c9e('0x1c')](0xcc)[_0x7c9e('0x1b')]();});}};}function handleEntityNotFound(_0x3956fe,_0x44d35f){return function(_0x274eae){if(!_0x274eae){_0x3956fe['sendStatus'](0x194);}return _0x274eae;};}function handleError(_0xb97807,_0x7a5a19){_0x7a5a19=_0x7a5a19||0x1f4;return function(_0x2e3ce5){logger[_0x7c9e('0x2c')](_0x2e3ce5[_0x7c9e('0x2d')]);if(_0x2e3ce5[_0x7c9e('0x2e')]){delete _0x2e3ce5[_0x7c9e('0x2e')];}_0xb97807[_0x7c9e('0x1c')](_0x7a5a19)[_0x7c9e('0x2f')](_0x2e3ce5);};}exports[_0x7c9e('0x30')]=function(_0x1ad25a,_0x5ccd46){var _0x15d7c2={},_0x2395e7={},_0x52ba68={'count':0x0,'rows':[]};return db[_0x7c9e('0x31')]['describe']()[_0x7c9e('0x28')](function(_0x5d8e81){_0x2395e7['model']=_[_0x7c9e('0x32')](_0x5d8e81);_0x2395e7['query']=_['keys'](_0x1ad25a[_0x7c9e('0x33')]);_0x2395e7[_0x7c9e('0x34')]=_['intersection'](_0x2395e7[_0x7c9e('0x35')],_0x2395e7[_0x7c9e('0x33')]);_0x15d7c2['attributes']=_[_0x7c9e('0x36')](_0x2395e7[_0x7c9e('0x35')],qs['fields'](_0x1ad25a['query'][_0x7c9e('0x37')]));_0x15d7c2['attributes']=_0x15d7c2['attributes']['length']?_0x15d7c2[_0x7c9e('0x38')]:_0x2395e7['model'];if(!_0x1ad25a[_0x7c9e('0x33')][_0x7c9e('0x39')](_0x7c9e('0x3a'))){_0x15d7c2[_0x7c9e('0x1f')]=qs[_0x7c9e('0x1f')](_0x1ad25a[_0x7c9e('0x33')]['limit']);_0x15d7c2[_0x7c9e('0x21')]=qs[_0x7c9e('0x21')](_0x1ad25a[_0x7c9e('0x33')][_0x7c9e('0x21')]);}_0x15d7c2['order']=qs[_0x7c9e('0x3b')](_0x1ad25a[_0x7c9e('0x33')][_0x7c9e('0x3b')]);_0x15d7c2[_0x7c9e('0x3c')]=qs[_0x7c9e('0x34')](_[_0x7c9e('0x3d')](_0x1ad25a[_0x7c9e('0x33')],_0x2395e7['filters']),_0x5d8e81);if(_0x1ad25a[_0x7c9e('0x33')][_0x7c9e('0x3e')]){_0x15d7c2[_0x7c9e('0x3c')]=_[_0x7c9e('0x3f')](_0x15d7c2[_0x7c9e('0x3c')],{'$or':_['map'](_0x15d7c2[_0x7c9e('0x38')],function(_0x1b28a4){var _0x5e741f={};_0x5e741f[_0x1b28a4]={'$like':'%'+_0x1ad25a[_0x7c9e('0x33')]['filter']+'%'};return _0x5e741f;})});}_0x15d7c2=_['merge']({},_0x15d7c2,_0x1ad25a[_0x7c9e('0x40')]);var _0xa074c6={'where':_0x15d7c2['where']};return db[_0x7c9e('0x31')][_0x7c9e('0x20')](_0xa074c6)[_0x7c9e('0x28')](function(_0x3dcace){_0x52ba68[_0x7c9e('0x20')]=_0x3dcace;if(_0x1ad25a[_0x7c9e('0x33')]['includeAll']){_0x15d7c2[_0x7c9e('0x41')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x15d7c2);})[_0x7c9e('0x28')](function(_0x515381){_0x52ba68[_0x7c9e('0x42')]=_0x515381;return _0x52ba68;})[_0x7c9e('0x28')](respondWithFilteredResult(_0x5ccd46,_0x15d7c2))[_0x7c9e('0x43')](handleError(_0x5ccd46,null));})[_0x7c9e('0x43')](handleError(_0x5ccd46,null));};exports[_0x7c9e('0x44')]=function(_0x4bb89d,_0x2e9050){var _0x10e579={'raw':![],'where':{'id':_0x4bb89d[_0x7c9e('0x45')]['id']}},_0x10db06={};_0x10db06[_0x7c9e('0x35')]=_[_0x7c9e('0x32')](db[_0x7c9e('0x31')][_0x7c9e('0x46')]);_0x10db06['query']=_['keys'](_0x4bb89d['query']);_0x10db06[_0x7c9e('0x34')]=_[_0x7c9e('0x36')](_0x10db06[_0x7c9e('0x35')],_0x10db06[_0x7c9e('0x33')]);_0x10e579['attributes']=_[_0x7c9e('0x36')](_0x10db06[_0x7c9e('0x35')],qs[_0x7c9e('0x37')](_0x4bb89d['query'][_0x7c9e('0x37')]));_0x10e579[_0x7c9e('0x38')]=_0x10e579['attributes'][_0x7c9e('0x47')]?_0x10e579[_0x7c9e('0x38')]:_0x10db06['model'];if(_0x4bb89d[_0x7c9e('0x33')][_0x7c9e('0x48')]){_0x10e579[_0x7c9e('0x41')]=[{'all':!![]}];}_0x10e579=_['merge']({},_0x10e579,_0x4bb89d['options']);return db[_0x7c9e('0x31')][_0x7c9e('0x49')](_0x10e579)[_0x7c9e('0x28')](handleEntityNotFound(_0x2e9050,null))[_0x7c9e('0x28')](respondWithResult(_0x2e9050,null))[_0x7c9e('0x43')](handleError(_0x2e9050,null));};exports[_0x7c9e('0x4a')]=function(_0x46bccd,_0x2c27a2){return db[_0x7c9e('0x31')]['create'](_0x46bccd[_0x7c9e('0x4b')],{})[_0x7c9e('0x28')](function(_0x27d6b4){var _0x14dc94=_0x46bccd[_0x7c9e('0x4c')]['get']({'plain':!![]});if(!_0x14dc94)throw new Error(_0x7c9e('0x4d'));if(_0x14dc94[_0x7c9e('0x4e')]===_0x7c9e('0x4c')){var _0x4f1903=_0x27d6b4[_0x7c9e('0x29')]({'plain':!![]});var _0x47a6c2=_0x7c9e('0x2a');return db[_0x7c9e('0x4f')][_0x7c9e('0x49')]({'where':{'name':_0x47a6c2,'userProfileId':_0x14dc94[_0x7c9e('0x50')]},'raw':!![]})[_0x7c9e('0x28')](function(_0xf9223d){if(_0xf9223d&&_0xf9223d[_0x7c9e('0x51')]===0x0){return db[_0x7c9e('0x2b')][_0x7c9e('0x4a')]({'name':_0x4f1903[_0x7c9e('0x2e')],'resourceId':_0x4f1903['id'],'type':_0xf9223d['name'],'sectionId':_0xf9223d['id']},{})[_0x7c9e('0x28')](function(){return _0x27d6b4;});}else{return _0x27d6b4;}})['catch'](function(_0x2a6ae2){logger[_0x7c9e('0x2c')](_0x7c9e('0x52'),_0x2a6ae2);throw _0x2a6ae2;});}return _0x27d6b4;})[_0x7c9e('0x28')](respondWithResult(_0x2c27a2,0xc9))[_0x7c9e('0x43')](handleError(_0x2c27a2,null));};exports[_0x7c9e('0x27')]=function(_0x4d124b,_0x7f3ca6){if(_0x4d124b['body']['id']){delete _0x4d124b['body']['id'];}return db[_0x7c9e('0x31')]['find']({'where':{'id':_0x4d124b['params']['id']}})[_0x7c9e('0x28')](handleEntityNotFound(_0x7f3ca6,null))['then'](saveUpdates(_0x4d124b['body'],null))[_0x7c9e('0x28')](respondWithResult(_0x7f3ca6,null))['catch'](handleError(_0x7f3ca6,null));};exports[_0x7c9e('0x53')]=function(_0x190414,_0x1bf474){return db[_0x7c9e('0x31')][_0x7c9e('0x49')]({'where':{'id':_0x190414[_0x7c9e('0x45')]['id']}})[_0x7c9e('0x28')](handleEntityNotFound(_0x1bf474,null))['then'](removeEntity(_0x1bf474,null))[_0x7c9e('0x43')](handleError(_0x1bf474,null));};exports[_0x7c9e('0x54')]=function(_0x5cca40,_0x5977cf){return db[_0x7c9e('0x31')][_0x7c9e('0x54')]()[_0x7c9e('0x28')](respondWithResult(_0x5977cf,null))[_0x7c9e('0x43')](handleError(_0x5977cf,null));};exports[_0x7c9e('0x55')]=function(_0x5d5d1f,_0x264c93,_0x28655d){return db[_0x7c9e('0x56')][_0x7c9e('0x49')]({'where':{'id':_0x5d5d1f[_0x7c9e('0x45')]['id']}})[_0x7c9e('0x28')](handleEntityNotFound(_0x264c93,null))['then'](function(_0x430a69){if(_0x430a69){return _0x430a69[_0x7c9e('0x55')](_0x5d5d1f['body'][_0x7c9e('0x57')],_[_0x7c9e('0x58')](_0x5d5d1f[_0x7c9e('0x4b')],[_0x7c9e('0x57'),'id'])||{});}})[_0x7c9e('0x28')](respondWithResult(_0x264c93,null))['catch'](handleError(_0x264c93,null));};exports[_0x7c9e('0x59')]=function(_0x4d4a71,_0x35c892,_0x543840){var _0x87ade={};var _0x5f268b={};var _0x4b7f38;var _0x218cae;return db[_0x7c9e('0x31')][_0x7c9e('0x5a')]({'where':{'id':_0x4d4a71[_0x7c9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x35c892,null))[_0x7c9e('0x28')](function(_0x96b627){if(_0x96b627){_0x4b7f38=_0x96b627;_0x5f268b['model']=_[_0x7c9e('0x32')](db[_0x7c9e('0x56')][_0x7c9e('0x46')]);_0x5f268b[_0x7c9e('0x33')]=_[_0x7c9e('0x32')](_0x4d4a71[_0x7c9e('0x33')]);_0x5f268b['filters']=_[_0x7c9e('0x36')](_0x5f268b[_0x7c9e('0x35')],_0x5f268b[_0x7c9e('0x33')]);_0x87ade[_0x7c9e('0x38')]=_[_0x7c9e('0x36')](_0x5f268b['model'],qs[_0x7c9e('0x37')](_0x4d4a71['query'][_0x7c9e('0x37')]));_0x87ade[_0x7c9e('0x38')]=_0x87ade['attributes'][_0x7c9e('0x47')]?_0x87ade[_0x7c9e('0x38')]:_0x5f268b[_0x7c9e('0x35')];_0x87ade[_0x7c9e('0x5b')]=qs[_0x7c9e('0x3b')](_0x4d4a71[_0x7c9e('0x33')][_0x7c9e('0x3b')]);_0x87ade[_0x7c9e('0x3c')]=qs[_0x7c9e('0x34')](_[_0x7c9e('0x3d')](_0x4d4a71['query'],_0x5f268b['filters']));if(_0x4d4a71['query']['filter']){_0x87ade[_0x7c9e('0x3c')]=_[_0x7c9e('0x3f')](_0x87ade[_0x7c9e('0x3c')],{'$or':_[_0x7c9e('0x5c')](_0x87ade[_0x7c9e('0x38')],function(_0x1383e9){var _0x54cf41={};_0x54cf41[_0x1383e9]={'$like':'%'+_0x4d4a71['query'][_0x7c9e('0x3e')]+'%'};return _0x54cf41;})});}_0x87ade=_['merge']({},_0x87ade,_0x4d4a71[_0x7c9e('0x40')]);return _0x4b7f38['getContacts'](_0x87ade);}})[_0x7c9e('0x28')](function(_0x38d023){if(_0x38d023){_0x218cae=_0x38d023[_0x7c9e('0x47')];if(!_0x4d4a71[_0x7c9e('0x33')][_0x7c9e('0x39')](_0x7c9e('0x3a'))){_0x87ade[_0x7c9e('0x1f')]=qs['limit'](_0x4d4a71[_0x7c9e('0x33')]['limit']);_0x87ade[_0x7c9e('0x21')]=qs[_0x7c9e('0x21')](_0x4d4a71[_0x7c9e('0x33')][_0x7c9e('0x21')]);}return _0x4b7f38[_0x7c9e('0x59')](_0x87ade);}})[_0x7c9e('0x28')](function(_0x5be71e){if(_0x5be71e){return _0x5be71e?{'count':_0x218cae,'rows':_0x5be71e}:null;}})[_0x7c9e('0x28')](respondWithResult(_0x35c892,null))['catch'](handleError(_0x35c892,null));};
\ No newline at end of file
+var _0x153b=['lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','Companies','UserProfileResource','sendStatus','error','stack','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rawAttributes','length','catch','create','body','user','role','get','UserProfileSection','find','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','sort','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x117512,_0x2163f5){var _0xe34741=function(_0x372088){while(--_0x372088){_0x117512['push'](_0x117512['shift']());}};_0xe34741(++_0x2163f5);}(_0x153b,0x9d));var _0xb153=function(_0x10bd48,_0xffde46){_0x10bd48=_0x10bd48-0x0;var _0x581623=_0x153b[_0x10bd48];return _0x581623;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb153('0x0'));var zipdir=require(_0xb153('0x1'));var jsonpatch=require(_0xb153('0x2'));var rp=require(_0xb153('0x3'));var moment=require(_0xb153('0x4'));var BPromise=require(_0xb153('0x5'));var Mustache=require(_0xb153('0x6'));var util=require(_0xb153('0x7'));var path=require('path');var sox=require(_0xb153('0x8'));var csv=require(_0xb153('0x9'));var ejs=require(_0xb153('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb153('0xb'));var squel=require('squel');var crypto=require(_0xb153('0xc'));var jsforce=require(_0xb153('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb153('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb153('0xe'));var authService=require(_0xb153('0xf'));var qs=require(_0xb153('0x10'));var as=require(_0xb153('0x11'));var hardwareService=require(_0xb153('0x12'));var logger=require(_0xb153('0x13'))(_0xb153('0x14'));var utils=require(_0xb153('0x15'));var config=require(_0xb153('0x16'));var licenseUtil=require(_0xb153('0x17'));var db=require(_0xb153('0x18'))['db'];function respondWithStatusCode(_0xbaa57,_0x1fcbda){_0x1fcbda=_0x1fcbda||0xcc;return function(_0x5a28e4){if(_0x5a28e4){return _0xbaa57['sendStatus'](_0x1fcbda);}return _0xbaa57[_0xb153('0x19')](_0x1fcbda)[_0xb153('0x1a')]();};}function respondWithResult(_0x427728,_0x4a2d5e){_0x4a2d5e=_0x4a2d5e||0xc8;return function(_0x1b38b7){if(_0x1b38b7){return _0x427728[_0xb153('0x19')](_0x4a2d5e)['json'](_0x1b38b7);}};}function respondWithFilteredResult(_0x3ae77b,_0x3cd2e0){return function(_0xee1bc7){if(_0xee1bc7){var _0x536a28=typeof _0x3cd2e0[_0xb153('0x1b')]===_0xb153('0x1c')&&typeof _0x3cd2e0[_0xb153('0x1d')]===_0xb153('0x1c');var _0x227c07=_0xee1bc7['count'];var _0x4edc45=_0x536a28?0x0:_0x3cd2e0[_0xb153('0x1b')];var _0xebd725=_0x536a28?_0xee1bc7[_0xb153('0x1e')]:_0x3cd2e0[_0xb153('0x1b')]+_0x3cd2e0[_0xb153('0x1d')];var _0x3922c9;if(_0xebd725>=_0x227c07){_0xebd725=_0x227c07;_0x3922c9=0xc8;}else{_0x3922c9=0xce;}_0x3ae77b[_0xb153('0x19')](_0x3922c9);return _0x3ae77b[_0xb153('0x1f')](_0xb153('0x20'),_0x4edc45+'-'+_0xebd725+'/'+_0x227c07)['json'](_0xee1bc7);}return null;};}function patchUpdates(_0x265838){return function(_0x2affc9){try{jsonpatch['apply'](_0x2affc9,_0x265838,!![]);}catch(_0x2867eb){return BPromise[_0xb153('0x21')](_0x2867eb);}return _0x2affc9[_0xb153('0x22')]();};}function saveUpdates(_0x4b7d77,_0xeaab15){return function(_0x31dd89){if(_0x31dd89){return _0x31dd89[_0xb153('0x23')](_0x4b7d77)[_0xb153('0x24')](function(_0x4ce9b9){return _0x4ce9b9;});}return null;};}function removeEntity(_0x335b9e,_0x241b96){return function(_0x2c68d5){if(_0x2c68d5){return _0x2c68d5[_0xb153('0x25')]()['then'](function(){var _0x4a3606=_0x2c68d5['get']({'plain':!![]});var _0x2aef3f=_0xb153('0x26');return db[_0xb153('0x27')]['destroy']({'where':{'type':_0x2aef3f,'resourceId':_0x4a3606['id']}})[_0xb153('0x24')](function(){return _0x2c68d5;});})[_0xb153('0x24')](function(){_0x335b9e[_0xb153('0x19')](0xcc)[_0xb153('0x1a')]();});}};}function handleEntityNotFound(_0x4afd1d,_0x1db497){return function(_0x1007ff){if(!_0x1007ff){_0x4afd1d[_0xb153('0x28')](0x194);}return _0x1007ff;};}function handleError(_0x5ac008,_0x247d13){_0x247d13=_0x247d13||0x1f4;return function(_0x2950e2){logger[_0xb153('0x29')](_0x2950e2[_0xb153('0x2a')]);if(_0x2950e2['name']){delete _0x2950e2['name'];}_0x5ac008[_0xb153('0x19')](_0x247d13)[_0xb153('0x2b')](_0x2950e2);};}exports[_0xb153('0x2c')]=function(_0x13f7cc,_0x5a0b14){var _0x3f796d={},_0x20694e={},_0x1059ef={'count':0x0,'rows':[]};return db[_0xb153('0x2d')][_0xb153('0x2e')]()[_0xb153('0x24')](function(_0x5558aa){_0x20694e[_0xb153('0x2f')]=_['keys'](_0x5558aa);_0x20694e[_0xb153('0x30')]=_[_0xb153('0x31')](_0x13f7cc['query']);_0x20694e[_0xb153('0x32')]=_[_0xb153('0x33')](_0x20694e[_0xb153('0x2f')],_0x20694e[_0xb153('0x30')]);_0x3f796d[_0xb153('0x34')]=_[_0xb153('0x33')](_0x20694e[_0xb153('0x2f')],qs[_0xb153('0x35')](_0x13f7cc['query'][_0xb153('0x35')]));_0x3f796d[_0xb153('0x34')]=_0x3f796d['attributes']['length']?_0x3f796d[_0xb153('0x34')]:_0x20694e[_0xb153('0x2f')];if(!_0x13f7cc[_0xb153('0x30')][_0xb153('0x36')](_0xb153('0x37'))){_0x3f796d[_0xb153('0x1d')]=qs[_0xb153('0x1d')](_0x13f7cc['query'][_0xb153('0x1d')]);_0x3f796d['offset']=qs['offset'](_0x13f7cc['query'][_0xb153('0x1b')]);}_0x3f796d['order']=qs['sort'](_0x13f7cc[_0xb153('0x30')]['sort']);_0x3f796d[_0xb153('0x38')]=qs[_0xb153('0x32')](_[_0xb153('0x39')](_0x13f7cc[_0xb153('0x30')],_0x20694e[_0xb153('0x32')]),_0x5558aa);if(_0x13f7cc[_0xb153('0x30')][_0xb153('0x3a')]){_0x3f796d[_0xb153('0x38')]=_[_0xb153('0x3b')](_0x3f796d[_0xb153('0x38')],{'$or':_['map'](_0x3f796d[_0xb153('0x34')],function(_0x5ee63f){var _0x511454={};_0x511454[_0x5ee63f]={'$like':'%'+_0x13f7cc['query'][_0xb153('0x3a')]+'%'};return _0x511454;})});}_0x3f796d=_['merge']({},_0x3f796d,_0x13f7cc[_0xb153('0x3c')]);var _0x3a69b5={'where':_0x3f796d[_0xb153('0x38')]};return db[_0xb153('0x2d')][_0xb153('0x1e')](_0x3a69b5)['then'](function(_0x288229){_0x1059ef[_0xb153('0x1e')]=_0x288229;if(_0x13f7cc[_0xb153('0x30')][_0xb153('0x3d')]){_0x3f796d[_0xb153('0x3e')]=[{'all':!![]}];}return db[_0xb153('0x2d')][_0xb153('0x3f')](_0x3f796d);})[_0xb153('0x24')](function(_0x2c1bec){_0x1059ef['rows']=_0x2c1bec;return _0x1059ef;})[_0xb153('0x24')](respondWithFilteredResult(_0x5a0b14,_0x3f796d))['catch'](handleError(_0x5a0b14,null));})['catch'](handleError(_0x5a0b14,null));};exports['show']=function(_0x50dfa1,_0x5223da){var _0x3086f2={'raw':![],'where':{'id':_0x50dfa1['params']['id']}},_0x328379={};_0x328379[_0xb153('0x2f')]=_[_0xb153('0x31')](db[_0xb153('0x2d')][_0xb153('0x40')]);_0x328379[_0xb153('0x30')]=_[_0xb153('0x31')](_0x50dfa1[_0xb153('0x30')]);_0x328379[_0xb153('0x32')]=_[_0xb153('0x33')](_0x328379['model'],_0x328379[_0xb153('0x30')]);_0x3086f2[_0xb153('0x34')]=_[_0xb153('0x33')](_0x328379[_0xb153('0x2f')],qs['fields'](_0x50dfa1[_0xb153('0x30')][_0xb153('0x35')]));_0x3086f2[_0xb153('0x34')]=_0x3086f2[_0xb153('0x34')][_0xb153('0x41')]?_0x3086f2['attributes']:_0x328379[_0xb153('0x2f')];if(_0x50dfa1[_0xb153('0x30')]['includeAll']){_0x3086f2[_0xb153('0x3e')]=[{'all':!![]}];}_0x3086f2=_['merge']({},_0x3086f2,_0x50dfa1['options']);return db[_0xb153('0x2d')]['find'](_0x3086f2)[_0xb153('0x24')](handleEntityNotFound(_0x5223da,null))[_0xb153('0x24')](respondWithResult(_0x5223da,null))[_0xb153('0x42')](handleError(_0x5223da,null));};exports[_0xb153('0x43')]=function(_0x3a5234,_0x75a395){return db[_0xb153('0x2d')][_0xb153('0x43')](_0x3a5234[_0xb153('0x44')],{})['then'](function(_0x326865){var _0x7dbe0=_0x3a5234[_0xb153('0x45')]['get']({'plain':!![]});if(!_0x7dbe0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7dbe0[_0xb153('0x46')]===_0xb153('0x45')){var _0x2aff6c=_0x326865[_0xb153('0x47')]({'plain':!![]});var _0x9b7e80=_0xb153('0x26');return db[_0xb153('0x48')][_0xb153('0x49')]({'where':{'name':_0x9b7e80,'userProfileId':_0x7dbe0[_0xb153('0x4a')]},'raw':!![]})['then'](function(_0x5827cb){if(_0x5827cb&&_0x5827cb['autoAssociation']===0x0){return db[_0xb153('0x27')][_0xb153('0x43')]({'name':_0x2aff6c[_0xb153('0x4b')],'resourceId':_0x2aff6c['id'],'type':_0x5827cb[_0xb153('0x4b')],'sectionId':_0x5827cb['id']},{})[_0xb153('0x24')](function(){return _0x326865;});}else{return _0x326865;}})['catch'](function(_0xb02fac){logger[_0xb153('0x29')](_0xb153('0x4c'),_0xb02fac);throw _0xb02fac;});}return _0x326865;})[_0xb153('0x24')](respondWithResult(_0x75a395,0xc9))[_0xb153('0x42')](handleError(_0x75a395,null));};exports[_0xb153('0x23')]=function(_0x4a81cd,_0x38aa92){if(_0x4a81cd[_0xb153('0x44')]['id']){delete _0x4a81cd['body']['id'];}return db[_0xb153('0x2d')][_0xb153('0x49')]({'where':{'id':_0x4a81cd[_0xb153('0x4d')]['id']}})['then'](handleEntityNotFound(_0x38aa92,null))[_0xb153('0x24')](saveUpdates(_0x4a81cd[_0xb153('0x44')],null))[_0xb153('0x24')](respondWithResult(_0x38aa92,null))['catch'](handleError(_0x38aa92,null));};exports[_0xb153('0x25')]=function(_0x2e89b0,_0x5034f8){return db['CmCompany']['find']({'where':{'id':_0x2e89b0[_0xb153('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5034f8,null))[_0xb153('0x24')](removeEntity(_0x5034f8,null))['catch'](handleError(_0x5034f8,null));};exports['describe']=function(_0x5676da,_0x25fef5){return db['CmCompany'][_0xb153('0x2e')]()['then'](respondWithResult(_0x25fef5,null))[_0xb153('0x42')](handleError(_0x25fef5,null));};exports[_0xb153('0x4e')]=function(_0x413719,_0xe2e159,_0x204942){return db[_0xb153('0x4f')][_0xb153('0x49')]({'where':{'id':_0x413719['params']['id']}})[_0xb153('0x24')](handleEntityNotFound(_0xe2e159,null))[_0xb153('0x24')](function(_0xc391d7){if(_0xc391d7){return _0xc391d7[_0xb153('0x4e')](_0x413719['body'][_0xb153('0x50')],_[_0xb153('0x51')](_0x413719[_0xb153('0x44')],[_0xb153('0x50'),'id'])||{});}})['then'](respondWithResult(_0xe2e159,null))[_0xb153('0x42')](handleError(_0xe2e159,null));};exports[_0xb153('0x52')]=function(_0x4b55df,_0xe239b0,_0x2b5b2d){var _0x4a568e={};var _0x4d1423={};var _0xbba249;var _0x37e398;return db[_0xb153('0x2d')]['findOne']({'where':{'id':_0x4b55df[_0xb153('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe239b0,null))[_0xb153('0x24')](function(_0x16e469){if(_0x16e469){_0xbba249=_0x16e469;_0x4d1423[_0xb153('0x2f')]=_[_0xb153('0x31')](db[_0xb153('0x4f')][_0xb153('0x40')]);_0x4d1423[_0xb153('0x30')]=_[_0xb153('0x31')](_0x4b55df[_0xb153('0x30')]);_0x4d1423[_0xb153('0x32')]=_['intersection'](_0x4d1423['model'],_0x4d1423[_0xb153('0x30')]);_0x4a568e['attributes']=_[_0xb153('0x33')](_0x4d1423[_0xb153('0x2f')],qs['fields'](_0x4b55df['query'][_0xb153('0x35')]));_0x4a568e[_0xb153('0x34')]=_0x4a568e[_0xb153('0x34')][_0xb153('0x41')]?_0x4a568e[_0xb153('0x34')]:_0x4d1423[_0xb153('0x2f')];_0x4a568e['order']=qs[_0xb153('0x53')](_0x4b55df[_0xb153('0x30')][_0xb153('0x53')]);_0x4a568e[_0xb153('0x38')]=qs[_0xb153('0x32')](_[_0xb153('0x39')](_0x4b55df[_0xb153('0x30')],_0x4d1423[_0xb153('0x32')]));if(_0x4b55df['query'][_0xb153('0x3a')]){_0x4a568e[_0xb153('0x38')]=_[_0xb153('0x3b')](_0x4a568e[_0xb153('0x38')],{'$or':_['map'](_0x4a568e[_0xb153('0x34')],function(_0x2f8b1b){var _0x1de5d2={};_0x1de5d2[_0x2f8b1b]={'$like':'%'+_0x4b55df['query']['filter']+'%'};return _0x1de5d2;})});}_0x4a568e=_[_0xb153('0x3b')]({},_0x4a568e,_0x4b55df[_0xb153('0x3c')]);return _0xbba249[_0xb153('0x52')](_0x4a568e);}})['then'](function(_0x3ada94){if(_0x3ada94){_0x37e398=_0x3ada94[_0xb153('0x41')];if(!_0x4b55df['query']['hasOwnProperty'](_0xb153('0x37'))){_0x4a568e['limit']=qs[_0xb153('0x1d')](_0x4b55df[_0xb153('0x30')]['limit']);_0x4a568e[_0xb153('0x1b')]=qs[_0xb153('0x1b')](_0x4b55df['query']['offset']);}return _0xbba249[_0xb153('0x52')](_0x4a568e);}})[_0xb153('0x24')](function(_0xc76242){if(_0xc76242){return _0xc76242?{'count':_0x37e398,'rows':_0xc76242}:null;}})[_0xb153('0x24')](respondWithResult(_0xe239b0,null))[_0xb153('0x42')](handleError(_0xe239b0,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index f110f20..424a20e 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 _0x2fc0=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','../../config/logger','api','moment','bluebird'];(function(_0x3a465a,_0x3e8001){var _0x1ed244=function(_0x1349e9){while(--_0x1349e9){_0x3a465a['push'](_0x3a465a['shift']());}};_0x1ed244(++_0x3e8001);}(_0x2fc0,0x188));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x02fc('0x0'))(_0x02fc('0x1'));var moment=require(_0x02fc('0x2'));var BPromise=require(_0x02fc('0x3'));var rp=require(_0x02fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02fc('0x5'));var config=require(_0x02fc('0x6'));var attributes=require(_0x02fc('0x7'));module['exports']=function(_0x53c27e,_0x504a95){return _0x53c27e[_0x02fc('0x8')](_0x02fc('0x9'),attributes,{'tableName':_0x02fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x09de=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x09de,0x89));var _0xe09d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x09de[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xe09d('0x0'));var util=require(_0xe09d('0x1'));var logger=require(_0xe09d('0x2'))(_0xe09d('0x3'));var moment=require(_0xe09d('0x4'));var BPromise=require(_0xe09d('0x5'));var rp=require(_0xe09d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe09d('0x7'));var config=require(_0xe09d('0x8'));var attributes=require(_0xe09d('0x9'));module[_0xe09d('0xa')]=function(_0x1b24e6,_0xbbba79){return _0x1b24e6['define'](_0xe09d('0xb'),attributes,{'tableName':_0xe09d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index bdff505..856e9c6 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 _0xfa3b=['../../config/environment','jayson/promise','client','request','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5cd253,_0x4162da){var _0x36e179=function(_0x597977){while(--_0x597977){_0x5cd253['push'](_0x5cd253['shift']());}};_0x36e179(++_0x4162da);}(_0xfa3b,0x1c5));var _0xbfa3=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0xfa3b[_0x474035];return _0x1b58e0;};'use strict';var _=require(_0xbfa3('0x0'));var util=require(_0xbfa3('0x1'));var moment=require(_0xbfa3('0x2'));var BPromise=require(_0xbfa3('0x3'));var rs=require(_0xbfa3('0x4'));var fs=require('fs');var Redis=require(_0xbfa3('0x5'));var db=require(_0xbfa3('0x6'))['db'];var utils=require(_0xbfa3('0x7'));var logger=require(_0xbfa3('0x8'))('rpc');var config=require(_0xbfa3('0x9'));var jayson=require(_0xbfa3('0xa'));var client=jayson[_0xbfa3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x262cf0,_0xe8c5b4,_0x3a32b4){return new BPromise(function(_0x53a7d9,_0x21a4c3){return client[_0xbfa3('0xc')](_0x262cf0,_0x3a32b4)['then'](function(_0x206b9d){logger['info'](_0xbfa3('0xd'),_0xe8c5b4,_0xbfa3('0xe'));logger['debug'](_0xbfa3('0xf'),_0xe8c5b4,_0xbfa3('0xe'),JSON[_0xbfa3('0x10')](_0x206b9d));if(_0x206b9d[_0xbfa3('0x11')]){if(_0x206b9d[_0xbfa3('0x11')][_0xbfa3('0x12')]===0x1f4){logger[_0xbfa3('0x11')]('CmCompany,\x20%s,\x20%s',_0xe8c5b4,_0x206b9d[_0xbfa3('0x11')][_0xbfa3('0x13')]);return _0x21a4c3(_0x206b9d[_0xbfa3('0x11')][_0xbfa3('0x13')]);}logger[_0xbfa3('0x11')](_0xbfa3('0xd'),_0xe8c5b4,_0x206b9d[_0xbfa3('0x11')]['message']);return _0x53a7d9(_0x206b9d[_0xbfa3('0x11')][_0xbfa3('0x13')]);}else{logger[_0xbfa3('0x14')]('CmCompany,\x20%s,\x20%s',_0xe8c5b4,_0xbfa3('0xe'));_0x53a7d9(_0x206b9d[_0xbfa3('0x15')][_0xbfa3('0x13')]);}})['catch'](function(_0x2cd260){logger[_0xbfa3('0x11')](_0xbfa3('0xd'),_0xe8c5b4,_0x2cd260);_0x21a4c3(_0x2cd260);});});}
\ No newline at end of file
+var _0x6957=['jayson/promise','client','info','request\x20sent','debug','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x157a8a,_0x34d072){var _0x5bf33f=function(_0x4fc182){while(--_0x4fc182){_0x157a8a['push'](_0x157a8a['shift']());}};_0x5bf33f(++_0x34d072);}(_0x6957,0xf3));var _0x7695=function(_0x23d081,_0x4b90c6){_0x23d081=_0x23d081-0x0;var _0xcc6bd3=_0x6957[_0x23d081];return _0xcc6bd3;};'use strict';var _=require(_0x7695('0x0'));var util=require(_0x7695('0x1'));var moment=require(_0x7695('0x2'));var BPromise=require(_0x7695('0x3'));var rs=require(_0x7695('0x4'));var fs=require('fs');var Redis=require(_0x7695('0x5'));var db=require(_0x7695('0x6'))['db'];var utils=require(_0x7695('0x7'));var logger=require('../../config/logger')(_0x7695('0x8'));var config=require('../../config/environment');var jayson=require(_0x7695('0x9'));var client=jayson[_0x7695('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dfa3f,_0x58ffb9,_0x365ba7){return new BPromise(function(_0x3d4a4a,_0xa71da6){return client['request'](_0x1dfa3f,_0x365ba7)['then'](function(_0x55e575){logger[_0x7695('0xb')]('CmCompany,\x20%s,\x20%s',_0x58ffb9,_0x7695('0xc'));logger[_0x7695('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x58ffb9,_0x7695('0xc'),JSON[_0x7695('0xe')](_0x55e575));if(_0x55e575[_0x7695('0xf')]){if(_0x55e575[_0x7695('0xf')][_0x7695('0x10')]===0x1f4){logger[_0x7695('0xf')]('CmCompany,\x20%s,\x20%s',_0x58ffb9,_0x55e575[_0x7695('0xf')][_0x7695('0x11')]);return _0xa71da6(_0x55e575[_0x7695('0xf')][_0x7695('0x11')]);}logger['error'](_0x7695('0x12'),_0x58ffb9,_0x55e575['error'][_0x7695('0x11')]);return _0x3d4a4a(_0x55e575[_0x7695('0xf')]['message']);}else{logger[_0x7695('0xb')]('CmCompany,\x20%s,\x20%s',_0x58ffb9,_0x7695('0xc'));_0x3d4a4a(_0x55e575[_0x7695('0x13')][_0x7695('0x11')]);}})[_0x7695('0x14')](function(_0x55c3dc){logger['error'](_0x7695('0x12'),_0x58ffb9,_0x55c3dc);_0xa71da6(_0x55c3dc);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 513f07c..5ff23ea 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 _0xf820=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','show','/:id/contacts','getContacts','create','post','addContacts','/:id','delete','destroy','multer','util','path','express'];(function(_0x37d77c,_0x4317e0){var _0x50c8f1=function(_0x20644b){while(--_0x20644b){_0x37d77c['push'](_0x37d77c['shift']());}};_0x50c8f1(++_0x4317e0);}(_0xf820,0x86));var _0x0f82=function(_0x33668d,_0x364922){_0x33668d=_0x33668d-0x0;var _0x1346e2=_0xf820[_0x33668d];return _0x1346e2;};'use strict';var multer=require(_0x0f82('0x0'));var util=require(_0x0f82('0x1'));var path=require(_0x0f82('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f82('0x3'));var router=express[_0x0f82('0x4')]();var fs_extra=require(_0x0f82('0x5'));var auth=require(_0x0f82('0x6'));var interaction=require(_0x0f82('0x7'));var config=require(_0x0f82('0x8'));var controller=require(_0x0f82('0x9'));router['get']('/',auth[_0x0f82('0xa')](),controller[_0x0f82('0xb')]);router[_0x0f82('0xc')](_0x0f82('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x0f82('0xc')]('/:id',auth[_0x0f82('0xa')](),controller[_0x0f82('0xe')]);router['get'](_0x0f82('0xf'),auth[_0x0f82('0xa')](),controller[_0x0f82('0x10')]);router['post']('/',auth[_0x0f82('0xa')](),controller[_0x0f82('0x11')]);router[_0x0f82('0x12')]('/:id/contacts',auth[_0x0f82('0xa')](),controller[_0x0f82('0x13')]);router['put'](_0x0f82('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x0f82('0x15')](_0x0f82('0x14'),auth[_0x0f82('0xa')](),controller[_0x0f82('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x8c7a=['/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8c7a,0x197));var _0xa8c7=function(_0x58946f,_0x2ef6b3){_0x58946f=_0x58946f-0x0;var _0x641917=_0x8c7a[_0x58946f];return _0x641917;};'use strict';var multer=require(_0xa8c7('0x0'));var util=require(_0xa8c7('0x1'));var path=require(_0xa8c7('0x2'));var timeout=require(_0xa8c7('0x3'));var express=require(_0xa8c7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa8c7('0x5'));var config=require(_0xa8c7('0x6'));var controller=require(_0xa8c7('0x7'));router[_0xa8c7('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8c7('0x9')]);router[_0xa8c7('0x8')](_0xa8c7('0xa'),auth[_0xa8c7('0xb')](),controller[_0xa8c7('0xc')]);router['get'](_0xa8c7('0xd'),auth[_0xa8c7('0xb')](),controller[_0xa8c7('0xe')]);router[_0xa8c7('0x8')](_0xa8c7('0xf'),auth[_0xa8c7('0xb')](),controller[_0xa8c7('0x10')]);router[_0xa8c7('0x11')]('/',auth[_0xa8c7('0xb')](),controller[_0xa8c7('0x12')]);router[_0xa8c7('0x11')](_0xa8c7('0xf'),auth['isAuthenticated'](),controller[_0xa8c7('0x13')]);router['put'](_0xa8c7('0xd'),auth['isAuthenticated'](),controller[_0xa8c7('0x14')]);router['delete'](_0xa8c7('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index dde9600..95d7c8c 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 _0x2032=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x2032,0xd9));var _0x2203=function(_0x49c099,_0x3e6dde){_0x49c099=_0x49c099-0x0;var _0x5ab6cb=_0x2032[_0x49c099];return _0x5ab6cb;};'use strict';var _=require('lodash');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'firstName':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2203('0x2')]},'postalCode':{'type':Sequelize[_0x2203('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2203('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2203('0x2')]},'description':{'type':Sequelize[_0x2203('0x3')]},'phone':{'type':Sequelize[_0x2203('0x2')]},'mobile':{'type':Sequelize[_0x2203('0x2')]},'fax':{'type':Sequelize[_0x2203('0x2')]},'email':{'type':Sequelize[_0x2203('0x2')]},'url':{'type':Sequelize[_0x2203('0x2')]},'facebook':{'type':Sequelize[_0x2203('0x2')]},'fb_data':{'type':Sequelize[_0x2203('0x2')]},'twitter':{'type':Sequelize[_0x2203('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2203('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x2203('0x2')]},'telegram':{'type':Sequelize[_0x2203('0x2')]},'UserId':{'type':Sequelize[_0x2203('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2203('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2203('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2203('0x4')]}};
\ No newline at end of file
+var _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x2083a4,_0x2abcc4){var _0x46380c=function(_0x1cfd4d){while(--_0x1cfd4d){_0x2083a4['push'](_0x2083a4['shift']());}};_0x46380c(++_0x2abcc4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index b3fdf49..28139ae 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 _0x3da3=['cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','DATE','buildExpression','text','filter','isNil','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','user','role','some','User','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','agent','toString','sequelize','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','findAll','alias','custom','body','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','timezones','utcOffset','duplicates','findOrCreate','spread','show','get','$and','omit','format','cf_%d','pickBy','setFields','id\x20=\x20?','phone','getTags','options','nolimit','setTags','getHoppers','pick','ContactId','includeAll','include','getHopperHistories','rawAttributes','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','No\x20ListId\x20specified','binding','No\x20phone\x20column\x20specified','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','closed','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','customerPort','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','flatten','sortBy','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','defaults','./cmContact.socket','register','status','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','index','CmContact','describe','keys','startsWith','push','CmCustomField','findOne','trimStart','cf_','all','length','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','from','tools_tags','select'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x3da3,0xe2));var _0x33da=function(_0x572bd8,_0x232739){_0x572bd8=_0x572bd8-0x0;var _0x4c2aca=_0x3da3[_0x572bd8];return _0x4c2aca;};'use strict';var moment=require(_0x33da('0x0'));var BPromise=require(_0x33da('0x1'));var util=require(_0x33da('0x2'));var path=require(_0x33da('0x3'));var fs=require('fs');var _=require(_0x33da('0x4'));var squel=require(_0x33da('0x5'));var Papa=require(_0x33da('0x6'));var Redis=require(_0x33da('0x7'));var qs=require(_0x33da('0x8'));var as=require(_0x33da('0x9'));var logger=require(_0x33da('0xa'))(_0x33da('0xb'));var config=require('../../config/environment');var shared=require(_0x33da('0xc'));var db=require(_0x33da('0xd'))['db'];config[_0x33da('0xe')]=_[_0x33da('0xf')](config[_0x33da('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33da('0xe')]));require(_0x33da('0x10'))[_0x33da('0x11')](socket);function respondWithResult(_0x2ec2c7,_0x3e0f6d){_0x3e0f6d=_0x3e0f6d||0xc8;return function(_0x15f9dd){if(_0x15f9dd){return _0x2ec2c7[_0x33da('0x12')](_0x3e0f6d)[_0x33da('0x13')](_0x15f9dd);}};}function respondWithFilteredResult(_0xeddf17,_0x4ff5dd){return function(_0x165687){if(_0x165687){var _0x4a0d9d=typeof _0x4ff5dd['offset']===_0x33da('0x14')&&typeof _0x4ff5dd[_0x33da('0x15')]===_0x33da('0x14');var _0x19741d=_0x165687['count'];var _0x24b722=_0x4a0d9d?0x0:_0x4ff5dd[_0x33da('0x16')];var _0x2e405d=_0x4a0d9d?_0x165687[_0x33da('0x17')]:_0x4ff5dd[_0x33da('0x16')]+_0x4ff5dd[_0x33da('0x15')];var _0xa4a093;if(_0x2e405d>=_0x19741d){_0x2e405d=_0x19741d;_0xa4a093=0xc8;}else{_0xa4a093=0xce;}_0xeddf17[_0x33da('0x12')](_0xa4a093);return _0xeddf17[_0x33da('0x18')](_0x33da('0x19'),_0x24b722+'-'+_0x2e405d+'/'+_0x19741d)[_0x33da('0x13')](_0x165687);}return null;};}function saveUpdates(_0x1eb739){return function(_0x168d01){if(_0x168d01){return _0x168d01[_0x33da('0x1a')](_0x1eb739)[_0x33da('0x1b')](function(_0x29131b){return _0x29131b;});}return null;};}function removeEntity(_0x20dec6){return function(_0x3e4609){if(_0x3e4609){return _0x3e4609[_0x33da('0x1c')]()[_0x33da('0x1b')](function(){_0x20dec6['status'](0xcc)[_0x33da('0x1d')]();});}};}function handleEntityNotFound(_0x2dc585){return function(_0x41350c){if(!_0x41350c){_0x2dc585[_0x33da('0x1e')](0x194);}return _0x41350c;};}function handleError(_0xf4add0,_0x525335){_0x525335=_0x525335||0x1f4;return function(_0x1aa252){logger['error'](_0x1aa252[_0x33da('0x1f')]);if(_0x1aa252[_0x33da('0x20')]){delete _0x1aa252['name'];}_0xf4add0['status'](_0x525335)[_0x33da('0x21')](_0x1aa252);};}exports[_0x33da('0x22')]=function(_0x1786c2,_0x5682a7){var _0x5a94d2={},_0x35b15a={},_0x340a46={'count':0x0,'rows':[]};return db[_0x33da('0x23')][_0x33da('0x24')]()[_0x33da('0x1b')](function(_0x1b53f8){var _0x42ac02=[];for(var _0x4a483f=0x0;_0x4a483f
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20'];(function(_0x40fc07,_0x2627f4){var _0x30bded=function(_0x5b87fa){while(--_0x5b87fa){_0x40fc07['push'](_0x40fc07['shift']());}};_0x30bded(++_0x2627f4);}(_0xfadf,0x9c));var _0xffad=function(_0x189198,_0x26d47a){_0x189198=_0x189198-0x0;var _0x1e681d=_0xfadf[_0x189198];return _0x1e681d;};'use strict';var _=require(_0xffad('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xffad('0x1'));var util=require(_0xffad('0x2'));var tnef=require(_0xffad('0x3'));var logger=require(_0xffad('0x4'))(_0xffad('0x5'));var config=require('../../../config/environment');function getAddress(_0x5bc50f){var _0x57ffba=_[_0xffad('0x6')](_0x5bc50f['value']);return _0x57ffba&&_0x57ffba[_0xffad('0x7')]?_0x57ffba[_0xffad('0x7')]:_0xffad('0x8')+random[_0xffad('0x9')](0x6)+_0xffad('0xa');}function getFirstName(_0x3534fe){var _0x35219c=_['head'](_0x3534fe[_0xffad('0xb')]);if(_0x35219c&&_0x35219c['name']){if(_0x35219c['name']==_0x35219c['address']){return _0x35219c[_0xffad('0xc')]['substring'](0x0,_0x35219c['name']['indexOf']('@'));}var _0x2ab984=_0x35219c['name'][_0xffad('0xd')](/\s+/);return _0x2ab984[_0xffad('0xe')]>0x1?_0x2ab984[_0xffad('0xf')](0x0,-0x1)[_0xffad('0x10')]('\x20'):_0x35219c[_0xffad('0xc')];}return _0xffad('0x11');}function getLastName(_0x2b9314){var _0x486376=_['head'](_0x2b9314[_0xffad('0xb')]);if(_0x486376&&_0x486376[_0xffad('0xc')]){var _0xb675ea=_0x486376['name'][_0xffad('0xd')](/\s+/);return _0xb675ea[_0xffad('0xe')]>0x1?_0xb675ea[_0xffad('0x12')]():'';}return'';}function getMails(_0x1d5873,_0xd32f81){var _0x3ea107='';for(var _0x515805=0x0;_0x515805<_0xd32f81[_0xffad('0xb')]['length'];_0x515805+=0x1){if(_0xd32f81[_0xffad('0xb')][_0x515805]['address']!==_0x1d5873){if(!_[_0xffad('0x13')](_0x3ea107)){_0x3ea107+=',';}_0x3ea107+=_0xd32f81[_0xffad('0xb')][_0x515805][_0xffad('0xc')]||_0xd32f81[_0xffad('0xb')][_0x515805]['address']||'';_0x3ea107+='\x20<';_0x3ea107+=_0xd32f81[_0xffad('0xb')][_0x515805][_0xffad('0x7')]?_0xd32f81[_0xffad('0xb')][_0x515805][_0xffad('0x7')]:_0xffad('0x8')+random[_0xffad('0x9')](0x6)+'@xcally.com';_0x3ea107+='>';}}return _0x3ea107;}function parseEmail(_0x59d17f,_0x19b8d8,_0x403da2){if(_0x19b8d8[_0xffad('0x14')]){var _0x1241b3=/