From 3604c82676d8947abd5ee8effbb8fdf02649b0fe Mon Sep 17 00:00:00 2001
From: support
Date: Fri, 27 May 2022 06:50:16 +0000
Subject: [PATCH] Built motion from commit 39a99f00.|2.6.10
---
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 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/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 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/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 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/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/contacts/index.js | 2 +-
server/components/contacts/sql-utils.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/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.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/api.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/events.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/project.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/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.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/voiceQueueSummary.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/realtime/utils.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/cmHopperAdditionalPhone.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/interval.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/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1202 files changed, 1202 insertions(+), 1202 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index b1e2031..7860508 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-05-26T14:30:32.770Z",
+ "time": "2022-05-27T06:42:42.549Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 26b6111..ac47c8e 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-05-26T14:30:32.770Z",
+ "time": "2022-05-27T06:42:42.549Z",
"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 32b8956..4893977 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 _0x1445=['motionbar','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','VIRTUAL','action','STRING','contactManager'];(function(_0xd2218a,_0x341cc9){var _0x4fd180=function(_0x485dcd){while(--_0x485dcd){_0xd2218a['push'](_0xd2218a['shift']());}};_0x4fd180(++_0x341cc9);}(_0x1445,0x1bb));var _0x5144=function(_0x191c60,_0x5c0dd8){_0x191c60=_0x191c60-0x0;var _0x3c60e7=_0x1445[_0x191c60];return _0x3c60e7;};'use strict';var Sequelize=require(_0x5144('0x0'));module['exports']={'name':{'type':Sequelize[_0x5144('0x1')],'get':function(_0x2c71bd){return this['getDataValue'](_0x5144('0x2'));}},'action':{'type':Sequelize[_0x5144('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5144('0x4'),'integration',_0x5144('0x5'),'jscripty','urlForward',_0x5144('0x6'),_0x5144('0x7'),_0x5144('0x8')]],'msg':_0x5144('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5144('0xa')},'data2':{'type':Sequelize[_0x5144('0x3')](0x1000),'comment':_0x5144('0xb')},'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[_0x5144('0x3')](0x1000),'comments':_0x5144('0xc')},'data5':{'type':Sequelize[_0x5144('0x3')](0x1000),'comments':_0x5144('0xd')},'data6':{'type':Sequelize[_0x5144('0x3')],'comments':_0x5144('0xe')},'data7':{'type':Sequelize[_0x5144('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x16e9=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x5a74da,_0xb4b3e3){var _0x79fbc3=function(_0x238354){while(--_0x238354){_0x5a74da['push'](_0x5a74da['shift']());}};_0x79fbc3(++_0xb4b3e3);}(_0x16e9,0x144));var _0x916e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x16e9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x916e('0x0')]={'name':{'type':Sequelize[_0x916e('0x1')],'get':function(_0x46c7ba){return this[_0x916e('0x2')](_0x916e('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x916e('0x4'),_0x916e('0x5'),_0x916e('0x6'),_0x916e('0x7'),'urlForward','browser',_0x916e('0x8'),_0x916e('0x9')]],'msg':_0x916e('0xa')}},'comment':_0x916e('0xa')},'data1':{'type':Sequelize[_0x916e('0xb')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x916e('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x916e('0xb')](0x1000),'comment':_0x916e('0xc')},'data4':{'type':Sequelize[_0x916e('0xb')](0x1000),'comments':_0x916e('0xd')},'data5':{'type':Sequelize[_0x916e('0xb')](0x1000),'comments':_0x916e('0xe')},'data6':{'type':Sequelize[_0x916e('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x916e('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 661c77d..5542fab 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 _0xc047=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','body','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x5a68a8,_0x29a5b3){var _0x3625d7=function(_0x47cd74){while(--_0x47cd74){_0x5a68a8['push'](_0x5a68a8['shift']());}};_0x3625d7(++_0x29a5b3);}(_0xc047,0xe8));var _0x7c04=function(_0x3963e8,_0x479606){_0x3963e8=_0x3963e8-0x0;var _0x25bef0=_0xc047[_0x3963e8];return _0x25bef0;};'use strict';var emlformat=require(_0x7c04('0x0'));var rimraf=require(_0x7c04('0x1'));var zipdir=require(_0x7c04('0x2'));var jsonpatch=require(_0x7c04('0x3'));var rp=require(_0x7c04('0x4'));var moment=require(_0x7c04('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7c04('0x6'));var util=require(_0x7c04('0x7'));var path=require(_0x7c04('0x8'));var sox=require('sox');var csv=require(_0x7c04('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c04('0xa'));var _=require(_0x7c04('0xb'));var squel=require(_0x7c04('0xc'));var crypto=require(_0x7c04('0xd'));var jsforce=require(_0x7c04('0xe'));var deskjs=require(_0x7c04('0xf'));var toCsv=require(_0x7c04('0x9'));var querystring=require(_0x7c04('0x10'));var Papa=require(_0x7c04('0x11'));var Redis=require(_0x7c04('0x12'));var authService=require(_0x7c04('0x13'));var qs=require(_0x7c04('0x14'));var as=require(_0x7c04('0x15'));var hardwareService=require(_0x7c04('0x16'));var logger=require('../../config/logger')(_0x7c04('0x17'));var utils=require('../../config/utils');var config=require(_0x7c04('0x18'));var licenseUtil=require(_0x7c04('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17b40f,_0xd8f63f){_0xd8f63f=_0xd8f63f||0xcc;return function(_0x42b195){if(_0x42b195){return _0x17b40f[_0x7c04('0x1a')](_0xd8f63f);}return _0x17b40f[_0x7c04('0x1b')](_0xd8f63f)[_0x7c04('0x1c')]();};}function respondWithResult(_0x65a9df,_0x468ffa){_0x468ffa=_0x468ffa||0xc8;return function(_0x17f5a9){if(_0x17f5a9){return _0x65a9df[_0x7c04('0x1b')](_0x468ffa)[_0x7c04('0x1d')](_0x17f5a9);}};}function respondWithFilteredResult(_0x58a088,_0x469219){return function(_0x484c53){if(_0x484c53){var _0x161349=typeof _0x469219['offset']===_0x7c04('0x1e')&&typeof _0x469219[_0x7c04('0x1f')]===_0x7c04('0x1e');var _0x1edca1=_0x484c53[_0x7c04('0x20')];var _0x3b6ec7=_0x161349?0x0:_0x469219[_0x7c04('0x21')];var _0x4d8fa2=_0x161349?_0x484c53[_0x7c04('0x20')]:_0x469219[_0x7c04('0x21')]+_0x469219[_0x7c04('0x1f')];var _0x52d0d4;if(_0x4d8fa2>=_0x1edca1){_0x4d8fa2=_0x1edca1;_0x52d0d4=0xc8;}else{_0x52d0d4=0xce;}_0x58a088[_0x7c04('0x1b')](_0x52d0d4);return _0x58a088[_0x7c04('0x22')](_0x7c04('0x23'),_0x3b6ec7+'-'+_0x4d8fa2+'/'+_0x1edca1)[_0x7c04('0x1d')](_0x484c53);}return null;};}function patchUpdates(_0x17ceab){return function(_0x3235f9){try{jsonpatch[_0x7c04('0x24')](_0x3235f9,_0x17ceab,!![]);}catch(_0x2112c7){return BPromise['reject'](_0x2112c7);}return _0x3235f9[_0x7c04('0x25')]();};}function saveUpdates(_0x38b501,_0x10e78e){return function(_0x4f6068){if(_0x4f6068){return _0x4f6068[_0x7c04('0x26')](_0x38b501)[_0x7c04('0x27')](function(_0x29f8aa){return _0x29f8aa;});}return null;};}function removeEntity(_0x128a1a,_0x1c2d0c){return function(_0x159eeb){if(_0x159eeb){return _0x159eeb[_0x7c04('0x28')]()['then'](function(){_0x128a1a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43a6ae,_0x3cb1a2){return function(_0x1522bd){if(!_0x1522bd){_0x43a6ae['sendStatus'](0x194);}return _0x1522bd;};}function handleError(_0x9849a,_0xcd19a6){_0xcd19a6=_0xcd19a6||0x1f4;return function(_0x136430){logger[_0x7c04('0x29')](_0x136430[_0x7c04('0x2a')]);if(_0x136430[_0x7c04('0x2b')]){delete _0x136430[_0x7c04('0x2b')];}_0x9849a['status'](_0xcd19a6)[_0x7c04('0x2c')](_0x136430);};}exports[_0x7c04('0x26')]=function(_0x37bd31,_0x656054){if(_0x37bd31[_0x7c04('0x2d')]['id']){delete _0x37bd31[_0x7c04('0x2d')]['id'];}return db['Action']['find']({'where':{'id':_0x37bd31[_0x7c04('0x2e')]['id']}})[_0x7c04('0x27')](handleEntityNotFound(_0x656054,null))['then'](saveUpdates(_0x37bd31[_0x7c04('0x2d')],null))[_0x7c04('0x27')](respondWithResult(_0x656054,null))[_0x7c04('0x2f')](handleError(_0x656054,null));};exports['destroy']=function(_0x1a1498,_0x220c6f){return db['Action'][_0x7c04('0x30')]({'where':{'id':_0x1a1498['params']['id']}})[_0x7c04('0x27')](handleEntityNotFound(_0x220c6f,null))[_0x7c04('0x27')](removeEntity(_0x220c6f,null))[_0x7c04('0x2f')](handleError(_0x220c6f,null));};
\ No newline at end of file
+var _0x0d9d=['error','stack','name','send','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus'];(function(_0x53b087,_0x52fae0){var _0x1a5af1=function(_0x27dc67){while(--_0x27dc67){_0x53b087['push'](_0x53b087['shift']());}};_0x1a5af1(++_0x52fae0);}(_0x0d9d,0xde));var _0xd0d9=function(_0x587c70,_0x58dae5){_0x587c70=_0x587c70-0x0;var _0x537181=_0x0d9d[_0x587c70];return _0x537181;};'use strict';var emlformat=require(_0xd0d9('0x0'));var rimraf=require(_0xd0d9('0x1'));var zipdir=require(_0xd0d9('0x2'));var jsonpatch=require(_0xd0d9('0x3'));var rp=require('request-promise');var moment=require(_0xd0d9('0x4'));var BPromise=require(_0xd0d9('0x5'));var Mustache=require(_0xd0d9('0x6'));var util=require(_0xd0d9('0x7'));var path=require(_0xd0d9('0x8'));var sox=require(_0xd0d9('0x9'));var csv=require(_0xd0d9('0xa'));var ejs=require(_0xd0d9('0xb'));var fs=require('fs');var fs_extra=require(_0xd0d9('0xc'));var _=require('lodash');var squel=require(_0xd0d9('0xd'));var crypto=require(_0xd0d9('0xe'));var jsforce=require(_0xd0d9('0xf'));var deskjs=require(_0xd0d9('0x10'));var toCsv=require(_0xd0d9('0xa'));var querystring=require(_0xd0d9('0x11'));var Papa=require('papaparse');var Redis=require(_0xd0d9('0x12'));var authService=require(_0xd0d9('0x13'));var qs=require(_0xd0d9('0x14'));var as=require(_0xd0d9('0x15'));var hardwareService=require(_0xd0d9('0x16'));var logger=require(_0xd0d9('0x17'))(_0xd0d9('0x18'));var utils=require('../../config/utils');var config=require(_0xd0d9('0x19'));var licenseUtil=require(_0xd0d9('0x1a'));var db=require(_0xd0d9('0x1b'))['db'];function respondWithStatusCode(_0x25249c,_0x237060){_0x237060=_0x237060||0xcc;return function(_0x402196){if(_0x402196){return _0x25249c['sendStatus'](_0x237060);}return _0x25249c[_0xd0d9('0x1c')](_0x237060)[_0xd0d9('0x1d')]();};}function respondWithResult(_0x583ae4,_0xa18aa1){_0xa18aa1=_0xa18aa1||0xc8;return function(_0x317285){if(_0x317285){return _0x583ae4[_0xd0d9('0x1c')](_0xa18aa1)['json'](_0x317285);}};}function respondWithFilteredResult(_0x2d5ff0,_0x204a4b){return function(_0x22aa74){if(_0x22aa74){var _0x3fa0ef=typeof _0x204a4b[_0xd0d9('0x1e')]===_0xd0d9('0x1f')&&typeof _0x204a4b[_0xd0d9('0x20')]===_0xd0d9('0x1f');var _0x5017c5=_0x22aa74[_0xd0d9('0x21')];var _0x18390f=_0x3fa0ef?0x0:_0x204a4b[_0xd0d9('0x1e')];var _0x58f2ee=_0x3fa0ef?_0x22aa74['count']:_0x204a4b[_0xd0d9('0x1e')]+_0x204a4b[_0xd0d9('0x20')];var _0x1bc271;if(_0x58f2ee>=_0x5017c5){_0x58f2ee=_0x5017c5;_0x1bc271=0xc8;}else{_0x1bc271=0xce;}_0x2d5ff0[_0xd0d9('0x1c')](_0x1bc271);return _0x2d5ff0[_0xd0d9('0x22')](_0xd0d9('0x23'),_0x18390f+'-'+_0x58f2ee+'/'+_0x5017c5)[_0xd0d9('0x24')](_0x22aa74);}return null;};}function patchUpdates(_0x595748){return function(_0x23e478){try{jsonpatch[_0xd0d9('0x25')](_0x23e478,_0x595748,!![]);}catch(_0x5d3108){return BPromise[_0xd0d9('0x26')](_0x5d3108);}return _0x23e478[_0xd0d9('0x27')]();};}function saveUpdates(_0x2cfdf7,_0x4d387e){return function(_0x524717){if(_0x524717){return _0x524717[_0xd0d9('0x28')](_0x2cfdf7)[_0xd0d9('0x29')](function(_0x3f7150){return _0x3f7150;});}return null;};}function removeEntity(_0x1a17b9,_0x4c1406){return function(_0x108023){if(_0x108023){return _0x108023['destroy']()[_0xd0d9('0x29')](function(){_0x1a17b9[_0xd0d9('0x1c')](0xcc)[_0xd0d9('0x1d')]();});}};}function handleEntityNotFound(_0x53a3b3,_0x4fc89d){return function(_0x107ad0){if(!_0x107ad0){_0x53a3b3[_0xd0d9('0x2a')](0x194);}return _0x107ad0;};}function handleError(_0x32281d,_0x5f58c7){_0x5f58c7=_0x5f58c7||0x1f4;return function(_0x471ba2){logger[_0xd0d9('0x2b')](_0x471ba2[_0xd0d9('0x2c')]);if(_0x471ba2[_0xd0d9('0x2d')]){delete _0x471ba2[_0xd0d9('0x2d')];}_0x32281d['status'](_0x5f58c7)[_0xd0d9('0x2e')](_0x471ba2);};}exports[_0xd0d9('0x28')]=function(_0x232f74,_0x3b6f17){if(_0x232f74[_0xd0d9('0x2f')]['id']){delete _0x232f74[_0xd0d9('0x2f')]['id'];}return db[_0xd0d9('0x30')][_0xd0d9('0x31')]({'where':{'id':_0x232f74[_0xd0d9('0x32')]['id']}})[_0xd0d9('0x29')](handleEntityNotFound(_0x3b6f17,null))[_0xd0d9('0x29')](saveUpdates(_0x232f74[_0xd0d9('0x2f')],null))[_0xd0d9('0x29')](respondWithResult(_0x3b6f17,null))[_0xd0d9('0x33')](handleError(_0x3b6f17,null));};exports[_0xd0d9('0x34')]=function(_0x44aced,_0x1fa564){return db['Action']['find']({'where':{'id':_0x44aced[_0xd0d9('0x32')]['id']}})[_0xd0d9('0x29')](handleEntityNotFound(_0x1fa564,null))[_0xd0d9('0x29')](removeEntity(_0x1fa564,null))[_0xd0d9('0x33')](handleError(_0x1fa564,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 7e64651..8d05546 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 _0xd795=['define','Action','tools_actions','lodash','util','../../config/logger','moment','path','rimraf','./action.attributes','exports'];(function(_0xc44261,_0x4952ab){var _0x156617=function(_0x167409){while(--_0x167409){_0xc44261['push'](_0xc44261['shift']());}};_0x156617(++_0x4952ab);}(_0xd795,0x121));var _0x5d79=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xd795[_0x279d37];return _0x530173;};'use strict';var _=require(_0x5d79('0x0'));var util=require(_0x5d79('0x1'));var logger=require(_0x5d79('0x2'))('api');var moment=require(_0x5d79('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d79('0x4'));var rimraf=require(_0x5d79('0x5'));var config=require('../../config/environment');var attributes=require(_0x5d79('0x6'));module[_0x5d79('0x7')]=function(_0x1566a1,_0x3a3840){return _0x1566a1[_0x5d79('0x8')](_0x5d79('0x9'),attributes,{'tableName':_0x5d79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x627d=['rimraf','../../config/environment','./action.attributes','exports','define','Action','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x627d,0xc6));var _0xd627=function(_0x132148,_0x5d9902){_0x132148=_0x132148-0x0;var _0x51bba2=_0x627d[_0x132148];return _0x51bba2;};'use strict';var _=require('lodash');var util=require(_0xd627('0x0'));var logger=require(_0xd627('0x1'))('api');var moment=require(_0xd627('0x2'));var BPromise=require(_0xd627('0x3'));var rp=require(_0xd627('0x4'));var fs=require('fs');var path=require(_0xd627('0x5'));var rimraf=require(_0xd627('0x6'));var config=require(_0xd627('0x7'));var attributes=require(_0xd627('0x8'));module[_0xd627('0x9')]=function(_0x5eef1e,_0x21c890){return _0x5eef1e[_0xd627('0xa')](_0xd627('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 6ce7d74..39b7a99 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x1a0473,_0x4f9879){_0x1a0473=_0x1a0473-0x0;var _0x5e6c27=_0x4975[_0x1a0473];return _0x5e6c27;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index eaf77bf..a21fa6b 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 _0x978c=['put','/:id','isAuthenticated','update','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x978c,0xc0));var _0xc978=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x978c[_0xc67528];return _0x38e26d;};'use strict';var multer=require(_0xc978('0x0'));var util=require(_0xc978('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc978('0x2')]();var fs_extra=require(_0xc978('0x3'));var auth=require(_0xc978('0x4'));var interaction=require(_0xc978('0x5'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xc978('0x6')](_0xc978('0x7'),auth[_0xc978('0x8')](),controller[_0xc978('0x9')]);router['delete'](_0xc978('0x7'),auth['isAuthenticated'](),controller[_0xc978('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0xd61e=['../../components/interaction/service','/:id','isAuthenticated','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3ba495,_0x25bcb4){var _0x1782b4=function(_0x20ce24){while(--_0x20ce24){_0x3ba495['push'](_0x3ba495['shift']());}};_0x1782b4(++_0x25bcb4);}(_0xd61e,0xdd));var _0xed61=function(_0x59c6d2,_0x5ea390){_0x59c6d2=_0x59c6d2-0x0;var _0x39610a=_0xd61e[_0x59c6d2];return _0x39610a;};'use strict';var multer=require(_0xed61('0x0'));var util=require(_0xed61('0x1'));var path=require(_0xed61('0x2'));var timeout=require(_0xed61('0x3'));var express=require(_0xed61('0x4'));var router=express[_0xed61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed61('0x6'));var interaction=require(_0xed61('0x7'));var config=require('../../config/environment');var controller=require('./action.controller');router['put'](_0xed61('0x8'),auth[_0xed61('0x9')](),controller[_0xed61('0xa')]);router[_0xed61('0xb')](_0xed61('0x8'),auth[_0xed61('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index c06522a..1c4f57c 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0x19b971,_0x1e7f16){var _0x267132=function(_0x49ed57){while(--_0x49ed57){_0x19b971['push'](_0x19b971['shift']());}};_0x267132(++_0x1e7f16);}(_0x326f,0xd1));var _0xf326=function(_0x3959ae,_0x11616e){_0x3959ae=_0x3959ae-0x0;var _0x50dc72=_0x326f[_0x3959ae];return _0x50dc72;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
+var _0x71ab=['TEXT','exports','STRING'];(function(_0x2d6376,_0x407415){var _0x30e77d=function(_0x48a3c5){while(--_0x48a3c5){_0x2d6376['push'](_0x2d6376['shift']());}};_0x30e77d(++_0x407415);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 49ac9f4..1fa5a1f 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 _0x473b=['rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','include','findAll','params','includeAll','find','create','body','user','role','Reports','userProfileId','autoAssociation','catch','preview','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','format','groupBy','orderBy','DESC','alias','joins','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','replace','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','SELECT','run','runReport','ROUND(%s)','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','name','send','index','map','AnalyticCustomReport'];(function(_0x33cd44,_0x421c8f){var _0x478f69=function(_0x4c0d32){while(--_0x4c0d32){_0x33cd44['push'](_0x33cd44['shift']());}};_0x478f69(++_0x421c8f);}(_0x473b,0x11a));var _0xb473=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x473b[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xb473('0x0'));var rimraf=require(_0xb473('0x1'));var zipdir=require(_0xb473('0x2'));var jsonpatch=require(_0xb473('0x3'));var rp=require(_0xb473('0x4'));var moment=require(_0xb473('0x5'));var BPromise=require(_0xb473('0x6'));var Mustache=require(_0xb473('0x7'));var util=require(_0xb473('0x8'));var path=require(_0xb473('0x9'));var sox=require(_0xb473('0xa'));var csv=require(_0xb473('0xb'));var ejs=require(_0xb473('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb473('0xd'));var squel=require('squel');var crypto=require(_0xb473('0xe'));var jsforce=require(_0xb473('0xf'));var deskjs=require(_0xb473('0x10'));var toCsv=require(_0xb473('0xb'));var querystring=require(_0xb473('0x11'));var Papa=require(_0xb473('0x12'));var Redis=require(_0xb473('0x13'));var authService=require(_0xb473('0x14'));var qs=require(_0xb473('0x15'));var as=require(_0xb473('0x16'));var hardwareService=require(_0xb473('0x17'));var logger=require(_0xb473('0x18'))(_0xb473('0x19'));var utils=require(_0xb473('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xb473('0x1b'));var db=require(_0xb473('0x1c'))['db'];var dbH=require(_0xb473('0x1c'))[_0xb473('0x1d')];function respondWithStatusCode(_0x69173d,_0x216c34){_0x216c34=_0x216c34||0xcc;return function(_0x2498ba){if(_0x2498ba){return _0x69173d['sendStatus'](_0x216c34);}return _0x69173d[_0xb473('0x1e')](_0x216c34)[_0xb473('0x1f')]();};}function respondWithResult(_0x9bf51b,_0x4cece5){_0x4cece5=_0x4cece5||0xc8;return function(_0x36cb06){if(_0x36cb06){return _0x9bf51b[_0xb473('0x1e')](_0x4cece5)[_0xb473('0x20')](_0x36cb06);}};}function respondWithFilteredResult(_0x1247bf,_0x408d1c){return function(_0x54b28c){if(_0x54b28c){var _0x15099a=typeof _0x408d1c[_0xb473('0x21')]===_0xb473('0x22')&&typeof _0x408d1c[_0xb473('0x23')]===_0xb473('0x22');var _0x1e39e0=_0x54b28c['count'];var _0x312180=_0x15099a?0x0:_0x408d1c[_0xb473('0x21')];var _0x1e3891=_0x15099a?_0x54b28c['count']:_0x408d1c[_0xb473('0x21')]+_0x408d1c[_0xb473('0x23')];var _0x1626a5;if(_0x1e3891>=_0x1e39e0){_0x1e3891=_0x1e39e0;_0x1626a5=0xc8;}else{_0x1626a5=0xce;}_0x1247bf[_0xb473('0x1e')](_0x1626a5);return _0x1247bf[_0xb473('0x24')](_0xb473('0x25'),_0x312180+'-'+_0x1e3891+'/'+_0x1e39e0)[_0xb473('0x20')](_0x54b28c);}return null;};}function patchUpdates(_0x122295){return function(_0x4335bf){try{jsonpatch[_0xb473('0x26')](_0x4335bf,_0x122295,!![]);}catch(_0x2e2fad){return BPromise[_0xb473('0x27')](_0x2e2fad);}return _0x4335bf[_0xb473('0x28')]();};}function saveUpdates(_0x11f55d,_0x564671){return function(_0x5ae73f){if(_0x5ae73f){return _0x5ae73f[_0xb473('0x29')](_0x11f55d)[_0xb473('0x2a')](function(_0x4a71bb){return _0x4a71bb;});}return null;};}function removeEntity(_0x5afe50,_0x4f6447){return function(_0x440d5b){if(_0x440d5b){return _0x440d5b[_0xb473('0x2b')]()[_0xb473('0x2a')](function(){var _0x16695d=_0x440d5b[_0xb473('0x2c')]({'plain':!![]});var _0x1165e7=_0xb473('0x2d');return db[_0xb473('0x2e')][_0xb473('0x2b')]({'where':{'type':_0x1165e7,'resourceId':_0x16695d['id']}})[_0xb473('0x2a')](function(){return _0x440d5b;});})[_0xb473('0x2a')](function(){_0x5afe50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19e7b7,_0x4b81d0){return function(_0x171f8a){if(!_0x171f8a){_0x19e7b7[_0xb473('0x2f')](0x194);}return _0x171f8a;};}function handleError(_0x31b00a,_0x4ad587){_0x4ad587=_0x4ad587||0x1f4;return function(_0x61b1bb){logger[_0xb473('0x30')](_0x61b1bb['stack']);if(_0x61b1bb[_0xb473('0x31')]){delete _0x61b1bb[_0xb473('0x31')];}_0x31b00a[_0xb473('0x1e')](_0x4ad587)[_0xb473('0x32')](_0x61b1bb);};}exports[_0xb473('0x33')]=function(_0x51e439,_0x563226){var _0x31e61a={},_0x57c233={},_0x58ab7e={'count':0x0,'rows':[]};var _0x3076e0=_[_0xb473('0x34')](db[_0xb473('0x35')][_0xb473('0x36')],function(_0x178e93){return{'name':_0x178e93['fieldName'],'type':_0x178e93['type'][_0xb473('0x37')]};});_0x57c233[_0xb473('0x38')]=_[_0xb473('0x34')](_0x3076e0,'name');_0x57c233['query']=_[_0xb473('0x39')](_0x51e439[_0xb473('0x3a')]);_0x57c233[_0xb473('0x3b')]=_['intersection'](_0x57c233['model'],_0x57c233[_0xb473('0x3a')]);_0x31e61a[_0xb473('0x3c')]=_[_0xb473('0x3d')](_0x57c233['model'],qs[_0xb473('0x3e')](_0x51e439[_0xb473('0x3a')][_0xb473('0x3e')]));_0x31e61a['attributes']=_0x31e61a[_0xb473('0x3c')][_0xb473('0x3f')]?_0x31e61a[_0xb473('0x3c')]:_0x57c233['model'];if(!_0x51e439['query']['hasOwnProperty'](_0xb473('0x40'))){_0x31e61a[_0xb473('0x23')]=qs['limit'](_0x51e439[_0xb473('0x3a')]['limit']);_0x31e61a['offset']=qs['offset'](_0x51e439[_0xb473('0x3a')]['offset']);}_0x31e61a[_0xb473('0x41')]=qs[_0xb473('0x42')](_0x51e439['query'][_0xb473('0x42')]);_0x31e61a['where']=qs[_0xb473('0x3b')](_['pick'](_0x51e439[_0xb473('0x3a')],_0x57c233[_0xb473('0x3b')]),_0x3076e0);if(_0x51e439[_0xb473('0x3a')][_0xb473('0x43')]){_0x31e61a[_0xb473('0x44')]=_[_0xb473('0x45')](_0x31e61a['where'],{'$or':_['map'](_0x3076e0,function(_0x6d660a){if(_0x6d660a['type']!==_0xb473('0x46')){var _0x8a915b={};_0x8a915b[_0x6d660a['name']]={'$like':'%'+_0x51e439['query']['filter']+'%'};return _0x8a915b;}})});}_0x31e61a=_[_0xb473('0x45')]({},_0x31e61a,_0x51e439[_0xb473('0x47')]);var _0x32e93e={'where':_0x31e61a[_0xb473('0x44')]};return db[_0xb473('0x35')][_0xb473('0x48')](_0x32e93e)['then'](function(_0x10f574){_0x58ab7e['count']=_0x10f574;if(_0x51e439[_0xb473('0x3a')]['includeAll']){_0x31e61a[_0xb473('0x49')]=[{'all':!![]}];}return db[_0xb473('0x35')][_0xb473('0x4a')](_0x31e61a);})['then'](function(_0x24668e){_0x58ab7e['rows']=_0x24668e;return _0x58ab7e;})[_0xb473('0x2a')](respondWithFilteredResult(_0x563226,_0x31e61a))['catch'](handleError(_0x563226,null));};exports['show']=function(_0x551084,_0x36662c){var _0x31aee9={'raw':![],'where':{'id':_0x551084[_0xb473('0x4b')]['id']}},_0x89a5c={};_0x89a5c[_0xb473('0x38')]=_[_0xb473('0x39')](db[_0xb473('0x35')][_0xb473('0x36')]);_0x89a5c[_0xb473('0x3a')]=_[_0xb473('0x39')](_0x551084['query']);_0x89a5c['filters']=_[_0xb473('0x3d')](_0x89a5c['model'],_0x89a5c[_0xb473('0x3a')]);_0x31aee9[_0xb473('0x3c')]=_['intersection'](_0x89a5c[_0xb473('0x38')],qs[_0xb473('0x3e')](_0x551084[_0xb473('0x3a')][_0xb473('0x3e')]));_0x31aee9['attributes']=_0x31aee9[_0xb473('0x3c')][_0xb473('0x3f')]?_0x31aee9['attributes']:_0x89a5c[_0xb473('0x38')];if(_0x551084[_0xb473('0x3a')][_0xb473('0x4c')]){_0x31aee9[_0xb473('0x49')]=[{'all':!![]}];}_0x31aee9=_[_0xb473('0x45')]({},_0x31aee9,_0x551084['options']);return db['AnalyticCustomReport'][_0xb473('0x4d')](_0x31aee9)['then'](handleEntityNotFound(_0x36662c,null))['then'](respondWithResult(_0x36662c,null))['catch'](handleError(_0x36662c,null));};exports['create']=function(_0x33b187,_0x22b41d){return db[_0xb473('0x35')][_0xb473('0x4e')](_0x33b187[_0xb473('0x4f')],{})[_0xb473('0x2a')](function(_0x21064a){var _0x40d3b3=_0x33b187[_0xb473('0x50')][_0xb473('0x2c')]({'plain':!![]});if(!_0x40d3b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40d3b3[_0xb473('0x51')]===_0xb473('0x50')){var _0x268ee9=_0x21064a[_0xb473('0x2c')]({'plain':!![]});var _0x1d9564=_0xb473('0x52');return db['UserProfileSection'][_0xb473('0x4d')]({'where':{'name':_0x1d9564,'userProfileId':_0x40d3b3[_0xb473('0x53')]},'raw':!![]})[_0xb473('0x2a')](function(_0x3fe925){if(_0x3fe925&&_0x3fe925[_0xb473('0x54')]===0x0){return db[_0xb473('0x2e')][_0xb473('0x4e')]({'name':_0x268ee9[_0xb473('0x31')],'resourceId':_0x268ee9['id'],'type':_0xb473('0x2d'),'sectionId':_0x3fe925['id']},{})['then'](function(){return _0x21064a;});}else{return _0x21064a;}})[_0xb473('0x55')](function(_0x5ee0cf){logger[_0xb473('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ee0cf);throw _0x5ee0cf;});}return _0x21064a;})[_0xb473('0x2a')](respondWithResult(_0x22b41d,0xc9))[_0xb473('0x55')](handleError(_0x22b41d,null));};exports[_0xb473('0x29')]=function(_0xe1178a,_0x1f5ee6){if(_0xe1178a[_0xb473('0x4f')]['id']){delete _0xe1178a[_0xb473('0x4f')]['id'];}return db[_0xb473('0x35')][_0xb473('0x4d')]({'where':{'id':_0xe1178a['params']['id']}})[_0xb473('0x2a')](handleEntityNotFound(_0x1f5ee6,null))[_0xb473('0x2a')](saveUpdates(_0xe1178a[_0xb473('0x4f')],null))[_0xb473('0x2a')](respondWithResult(_0x1f5ee6,null))['catch'](handleError(_0x1f5ee6,null));};exports['destroy']=function(_0xb104a8,_0x4133aa){return db[_0xb473('0x35')][_0xb473('0x4d')]({'where':{'id':_0xb104a8[_0xb473('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4133aa,null))['then'](removeEntity(_0x4133aa,null))['catch'](handleError(_0x4133aa,null));};exports[_0xb473('0x56')]=function(_0x1aa944,_0x128afa){var _0x22ca45=0xa;var _0x4c4712=['join','left_join',_0xb473('0x57'),_0xb473('0x58')];var _0x1ab63b={'SUM':_0xb473('0x59'),'COUNT':_0xb473('0x5a'),'COUNT DISTINCT':_0xb473('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb473('0x5c'),'GROUP_CONCAT ASC':_0xb473('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x53072a={'SEC_TO_TIME':_0xb473('0x5e'),'DATE':'DATE(%s)','HOUR':_0xb473('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb473('0x60')};var _0x2524cc=function(_0x5ccdc8){return!_[_0xb473('0x61')]([_0xb473('0x62'),_0xb473('0x63'),_0xb473('0x64'),'IS\x20NOT\x20EMPTY'],_0x5ccdc8);};var _0x3ba6a4=function(_0x3fefb8){if(!_0x3fefb8||!_0x3fefb8[_0xb473('0x65')][_0xb473('0x3f')]){return'';}for(var _0xb130b='(',_0x3749f0=0x0;_0x3749f0<_0x3fefb8['rules']['length'];_0x3749f0+=0x1){_0x3749f0>0x0&&(_0xb130b+='\x20'+_0x3fefb8[_0xb473('0x66')]+'\x20');_0xb130b+=_0x3fefb8['rules'][_0x3749f0][_0xb473('0x67')]?_0x3ba6a4(_0x3fefb8[_0xb473('0x65')][_0x3749f0]['group']):_0x3fefb8[_0xb473('0x65')][_0x3749f0][_0xb473('0x68')]+'\x20'+_0x3fefb8[_0xb473('0x65')][_0x3749f0][_0xb473('0x69')]+(_0x2524cc(_0x3fefb8['rules'][_0x3749f0][_0xb473('0x69')])?'\x20'+_0x3fefb8[_0xb473('0x65')][_0x3749f0][_0xb473('0x6a')]:'');}return _0xb130b+')';};var _0x19c33b={'where':{'id':_0x1aa944['params']['id']}},_0x4b2d93,_0x3e0eb7,_0x559766,_0x4b5c09,_0x126446;_0x19c33b=_[_0xb473('0x45')]({},_0x19c33b,_0x1aa944['options']);return db['AnalyticCustomReport'][_0xb473('0x4d')](_0x19c33b)[_0xb473('0x2a')](function(_0x2d07c1){if(_0x2d07c1){_0x4b2d93=_0x2d07c1;return _0x2d07c1[_0xb473('0x6b')]();}return null;})[_0xb473('0x2a')](function(_0x5aa1e4){if(_0x5aa1e4){if(!_0x5aa1e4[_0xb473('0x3f')]){throw new db[(_0xb473('0x6c'))]['ValidationErrorItem'](_0xb473('0x6d'),0x193);}_0x3e0eb7=_0x5aa1e4;return db[_0xb473('0x6e')][_0xb473('0x4a')]({'raw':!![]});}return null;})[_0xb473('0x2a')](function(_0x6d962c){if(_0x6d962c){_0x559766=_[_0xb473('0x6f')](_0x6d962c,'id');var _0x58acf6;var _0x2dafdb=squel[_0xb473('0x70')]();_0x2dafdb[_0xb473('0x71')](_0x4b2d93['table']);for(var _0x4ac97e=0x0;_0x4ac97e<_0x3e0eb7[_0xb473('0x3f')];_0x4ac97e+=0x1){_0x58acf6=_0x3e0eb7[_0x4ac97e]['MetricId']?_0x559766[_0x3e0eb7[_0x4ac97e][_0xb473('0x72')]]['metric']:_0x3e0eb7[_0x4ac97e][_0xb473('0x68')];_0x58acf6=_0x3e0eb7[_0x4ac97e][_0xb473('0x73')]?_['replace'](_0x1ab63b[_0x3e0eb7[_0x4ac97e][_0xb473('0x73')]],'%s',_0x58acf6):_0x58acf6;_0x58acf6=_0x3e0eb7[_0x4ac97e]['format']?_['replace'](_0x53072a[_0x3e0eb7[_0x4ac97e][_0xb473('0x74')]],'%s',_0x58acf6):_0x58acf6;if(_0x3e0eb7[_0x4ac97e][_0xb473('0x75')]){_0x2dafdb['group'](_0x58acf6);}_0x3e0eb7[_0x4ac97e][_0xb473('0x76')]&&_0x2dafdb[_0xb473('0x41')](_0x58acf6,_0x3e0eb7[_0x4ac97e][_0xb473('0x76')]===_0xb473('0x77')?![]:!![]);_0x2dafdb[_0xb473('0x68')](_0x58acf6,_0x3e0eb7[_0x4ac97e][_0xb473('0x78')]||_0x58acf6);}if(_0x4b2d93['joins']){_0x4b2d93[_0xb473('0x79')]=JSON['parse'](_0x4b2d93[_0xb473('0x79')]);for(var _0x3bce91=0x0;_0x3bce91<_0x4b2d93[_0xb473('0x79')][_0xb473('0x3f')];_0x3bce91+=0x1){if(_0x4b2d93['joins'][_0x3bce91][_0xb473('0x7a')]&&_[_0xb473('0x61')](_0x4c4712,_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7a')])&&_0x4b2d93['joins'][_0x3bce91][_0xb473('0x7b')]&&_0x4b2d93['joins'][_0x3bce91][_0xb473('0x7c')]&&_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7d')]){_0x2dafdb[_0x4b2d93[_0xb473('0x79')][_0x3bce91]['type']](_0x4b2d93[_0xb473('0x79')][_0x3bce91]['foreignTable'],null,util[_0xb473('0x74')](_0xb473('0x7e'),_0x4b2d93[_0xb473('0x7f')],_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7b')],_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7c')],_0x4b2d93[_0xb473('0x79')][_0x3bce91][_0xb473('0x7d')]));}}}if(_0x4b2d93[_0xb473('0x80')]){_0x4b2d93[_0xb473('0x80')]=JSON[_0xb473('0x81')](_0x4b2d93[_0xb473('0x80')]);_0x2dafdb[_0xb473('0x44')](_0x3ba6a4(_0x4b2d93['conditions'][_0xb473('0x67')]));}_0x126446=_0x2dafdb[_0xb473('0x82')]();_0x2dafdb[_0xb473('0x23')](_0x22ca45);_0x2dafdb[_0xb473('0x21')](0x0);logger[_0xb473('0x83')](_0xb473('0x84'),_0x2dafdb[_0xb473('0x85')]());return dbH[_0xb473('0x86')][_0xb473('0x3a')](_0x2dafdb['toString'](),{'type':dbH[_0xb473('0x86')]['QueryTypes']['SELECT']});}})[_0xb473('0x2a')](respondWithResult(_0x128afa,null))[_0xb473('0x55')](handleError(_0x128afa,null));};function runReport(_0x1b77f2,_0x575b60,_0x5bf713){var _0x3d8e36=_0x575b60[_0xb473('0x31')];var _0x7e29e1=0xa;var _0x10786f=[_0xb473('0x87'),_0xb473('0x88'),_0xb473('0x57'),'cross_join'];var _0x578d69={'SUM':_0xb473('0x59'),'COUNT':_0xb473('0x5a'),'COUNT DISTINCT':_0xb473('0x5b'),'MAX':_0xb473('0x89'),'MIN':'MIN(%s)','AVG':_0xb473('0x8a'),'GROUP_CONCAT':_0xb473('0x5c'),'GROUP_CONCAT ASC':_0xb473('0x5d'),'GROUP_CONCAT DESC':_0xb473('0x8b')};var _0x4d3f6a={'SEC_TO_TIME':_0xb473('0x5e'),'DATE':_0xb473('0x8c'),'HOUR':_0xb473('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb473('0x60')};var _0x45bd90=function(_0x91602b){return!_[_0xb473('0x61')]([_0xb473('0x62'),_0xb473('0x63'),'IS\x20EMPTY',_0xb473('0x8d')],_0x91602b);};var _0x1c7863=function(_0x552dcc){if(!_0x552dcc||!_0x552dcc['rules'][_0xb473('0x3f')]){return'';}for(var _0x2e4bc8='(',_0x1fd5f7=0x0;_0x1fd5f7<_0x552dcc[_0xb473('0x65')][_0xb473('0x3f')];_0x1fd5f7+=0x1){_0x1fd5f7>0x0&&(_0x2e4bc8+='\x20'+_0x552dcc['operator']+'\x20');_0x2e4bc8+=_0x552dcc['rules'][_0x1fd5f7]['group']?_0x1c7863(_0x552dcc[_0xb473('0x65')][_0x1fd5f7][_0xb473('0x67')]):_0x552dcc['rules'][_0x1fd5f7][_0xb473('0x68')]+'\x20'+_0x552dcc[_0xb473('0x65')][_0x1fd5f7][_0xb473('0x69')]+(_0x45bd90(_0x552dcc[_0xb473('0x65')][_0x1fd5f7][_0xb473('0x69')])?'\x20'+_0x552dcc['rules'][_0x1fd5f7][_0xb473('0x6a')]:'');}return _0x2e4bc8+')';};var _0x41b0={'where':{'id':_0x1b77f2['id']}},_0x1b377b,_0x31a119,_0x392360,_0x215806,_0x686c4e;_0x41b0=_[_0xb473('0x45')]({},_0x41b0,_0x5bf713);return db[_0xb473('0x35')][_0xb473('0x4d')](_0x41b0)[_0xb473('0x2a')](function(_0x14bf1b){if(_0x14bf1b){_0x1b377b=_0x14bf1b;return _0x14bf1b[_0xb473('0x6b')]();}return null;})[_0xb473('0x2a')](function(_0x36a82c){if(_0x36a82c){if(!_0x36a82c['length']){throw new db[(_0xb473('0x6c'))][(_0xb473('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x31a119=_0x36a82c;return db[_0xb473('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xb473('0x2a')](function(_0x57d11e){if(_0x57d11e){_0x392360=_[_0xb473('0x6f')](_0x57d11e,'id');var _0x50a3cd;var _0x3d1854=squel[_0xb473('0x70')]();_0x3d1854['from'](_0x1b377b[_0xb473('0x7f')]);for(var _0x42eec0=0x0;_0x42eec0<_0x31a119['length'];_0x42eec0+=0x1){_0x50a3cd=_0x31a119[_0x42eec0][_0xb473('0x72')]?_0x392360[_0x31a119[_0x42eec0]['MetricId']]['metric']:_0x31a119[_0x42eec0]['field'];_0x50a3cd=_0x31a119[_0x42eec0][_0xb473('0x73')]?_[_0xb473('0x8f')](_0x578d69[_0x31a119[_0x42eec0][_0xb473('0x73')]],'%s',_0x50a3cd):_0x50a3cd;_0x50a3cd=_0x31a119[_0x42eec0][_0xb473('0x74')]?_['replace'](_0x4d3f6a[_0x31a119[_0x42eec0][_0xb473('0x74')]],'%s',_0x50a3cd):_0x50a3cd;if(_0x31a119[_0x42eec0][_0xb473('0x75')]){_0x3d1854[_0xb473('0x67')](_0x50a3cd);}_0x31a119[_0x42eec0][_0xb473('0x76')]&&_0x3d1854[_0xb473('0x41')](_0x50a3cd,_0x31a119[_0x42eec0][_0xb473('0x76')]===_0xb473('0x77')?![]:!![]);_0x3d1854['field'](_0x50a3cd,_0x31a119[_0x42eec0]['alias']||_0x50a3cd);}if(_0x1b377b['joins']){_0x1b377b[_0xb473('0x79')]=JSON[_0xb473('0x81')](_0x1b377b['joins']);for(var _0x4809bb=0x0;_0x4809bb<_0x1b377b['joins'][_0xb473('0x3f')];_0x4809bb+=0x1){if(_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7a')]&&_[_0xb473('0x61')](_0x10786f,_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7a')])&&_0x1b377b['joins'][_0x4809bb][_0xb473('0x7b')]&&_0x1b377b[_0xb473('0x79')][_0x4809bb]['foreignTable']&&_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7d')]){_0x3d1854[_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7a')]](_0x1b377b[_0xb473('0x79')][_0x4809bb]['foreignTable'],null,util[_0xb473('0x74')](_0xb473('0x7e'),_0x1b377b[_0xb473('0x7f')],_0x1b377b[_0xb473('0x79')][_0x4809bb]['parentKey'],_0x1b377b[_0xb473('0x79')][_0x4809bb]['foreignTable'],_0x1b377b[_0xb473('0x79')][_0x4809bb][_0xb473('0x7d')]));}}}if(_0x1b377b['conditions']){_0x1b377b['conditions']=JSON['parse'](_0x1b377b[_0xb473('0x80')]);_0x3d1854[_0xb473('0x44')](_0x1c7863(_0x1b377b['conditions'][_0xb473('0x67')]));}_0x686c4e=_0x3d1854['clone']();_0x3d1854[_0xb473('0x23')](_0x7e29e1);_0x3d1854[_0xb473('0x21')](0x0);return;}})[_0xb473('0x2a')](function(){if(_0x575b60[_0xb473('0x90')]===_0xb473('0x91')){return null;}var _0x2731f8=_[_0xb473('0x45')](_0x575b60,{'name':_0x575b60['fullPath']||_0x575b60['name']||_0x1b377b[_0xb473('0x31')],'basename':_0x3d8e36,'savename':util[_0xb473('0x74')](_0xb473('0x92'),_0x575b60[_0xb473('0x31')]||_0x1b377b['name'],require(_0xb473('0x93'))[_0xb473('0x94')](0x4),_0x575b60[_0xb473('0x90')]||_0xb473('0x95')),'reportId':_0x1b377b['id'],'reportType':_0xb473('0x96')});return db['AnalyticExtractedReport'][_0xb473('0x4e')](_0x2731f8,{'raw':!![]});})[_0xb473('0x2a')](function(_0x18ffcc){if(_0x1b377b[_0xb473('0x7f')]===_0xb473('0x97')){_0x686c4e[_0xb473('0x44')](_0x1b377b['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x575b60[_0xb473('0x98')],_0x575b60['endDate']);}else{_0x686c4e[_0xb473('0x44')](_0x1b377b['table']+_0xb473('0x99'),_0x575b60[_0xb473('0x98')],_0x575b60[_0xb473('0x9a')]);}if(_0x18ffcc){logger[_0xb473('0x9b')](_0xb473('0x9c'),_0x686c4e[_0xb473('0x85')]());require(_0xb473('0x9d'))[_0xb473('0x9e')](path['join'](__dirname,_0xb473('0x9f'),_0x18ffcc[_0xb473('0x90')]),[_0x18ffcc['id'],_0x686c4e[_0xb473('0x85')](),path['join'](__dirname,_0xb473('0xa0'),_0x18ffcc[_0xb473('0xa1')]),_0x3d8e36]);return _0x18ffcc;}else{var _0x30b631=squel['select']();_0x30b631['from']('('+_0x686c4e[_0xb473('0x85')]()+')',_0xb473('0xa2'));_0x30b631[_0xb473('0x68')]('COUNT(*)',_0xb473('0x48'));_0x686c4e['limit'](_0x575b60[_0xb473('0x23')]||_0x7e29e1);_0x686c4e[_0xb473('0x21')](_0x575b60[_0xb473('0x21')]||0x0);return dbH[_0xb473('0x86')][_0xb473('0x3a')](_0x30b631[_0xb473('0x85')](),{'type':dbH[_0xb473('0x86')]['QueryTypes'][_0xb473('0xa3')]})[_0xb473('0x2a')](function(_0x238577){if(!_0x238577['length']){_0x215806=0x0;}else{_0x215806=_0x238577[0x0]['count']||0x0;}return dbH[_0xb473('0x86')][_0xb473('0x3a')](_0x686c4e['toString'](),{'type':dbH[_0xb473('0x86')]['QueryTypes'][_0xb473('0xa3')]});})[_0xb473('0x2a')](function(_0x2f0f17){return{'rows':_0x2f0f17||[],'count':_0x215806};});}});}exports[_0xb473('0xa4')]=function(_0x28b33b,_0x147c95){return runReport(_0x28b33b[_0xb473('0x4b')],_0x28b33b[_0xb473('0x3a')],_0x28b33b[_0xb473('0x47')])['then'](respondWithResult(_0x147c95,null))['catch'](handleError(_0x147c95,null));};exports[_0xb473('0xa5')]=runReport;exports['query']=function(_0x15f9cf,_0xc07578){var _0x56f028=0xa;var _0x3d21e4=[_0xb473('0x87'),_0xb473('0x88'),_0xb473('0x57'),_0xb473('0x58')];var _0x5bac91={'SUM':_0xb473('0x59'),'COUNT':_0xb473('0x5a'),'COUNT DISTINCT':_0xb473('0x5b'),'MAX':_0xb473('0x89'),'MIN':'MIN(%s)','AVG':_0xb473('0x8a'),'GROUP_CONCAT':_0xb473('0x5c'),'GROUP_CONCAT ASC':_0xb473('0x5d'),'GROUP_CONCAT DESC':_0xb473('0x8b')};var _0x2d615d={'SEC_TO_TIME':_0xb473('0x5e'),'DATE':_0xb473('0x8c'),'HOUR':'HOUR(%s)','ROUND':_0xb473('0xa6'),'UNIX_TIMESTAMP':_0xb473('0x60')};var _0x52b950=function(_0x584222){return!_[_0xb473('0x61')]([_0xb473('0x62'),_0xb473('0x63'),_0xb473('0x64'),_0xb473('0x8d')],_0x584222);};var _0x52ba6f=function(_0x3136d7){if(!_0x3136d7||!_0x3136d7[_0xb473('0x65')]['length']){return'';}for(var _0x448c41='(',_0x2e0408=0x0;_0x2e0408<_0x3136d7['rules'][_0xb473('0x3f')];_0x2e0408+=0x1){_0x2e0408>0x0&&(_0x448c41+='\x20'+_0x3136d7['operator']+'\x20');_0x448c41+=_0x3136d7[_0xb473('0x65')][_0x2e0408]['group']?_0x52ba6f(_0x3136d7[_0xb473('0x65')][_0x2e0408][_0xb473('0x67')]):_0x3136d7['rules'][_0x2e0408][_0xb473('0x68')]+'\x20'+_0x3136d7[_0xb473('0x65')][_0x2e0408]['condition']+(_0x52b950(_0x3136d7[_0xb473('0x65')][_0x2e0408][_0xb473('0x69')])?'\x20'+_0x3136d7[_0xb473('0x65')][_0x2e0408]['value']:'');}return _0x448c41+')';};var _0x1ab435={'where':{'id':_0x15f9cf[_0xb473('0x4b')]['id']}},_0x2eb994,_0x2549df,_0x42cbda,_0x2b16a4,_0x25b6a8;_0x1ab435=_[_0xb473('0x45')]({},_0x1ab435,_0x15f9cf['options']);return db[_0xb473('0x35')][_0xb473('0x4d')](_0x1ab435)[_0xb473('0x2a')](function(_0x4ed0c0){if(_0x4ed0c0){_0x2eb994=_0x4ed0c0;return _0x4ed0c0[_0xb473('0x6b')]();}return null;})['then'](function(_0x67cc3){if(_0x67cc3){if(!_0x67cc3['length']){throw new db['Sequelize'][(_0xb473('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2549df=_0x67cc3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xb473('0x2a')](function(_0x22564f){if(_0x22564f){_0x42cbda=_[_0xb473('0x6f')](_0x22564f,'id');var _0x4a8ff9;var _0x21549e=squel[_0xb473('0x70')]();_0x21549e[_0xb473('0x71')](_0x2eb994[_0xb473('0x7f')]);for(var _0x1a792b=0x0;_0x1a792b<_0x2549df[_0xb473('0x3f')];_0x1a792b+=0x1){_0x4a8ff9=_0x2549df[_0x1a792b][_0xb473('0x72')]?_0x42cbda[_0x2549df[_0x1a792b][_0xb473('0x72')]][_0xb473('0xa7')]:_0x2549df[_0x1a792b][_0xb473('0x68')];_0x4a8ff9=_0x2549df[_0x1a792b][_0xb473('0x73')]?_[_0xb473('0x8f')](_0x5bac91[_0x2549df[_0x1a792b][_0xb473('0x73')]],'%s',_0x4a8ff9):_0x4a8ff9;_0x4a8ff9=_0x2549df[_0x1a792b][_0xb473('0x74')]?_[_0xb473('0x8f')](_0x2d615d[_0x2549df[_0x1a792b][_0xb473('0x74')]],'%s',_0x4a8ff9):_0x4a8ff9;if(_0x2549df[_0x1a792b][_0xb473('0x75')]){_0x21549e[_0xb473('0x67')](_0x4a8ff9);}_0x2549df[_0x1a792b][_0xb473('0x76')]&&_0x21549e[_0xb473('0x41')](_0x4a8ff9,_0x2549df[_0x1a792b]['orderBy']===_0xb473('0x77')?![]:!![]);_0x21549e[_0xb473('0x68')](_0x4a8ff9,_0x2549df[_0x1a792b]['alias']||_0x4a8ff9);}if(_0x2eb994[_0xb473('0x79')]){_0x2eb994[_0xb473('0x79')]=JSON[_0xb473('0x81')](_0x2eb994['joins']);for(var _0x368750=0x0;_0x368750<_0x2eb994[_0xb473('0x79')][_0xb473('0x3f')];_0x368750+=0x1){if(_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7a')]&&_[_0xb473('0x61')](_0x3d21e4,_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7a')])&&_0x2eb994['joins'][_0x368750][_0xb473('0x7b')]&&_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7c')]&&_0x2eb994['joins'][_0x368750][_0xb473('0x7d')]){_0x21549e[_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7a')]](_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7c')],null,util[_0xb473('0x74')](_0xb473('0x7e'),_0x2eb994[_0xb473('0x7f')],_0x2eb994[_0xb473('0x79')][_0x368750]['parentKey'],_0x2eb994[_0xb473('0x79')][_0x368750][_0xb473('0x7c')],_0x2eb994[_0xb473('0x79')][_0x368750]['foreignKey']));}}}if(_0x2eb994[_0xb473('0x80')]){_0x2eb994[_0xb473('0x80')]=JSON[_0xb473('0x81')](_0x2eb994[_0xb473('0x80')]);_0x21549e[_0xb473('0x44')](_0x52ba6f(_0x2eb994[_0xb473('0x80')][_0xb473('0x67')]));}_0x25b6a8=_0x21549e[_0xb473('0x82')]();_0x21549e[_0xb473('0x23')](_0x56f028);_0x21549e[_0xb473('0x21')](0x0);logger[_0xb473('0x83')]('Limited\x20Query:',_0x21549e[_0xb473('0x85')]());return dbH['sequelize'][_0xb473('0x3a')](_0x21549e[_0xb473('0x85')](),{'type':dbH[_0xb473('0x86')]['QueryTypes'][_0xb473('0xa3')]});}})[_0xb473('0x2a')](function(){return{'sql':_0x25b6a8['toString']()};})[_0xb473('0x2a')](respondWithResult(_0xc07578,null))['catch'](handleError(_0xc07578,null));};
\ No newline at end of file
+var _0x0de2=['request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','format','orderBy','DESC','alias','joins','foreignTable','parentKey','conditions','clone','debug','Limited\x20Query:','toString','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','metric','groupBy','foreignKey','%s.%s\x20=\x20%s.%s','parse','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','../../components/export/','../../files/reports','savename','countTable','sequelize','QueryTypes','SELECT','run','runReport','DATE(%s)','rimraf'];(function(_0x231782,_0x14e733){var _0x26b4a5=function(_0x55c232){while(--_0x55c232){_0x231782['push'](_0x231782['shift']());}};_0x26b4a5(++_0x14e733);}(_0x0de2,0xa4));var _0x20de=function(_0x243dce,_0x548bcf){_0x243dce=_0x243dce-0x0;var _0x482b9d=_0x0de2[_0x243dce];return _0x482b9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20de('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x20de('0x1'));var moment=require(_0x20de('0x2'));var BPromise=require(_0x20de('0x3'));var Mustache=require(_0x20de('0x4'));var util=require('util');var path=require('path');var sox=require(_0x20de('0x5'));var csv=require('to-csv');var ejs=require(_0x20de('0x6'));var fs=require('fs');var fs_extra=require(_0x20de('0x7'));var _=require('lodash');var squel=require(_0x20de('0x8'));var crypto=require(_0x20de('0x9'));var jsforce=require(_0x20de('0xa'));var deskjs=require(_0x20de('0xb'));var toCsv=require(_0x20de('0xc'));var querystring=require(_0x20de('0xd'));var Papa=require(_0x20de('0xe'));var Redis=require('ioredis');var authService=require(_0x20de('0xf'));var qs=require(_0x20de('0x10'));var as=require(_0x20de('0x11'));var hardwareService=require(_0x20de('0x12'));var logger=require(_0x20de('0x13'))('api');var utils=require(_0x20de('0x14'));var config=require(_0x20de('0x15'));var licenseUtil=require(_0x20de('0x16'));var db=require(_0x20de('0x17'))['db'];var dbH=require('../../mysqldb')[_0x20de('0x18')];function respondWithStatusCode(_0x2604eb,_0x5d1775){_0x5d1775=_0x5d1775||0xcc;return function(_0x5fdad2){if(_0x5fdad2){return _0x2604eb['sendStatus'](_0x5d1775);}return _0x2604eb[_0x20de('0x19')](_0x5d1775)[_0x20de('0x1a')]();};}function respondWithResult(_0x570923,_0x274d51){_0x274d51=_0x274d51||0xc8;return function(_0x507803){if(_0x507803){return _0x570923[_0x20de('0x19')](_0x274d51)['json'](_0x507803);}};}function respondWithFilteredResult(_0x59bff,_0x18b7c2){return function(_0x3b52b5){if(_0x3b52b5){var _0x55552f=typeof _0x18b7c2['offset']===_0x20de('0x1b')&&typeof _0x18b7c2[_0x20de('0x1c')]==='undefined';var _0x35bd02=_0x3b52b5[_0x20de('0x1d')];var _0x1fb1ce=_0x55552f?0x0:_0x18b7c2['offset'];var _0x6600e7=_0x55552f?_0x3b52b5[_0x20de('0x1d')]:_0x18b7c2[_0x20de('0x1e')]+_0x18b7c2[_0x20de('0x1c')];var _0x266001;if(_0x6600e7>=_0x35bd02){_0x6600e7=_0x35bd02;_0x266001=0xc8;}else{_0x266001=0xce;}_0x59bff[_0x20de('0x19')](_0x266001);return _0x59bff[_0x20de('0x1f')](_0x20de('0x20'),_0x1fb1ce+'-'+_0x6600e7+'/'+_0x35bd02)[_0x20de('0x21')](_0x3b52b5);}return null;};}function patchUpdates(_0x3a97d7){return function(_0x2dd2ad){try{jsonpatch[_0x20de('0x22')](_0x2dd2ad,_0x3a97d7,!![]);}catch(_0x176b53){return BPromise['reject'](_0x176b53);}return _0x2dd2ad['save']();};}function saveUpdates(_0x1f3581,_0x5b2753){return function(_0x60b1c3){if(_0x60b1c3){return _0x60b1c3['update'](_0x1f3581)[_0x20de('0x23')](function(_0x290a73){return _0x290a73;});}return null;};}function removeEntity(_0x3ed8de,_0x21bd82){return function(_0x49dcd5){if(_0x49dcd5){return _0x49dcd5[_0x20de('0x24')]()[_0x20de('0x23')](function(){var _0x5b4db9=_0x49dcd5[_0x20de('0x25')]({'plain':!![]});var _0x2a81bc='CustomReports';return db[_0x20de('0x26')][_0x20de('0x24')]({'where':{'type':_0x2a81bc,'resourceId':_0x5b4db9['id']}})['then'](function(){return _0x49dcd5;});})['then'](function(){_0x3ed8de[_0x20de('0x19')](0xcc)[_0x20de('0x1a')]();});}};}function handleEntityNotFound(_0x17444e,_0x4f5951){return function(_0x346d3d){if(!_0x346d3d){_0x17444e[_0x20de('0x27')](0x194);}return _0x346d3d;};}function handleError(_0x32131e,_0x366839){_0x366839=_0x366839||0x1f4;return function(_0xd2c589){logger[_0x20de('0x28')](_0xd2c589[_0x20de('0x29')]);if(_0xd2c589[_0x20de('0x2a')]){delete _0xd2c589['name'];}_0x32131e[_0x20de('0x19')](_0x366839)[_0x20de('0x2b')](_0xd2c589);};}exports[_0x20de('0x2c')]=function(_0x1ffe28,_0x4a4c23){var _0x592c31={},_0x3630c0={},_0x1c3f32={'count':0x0,'rows':[]};var _0x5f17b6=_[_0x20de('0x2d')](db[_0x20de('0x2e')][_0x20de('0x2f')],function(_0x2409f6){return{'name':_0x2409f6[_0x20de('0x30')],'type':_0x2409f6[_0x20de('0x31')][_0x20de('0x32')]};});_0x3630c0[_0x20de('0x33')]=_[_0x20de('0x2d')](_0x5f17b6,_0x20de('0x2a'));_0x3630c0[_0x20de('0x34')]=_[_0x20de('0x35')](_0x1ffe28[_0x20de('0x34')]);_0x3630c0[_0x20de('0x36')]=_[_0x20de('0x37')](_0x3630c0[_0x20de('0x33')],_0x3630c0[_0x20de('0x34')]);_0x592c31[_0x20de('0x38')]=_[_0x20de('0x37')](_0x3630c0[_0x20de('0x33')],qs[_0x20de('0x39')](_0x1ffe28[_0x20de('0x34')][_0x20de('0x39')]));_0x592c31[_0x20de('0x38')]=_0x592c31['attributes']['length']?_0x592c31[_0x20de('0x38')]:_0x3630c0[_0x20de('0x33')];if(!_0x1ffe28[_0x20de('0x34')]['hasOwnProperty']('nolimit')){_0x592c31[_0x20de('0x1c')]=qs[_0x20de('0x1c')](_0x1ffe28[_0x20de('0x34')][_0x20de('0x1c')]);_0x592c31['offset']=qs[_0x20de('0x1e')](_0x1ffe28[_0x20de('0x34')][_0x20de('0x1e')]);}_0x592c31[_0x20de('0x3a')]=qs[_0x20de('0x3b')](_0x1ffe28[_0x20de('0x34')]['sort']);_0x592c31[_0x20de('0x3c')]=qs['filters'](_['pick'](_0x1ffe28[_0x20de('0x34')],_0x3630c0[_0x20de('0x36')]),_0x5f17b6);if(_0x1ffe28['query'][_0x20de('0x3d')]){_0x592c31[_0x20de('0x3c')]=_[_0x20de('0x3e')](_0x592c31[_0x20de('0x3c')],{'$or':_['map'](_0x5f17b6,function(_0x50f47c){if(_0x50f47c[_0x20de('0x31')]!==_0x20de('0x3f')){var _0x4095c7={};_0x4095c7[_0x50f47c[_0x20de('0x2a')]]={'$like':'%'+_0x1ffe28[_0x20de('0x34')][_0x20de('0x3d')]+'%'};return _0x4095c7;}})});}_0x592c31=_['merge']({},_0x592c31,_0x1ffe28[_0x20de('0x40')]);var _0x3f733d={'where':_0x592c31[_0x20de('0x3c')]};return db[_0x20de('0x2e')][_0x20de('0x1d')](_0x3f733d)[_0x20de('0x23')](function(_0x108c2e){_0x1c3f32[_0x20de('0x1d')]=_0x108c2e;if(_0x1ffe28[_0x20de('0x34')][_0x20de('0x41')]){_0x592c31[_0x20de('0x42')]=[{'all':!![]}];}return db[_0x20de('0x2e')][_0x20de('0x43')](_0x592c31);})[_0x20de('0x23')](function(_0x543247){_0x1c3f32[_0x20de('0x44')]=_0x543247;return _0x1c3f32;})[_0x20de('0x23')](respondWithFilteredResult(_0x4a4c23,_0x592c31))[_0x20de('0x45')](handleError(_0x4a4c23,null));};exports[_0x20de('0x46')]=function(_0x183fb7,_0x66bf6f){var _0xedc9c9={'raw':![],'where':{'id':_0x183fb7['params']['id']}},_0x4d2afc={};_0x4d2afc['model']=_[_0x20de('0x35')](db['AnalyticCustomReport'][_0x20de('0x2f')]);_0x4d2afc['query']=_['keys'](_0x183fb7[_0x20de('0x34')]);_0x4d2afc[_0x20de('0x36')]=_[_0x20de('0x37')](_0x4d2afc[_0x20de('0x33')],_0x4d2afc[_0x20de('0x34')]);_0xedc9c9[_0x20de('0x38')]=_['intersection'](_0x4d2afc[_0x20de('0x33')],qs[_0x20de('0x39')](_0x183fb7[_0x20de('0x34')][_0x20de('0x39')]));_0xedc9c9['attributes']=_0xedc9c9[_0x20de('0x38')][_0x20de('0x47')]?_0xedc9c9[_0x20de('0x38')]:_0x4d2afc[_0x20de('0x33')];if(_0x183fb7[_0x20de('0x34')]['includeAll']){_0xedc9c9[_0x20de('0x42')]=[{'all':!![]}];}_0xedc9c9=_['merge']({},_0xedc9c9,_0x183fb7[_0x20de('0x40')]);return db[_0x20de('0x2e')][_0x20de('0x48')](_0xedc9c9)['then'](handleEntityNotFound(_0x66bf6f,null))['then'](respondWithResult(_0x66bf6f,null))[_0x20de('0x45')](handleError(_0x66bf6f,null));};exports[_0x20de('0x49')]=function(_0x2d06c5,_0x32b786){return db['AnalyticCustomReport'][_0x20de('0x49')](_0x2d06c5[_0x20de('0x4a')],{})[_0x20de('0x23')](function(_0x50b241){var _0x1cef99=_0x2d06c5[_0x20de('0x4b')]['get']({'plain':!![]});if(!_0x1cef99)throw new Error(_0x20de('0x4c'));if(_0x1cef99[_0x20de('0x4d')]===_0x20de('0x4b')){var _0x1a8f75=_0x50b241[_0x20de('0x25')]({'plain':!![]});var _0x432b0c=_0x20de('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x432b0c,'userProfileId':_0x1cef99[_0x20de('0x4f')]},'raw':!![]})[_0x20de('0x23')](function(_0x388dec){if(_0x388dec&&_0x388dec[_0x20de('0x50')]===0x0){return db['UserProfileResource'][_0x20de('0x49')]({'name':_0x1a8f75['name'],'resourceId':_0x1a8f75['id'],'type':'CustomReports','sectionId':_0x388dec['id']},{})['then'](function(){return _0x50b241;});}else{return _0x50b241;}})[_0x20de('0x45')](function(_0x5277d2){logger[_0x20de('0x28')](_0x20de('0x51'),_0x5277d2);throw _0x5277d2;});}return _0x50b241;})[_0x20de('0x23')](respondWithResult(_0x32b786,0xc9))[_0x20de('0x45')](handleError(_0x32b786,null));};exports[_0x20de('0x52')]=function(_0x2c1c75,_0x5df128){if(_0x2c1c75[_0x20de('0x4a')]['id']){delete _0x2c1c75['body']['id'];}return db[_0x20de('0x2e')][_0x20de('0x48')]({'where':{'id':_0x2c1c75[_0x20de('0x53')]['id']}})[_0x20de('0x23')](handleEntityNotFound(_0x5df128,null))[_0x20de('0x23')](saveUpdates(_0x2c1c75[_0x20de('0x4a')],null))[_0x20de('0x23')](respondWithResult(_0x5df128,null))[_0x20de('0x45')](handleError(_0x5df128,null));};exports[_0x20de('0x24')]=function(_0x527d14,_0x1756ac){return db[_0x20de('0x2e')][_0x20de('0x48')]({'where':{'id':_0x527d14['params']['id']}})[_0x20de('0x23')](handleEntityNotFound(_0x1756ac,null))[_0x20de('0x23')](removeEntity(_0x1756ac,null))['catch'](handleError(_0x1756ac,null));};exports[_0x20de('0x54')]=function(_0x96cdcb,_0x3cdf99){var _0x446dc2=0xa;var _0x5f19a4=[_0x20de('0x55'),_0x20de('0x56'),_0x20de('0x57'),_0x20de('0x58')];var _0x24a16b={'SUM':_0x20de('0x59'),'COUNT':_0x20de('0x5a'),'COUNT DISTINCT':_0x20de('0x5b'),'MAX':_0x20de('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x20de('0x5d'),'GROUP_CONCAT ASC':_0x20de('0x5e'),'GROUP_CONCAT DESC':_0x20de('0x5f')};var _0x3983bd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x20de('0x60'),'ROUND':_0x20de('0x61'),'UNIX_TIMESTAMP':_0x20de('0x62')};var _0x3a8d51=function(_0x5e7e26){return!_[_0x20de('0x63')]([_0x20de('0x64'),_0x20de('0x65'),_0x20de('0x66'),_0x20de('0x67')],_0x5e7e26);};var _0x814e83=function(_0x5ddc25){if(!_0x5ddc25||!_0x5ddc25[_0x20de('0x68')]['length']){return'';}for(var _0x142de='(',_0x1207e4=0x0;_0x1207e4<_0x5ddc25[_0x20de('0x68')][_0x20de('0x47')];_0x1207e4+=0x1){_0x1207e4>0x0&&(_0x142de+='\x20'+_0x5ddc25[_0x20de('0x69')]+'\x20');_0x142de+=_0x5ddc25['rules'][_0x1207e4][_0x20de('0x6a')]?_0x814e83(_0x5ddc25['rules'][_0x1207e4][_0x20de('0x6a')]):_0x5ddc25[_0x20de('0x68')][_0x1207e4]['field']+'\x20'+_0x5ddc25[_0x20de('0x68')][_0x1207e4][_0x20de('0x6b')]+(_0x3a8d51(_0x5ddc25[_0x20de('0x68')][_0x1207e4]['condition'])?'\x20'+_0x5ddc25[_0x20de('0x68')][_0x1207e4][_0x20de('0x6c')]:'');}return _0x142de+')';};var _0x1e987f={'where':{'id':_0x96cdcb[_0x20de('0x53')]['id']}},_0x4ed5c7,_0x117f53,_0x158d52,_0x39929e,_0x3e2a2f;_0x1e987f=_['merge']({},_0x1e987f,_0x96cdcb[_0x20de('0x40')]);return db[_0x20de('0x2e')][_0x20de('0x48')](_0x1e987f)[_0x20de('0x23')](function(_0x197557){if(_0x197557){_0x4ed5c7=_0x197557;return _0x197557[_0x20de('0x6d')]();}return null;})[_0x20de('0x23')](function(_0x8bb939){if(_0x8bb939){if(!_0x8bb939[_0x20de('0x47')]){throw new db[(_0x20de('0x6e'))][(_0x20de('0x6f'))](_0x20de('0x70'),0x193);}_0x117f53=_0x8bb939;return db[_0x20de('0x71')][_0x20de('0x43')]({'raw':!![]});}return null;})[_0x20de('0x23')](function(_0x1d6e97){if(_0x1d6e97){_0x158d52=_[_0x20de('0x72')](_0x1d6e97,'id');var _0x3d0241;var _0x266299=squel[_0x20de('0x73')]();_0x266299[_0x20de('0x74')](_0x4ed5c7[_0x20de('0x75')]);for(var _0x128653=0x0;_0x128653<_0x117f53[_0x20de('0x47')];_0x128653+=0x1){_0x3d0241=_0x117f53[_0x128653][_0x20de('0x76')]?_0x158d52[_0x117f53[_0x128653][_0x20de('0x76')]]['metric']:_0x117f53[_0x128653][_0x20de('0x77')];_0x3d0241=_0x117f53[_0x128653][_0x20de('0x78')]?_[_0x20de('0x79')](_0x24a16b[_0x117f53[_0x128653][_0x20de('0x78')]],'%s',_0x3d0241):_0x3d0241;_0x3d0241=_0x117f53[_0x128653][_0x20de('0x7a')]?_['replace'](_0x3983bd[_0x117f53[_0x128653]['format']],'%s',_0x3d0241):_0x3d0241;if(_0x117f53[_0x128653]['groupBy']){_0x266299['group'](_0x3d0241);}_0x117f53[_0x128653][_0x20de('0x7b')]&&_0x266299[_0x20de('0x3a')](_0x3d0241,_0x117f53[_0x128653][_0x20de('0x7b')]===_0x20de('0x7c')?![]:!![]);_0x266299[_0x20de('0x77')](_0x3d0241,_0x117f53[_0x128653][_0x20de('0x7d')]||_0x3d0241);}if(_0x4ed5c7[_0x20de('0x7e')]){_0x4ed5c7[_0x20de('0x7e')]=JSON['parse'](_0x4ed5c7[_0x20de('0x7e')]);for(var _0x8a21d9=0x0;_0x8a21d9<_0x4ed5c7[_0x20de('0x7e')][_0x20de('0x47')];_0x8a21d9+=0x1){if(_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x31')]&&_['includes'](_0x5f19a4,_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x31')])&&_0x4ed5c7['joins'][_0x8a21d9]['parentKey']&&_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x7f')]&&_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9]['foreignKey']){_0x266299[_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9]['type']](_0x4ed5c7['joins'][_0x8a21d9]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4ed5c7[_0x20de('0x75')],_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x80')],_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9][_0x20de('0x7f')],_0x4ed5c7[_0x20de('0x7e')][_0x8a21d9]['foreignKey']));}}}if(_0x4ed5c7[_0x20de('0x81')]){_0x4ed5c7[_0x20de('0x81')]=JSON['parse'](_0x4ed5c7[_0x20de('0x81')]);_0x266299[_0x20de('0x3c')](_0x814e83(_0x4ed5c7[_0x20de('0x81')][_0x20de('0x6a')]));}_0x3e2a2f=_0x266299[_0x20de('0x82')]();_0x266299[_0x20de('0x1c')](_0x446dc2);_0x266299[_0x20de('0x1e')](0x0);logger[_0x20de('0x83')](_0x20de('0x84'),_0x266299[_0x20de('0x85')]());return dbH['sequelize']['query'](_0x266299[_0x20de('0x85')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x20de('0x23')](respondWithResult(_0x3cdf99,null))[_0x20de('0x45')](handleError(_0x3cdf99,null));};function runReport(_0x4e7b85,_0xe3aa,_0x52f3da){var _0x722e15=_0xe3aa[_0x20de('0x2a')];var _0x33b510=0xa;var _0x31099a=[_0x20de('0x55'),'left_join',_0x20de('0x57'),_0x20de('0x58')];var _0x227154={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x20de('0x5b'),'MAX':_0x20de('0x5c'),'MIN':_0x20de('0x86'),'AVG':_0x20de('0x87'),'GROUP_CONCAT':_0x20de('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x20de('0x5f')};var _0x3fbde9={'SEC_TO_TIME':_0x20de('0x88'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x20de('0x61'),'UNIX_TIMESTAMP':_0x20de('0x62')};var _0x1dbd8f=function(_0x588564){return!_[_0x20de('0x63')]([_0x20de('0x64'),_0x20de('0x65'),_0x20de('0x66'),_0x20de('0x67')],_0x588564);};var _0x236f5f=function(_0x2e7f49){if(!_0x2e7f49||!_0x2e7f49[_0x20de('0x68')][_0x20de('0x47')]){return'';}for(var _0x2479a4='(',_0x33ff2d=0x0;_0x33ff2d<_0x2e7f49[_0x20de('0x68')][_0x20de('0x47')];_0x33ff2d+=0x1){_0x33ff2d>0x0&&(_0x2479a4+='\x20'+_0x2e7f49[_0x20de('0x69')]+'\x20');_0x2479a4+=_0x2e7f49[_0x20de('0x68')][_0x33ff2d][_0x20de('0x6a')]?_0x236f5f(_0x2e7f49[_0x20de('0x68')][_0x33ff2d][_0x20de('0x6a')]):_0x2e7f49[_0x20de('0x68')][_0x33ff2d][_0x20de('0x77')]+'\x20'+_0x2e7f49['rules'][_0x33ff2d][_0x20de('0x6b')]+(_0x1dbd8f(_0x2e7f49['rules'][_0x33ff2d][_0x20de('0x6b')])?'\x20'+_0x2e7f49[_0x20de('0x68')][_0x33ff2d]['value']:'');}return _0x2479a4+')';};var _0x436bbc={'where':{'id':_0x4e7b85['id']}},_0x17bd43,_0x251755,_0x452c4b,_0x22d9a2,_0x3a2178;_0x436bbc=_['merge']({},_0x436bbc,_0x52f3da);return db[_0x20de('0x2e')][_0x20de('0x48')](_0x436bbc)[_0x20de('0x23')](function(_0x20efee){if(_0x20efee){_0x17bd43=_0x20efee;return _0x20efee['getFields']();}return null;})[_0x20de('0x23')](function(_0x403d4f){if(_0x403d4f){if(!_0x403d4f[_0x20de('0x47')]){throw new db[(_0x20de('0x6e'))]['ValidationErrorItem'](_0x20de('0x70'),0x193);}_0x251755=_0x403d4f;return db[_0x20de('0x71')][_0x20de('0x43')]({'raw':!![]});}return null;})['then'](function(_0xd45925){if(_0xd45925){_0x452c4b=_['keyBy'](_0xd45925,'id');var _0x32da10;var _0x59138f=squel[_0x20de('0x73')]();_0x59138f['from'](_0x17bd43[_0x20de('0x75')]);for(var _0x3f6685=0x0;_0x3f6685<_0x251755[_0x20de('0x47')];_0x3f6685+=0x1){_0x32da10=_0x251755[_0x3f6685][_0x20de('0x76')]?_0x452c4b[_0x251755[_0x3f6685]['MetricId']][_0x20de('0x89')]:_0x251755[_0x3f6685][_0x20de('0x77')];_0x32da10=_0x251755[_0x3f6685][_0x20de('0x78')]?_[_0x20de('0x79')](_0x227154[_0x251755[_0x3f6685]['function']],'%s',_0x32da10):_0x32da10;_0x32da10=_0x251755[_0x3f6685][_0x20de('0x7a')]?_[_0x20de('0x79')](_0x3fbde9[_0x251755[_0x3f6685]['format']],'%s',_0x32da10):_0x32da10;if(_0x251755[_0x3f6685][_0x20de('0x8a')]){_0x59138f[_0x20de('0x6a')](_0x32da10);}_0x251755[_0x3f6685][_0x20de('0x7b')]&&_0x59138f[_0x20de('0x3a')](_0x32da10,_0x251755[_0x3f6685]['orderBy']===_0x20de('0x7c')?![]:!![]);_0x59138f['field'](_0x32da10,_0x251755[_0x3f6685][_0x20de('0x7d')]||_0x32da10);}if(_0x17bd43[_0x20de('0x7e')]){_0x17bd43[_0x20de('0x7e')]=JSON['parse'](_0x17bd43[_0x20de('0x7e')]);for(var _0x30a7b3=0x0;_0x30a7b3<_0x17bd43[_0x20de('0x7e')][_0x20de('0x47')];_0x30a7b3+=0x1){if(_0x17bd43[_0x20de('0x7e')][_0x30a7b3]['type']&&_['includes'](_0x31099a,_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x31')])&&_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x80')]&&_0x17bd43[_0x20de('0x7e')][_0x30a7b3]['foreignTable']&&_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x8b')]){_0x59138f[_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x31')]](_0x17bd43[_0x20de('0x7e')][_0x30a7b3]['foreignTable'],null,util[_0x20de('0x7a')](_0x20de('0x8c'),_0x17bd43[_0x20de('0x75')],_0x17bd43['joins'][_0x30a7b3][_0x20de('0x80')],_0x17bd43[_0x20de('0x7e')][_0x30a7b3][_0x20de('0x7f')],_0x17bd43[_0x20de('0x7e')][_0x30a7b3]['foreignKey']));}}}if(_0x17bd43[_0x20de('0x81')]){_0x17bd43[_0x20de('0x81')]=JSON[_0x20de('0x8d')](_0x17bd43['conditions']);_0x59138f[_0x20de('0x3c')](_0x236f5f(_0x17bd43[_0x20de('0x81')]['group']));}_0x3a2178=_0x59138f['clone']();_0x59138f[_0x20de('0x1c')](_0x33b510);_0x59138f[_0x20de('0x1e')](0x0);return;}})[_0x20de('0x23')](function(){if(_0xe3aa[_0x20de('0x8e')]===_0x20de('0x8f')){return null;}var _0x390d5a=_[_0x20de('0x3e')](_0xe3aa,{'name':_0xe3aa[_0x20de('0x90')]||_0xe3aa[_0x20de('0x2a')]||_0x17bd43[_0x20de('0x2a')],'basename':_0x722e15,'savename':util[_0x20de('0x7a')](_0x20de('0x91'),_0xe3aa[_0x20de('0x2a')]||_0x17bd43['name'],require(_0x20de('0x92'))[_0x20de('0x93')](0x4),_0xe3aa[_0x20de('0x8e')]||_0x20de('0x94')),'reportId':_0x17bd43['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x20de('0x49')](_0x390d5a,{'raw':!![]});})[_0x20de('0x23')](function(_0x5a0153){if(_0x17bd43[_0x20de('0x75')]===_0x20de('0x95')){_0x3a2178[_0x20de('0x3c')](_0x17bd43[_0x20de('0x75')]+_0x20de('0x96'),_0xe3aa[_0x20de('0x97')],_0xe3aa[_0x20de('0x98')]);}else{_0x3a2178[_0x20de('0x3c')](_0x17bd43[_0x20de('0x75')]+_0x20de('0x99'),_0xe3aa['startDate'],_0xe3aa[_0x20de('0x98')]);}if(_0x5a0153){logger['info']('Run\x20Query:',_0x3a2178[_0x20de('0x85')]());require(_0x20de('0x9a'))['fork'](path[_0x20de('0x55')](__dirname,_0x20de('0x9b'),_0x5a0153['output']),[_0x5a0153['id'],_0x3a2178[_0x20de('0x85')](),path[_0x20de('0x55')](__dirname,_0x20de('0x9c'),_0x5a0153[_0x20de('0x9d')]),_0x722e15]);return _0x5a0153;}else{var _0x2f8aa2=squel[_0x20de('0x73')]();_0x2f8aa2[_0x20de('0x74')]('('+_0x3a2178['toString']()+')',_0x20de('0x9e'));_0x2f8aa2[_0x20de('0x77')]('COUNT(*)',_0x20de('0x1d'));_0x3a2178[_0x20de('0x1c')](_0xe3aa['limit']||_0x33b510);_0x3a2178[_0x20de('0x1e')](_0xe3aa['offset']||0x0);return dbH[_0x20de('0x9f')][_0x20de('0x34')](_0x2f8aa2[_0x20de('0x85')](),{'type':dbH['sequelize'][_0x20de('0xa0')][_0x20de('0xa1')]})[_0x20de('0x23')](function(_0x2fc5fd){if(!_0x2fc5fd[_0x20de('0x47')]){_0x22d9a2=0x0;}else{_0x22d9a2=_0x2fc5fd[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3a2178[_0x20de('0x85')](),{'type':dbH[_0x20de('0x9f')][_0x20de('0xa0')][_0x20de('0xa1')]});})[_0x20de('0x23')](function(_0x86a25b){return{'rows':_0x86a25b||[],'count':_0x22d9a2};});}});}exports[_0x20de('0xa2')]=function(_0x221f00,_0x304bef){return runReport(_0x221f00[_0x20de('0x53')],_0x221f00[_0x20de('0x34')],_0x221f00[_0x20de('0x40')])[_0x20de('0x23')](respondWithResult(_0x304bef,null))[_0x20de('0x45')](handleError(_0x304bef,null));};exports[_0x20de('0xa3')]=runReport;exports[_0x20de('0x34')]=function(_0x1580b8,_0x5aab19){var _0x3f56bd=0xa;var _0x48fbc2=['join',_0x20de('0x56'),_0x20de('0x57'),'cross_join'];var _0x1de069={'SUM':_0x20de('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x20de('0x5b'),'MAX':_0x20de('0x5c'),'MIN':'MIN(%s)','AVG':_0x20de('0x87'),'GROUP_CONCAT':_0x20de('0x5d'),'GROUP_CONCAT ASC':_0x20de('0x5e'),'GROUP_CONCAT DESC':_0x20de('0x5f')};var _0x27e217={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x20de('0xa4'),'HOUR':'HOUR(%s)','ROUND':_0x20de('0x61'),'UNIX_TIMESTAMP':_0x20de('0x62')};var _0x1cbb97=function(_0x20dbb0){return!_[_0x20de('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x20de('0x67')],_0x20dbb0);};var _0x2bad66=function(_0xe52e8b){if(!_0xe52e8b||!_0xe52e8b[_0x20de('0x68')]['length']){return'';}for(var _0x540439='(',_0x2de639=0x0;_0x2de639<_0xe52e8b[_0x20de('0x68')]['length'];_0x2de639+=0x1){_0x2de639>0x0&&(_0x540439+='\x20'+_0xe52e8b['operator']+'\x20');_0x540439+=_0xe52e8b[_0x20de('0x68')][_0x2de639][_0x20de('0x6a')]?_0x2bad66(_0xe52e8b['rules'][_0x2de639][_0x20de('0x6a')]):_0xe52e8b[_0x20de('0x68')][_0x2de639]['field']+'\x20'+_0xe52e8b[_0x20de('0x68')][_0x2de639][_0x20de('0x6b')]+(_0x1cbb97(_0xe52e8b[_0x20de('0x68')][_0x2de639][_0x20de('0x6b')])?'\x20'+_0xe52e8b[_0x20de('0x68')][_0x2de639][_0x20de('0x6c')]:'');}return _0x540439+')';};var _0x2e2a9b={'where':{'id':_0x1580b8[_0x20de('0x53')]['id']}},_0x270220,_0x1b8e0c,_0x4078c,_0x2df4ef,_0x4fbbfb;_0x2e2a9b=_[_0x20de('0x3e')]({},_0x2e2a9b,_0x1580b8[_0x20de('0x40')]);return db['AnalyticCustomReport'][_0x20de('0x48')](_0x2e2a9b)[_0x20de('0x23')](function(_0x553613){if(_0x553613){_0x270220=_0x553613;return _0x553613['getFields']();}return null;})['then'](function(_0x557b26){if(_0x557b26){if(!_0x557b26[_0x20de('0x47')]){throw new db[(_0x20de('0x6e'))][(_0x20de('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1b8e0c=_0x557b26;return db['AnalyticMetric'][_0x20de('0x43')]({'raw':!![]});}return null;})[_0x20de('0x23')](function(_0x2e440d){if(_0x2e440d){_0x4078c=_[_0x20de('0x72')](_0x2e440d,'id');var _0x442d11;var _0x19a903=squel[_0x20de('0x73')]();_0x19a903[_0x20de('0x74')](_0x270220[_0x20de('0x75')]);for(var _0x6081b7=0x0;_0x6081b7<_0x1b8e0c[_0x20de('0x47')];_0x6081b7+=0x1){_0x442d11=_0x1b8e0c[_0x6081b7][_0x20de('0x76')]?_0x4078c[_0x1b8e0c[_0x6081b7][_0x20de('0x76')]][_0x20de('0x89')]:_0x1b8e0c[_0x6081b7][_0x20de('0x77')];_0x442d11=_0x1b8e0c[_0x6081b7][_0x20de('0x78')]?_[_0x20de('0x79')](_0x1de069[_0x1b8e0c[_0x6081b7][_0x20de('0x78')]],'%s',_0x442d11):_0x442d11;_0x442d11=_0x1b8e0c[_0x6081b7]['format']?_[_0x20de('0x79')](_0x27e217[_0x1b8e0c[_0x6081b7][_0x20de('0x7a')]],'%s',_0x442d11):_0x442d11;if(_0x1b8e0c[_0x6081b7][_0x20de('0x8a')]){_0x19a903[_0x20de('0x6a')](_0x442d11);}_0x1b8e0c[_0x6081b7][_0x20de('0x7b')]&&_0x19a903[_0x20de('0x3a')](_0x442d11,_0x1b8e0c[_0x6081b7][_0x20de('0x7b')]==='DESC'?![]:!![]);_0x19a903['field'](_0x442d11,_0x1b8e0c[_0x6081b7][_0x20de('0x7d')]||_0x442d11);}if(_0x270220[_0x20de('0x7e')]){_0x270220[_0x20de('0x7e')]=JSON[_0x20de('0x8d')](_0x270220[_0x20de('0x7e')]);for(var _0x53f423=0x0;_0x53f423<_0x270220[_0x20de('0x7e')]['length'];_0x53f423+=0x1){if(_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x31')]&&_[_0x20de('0x63')](_0x48fbc2,_0x270220['joins'][_0x53f423][_0x20de('0x31')])&&_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x80')]&&_0x270220['joins'][_0x53f423][_0x20de('0x7f')]&&_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x8b')]){_0x19a903[_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x31')]](_0x270220[_0x20de('0x7e')][_0x53f423]['foreignTable'],null,util[_0x20de('0x7a')](_0x20de('0x8c'),_0x270220[_0x20de('0x75')],_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x80')],_0x270220['joins'][_0x53f423][_0x20de('0x7f')],_0x270220[_0x20de('0x7e')][_0x53f423][_0x20de('0x8b')]));}}}if(_0x270220[_0x20de('0x81')]){_0x270220[_0x20de('0x81')]=JSON[_0x20de('0x8d')](_0x270220['conditions']);_0x19a903['where'](_0x2bad66(_0x270220['conditions'][_0x20de('0x6a')]));}_0x4fbbfb=_0x19a903[_0x20de('0x82')]();_0x19a903[_0x20de('0x1c')](_0x3f56bd);_0x19a903[_0x20de('0x1e')](0x0);logger[_0x20de('0x83')](_0x20de('0x84'),_0x19a903[_0x20de('0x85')]());return dbH[_0x20de('0x9f')]['query'](_0x19a903['toString'](),{'type':dbH[_0x20de('0x9f')]['QueryTypes'][_0x20de('0xa1')]});}})[_0x20de('0x23')](function(){return{'sql':_0x4fbbfb[_0x20de('0x85')]()};})[_0x20de('0x23')](respondWithResult(_0x5aab19,null))[_0x20de('0x45')](handleError(_0x5aab19,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index cbfcf11..9c76b60 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 _0x5a17=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports'];(function(_0x24a9eb,_0x3849df){var _0x37a2c7=function(_0x284101){while(--_0x284101){_0x24a9eb['push'](_0x24a9eb['shift']());}};_0x37a2c7(++_0x3849df);}(_0x5a17,0x84));var _0x75a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x75a1('0x0'));var util=require('util');var logger=require(_0x75a1('0x1'))(_0x75a1('0x2'));var moment=require(_0x75a1('0x3'));var BPromise=require(_0x75a1('0x4'));var rp=require(_0x75a1('0x5'));var fs=require('fs');var path=require(_0x75a1('0x6'));var rimraf=require(_0x75a1('0x7'));var config=require(_0x75a1('0x8'));var attributes=require(_0x75a1('0x9'));module['exports']=function(_0xec4bca,_0x222bf8){return _0xec4bca[_0x75a1('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x75a1('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c05=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x1a20ec,_0x27626c){var _0x3a2ec1=function(_0xb45d54){while(--_0xb45d54){_0x1a20ec['push'](_0x1a20ec['shift']());}};_0x3a2ec1(++_0x27626c);}(_0x7c05,0x1d5));var _0x57c0=function(_0x1635fe,_0x5f1d9f){_0x1635fe=_0x1635fe-0x0;var _0x3c512a=_0x7c05[_0x1635fe];return _0x3c512a;};'use strict';var _=require('lodash');var util=require(_0x57c0('0x0'));var logger=require(_0x57c0('0x1'))(_0x57c0('0x2'));var moment=require(_0x57c0('0x3'));var BPromise=require(_0x57c0('0x4'));var rp=require(_0x57c0('0x5'));var fs=require('fs');var path=require(_0x57c0('0x6'));var rimraf=require(_0x57c0('0x7'));var config=require(_0x57c0('0x8'));var attributes=require(_0x57c0('0x9'));module[_0x57c0('0xa')]=function(_0x5105cf,_0x51f340){return _0x5105cf['define']('AnalyticCustomReport',attributes,{'tableName':_0x57c0('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 5d093e6..40fe6e6 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 _0xf7f3=['result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf7f3,0x10c));var _0x3f7f=function(_0x49ee10,_0x5803dc){_0x49ee10=_0x49ee10-0x0;var _0x36baa9=_0xf7f3[_0x49ee10];return _0x36baa9;};'use strict';var _=require(_0x3f7f('0x0'));var util=require(_0x3f7f('0x1'));var moment=require(_0x3f7f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3f7f('0x4'))(_0x3f7f('0x5'));var config=require(_0x3f7f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3f7f('0x7')][_0x3f7f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x402b51,_0x2008d0,_0x337d1e){return new BPromise(function(_0x526ed8,_0x135905){return client['request'](_0x402b51,_0x337d1e)['then'](function(_0x3339d0){logger['info'](_0x3f7f('0x9'),_0x2008d0,_0x3f7f('0xa'));logger[_0x3f7f('0xb')](_0x3f7f('0xc'),_0x2008d0,_0x3f7f('0xa'),JSON['stringify'](_0x3339d0));if(_0x3339d0[_0x3f7f('0xd')]){if(_0x3339d0[_0x3f7f('0xd')][_0x3f7f('0xe')]===0x1f4){logger[_0x3f7f('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2008d0,_0x3339d0[_0x3f7f('0xd')][_0x3f7f('0xf')]);return _0x135905(_0x3339d0['error'][_0x3f7f('0xf')]);}logger[_0x3f7f('0xd')](_0x3f7f('0x9'),_0x2008d0,_0x3339d0[_0x3f7f('0xd')]['message']);return _0x526ed8(_0x3339d0['error'][_0x3f7f('0xf')]);}else{logger[_0x3f7f('0x10')](_0x3f7f('0x9'),_0x2008d0,_0x3f7f('0xa'));_0x526ed8(_0x3339d0[_0x3f7f('0x11')]['message']);}})[_0x3f7f('0x12')](function(_0xb62c0d){logger[_0x3f7f('0xd')](_0x3f7f('0x9'),_0x2008d0,_0xb62c0d);_0x135905(_0xb62c0d);});});}
\ No newline at end of file
+var _0x9bfd=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2a16ef,_0x535d6e){var _0x153854=function(_0x456a96){while(--_0x456a96){_0x2a16ef['push'](_0x2a16ef['shift']());}};_0x153854(++_0x535d6e);}(_0x9bfd,0x1db));var _0xd9bf=function(_0x3edf99,_0x4e6e49){_0x3edf99=_0x3edf99-0x0;var _0x4517ab=_0x9bfd[_0x3edf99];return _0x4517ab;};'use strict';var _=require(_0xd9bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd9bf('0x1'));var rs=require(_0xd9bf('0x2'));var fs=require('fs');var Redis=require(_0xd9bf('0x3'));var db=require(_0xd9bf('0x4'))['db'];var utils=require(_0xd9bf('0x5'));var logger=require(_0xd9bf('0x6'))('rpc');var config=require(_0xd9bf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd9bf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52015c,_0x547af8,_0x4ca0d9){return new BPromise(function(_0x41cbc8,_0x5652b1){return client[_0xd9bf('0x9')](_0x52015c,_0x4ca0d9)[_0xd9bf('0xa')](function(_0x698c3f){logger[_0xd9bf('0xb')](_0xd9bf('0xc'),_0x547af8,_0xd9bf('0xd'));logger['debug'](_0xd9bf('0xe'),_0x547af8,'request\x20sent',JSON[_0xd9bf('0xf')](_0x698c3f));if(_0x698c3f[_0xd9bf('0x10')]){if(_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x547af8,_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x12')]);return _0x5652b1(_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x12')]);}logger[_0xd9bf('0x10')](_0xd9bf('0xc'),_0x547af8,_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x12')]);return _0x41cbc8(_0x698c3f[_0xd9bf('0x10')][_0xd9bf('0x12')]);}else{logger[_0xd9bf('0xb')](_0xd9bf('0xc'),_0x547af8,_0xd9bf('0xd'));_0x41cbc8(_0x698c3f['result'][_0xd9bf('0x12')]);}})[_0xd9bf('0x13')](function(_0x1ec35f){logger['error'](_0xd9bf('0xc'),_0x547af8,_0x1ec35f);_0x5652b1(_0x1ec35f);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 95b5ec1..b35b63c 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 _0x3128=['/:id/run','run','/:id/query','post','create','put','/:id','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id/preview','preview'];(function(_0x2b58f8,_0x14f865){var _0x2af05b=function(_0x2c2bf3){while(--_0x2c2bf3){_0x2b58f8['push'](_0x2b58f8['shift']());}};_0x2af05b(++_0x14f865);}(_0x3128,0xd0));var _0x8312=function(_0x1e715a,_0x47db84){_0x1e715a=_0x1e715a-0x0;var _0x262f09=_0x3128[_0x1e715a];return _0x262f09;};'use strict';var multer=require(_0x8312('0x0'));var util=require(_0x8312('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8312('0x2'));var router=express[_0x8312('0x3')]();var fs_extra=require(_0x8312('0x4'));var auth=require(_0x8312('0x5'));var interaction=require(_0x8312('0x6'));var config=require('../../config/environment');var controller=require(_0x8312('0x7'));router[_0x8312('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8312('0x8')]('/:id',auth[_0x8312('0x9')](),controller['show']);router[_0x8312('0x8')](_0x8312('0xa'),auth[_0x8312('0x9')](),controller[_0x8312('0xb')]);router[_0x8312('0x8')](_0x8312('0xc'),auth['isAuthenticated'](),controller[_0x8312('0xd')]);router['get'](_0x8312('0xe'),auth[_0x8312('0x9')](),controller['query']);router[_0x8312('0xf')]('/',auth['isAuthenticated'](),controller[_0x8312('0x10')]);router[_0x8312('0x11')](_0x8312('0x12'),auth[_0x8312('0x9')](),controller['update']);router[_0x8312('0x13')](_0x8312('0x12'),auth[_0x8312('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x02cf=['preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview'];(function(_0x3ce43b,_0x23c483){var _0x195a45=function(_0x35ce15){while(--_0x35ce15){_0x3ce43b['push'](_0x3ce43b['shift']());}};_0x195a45(++_0x23c483);}(_0x02cf,0x8e));var _0xf02c=function(_0x1005b0,_0x4a2c2c){_0x1005b0=_0x1005b0-0x0;var _0x47ba52=_0x02cf[_0x1005b0];return _0x47ba52;};'use strict';var multer=require(_0xf02c('0x0'));var util=require(_0xf02c('0x1'));var path=require(_0xf02c('0x2'));var timeout=require('connect-timeout');var express=require(_0xf02c('0x3'));var router=express[_0xf02c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf02c('0x5'));var interaction=require(_0xf02c('0x6'));var config=require(_0xf02c('0x7'));var controller=require(_0xf02c('0x8'));router[_0xf02c('0x9')]('/',auth[_0xf02c('0xa')](),controller[_0xf02c('0xb')]);router[_0xf02c('0x9')]('/:id',auth[_0xf02c('0xa')](),controller[_0xf02c('0xc')]);router[_0xf02c('0x9')](_0xf02c('0xd'),auth[_0xf02c('0xa')](),controller[_0xf02c('0xe')]);router['get'](_0xf02c('0xf'),auth['isAuthenticated'](),controller[_0xf02c('0x10')]);router[_0xf02c('0x9')](_0xf02c('0x11'),auth[_0xf02c('0xa')](),controller[_0xf02c('0x12')]);router[_0xf02c('0x13')]('/',auth['isAuthenticated'](),controller[_0xf02c('0x14')]);router[_0xf02c('0x15')](_0xf02c('0x16'),auth[_0xf02c('0xa')](),controller[_0xf02c('0x17')]);router['delete'](_0xf02c('0x16'),auth[_0xf02c('0xa')](),controller[_0xf02c('0x18')]);module[_0xf02c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index f0f4e98..f38e47a 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x3633ca,_0x1396a7){var _0x9d28b6=function(_0x8e9faa){while(--_0x8e9faa){_0x3633ca['push'](_0x3633ca['shift']());}};_0x9d28b6(++_0x1396a7);}(_0x7217,0x19e));var _0x7721=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7217[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x207c=['STRING','TEXT','exports'];(function(_0x5e8e3f,_0x3b69e9){var _0x45f87c=function(_0x5accb4){while(--_0x5accb4){_0x5e8e3f['push'](_0x5e8e3f['shift']());}};_0x45f87c(++_0x3b69e9);}(_0x207c,0x1e8));var _0xc207=function(_0x5538a4,_0xe0b8b0){_0x5538a4=_0x5538a4-0x0;var _0x530a52=_0x207c[_0x5538a4];return _0x530a52;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 3ae2a5e..a59281a 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 _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x3c72b9,_0xb5650a){var _0x39ff7a=function(_0x45440d){while(--_0x45440d){_0x3c72b9['push'](_0x3c72b9['shift']());}};_0x39ff7a(++_0xb5650a);}(_0x1261,0x144));var _0x1126=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0x1261[_0x40e854];return _0x1463b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
+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(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xabce[_0x25bea7];return _0x175952;};'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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 23e6d79..660fa8a 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 _0xbc48=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0xbc48,0x1e5));var _0x8bc4=function(_0x353d70,_0x139687){_0x353d70=_0x353d70-0x0;var _0x3ac2cd=_0xbc48[_0x353d70];return _0x3ac2cd;};'use strict';var _=require(_0x8bc4('0x0'));var util=require(_0x8bc4('0x1'));var logger=require(_0x8bc4('0x2'))(_0x8bc4('0x3'));var moment=require(_0x8bc4('0x4'));var BPromise=require(_0x8bc4('0x5'));var rp=require(_0x8bc4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bc4('0x7'));var config=require(_0x8bc4('0x8'));var attributes=require(_0x8bc4('0x9'));module['exports']=function(_0xf0590e,_0x34c2de){return _0xf0590e[_0x8bc4('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x8bc4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x955b=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','AnalyticDefaultReport'];(function(_0x22b028,_0x121029){var _0x535ac3=function(_0x10489a){while(--_0x10489a){_0x22b028['push'](_0x22b028['shift']());}};_0x535ac3(++_0x121029);}(_0x955b,0x6c));var _0xb955=function(_0x6dd9df,_0x30408f){_0x6dd9df=_0x6dd9df-0x0;var _0x4876f8=_0x955b[_0x6dd9df];return _0x4876f8;};'use strict';var _=require(_0xb955('0x0'));var util=require('util');var logger=require(_0xb955('0x1'))(_0xb955('0x2'));var moment=require(_0xb955('0x3'));var BPromise=require(_0xb955('0x4'));var rp=require(_0xb955('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb955('0x6'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0xb955('0x7')]=function(_0x4afbf0,_0x3d3cf0){return _0x4afbf0['define'](_0xb955('0x8'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 9334b5a..1fdc939 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 _0x839d=['request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x4b947b,_0x2c9616){var _0x3e2ad4=function(_0x26aea0){while(--_0x26aea0){_0x4b947b['push'](_0x4b947b['shift']());}};_0x3e2ad4(++_0x2c9616);}(_0x839d,0x1ac));var _0xd839=function(_0x3ecd89,_0x382241){_0x3ecd89=_0x3ecd89-0x0;var _0x336a23=_0x839d[_0x3ecd89];return _0x336a23;};'use strict';var _=require('lodash');var util=require(_0xd839('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd839('0x1'));var db=require(_0xd839('0x2'))['db'];var utils=require(_0xd839('0x3'));var logger=require(_0xd839('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd839('0x5'));var client=jayson['client'][_0xd839('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xe800ae,_0x45e25b,_0x203ce3){return new BPromise(function(_0x5290b4,_0x2f2dfc){return client[_0xd839('0x7')](_0xe800ae,_0x203ce3)['then'](function(_0x29c40c){logger['info'](_0xd839('0x8'),_0x45e25b,_0xd839('0x9'));logger[_0xd839('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x45e25b,_0xd839('0x9'),JSON[_0xd839('0xb')](_0x29c40c));if(_0x29c40c[_0xd839('0xc')]){if(_0x29c40c[_0xd839('0xc')]['code']===0x1f4){logger['error'](_0xd839('0x8'),_0x45e25b,_0x29c40c['error']['message']);return _0x2f2dfc(_0x29c40c['error'][_0xd839('0xd')]);}logger[_0xd839('0xc')](_0xd839('0x8'),_0x45e25b,_0x29c40c[_0xd839('0xc')][_0xd839('0xd')]);return _0x5290b4(_0x29c40c[_0xd839('0xc')][_0xd839('0xd')]);}else{logger['info'](_0xd839('0x8'),_0x45e25b,'request\x20sent');_0x5290b4(_0x29c40c[_0xd839('0xe')][_0xd839('0xd')]);}})['catch'](function(_0x1bfd00){logger[_0xd839('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x45e25b,_0x1bfd00);_0x2f2dfc(_0x1bfd00);});});}
\ No newline at end of file
+var _0xf1ca=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1eac7d,_0x58765d){var _0x3ad894=function(_0x45bf38){while(--_0x45bf38){_0x1eac7d['push'](_0x1eac7d['shift']());}};_0x3ad894(++_0x58765d);}(_0xf1ca,0x1b4));var _0xaf1c=function(_0x49bc5b,_0x5ee349){_0x49bc5b=_0x49bc5b-0x0;var _0x341774=_0xf1ca[_0x49bc5b];return _0x341774;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xaf1c('0x0'));var rs=require(_0xaf1c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf1c('0x2'))['db'];var utils=require(_0xaf1c('0x3'));var logger=require(_0xaf1c('0x4'))(_0xaf1c('0x5'));var config=require(_0xaf1c('0x6'));var jayson=require(_0xaf1c('0x7'));var client=jayson[_0xaf1c('0x8')][_0xaf1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a917,_0x1a0d6a,_0x40107d){return new BPromise(function(_0x1a04a2,_0x408011){return client[_0xaf1c('0xa')](_0x14a917,_0x40107d)[_0xaf1c('0xb')](function(_0x43d318){logger[_0xaf1c('0xc')](_0xaf1c('0xd'),_0x1a0d6a,'request\x20sent');logger[_0xaf1c('0xe')](_0xaf1c('0xf'),_0x1a0d6a,_0xaf1c('0x10'),JSON[_0xaf1c('0x11')](_0x43d318));if(_0x43d318[_0xaf1c('0x12')]){if(_0x43d318[_0xaf1c('0x12')][_0xaf1c('0x13')]===0x1f4){logger['error'](_0xaf1c('0xd'),_0x1a0d6a,_0x43d318['error'][_0xaf1c('0x14')]);return _0x408011(_0x43d318['error']['message']);}logger[_0xaf1c('0x12')](_0xaf1c('0xd'),_0x1a0d6a,_0x43d318['error'][_0xaf1c('0x14')]);return _0x1a04a2(_0x43d318[_0xaf1c('0x12')]['message']);}else{logger['info'](_0xaf1c('0xd'),_0x1a0d6a,'request\x20sent');_0x1a04a2(_0x43d318[_0xaf1c('0x15')][_0xaf1c('0x14')]);}})['catch'](function(_0x1061c0){logger['error'](_0xaf1c('0xd'),_0x1a0d6a,_0x1061c0);_0x408011(_0x1061c0);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 9872ce3..adce959 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 _0x4bdc=['put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create'];(function(_0x521054,_0x3640cb){var _0x40af5a=function(_0x12cce1){while(--_0x12cce1){_0x521054['push'](_0x521054['shift']());}};_0x40af5a(++_0x3640cb);}(_0x4bdc,0x18c));var _0xc4bd=function(_0x2f6f5f,_0x5ed9b0){_0x2f6f5f=_0x2f6f5f-0x0;var _0x55c4dd=_0x4bdc[_0x2f6f5f];return _0x55c4dd;};'use strict';var multer=require(_0xc4bd('0x0'));var util=require(_0xc4bd('0x1'));var path=require('path');var timeout=require(_0xc4bd('0x2'));var express=require(_0xc4bd('0x3'));var router=express[_0xc4bd('0x4')]();var fs_extra=require(_0xc4bd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc4bd('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0xc4bd('0x7')](),controller[_0xc4bd('0x8')]);router[_0xc4bd('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc4bd('0xa')]);router[_0xc4bd('0x9')](_0xc4bd('0xb'),auth[_0xc4bd('0x7')](),controller[_0xc4bd('0xc')]);router['get'](_0xc4bd('0xd'),auth['isAuthenticated'](),controller[_0xc4bd('0xe')]);router[_0xc4bd('0x9')](_0xc4bd('0xf'),auth[_0xc4bd('0x7')](),controller['query']);router[_0xc4bd('0x10')]('/',auth[_0xc4bd('0x7')](),controller[_0xc4bd('0x11')]);router[_0xc4bd('0x12')](_0xc4bd('0x13'),auth['isAuthenticated'](),controller[_0xc4bd('0x14')]);router[_0xc4bd('0x15')]('/:id',auth[_0xc4bd('0x7')](),controller[_0xc4bd('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xd2f5=['../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','update','delete','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1432a6,_0x5846c5){var _0x3eab00=function(_0x33871c){while(--_0x33871c){_0x1432a6['push'](_0x1432a6['shift']());}};_0x3eab00(++_0x5846c5);}(_0xd2f5,0x144));var _0x5d2f=function(_0x243bab,_0x1ff252){_0x243bab=_0x243bab-0x0;var _0x5ed762=_0xd2f5[_0x243bab];return _0x5ed762;};'use strict';var multer=require(_0x5d2f('0x0'));var util=require('util');var path=require(_0x5d2f('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d2f('0x2'));var router=express['Router']();var fs_extra=require(_0x5d2f('0x3'));var auth=require(_0x5d2f('0x4'));var interaction=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var controller=require(_0x5d2f('0x7'));router[_0x5d2f('0x8')]('/',auth[_0x5d2f('0x9')](),controller[_0x5d2f('0xa')]);router['get'](_0x5d2f('0xb'),auth[_0x5d2f('0x9')](),controller[_0x5d2f('0xc')]);router[_0x5d2f('0x8')](_0x5d2f('0xd'),auth[_0x5d2f('0x9')](),controller['preview']);router[_0x5d2f('0x8')](_0x5d2f('0xe'),auth['isAuthenticated'](),controller[_0x5d2f('0xf')]);router[_0x5d2f('0x8')](_0x5d2f('0x10'),auth['isAuthenticated'](),controller[_0x5d2f('0x11')]);router[_0x5d2f('0x12')]('/',auth[_0x5d2f('0x9')](),controller['create']);router['put'](_0x5d2f('0xb'),auth['isAuthenticated'](),controller[_0x5d2f('0x13')]);router[_0x5d2f('0x14')]('/:id',auth[_0x5d2f('0x9')](),controller['destroy']);module[_0x5d2f('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 8afd318..ade02ca 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 _0xb989=['pdf','xlsx','DATE','Loading','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x29df6c,_0x54aa08){var _0x3afad4=function(_0xf64dbc){while(--_0xf64dbc){_0x29df6c['push'](_0x29df6c['shift']());}};_0x3afad4(++_0x54aa08);}(_0xb989,0x1db));var _0x9b98=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0xb989[_0x198446];return _0x38d7b7;};'use strict';var Sequelize=require(_0x9b98('0x0'));var moment=require(_0x9b98('0x1'));module[_0x9b98('0x2')]={'name':{'type':Sequelize[_0x9b98('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x9b98('0x4')](_0x9b98('0x5'),_0x9b98('0x6'),_0x9b98('0x7')),'allowNull':![],'defaultValue':_0x9b98('0x5')},'savename':{'type':Sequelize[_0x9b98('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9b98('0x8')]},'endDate':{'type':Sequelize[_0x9b98('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x9b98('0x9')},'type':{'type':Sequelize['ENUM']('manual',_0x9b98('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x9b98('0xb')](0xb)[_0x9b98('0xc')]},'reportType':{'type':Sequelize[_0x9b98('0x3')]}};
\ No newline at end of file
+var _0x0d69=['Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','pdf','xlsx','csv'];(function(_0x530508,_0x351210){var _0x83aeac=function(_0x439763){while(--_0x439763){_0x530508['push'](_0x530508['shift']());}};_0x83aeac(++_0x351210);}(_0x0d69,0xba));var _0x90d6=function(_0x53df14,_0xc24eba){_0x53df14=_0x53df14-0x0;var _0x4c4e2d=_0x0d69[_0x53df14];return _0x4c4e2d;};'use strict';var Sequelize=require(_0x90d6('0x0'));var moment=require('moment');module[_0x90d6('0x1')]={'name':{'type':Sequelize[_0x90d6('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x90d6('0x3'),_0x90d6('0x4')),'allowNull':![],'defaultValue':_0x90d6('0x5')},'savename':{'type':Sequelize[_0x90d6('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x90d6('0x2')],'defaultValue':_0x90d6('0x6')},'type':{'type':Sequelize[_0x90d6('0x7')](_0x90d6('0x8'),_0x90d6('0x9')),'allowNull':![],'defaultValue':_0x90d6('0x8')},'reportId':{'type':Sequelize[_0x90d6('0xa')](0xb)[_0x90d6('0xb')]},'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 8437a9c..f27c199 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 _0x9f1c=['request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','get','ExtractedReports','UserProfileResource','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','length','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','download','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x9f1c,0x1eb));var _0xc9f1=function(_0x508140,_0x1bce34){_0x508140=_0x508140-0x0;var _0x4d57d4=_0x9f1c[_0x508140];return _0x4d57d4;};'use strict';var emlformat=require(_0xc9f1('0x0'));var rimraf=require(_0xc9f1('0x1'));var zipdir=require(_0xc9f1('0x2'));var jsonpatch=require(_0xc9f1('0x3'));var rp=require(_0xc9f1('0x4'));var moment=require('moment');var BPromise=require(_0xc9f1('0x5'));var Mustache=require(_0xc9f1('0x6'));var util=require('util');var path=require(_0xc9f1('0x7'));var sox=require(_0xc9f1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9f1('0x9'));var _=require(_0xc9f1('0xa'));var squel=require(_0xc9f1('0xb'));var crypto=require('crypto');var jsforce=require(_0xc9f1('0xc'));var deskjs=require(_0xc9f1('0xd'));var toCsv=require(_0xc9f1('0xe'));var querystring=require(_0xc9f1('0xf'));var Papa=require(_0xc9f1('0x10'));var Redis=require(_0xc9f1('0x11'));var authService=require(_0xc9f1('0x12'));var qs=require(_0xc9f1('0x13'));var as=require(_0xc9f1('0x14'));var hardwareService=require(_0xc9f1('0x15'));var logger=require('../../config/logger')(_0xc9f1('0x16'));var utils=require(_0xc9f1('0x17'));var config=require(_0xc9f1('0x18'));var licenseUtil=require(_0xc9f1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x134355,_0x4c53d7){_0x4c53d7=_0x4c53d7||0xcc;return function(_0x51a917){if(_0x51a917){return _0x134355[_0xc9f1('0x1a')](_0x4c53d7);}return _0x134355[_0xc9f1('0x1b')](_0x4c53d7)[_0xc9f1('0x1c')]();};}function respondWithResult(_0x1d2ef0,_0x3178fd){_0x3178fd=_0x3178fd||0xc8;return function(_0x324426){if(_0x324426){return _0x1d2ef0['status'](_0x3178fd)[_0xc9f1('0x1d')](_0x324426);}};}function respondWithFilteredResult(_0x2798b7,_0x7d879c){return function(_0x3ef2a7){if(_0x3ef2a7){var _0x3e8bf2=typeof _0x7d879c[_0xc9f1('0x1e')]===_0xc9f1('0x1f')&&typeof _0x7d879c[_0xc9f1('0x20')]==='undefined';var _0x590391=_0x3ef2a7[_0xc9f1('0x21')];var _0x499ce1=_0x3e8bf2?0x0:_0x7d879c[_0xc9f1('0x1e')];var _0x3d6558=_0x3e8bf2?_0x3ef2a7[_0xc9f1('0x21')]:_0x7d879c[_0xc9f1('0x1e')]+_0x7d879c['limit'];var _0x3f7b5e;if(_0x3d6558>=_0x590391){_0x3d6558=_0x590391;_0x3f7b5e=0xc8;}else{_0x3f7b5e=0xce;}_0x2798b7['status'](_0x3f7b5e);return _0x2798b7['set'](_0xc9f1('0x22'),_0x499ce1+'-'+_0x3d6558+'/'+_0x590391)[_0xc9f1('0x1d')](_0x3ef2a7);}return null;};}function patchUpdates(_0xfb073){return function(_0x464383){try{jsonpatch[_0xc9f1('0x23')](_0x464383,_0xfb073,!![]);}catch(_0x3495be){return BPromise['reject'](_0x3495be);}return _0x464383[_0xc9f1('0x24')]();};}function saveUpdates(_0x26e2ea,_0x2fc0c2){return function(_0x4945fa){if(_0x4945fa){return _0x4945fa['update'](_0x26e2ea)['then'](function(_0x721f98){return _0x721f98;});}return null;};}function removeEntity(_0x534a4b,_0x95cafe){return function(_0x1b7b16){if(_0x1b7b16){return _0x1b7b16[_0xc9f1('0x25')]()[_0xc9f1('0x26')](function(){var _0x3025c0=_0x1b7b16[_0xc9f1('0x27')]({'plain':!![]});var _0x6d932=_0xc9f1('0x28');return db[_0xc9f1('0x29')][_0xc9f1('0x25')]({'where':{'type':_0x6d932,'resourceId':_0x3025c0['id']}})[_0xc9f1('0x26')](function(){return _0x1b7b16;});})[_0xc9f1('0x26')](function(){_0x534a4b[_0xc9f1('0x1b')](0xcc)[_0xc9f1('0x1c')]();});}};}function handleEntityNotFound(_0x1aa763,_0x2573d1){return function(_0x33069d){if(!_0x33069d){_0x1aa763[_0xc9f1('0x1a')](0x194);}return _0x33069d;};}function handleError(_0xcb1a0e,_0x23b457){_0x23b457=_0x23b457||0x1f4;return function(_0x31960c){logger[_0xc9f1('0x2a')](_0x31960c[_0xc9f1('0x2b')]);if(_0x31960c['name']){delete _0x31960c[_0xc9f1('0x2c')];}_0xcb1a0e[_0xc9f1('0x1b')](_0x23b457)[_0xc9f1('0x2d')](_0x31960c);};}exports['index']=function(_0x5a3e5d,_0x18e0b7){var _0x391f28={},_0x506ddb={},_0x3e3af3={'count':0x0,'rows':[]};var _0x59aff8=_['map'](db[_0xc9f1('0x2e')][_0xc9f1('0x2f')],function(_0x47e820){return{'name':_0x47e820[_0xc9f1('0x30')],'type':_0x47e820[_0xc9f1('0x31')][_0xc9f1('0x32')]};});_0x506ddb[_0xc9f1('0x33')]=_[_0xc9f1('0x34')](_0x59aff8,_0xc9f1('0x2c'));_0x506ddb[_0xc9f1('0x35')]=_[_0xc9f1('0x36')](_0x5a3e5d[_0xc9f1('0x35')]);_0x506ddb[_0xc9f1('0x37')]=_['intersection'](_0x506ddb[_0xc9f1('0x33')],_0x506ddb[_0xc9f1('0x35')]);_0x391f28[_0xc9f1('0x38')]=_[_0xc9f1('0x39')](_0x506ddb[_0xc9f1('0x33')],qs[_0xc9f1('0x3a')](_0x5a3e5d['query'][_0xc9f1('0x3a')]));_0x391f28['attributes']=_0x391f28[_0xc9f1('0x38')]['length']?_0x391f28['attributes']:_0x506ddb['model'];if(!_0x5a3e5d[_0xc9f1('0x35')][_0xc9f1('0x3b')](_0xc9f1('0x3c'))){_0x391f28['limit']=qs[_0xc9f1('0x20')](_0x5a3e5d[_0xc9f1('0x35')][_0xc9f1('0x20')]);_0x391f28[_0xc9f1('0x1e')]=qs[_0xc9f1('0x1e')](_0x5a3e5d['query'][_0xc9f1('0x1e')]);}_0x391f28[_0xc9f1('0x3d')]=qs[_0xc9f1('0x3e')](_0x5a3e5d['query']['sort']);_0x391f28[_0xc9f1('0x3f')]=qs[_0xc9f1('0x37')](_[_0xc9f1('0x40')](_0x5a3e5d[_0xc9f1('0x35')],_0x506ddb['filters']),_0x59aff8);if(_0x5a3e5d[_0xc9f1('0x35')]['filter']){_0x391f28[_0xc9f1('0x3f')]=_['merge'](_0x391f28[_0xc9f1('0x3f')],{'$or':_['map'](_0x59aff8,function(_0x581edd){if(_0x581edd[_0xc9f1('0x31')]!=='VIRTUAL'){var _0x123e24={};_0x123e24[_0x581edd[_0xc9f1('0x2c')]]={'$like':'%'+_0x5a3e5d[_0xc9f1('0x35')][_0xc9f1('0x41')]+'%'};return _0x123e24;}})});}_0x391f28=_[_0xc9f1('0x42')]({},_0x391f28,_0x5a3e5d['options']);var _0x59fb64={'where':_0x391f28[_0xc9f1('0x3f')]};return db['AnalyticExtractedReport'][_0xc9f1('0x21')](_0x59fb64)[_0xc9f1('0x26')](function(_0x3829d0){_0x3e3af3['count']=_0x3829d0;if(_0x5a3e5d[_0xc9f1('0x35')]['includeAll']){_0x391f28[_0xc9f1('0x43')]=[{'all':!![]}];}return db[_0xc9f1('0x2e')][_0xc9f1('0x44')](_0x391f28);})['then'](function(_0x2b2edf){_0x3e3af3[_0xc9f1('0x45')]=_0x2b2edf;return _0x3e3af3;})['then'](respondWithFilteredResult(_0x18e0b7,_0x391f28))[_0xc9f1('0x46')](handleError(_0x18e0b7,null));};exports[_0xc9f1('0x47')]=function(_0x412fb4,_0x5e54f7){var _0x124e6f={'raw':!![],'where':{'id':_0x412fb4['params']['id']}},_0x257861={};_0x257861[_0xc9f1('0x33')]=_[_0xc9f1('0x36')](db[_0xc9f1('0x2e')]['rawAttributes']);_0x257861[_0xc9f1('0x35')]=_[_0xc9f1('0x36')](_0x412fb4[_0xc9f1('0x35')]);_0x257861['filters']=_['intersection'](_0x257861[_0xc9f1('0x33')],_0x257861[_0xc9f1('0x35')]);_0x124e6f[_0xc9f1('0x38')]=_['intersection'](_0x257861[_0xc9f1('0x33')],qs[_0xc9f1('0x3a')](_0x412fb4[_0xc9f1('0x35')][_0xc9f1('0x3a')]));_0x124e6f['attributes']=_0x124e6f[_0xc9f1('0x38')][_0xc9f1('0x48')]?_0x124e6f[_0xc9f1('0x38')]:_0x257861[_0xc9f1('0x33')];if(_0x412fb4[_0xc9f1('0x35')][_0xc9f1('0x49')]){_0x124e6f[_0xc9f1('0x43')]=[{'all':!![]}];}_0x124e6f=_[_0xc9f1('0x42')]({},_0x124e6f,_0x412fb4['options']);return db[_0xc9f1('0x2e')][_0xc9f1('0x4a')](_0x124e6f)[_0xc9f1('0x26')](handleEntityNotFound(_0x5e54f7,null))[_0xc9f1('0x26')](respondWithResult(_0x5e54f7,null))[_0xc9f1('0x46')](handleError(_0x5e54f7,null));};exports['create']=function(_0x4936bb,_0x188e47){return db[_0xc9f1('0x2e')]['create'](_0x4936bb[_0xc9f1('0x4b')],{})['then'](function(_0x5d0e79){var _0x1591ab=_0x4936bb[_0xc9f1('0x4c')][_0xc9f1('0x27')]({'plain':!![]});if(!_0x1591ab)throw new Error(_0xc9f1('0x4d'));if(_0x1591ab['role']===_0xc9f1('0x4c')){var _0x2293ce=_0x5d0e79[_0xc9f1('0x27')]({'plain':!![]});var _0x216cd6=_0xc9f1('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x216cd6,'userProfileId':_0x1591ab[_0xc9f1('0x4e')]},'raw':!![]})[_0xc9f1('0x26')](function(_0x3b9c42){if(_0x3b9c42&&_0x3b9c42[_0xc9f1('0x4f')]===0x0){return db[_0xc9f1('0x29')][_0xc9f1('0x50')]({'name':_0x2293ce[_0xc9f1('0x2c')],'resourceId':_0x2293ce['id'],'type':_0x3b9c42[_0xc9f1('0x2c')],'sectionId':_0x3b9c42['id']},{})[_0xc9f1('0x26')](function(){return _0x5d0e79;});}else{return _0x5d0e79;}})[_0xc9f1('0x46')](function(_0x4b6b01){logger[_0xc9f1('0x2a')](_0xc9f1('0x51'),_0x4b6b01);throw _0x4b6b01;});}return _0x5d0e79;})['then'](respondWithResult(_0x188e47,0xc9))['catch'](handleError(_0x188e47,null));};exports[_0xc9f1('0x52')]=function(_0x756aa5,_0x5cadfe){if(_0x756aa5[_0xc9f1('0x4b')]['id']){delete _0x756aa5[_0xc9f1('0x4b')]['id'];}return db[_0xc9f1('0x2e')][_0xc9f1('0x4a')]({'where':{'id':_0x756aa5[_0xc9f1('0x53')]['id']}})[_0xc9f1('0x26')](handleEntityNotFound(_0x5cadfe,null))[_0xc9f1('0x26')](saveUpdates(_0x756aa5[_0xc9f1('0x4b')],null))['then'](respondWithResult(_0x5cadfe,null))[_0xc9f1('0x46')](handleError(_0x5cadfe,null));};exports[_0xc9f1('0x25')]=function(_0x417a12,_0x1024f7){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x417a12['params']['id']}})[_0xc9f1('0x26')](handleEntityNotFound(_0x1024f7,null))[_0xc9f1('0x26')](removeEntity(_0x1024f7,null))[_0xc9f1('0x46')](handleError(_0x1024f7,null));};exports[_0xc9f1('0x54')]=function(_0x49df79,_0x20b706,_0x5c7d41){return db['AnalyticExtractedReport'][_0xc9f1('0x4a')]({'where':{'id':_0x49df79[_0xc9f1('0x53')]['id']},'attributes':[_0xc9f1('0x2c'),'basename',_0xc9f1('0x55'),_0xc9f1('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x20b706,null))[_0xc9f1('0x26')](function(_0x149e99){if(_0x149e99){if(!fs[_0xc9f1('0x57')](path[_0xc9f1('0x58')](config['root'],_0xc9f1('0x59'),_0x149e99['savename']))){throw new db[(_0xc9f1('0x5a'))][(_0xc9f1('0x5b'))](_0xc9f1('0x5c'));}if(_0x49df79[_0xc9f1('0x35')][_0xc9f1('0x5d')]){return _0x20b706['sendStatus'](0xc8);}return _0x20b706[_0xc9f1('0x54')](path[_0xc9f1('0x58')](config[_0xc9f1('0x5e')],'server/files/reports',_0x149e99['savename']),util[_0xc9f1('0x5f')](_0xc9f1('0x60'),_0x149e99[_0xc9f1('0x61')]||_0x149e99[_0xc9f1('0x2c')],_0x149e99[_0xc9f1('0x56')][_0xc9f1('0x62')]()));}})['catch'](handleError(_0x20b706,null));};
\ No newline at end of file
+var _0x3538=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','destroy','then','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','count','includeAll','include','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','request-promise','moment','mustache','path','to-csv','lodash','squel'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3538,0x1ba));var _0x8353=function(_0x1ae2a8,_0x5ad40d){_0x1ae2a8=_0x1ae2a8-0x0;var _0x33ab5d=_0x3538[_0x1ae2a8];return _0x33ab5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8353('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8353('0x1'));var moment=require(_0x8353('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8353('0x3'));var util=require('util');var path=require(_0x8353('0x4'));var sox=require('sox');var csv=require(_0x8353('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8353('0x6'));var squel=require(_0x8353('0x7'));var crypto=require(_0x8353('0x8'));var jsforce=require(_0x8353('0x9'));var deskjs=require(_0x8353('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8353('0xb'));var Redis=require('ioredis');var authService=require(_0x8353('0xc'));var qs=require(_0x8353('0xd'));var as=require(_0x8353('0xe'));var hardwareService=require(_0x8353('0xf'));var logger=require(_0x8353('0x10'))('api');var utils=require(_0x8353('0x11'));var config=require(_0x8353('0x12'));var licenseUtil=require(_0x8353('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4801e1,_0x587345){_0x587345=_0x587345||0xcc;return function(_0x4e40a7){if(_0x4e40a7){return _0x4801e1[_0x8353('0x14')](_0x587345);}return _0x4801e1[_0x8353('0x15')](_0x587345)['end']();};}function respondWithResult(_0x14ccb6,_0x3712bb){_0x3712bb=_0x3712bb||0xc8;return function(_0x2e256d){if(_0x2e256d){return _0x14ccb6['status'](_0x3712bb)[_0x8353('0x16')](_0x2e256d);}};}function respondWithFilteredResult(_0x43c3ca,_0x2cc740){return function(_0x3235d0){if(_0x3235d0){var _0x5835d4=typeof _0x2cc740[_0x8353('0x17')]===_0x8353('0x18')&&typeof _0x2cc740[_0x8353('0x19')]===_0x8353('0x18');var _0x2ceb85=_0x3235d0['count'];var _0x5b783a=_0x5835d4?0x0:_0x2cc740[_0x8353('0x17')];var _0x41c651=_0x5835d4?_0x3235d0['count']:_0x2cc740['offset']+_0x2cc740[_0x8353('0x19')];var _0x1e0a25;if(_0x41c651>=_0x2ceb85){_0x41c651=_0x2ceb85;_0x1e0a25=0xc8;}else{_0x1e0a25=0xce;}_0x43c3ca['status'](_0x1e0a25);return _0x43c3ca[_0x8353('0x1a')](_0x8353('0x1b'),_0x5b783a+'-'+_0x41c651+'/'+_0x2ceb85)[_0x8353('0x16')](_0x3235d0);}return null;};}function patchUpdates(_0x5d3b56){return function(_0x4e3454){try{jsonpatch['apply'](_0x4e3454,_0x5d3b56,!![]);}catch(_0x2e9705){return BPromise[_0x8353('0x1c')](_0x2e9705);}return _0x4e3454[_0x8353('0x1d')]();};}function saveUpdates(_0x21aec0,_0x5c9d35){return function(_0x2ef1b0){if(_0x2ef1b0){return _0x2ef1b0['update'](_0x21aec0)['then'](function(_0x441343){return _0x441343;});}return null;};}function removeEntity(_0x41f849,_0xbc8d21){return function(_0x57b9c7){if(_0x57b9c7){return _0x57b9c7[_0x8353('0x1e')]()[_0x8353('0x1f')](function(){var _0x4e2455=_0x57b9c7[_0x8353('0x20')]({'plain':!![]});var _0xe28913=_0x8353('0x21');return db[_0x8353('0x22')][_0x8353('0x1e')]({'where':{'type':_0xe28913,'resourceId':_0x4e2455['id']}})[_0x8353('0x1f')](function(){return _0x57b9c7;});})[_0x8353('0x1f')](function(){_0x41f849['status'](0xcc)[_0x8353('0x23')]();});}};}function handleEntityNotFound(_0xb74624,_0x258247){return function(_0x58d102){if(!_0x58d102){_0xb74624[_0x8353('0x14')](0x194);}return _0x58d102;};}function handleError(_0x38bec5,_0x318ea9){_0x318ea9=_0x318ea9||0x1f4;return function(_0x3b1688){logger[_0x8353('0x24')](_0x3b1688[_0x8353('0x25')]);if(_0x3b1688[_0x8353('0x26')]){delete _0x3b1688[_0x8353('0x26')];}_0x38bec5['status'](_0x318ea9)[_0x8353('0x27')](_0x3b1688);};}exports['index']=function(_0x52c3c9,_0x56d3a1){var _0x524461={},_0xe520a8={},_0x4d66ca={'count':0x0,'rows':[]};var _0x4b49b1=_['map'](db[_0x8353('0x28')][_0x8353('0x29')],function(_0x5beb53){return{'name':_0x5beb53[_0x8353('0x2a')],'type':_0x5beb53[_0x8353('0x2b')]['key']};});_0xe520a8[_0x8353('0x2c')]=_['map'](_0x4b49b1,_0x8353('0x26'));_0xe520a8['query']=_[_0x8353('0x2d')](_0x52c3c9[_0x8353('0x2e')]);_0xe520a8[_0x8353('0x2f')]=_[_0x8353('0x30')](_0xe520a8['model'],_0xe520a8[_0x8353('0x2e')]);_0x524461[_0x8353('0x31')]=_['intersection'](_0xe520a8[_0x8353('0x2c')],qs[_0x8353('0x32')](_0x52c3c9['query'][_0x8353('0x32')]));_0x524461['attributes']=_0x524461[_0x8353('0x31')][_0x8353('0x33')]?_0x524461[_0x8353('0x31')]:_0xe520a8['model'];if(!_0x52c3c9[_0x8353('0x2e')][_0x8353('0x34')](_0x8353('0x35'))){_0x524461[_0x8353('0x19')]=qs[_0x8353('0x19')](_0x52c3c9[_0x8353('0x2e')][_0x8353('0x19')]);_0x524461[_0x8353('0x17')]=qs[_0x8353('0x17')](_0x52c3c9['query']['offset']);}_0x524461['order']=qs[_0x8353('0x36')](_0x52c3c9[_0x8353('0x2e')][_0x8353('0x36')]);_0x524461[_0x8353('0x37')]=qs[_0x8353('0x2f')](_['pick'](_0x52c3c9[_0x8353('0x2e')],_0xe520a8[_0x8353('0x2f')]),_0x4b49b1);if(_0x52c3c9[_0x8353('0x2e')][_0x8353('0x38')]){_0x524461[_0x8353('0x37')]=_[_0x8353('0x39')](_0x524461[_0x8353('0x37')],{'$or':_[_0x8353('0x3a')](_0x4b49b1,function(_0x40eb50){if(_0x40eb50[_0x8353('0x2b')]!==_0x8353('0x3b')){var _0x442523={};_0x442523[_0x40eb50[_0x8353('0x26')]]={'$like':'%'+_0x52c3c9[_0x8353('0x2e')]['filter']+'%'};return _0x442523;}})});}_0x524461=_[_0x8353('0x39')]({},_0x524461,_0x52c3c9['options']);var _0x215439={'where':_0x524461[_0x8353('0x37')]};return db['AnalyticExtractedReport'][_0x8353('0x3c')](_0x215439)[_0x8353('0x1f')](function(_0x39e987){_0x4d66ca[_0x8353('0x3c')]=_0x39e987;if(_0x52c3c9['query'][_0x8353('0x3d')]){_0x524461[_0x8353('0x3e')]=[{'all':!![]}];}return db[_0x8353('0x28')]['findAll'](_0x524461);})[_0x8353('0x1f')](function(_0x2d4a96){_0x4d66ca['rows']=_0x2d4a96;return _0x4d66ca;})['then'](respondWithFilteredResult(_0x56d3a1,_0x524461))[_0x8353('0x3f')](handleError(_0x56d3a1,null));};exports['show']=function(_0x5306f4,_0x72e5a){var _0x4b01c9={'raw':!![],'where':{'id':_0x5306f4[_0x8353('0x40')]['id']}},_0xa19090={};_0xa19090[_0x8353('0x2c')]=_['keys'](db['AnalyticExtractedReport'][_0x8353('0x29')]);_0xa19090[_0x8353('0x2e')]=_[_0x8353('0x2d')](_0x5306f4[_0x8353('0x2e')]);_0xa19090[_0x8353('0x2f')]=_[_0x8353('0x30')](_0xa19090['model'],_0xa19090[_0x8353('0x2e')]);_0x4b01c9[_0x8353('0x31')]=_['intersection'](_0xa19090[_0x8353('0x2c')],qs[_0x8353('0x32')](_0x5306f4['query']['fields']));_0x4b01c9[_0x8353('0x31')]=_0x4b01c9[_0x8353('0x31')][_0x8353('0x33')]?_0x4b01c9[_0x8353('0x31')]:_0xa19090[_0x8353('0x2c')];if(_0x5306f4[_0x8353('0x2e')][_0x8353('0x3d')]){_0x4b01c9[_0x8353('0x3e')]=[{'all':!![]}];}_0x4b01c9=_['merge']({},_0x4b01c9,_0x5306f4[_0x8353('0x41')]);return db['AnalyticExtractedReport'][_0x8353('0x42')](_0x4b01c9)[_0x8353('0x1f')](handleEntityNotFound(_0x72e5a,null))[_0x8353('0x1f')](respondWithResult(_0x72e5a,null))[_0x8353('0x3f')](handleError(_0x72e5a,null));};exports[_0x8353('0x43')]=function(_0x20de06,_0x186659){return db[_0x8353('0x28')][_0x8353('0x43')](_0x20de06[_0x8353('0x44')],{})[_0x8353('0x1f')](function(_0x135003){var _0x1f521b=_0x20de06[_0x8353('0x45')][_0x8353('0x20')]({'plain':!![]});if(!_0x1f521b)throw new Error(_0x8353('0x46'));if(_0x1f521b[_0x8353('0x47')]==='user'){var _0x155c8d=_0x135003['get']({'plain':!![]});var _0x54f887=_0x8353('0x21');return db[_0x8353('0x48')][_0x8353('0x42')]({'where':{'name':_0x54f887,'userProfileId':_0x1f521b[_0x8353('0x49')]},'raw':!![]})[_0x8353('0x1f')](function(_0x2db5aa){if(_0x2db5aa&&_0x2db5aa['autoAssociation']===0x0){return db[_0x8353('0x22')][_0x8353('0x43')]({'name':_0x155c8d['name'],'resourceId':_0x155c8d['id'],'type':_0x2db5aa[_0x8353('0x26')],'sectionId':_0x2db5aa['id']},{})[_0x8353('0x1f')](function(){return _0x135003;});}else{return _0x135003;}})[_0x8353('0x3f')](function(_0x19f1c7){logger[_0x8353('0x24')](_0x8353('0x4a'),_0x19f1c7);throw _0x19f1c7;});}return _0x135003;})[_0x8353('0x1f')](respondWithResult(_0x186659,0xc9))[_0x8353('0x3f')](handleError(_0x186659,null));};exports[_0x8353('0x4b')]=function(_0x30901c,_0x39f99b){if(_0x30901c[_0x8353('0x44')]['id']){delete _0x30901c[_0x8353('0x44')]['id'];}return db[_0x8353('0x28')][_0x8353('0x42')]({'where':{'id':_0x30901c[_0x8353('0x40')]['id']}})[_0x8353('0x1f')](handleEntityNotFound(_0x39f99b,null))[_0x8353('0x1f')](saveUpdates(_0x30901c[_0x8353('0x44')],null))[_0x8353('0x1f')](respondWithResult(_0x39f99b,null))[_0x8353('0x3f')](handleError(_0x39f99b,null));};exports[_0x8353('0x1e')]=function(_0xc38e5c,_0x39e2e7){return db[_0x8353('0x28')]['find']({'where':{'id':_0xc38e5c['params']['id']}})[_0x8353('0x1f')](handleEntityNotFound(_0x39e2e7,null))[_0x8353('0x1f')](removeEntity(_0x39e2e7,null))[_0x8353('0x3f')](handleError(_0x39e2e7,null));};exports['download']=function(_0x3a2298,_0x1c6022,_0x5db17b){return db[_0x8353('0x28')][_0x8353('0x42')]({'where':{'id':_0x3a2298[_0x8353('0x40')]['id']},'attributes':[_0x8353('0x26'),_0x8353('0x4c'),'savename',_0x8353('0x4d')],'raw':!![]})[_0x8353('0x1f')](handleEntityNotFound(_0x1c6022,null))[_0x8353('0x1f')](function(_0x3d04f0){if(_0x3d04f0){if(!fs[_0x8353('0x4e')](path[_0x8353('0x4f')](config[_0x8353('0x50')],_0x8353('0x51'),_0x3d04f0[_0x8353('0x52')]))){throw new db[(_0x8353('0x53'))][(_0x8353('0x54'))](_0x8353('0x55'));}if(_0x3a2298[_0x8353('0x2e')][_0x8353('0x56')]){return _0x1c6022['sendStatus'](0xc8);}return _0x1c6022['download'](path[_0x8353('0x4f')](config[_0x8353('0x50')],_0x8353('0x51'),_0x3d04f0[_0x8353('0x52')]),util[_0x8353('0x57')](_0x8353('0x58'),_0x3d04f0['basename']||_0x3d04f0[_0x8353('0x26')],_0x3d04f0[_0x8353('0x4d')][_0x8353('0x59')]()));}})[_0x8353('0x3f')](handleError(_0x1c6022,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b8270cd..693fca9 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 _0x1f91=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1f91,0x1d2));var _0x11f9=function(_0x5084de,_0x5efbf3){_0x5084de=_0x5084de-0x0;var _0x47a2e4=_0x1f91[_0x5084de];return _0x47a2e4;};'use strict';var _=require(_0x11f9('0x0'));var util=require(_0x11f9('0x1'));var logger=require(_0x11f9('0x2'))('api');var moment=require(_0x11f9('0x3'));var BPromise=require(_0x11f9('0x4'));var rp=require(_0x11f9('0x5'));var fs=require('fs');var path=require(_0x11f9('0x6'));var rimraf=require('rimraf');var config=require(_0x11f9('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x11f9('0x8')]=function(_0x50fa2f,_0x5b9163){return _0x50fa2f[_0x11f9('0x9')](_0x11f9('0xa'),attributes,{'tableName':_0x11f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf82d=['request-promise','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x7385c7,_0x370776){var _0x4c3545=function(_0x3fed4c){while(--_0x3fed4c){_0x7385c7['push'](_0x7385c7['shift']());}};_0x4c3545(++_0x370776);}(_0xf82d,0xbd));var _0xdf82=function(_0xa9cee,_0x2d3ddd){_0xa9cee=_0xa9cee-0x0;var _0x4dc9f1=_0xf82d[_0xa9cee];return _0x4dc9f1;};'use strict';var _=require(_0xdf82('0x0'));var util=require(_0xdf82('0x1'));var logger=require(_0xdf82('0x2'))(_0xdf82('0x3'));var moment=require(_0xdf82('0x4'));var BPromise=require(_0xdf82('0x5'));var rp=require(_0xdf82('0x6'));var fs=require('fs');var path=require(_0xdf82('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf82('0x8'));module[_0xdf82('0x9')]=function(_0x23cf2b,_0x636c56){return _0x23cf2b[_0xdf82('0xa')](_0xdf82('0xb'),attributes,{'tableName':_0xdf82('0xc'),'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 c7c953d..fe24f26 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 _0x75d0=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x75d0,0x1bd));var _0x075d=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0x75d0[_0x43941d];return _0x27b82a;};'use strict';var _=require(_0x075d('0x0'));var util=require(_0x075d('0x1'));var moment=require(_0x075d('0x2'));var BPromise=require(_0x075d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x075d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x075d('0x5'));var logger=require(_0x075d('0x6'))(_0x075d('0x7'));var config=require(_0x075d('0x8'));var jayson=require(_0x075d('0x9'));var client=jayson[_0x075d('0xa')][_0x075d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53fdb4,_0xae52e7,_0x4ab8f5){return new BPromise(function(_0x555567,_0x33b8f4){return client[_0x075d('0xc')](_0x53fdb4,_0x4ab8f5)[_0x075d('0xd')](function(_0x19ab64){logger['info'](_0x075d('0xe'),_0xae52e7,_0x075d('0xf'));logger[_0x075d('0x10')](_0x075d('0x11'),_0xae52e7,_0x075d('0xf'),JSON[_0x075d('0x12')](_0x19ab64));if(_0x19ab64[_0x075d('0x13')]){if(_0x19ab64['error'][_0x075d('0x14')]===0x1f4){logger[_0x075d('0x13')](_0x075d('0xe'),_0xae52e7,_0x19ab64[_0x075d('0x13')]['message']);return _0x33b8f4(_0x19ab64[_0x075d('0x13')][_0x075d('0x15')]);}logger[_0x075d('0x13')](_0x075d('0xe'),_0xae52e7,_0x19ab64[_0x075d('0x13')][_0x075d('0x15')]);return _0x555567(_0x19ab64[_0x075d('0x13')][_0x075d('0x15')]);}else{logger[_0x075d('0x16')](_0x075d('0xe'),_0xae52e7,_0x075d('0xf'));_0x555567(_0x19ab64[_0x075d('0x17')][_0x075d('0x15')]);}})[_0x075d('0x18')](function(_0x50e892){logger[_0x075d('0x13')](_0x075d('0xe'),_0xae52e7,_0x50e892);_0x33b8f4(_0x50e892);});});}
\ No newline at end of file
+var _0x94e6=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1d9622,_0x2b3a3d){var _0x5241e4=function(_0x32e4ed){while(--_0x32e4ed){_0x1d9622['push'](_0x1d9622['shift']());}};_0x5241e4(++_0x2b3a3d);}(_0x94e6,0x194));var _0x694e=function(_0xc6e6b1,_0x45ddb5){_0xc6e6b1=_0xc6e6b1-0x0;var _0x3772a9=_0x94e6[_0xc6e6b1];return _0x3772a9;};'use strict';var _=require(_0x694e('0x0'));var util=require('util');var moment=require(_0x694e('0x1'));var BPromise=require(_0x694e('0x2'));var rs=require(_0x694e('0x3'));var fs=require('fs');var Redis=require(_0x694e('0x4'));var db=require(_0x694e('0x5'))['db'];var utils=require(_0x694e('0x6'));var logger=require('../../config/logger')(_0x694e('0x7'));var config=require(_0x694e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x694e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x84e66e,_0x1c0a45,_0x492dd2){return new BPromise(function(_0x504e0b,_0x3e3f5c){return client['request'](_0x84e66e,_0x492dd2)['then'](function(_0x4ab419){logger[_0x694e('0xa')](_0x694e('0xb'),_0x1c0a45,_0x694e('0xc'));logger[_0x694e('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1c0a45,_0x694e('0xc'),JSON[_0x694e('0xe')](_0x4ab419));if(_0x4ab419['error']){if(_0x4ab419[_0x694e('0xf')][_0x694e('0x10')]===0x1f4){logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4ab419['error'][_0x694e('0x11')]);return _0x3e3f5c(_0x4ab419['error'][_0x694e('0x11')]);}logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4ab419[_0x694e('0xf')][_0x694e('0x11')]);return _0x504e0b(_0x4ab419[_0x694e('0xf')][_0x694e('0x11')]);}else{logger[_0x694e('0xa')](_0x694e('0xb'),_0x1c0a45,_0x694e('0xc'));_0x504e0b(_0x4ab419[_0x694e('0x12')][_0x694e('0x11')]);}})[_0x694e('0x13')](function(_0x4e608d){logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4e608d);_0x3e3f5c(_0x4e608d);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 260536d..52f5389 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 _0xcb8a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post','create','put','update','delete','destroy','exports','util'];(function(_0x426ecc,_0x40233a){var _0x4df4f1=function(_0x400f50){while(--_0x400f50){_0x426ecc['push'](_0x426ecc['shift']());}};_0x4df4f1(++_0x40233a);}(_0xcb8a,0x13a));var _0xacb8=function(_0xd67337,_0x1e30dd){_0xd67337=_0xd67337-0x0;var _0x266b1d=_0xcb8a[_0xd67337];return _0x266b1d;};'use strict';var multer=require('multer');var util=require(_0xacb8('0x0'));var path=require(_0xacb8('0x1'));var timeout=require(_0xacb8('0x2'));var express=require(_0xacb8('0x3'));var router=express[_0xacb8('0x4')]();var fs_extra=require(_0xacb8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xacb8('0x6'));var config=require(_0xacb8('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xacb8('0x8')]('/',auth[_0xacb8('0x9')](),controller[_0xacb8('0xa')]);router[_0xacb8('0x8')](_0xacb8('0xb'),auth[_0xacb8('0x9')](),controller[_0xacb8('0xc')]);router['get']('/:id/download',auth[_0xacb8('0x9')](),controller[_0xacb8('0xd')]);router[_0xacb8('0xe')]('/',auth['isAuthenticated'](),controller[_0xacb8('0xf')]);router[_0xacb8('0x10')](_0xacb8('0xb'),auth[_0xacb8('0x9')](),controller[_0xacb8('0x11')]);router[_0xacb8('0x12')](_0xacb8('0xb'),auth[_0xacb8('0x9')](),controller[_0xacb8('0x13')]);module[_0xacb8('0x14')]=router;
\ No newline at end of file
+var _0x2dce=['update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','create','put'];(function(_0x1f560a,_0x1ade33){var _0x1b6bb3=function(_0x74be66){while(--_0x74be66){_0x1f560a['push'](_0x1f560a['shift']());}};_0x1b6bb3(++_0x1ade33);}(_0x2dce,0x120));var _0xe2dc=function(_0x142ead,_0x5c8525){_0x142ead=_0x142ead-0x0;var _0x58413b=_0x2dce[_0x142ead];return _0x58413b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe2dc('0x0'));var timeout=require(_0xe2dc('0x1'));var express=require(_0xe2dc('0x2'));var router=express['Router']();var fs_extra=require(_0xe2dc('0x3'));var auth=require(_0xe2dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe2dc('0x5'));var controller=require(_0xe2dc('0x6'));router[_0xe2dc('0x7')]('/',auth[_0xe2dc('0x8')](),controller[_0xe2dc('0x9')]);router['get'](_0xe2dc('0xa'),auth[_0xe2dc('0x8')](),controller[_0xe2dc('0xb')]);router[_0xe2dc('0x7')]('/:id/download',auth[_0xe2dc('0x8')](),controller[_0xe2dc('0xc')]);router[_0xe2dc('0xd')]('/',auth['isAuthenticated'](),controller[_0xe2dc('0xe')]);router[_0xe2dc('0xf')](_0xe2dc('0xa'),auth['isAuthenticated'](),controller[_0xe2dc('0x10')]);router['delete'](_0xe2dc('0xa'),auth[_0xe2dc('0x8')](),controller[_0xe2dc('0x11')]);module[_0xe2dc('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 83c34ec..67b41a5 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 _0x8740=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x33c8cb,_0x56cff2){var _0x2d28bb=function(_0x1fcc9b){while(--_0x1fcc9b){_0x33c8cb['push'](_0x33c8cb['shift']());}};_0x2d28bb(++_0x56cff2);}(_0x8740,0x193));var _0x0874=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x8740[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0x0874('0x0'));module[_0x0874('0x1')]={'field':{'type':Sequelize[_0x0874('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0874('0x3')]},'format':{'type':Sequelize[_0x0874('0x3')]},'groupBy':{'type':Sequelize[_0x0874('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0874('0x3')]},'custom':{'type':Sequelize[_0x0874('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x80fc=['exports','STRING','BOOLEAN','sequelize'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x80fc,0x1af));var _0xc80f=function(_0x4d7819,_0xe84f12){_0x4d7819=_0x4d7819-0x0;var _0x5e811c=_0x80fc[_0x4d7819];return _0x5e811c;};'use strict';var Sequelize=require(_0xc80f('0x0'));module[_0xc80f('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xc80f('0x2')]},'function':{'type':Sequelize[_0xc80f('0x2')]},'format':{'type':Sequelize[_0xc80f('0x2')]},'groupBy':{'type':Sequelize[_0xc80f('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc80f('0x2')]},'custom':{'type':Sequelize[_0xc80f('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 51b966b..51f43c3 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 _0x0440=['find','create','bulkCreate','body','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','reject','update','then','destroy','stack','name','send','index','map','AnalyticFieldReport','type','key','model','query','keys','intersection','attributes','length','sort','where','filters','pick','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','merge','options'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x0440,0xe9));var _0x0044=function(_0x32cf96,_0x7502d5){_0x32cf96=_0x32cf96-0x0;var _0x125cc1=_0x0440[_0x32cf96];return _0x125cc1;};'use strict';var emlformat=require(_0x0044('0x0'));var rimraf=require(_0x0044('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0044('0x2'));var BPromise=require(_0x0044('0x3'));var Mustache=require(_0x0044('0x4'));var util=require(_0x0044('0x5'));var path=require('path');var sox=require(_0x0044('0x6'));var csv=require('to-csv');var ejs=require(_0x0044('0x7'));var fs=require('fs');var fs_extra=require(_0x0044('0x8'));var _=require(_0x0044('0x9'));var squel=require(_0x0044('0xa'));var crypto=require(_0x0044('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0044('0xc'));var querystring=require(_0x0044('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0044('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0044('0xf'));var logger=require(_0x0044('0x10'))('api');var utils=require(_0x0044('0x11'));var config=require(_0x0044('0x12'));var licenseUtil=require(_0x0044('0x13'));var db=require(_0x0044('0x14'))['db'];function respondWithStatusCode(_0x539780,_0x53f940){_0x53f940=_0x53f940||0xcc;return function(_0x1296dd){if(_0x1296dd){return _0x539780[_0x0044('0x15')](_0x53f940);}return _0x539780[_0x0044('0x16')](_0x53f940)[_0x0044('0x17')]();};}function respondWithResult(_0x33cf56,_0x560ca1){_0x560ca1=_0x560ca1||0xc8;return function(_0x1a2ddf){if(_0x1a2ddf){return _0x33cf56[_0x0044('0x16')](_0x560ca1)['json'](_0x1a2ddf);}};}function respondWithFilteredResult(_0x37609c,_0x1836f6){return function(_0x9e74b3){if(_0x9e74b3){var _0x139882=typeof _0x1836f6[_0x0044('0x18')]===_0x0044('0x19')&&typeof _0x1836f6[_0x0044('0x1a')]===_0x0044('0x19');var _0x15645b=_0x9e74b3[_0x0044('0x1b')];var _0x642a53=_0x139882?0x0:_0x1836f6[_0x0044('0x18')];var _0x2f03f9=_0x139882?_0x9e74b3[_0x0044('0x1b')]:_0x1836f6['offset']+_0x1836f6[_0x0044('0x1a')];var _0x4c728a;if(_0x2f03f9>=_0x15645b){_0x2f03f9=_0x15645b;_0x4c728a=0xc8;}else{_0x4c728a=0xce;}_0x37609c[_0x0044('0x16')](_0x4c728a);return _0x37609c['set']('Content-Range',_0x642a53+'-'+_0x2f03f9+'/'+_0x15645b)['json'](_0x9e74b3);}return null;};}function patchUpdates(_0x46e8df){return function(_0x37280f){try{jsonpatch['apply'](_0x37280f,_0x46e8df,!![]);}catch(_0x16faf1){return BPromise[_0x0044('0x1c')](_0x16faf1);}return _0x37280f['save']();};}function saveUpdates(_0x39a84a,_0x1ee60d){return function(_0xa2f052){if(_0xa2f052){return _0xa2f052[_0x0044('0x1d')](_0x39a84a)[_0x0044('0x1e')](function(_0x17cbcd){return _0x17cbcd;});}return null;};}function removeEntity(_0x44ab0b,_0x40c482){return function(_0x16dee3){if(_0x16dee3){return _0x16dee3[_0x0044('0x1f')]()[_0x0044('0x1e')](function(){_0x44ab0b[_0x0044('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12bead,_0x1e4343){return function(_0x3e08fc){if(!_0x3e08fc){_0x12bead[_0x0044('0x15')](0x194);}return _0x3e08fc;};}function handleError(_0x3b1295,_0x7d6ead){_0x7d6ead=_0x7d6ead||0x1f4;return function(_0x110bdf){logger['error'](_0x110bdf[_0x0044('0x20')]);if(_0x110bdf[_0x0044('0x21')]){delete _0x110bdf[_0x0044('0x21')];}_0x3b1295[_0x0044('0x16')](_0x7d6ead)[_0x0044('0x22')](_0x110bdf);};}exports[_0x0044('0x23')]=function(_0x1a4e65,_0x585cc1){var _0x2c4ade={},_0x1cec2d={},_0x5d9639={'count':0x0,'rows':[]};var _0x535d8a=_[_0x0044('0x24')](db[_0x0044('0x25')]['rawAttributes'],function(_0x2b3dbe){return{'name':_0x2b3dbe['fieldName'],'type':_0x2b3dbe[_0x0044('0x26')][_0x0044('0x27')]};});_0x1cec2d[_0x0044('0x28')]=_[_0x0044('0x24')](_0x535d8a,_0x0044('0x21'));_0x1cec2d[_0x0044('0x29')]=_[_0x0044('0x2a')](_0x1a4e65[_0x0044('0x29')]);_0x1cec2d['filters']=_[_0x0044('0x2b')](_0x1cec2d[_0x0044('0x28')],_0x1cec2d[_0x0044('0x29')]);_0x2c4ade['attributes']=_[_0x0044('0x2b')](_0x1cec2d[_0x0044('0x28')],qs['fields'](_0x1a4e65[_0x0044('0x29')]['fields']));_0x2c4ade[_0x0044('0x2c')]=_0x2c4ade[_0x0044('0x2c')][_0x0044('0x2d')]?_0x2c4ade['attributes']:_0x1cec2d['model'];if(!_0x1a4e65[_0x0044('0x29')]['hasOwnProperty']('nolimit')){_0x2c4ade[_0x0044('0x1a')]=qs[_0x0044('0x1a')](_0x1a4e65[_0x0044('0x29')][_0x0044('0x1a')]);_0x2c4ade[_0x0044('0x18')]=qs['offset'](_0x1a4e65[_0x0044('0x29')][_0x0044('0x18')]);}_0x2c4ade['order']=qs['sort'](_0x1a4e65[_0x0044('0x29')][_0x0044('0x2e')]);_0x2c4ade[_0x0044('0x2f')]=qs[_0x0044('0x30')](_[_0x0044('0x31')](_0x1a4e65[_0x0044('0x29')],_0x1cec2d[_0x0044('0x30')]),_0x535d8a);if(_0x1a4e65[_0x0044('0x29')]['filter']){_0x2c4ade[_0x0044('0x2f')]=_['merge'](_0x2c4ade['where'],{'$or':_[_0x0044('0x24')](_0x535d8a,function(_0x41a243){if(_0x41a243[_0x0044('0x26')]!==_0x0044('0x32')){var _0x2bc756={};_0x2bc756[_0x41a243[_0x0044('0x21')]]={'$like':'%'+_0x1a4e65['query'][_0x0044('0x33')]+'%'};return _0x2bc756;}})});}_0x2c4ade=_['merge']({},_0x2c4ade,_0x1a4e65['options']);var _0x46ed81={'where':_0x2c4ade[_0x0044('0x2f')]};return db['AnalyticFieldReport'][_0x0044('0x1b')](_0x46ed81)[_0x0044('0x1e')](function(_0x22f018){_0x5d9639['count']=_0x22f018;if(_0x1a4e65[_0x0044('0x29')][_0x0044('0x34')]){_0x2c4ade[_0x0044('0x35')]=[{'all':!![]}];}return db[_0x0044('0x25')][_0x0044('0x36')](_0x2c4ade);})[_0x0044('0x1e')](function(_0x177060){_0x5d9639[_0x0044('0x37')]=_0x177060;return _0x5d9639;})[_0x0044('0x1e')](respondWithFilteredResult(_0x585cc1,_0x2c4ade))[_0x0044('0x38')](handleError(_0x585cc1,null));};exports[_0x0044('0x39')]=function(_0x3bb356,_0x559426){var _0x39ce45={'raw':![],'where':{'id':_0x3bb356[_0x0044('0x3a')]['id']}},_0x53a46c={};_0x53a46c[_0x0044('0x28')]=_[_0x0044('0x2a')](db[_0x0044('0x25')][_0x0044('0x3b')]);_0x53a46c[_0x0044('0x29')]=_[_0x0044('0x2a')](_0x3bb356[_0x0044('0x29')]);_0x53a46c['filters']=_[_0x0044('0x2b')](_0x53a46c[_0x0044('0x28')],_0x53a46c[_0x0044('0x29')]);_0x39ce45[_0x0044('0x2c')]=_['intersection'](_0x53a46c[_0x0044('0x28')],qs[_0x0044('0x3c')](_0x3bb356[_0x0044('0x29')][_0x0044('0x3c')]));_0x39ce45[_0x0044('0x2c')]=_0x39ce45[_0x0044('0x2c')][_0x0044('0x2d')]?_0x39ce45[_0x0044('0x2c')]:_0x53a46c[_0x0044('0x28')];if(_0x3bb356[_0x0044('0x29')][_0x0044('0x34')]){_0x39ce45[_0x0044('0x35')]=[{'all':!![]}];}_0x39ce45=_[_0x0044('0x3d')]({},_0x39ce45,_0x3bb356[_0x0044('0x3e')]);return db[_0x0044('0x25')][_0x0044('0x3f')](_0x39ce45)['then'](handleEntityNotFound(_0x559426,null))['then'](respondWithResult(_0x559426,null))[_0x0044('0x38')](handleError(_0x559426,null));};exports[_0x0044('0x40')]=function(_0x4126b7,_0x2c99a5){return db[_0x0044('0x25')][_0x0044('0x40')](_0x4126b7['body'],{})[_0x0044('0x1e')](respondWithResult(_0x2c99a5,0xc9))[_0x0044('0x38')](handleError(_0x2c99a5,null));};exports[_0x0044('0x41')]=function(_0x2ffba9,_0x271642){return db[_0x0044('0x25')][_0x0044('0x41')](_0x2ffba9[_0x0044('0x42')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x271642,0xc9))[_0x0044('0x38')](handleError(_0x271642,null));};exports[_0x0044('0x1d')]=function(_0x3ab2c3,_0x3e9a8f){if(_0x3ab2c3[_0x0044('0x42')]['id']){delete _0x3ab2c3[_0x0044('0x42')]['id'];}return db['AnalyticFieldReport'][_0x0044('0x3f')]({'where':{'id':_0x3ab2c3['params']['id']}})[_0x0044('0x1e')](handleEntityNotFound(_0x3e9a8f,null))[_0x0044('0x1e')](saveUpdates(_0x3ab2c3['body'],null))[_0x0044('0x1e')](respondWithResult(_0x3e9a8f,null))['catch'](handleError(_0x3e9a8f,null));};exports[_0x0044('0x1f')]=function(_0x313622,_0x546fb5){return db[_0x0044('0x25')][_0x0044('0x3f')]({'where':{'id':_0x313622[_0x0044('0x3a')]['id']}})[_0x0044('0x1e')](handleEntityNotFound(_0x546fb5,null))['then'](removeEntity(_0x546fb5,null))['catch'](handleError(_0x546fb5,null));};exports[_0x0044('0x43')]=function(_0x19e0ad,_0x9fb379){return db[_0x0044('0x25')][_0x0044('0x1f')]({'where':{'id':_0x19e0ad['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x9fb379,0xcc))[_0x0044('0x38')](handleError(_0x9fb379,null));};exports[_0x0044('0x44')]=function(_0x5ccf47,_0x10cc39,_0x27dcdf){return db[_0x0044('0x45')][_0x0044('0x46')]({'where':{'id':_0x5ccf47[_0x0044('0x3a')]['id']}})[_0x0044('0x1e')](handleEntityNotFound(_0x10cc39,null))[_0x0044('0x1e')](function(_0x527d28){if(_0x527d28){return db[_0x0044('0x47')][_0x0044('0x48')](function(_0x1eed60){return db[_0x0044('0x25')]['destroy']({'where':{'CustomReportId':_0x5ccf47[_0x0044('0x3a')]['id']},'transaction':_0x1eed60})[_0x0044('0x1e')](function(_0x38b08e){var _0x2ec91f=_[_0x0044('0x24')](_0x5ccf47[_0x0044('0x42')],function(_0x328fc4){delete _0x328fc4['id'];_0x328fc4[_0x0044('0x49')]=_0x5ccf47[_0x0044('0x3a')]['id'];return _0x328fc4;});return db['AnalyticFieldReport']['bulkCreate'](_0x2ec91f,{'transaction':_0x1eed60});});})[_0x0044('0x1e')](function(){return db[_0x0044('0x25')][_0x0044('0x36')]({'where':{'CustomReportId':_0x5ccf47[_0x0044('0x3a')]['id']}});});}})[_0x0044('0x1e')](respondWithResult(_0x10cc39,null))[_0x0044('0x38')](handleError(_0x10cc39,null));};
\ No newline at end of file
+var _0xfc91=['intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','then','stack','name','map','AnalyticFieldReport','fieldName','type','key','model','query','keys'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xfc91,0x72));var _0x1fc9=function(_0x1b4d17,_0xbd4d2d){_0x1b4d17=_0x1b4d17-0x0;var _0x185be8=_0xfc91[_0x1b4d17];return _0x185be8;};'use strict';var emlformat=require(_0x1fc9('0x0'));var rimraf=require(_0x1fc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fc9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1fc9('0x3'));var Mustache=require('mustache');var util=require(_0x1fc9('0x4'));var path=require(_0x1fc9('0x5'));var sox=require(_0x1fc9('0x6'));var csv=require(_0x1fc9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fc9('0x8'));var _=require(_0x1fc9('0x9'));var squel=require(_0x1fc9('0xa'));var crypto=require(_0x1fc9('0xb'));var jsforce=require(_0x1fc9('0xc'));var deskjs=require(_0x1fc9('0xd'));var toCsv=require(_0x1fc9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1fc9('0xe'));var authService=require(_0x1fc9('0xf'));var qs=require(_0x1fc9('0x10'));var as=require(_0x1fc9('0x11'));var hardwareService=require(_0x1fc9('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1fc9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fc9('0x14'))['db'];function respondWithStatusCode(_0x1033b4,_0x420aee){_0x420aee=_0x420aee||0xcc;return function(_0x518fa9){if(_0x518fa9){return _0x1033b4[_0x1fc9('0x15')](_0x420aee);}return _0x1033b4['status'](_0x420aee)[_0x1fc9('0x16')]();};}function respondWithResult(_0x2d351b,_0x50e3f4){_0x50e3f4=_0x50e3f4||0xc8;return function(_0x3c3a6c){if(_0x3c3a6c){return _0x2d351b['status'](_0x50e3f4)[_0x1fc9('0x17')](_0x3c3a6c);}};}function respondWithFilteredResult(_0x18ed6e,_0x48c636){return function(_0x49be11){if(_0x49be11){var _0x21894=typeof _0x48c636[_0x1fc9('0x18')]===_0x1fc9('0x19')&&typeof _0x48c636[_0x1fc9('0x1a')]===_0x1fc9('0x19');var _0x582121=_0x49be11[_0x1fc9('0x1b')];var _0x1ff6dc=_0x21894?0x0:_0x48c636[_0x1fc9('0x18')];var _0x3d2a99=_0x21894?_0x49be11['count']:_0x48c636[_0x1fc9('0x18')]+_0x48c636[_0x1fc9('0x1a')];var _0xf9eaf5;if(_0x3d2a99>=_0x582121){_0x3d2a99=_0x582121;_0xf9eaf5=0xc8;}else{_0xf9eaf5=0xce;}_0x18ed6e[_0x1fc9('0x1c')](_0xf9eaf5);return _0x18ed6e[_0x1fc9('0x1d')]('Content-Range',_0x1ff6dc+'-'+_0x3d2a99+'/'+_0x582121)[_0x1fc9('0x17')](_0x49be11);}return null;};}function patchUpdates(_0xe0243d){return function(_0x4efe15){try{jsonpatch[_0x1fc9('0x1e')](_0x4efe15,_0xe0243d,!![]);}catch(_0x5b2f67){return BPromise[_0x1fc9('0x1f')](_0x5b2f67);}return _0x4efe15[_0x1fc9('0x20')]();};}function saveUpdates(_0x29049a,_0x348aaa){return function(_0x14f2b8){if(_0x14f2b8){return _0x14f2b8[_0x1fc9('0x21')](_0x29049a)['then'](function(_0xe4a0a9){return _0xe4a0a9;});}return null;};}function removeEntity(_0x3a7901,_0x274d0d){return function(_0x3ec61e){if(_0x3ec61e){return _0x3ec61e[_0x1fc9('0x22')]()[_0x1fc9('0x23')](function(){_0x3a7901[_0x1fc9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b4c4b,_0x59bed7){return function(_0x281061){if(!_0x281061){_0x3b4c4b[_0x1fc9('0x15')](0x194);}return _0x281061;};}function handleError(_0x31c5a7,_0x4c734b){_0x4c734b=_0x4c734b||0x1f4;return function(_0x678adb){logger['error'](_0x678adb[_0x1fc9('0x24')]);if(_0x678adb[_0x1fc9('0x25')]){delete _0x678adb[_0x1fc9('0x25')];}_0x31c5a7['status'](_0x4c734b)['send'](_0x678adb);};}exports['index']=function(_0xdaffcf,_0x3e35eb){var _0x5849a4={},_0x48f997={},_0x4f54b6={'count':0x0,'rows':[]};var _0xb9e0e=_[_0x1fc9('0x26')](db[_0x1fc9('0x27')]['rawAttributes'],function(_0x2d8ea6){return{'name':_0x2d8ea6[_0x1fc9('0x28')],'type':_0x2d8ea6[_0x1fc9('0x29')][_0x1fc9('0x2a')]};});_0x48f997[_0x1fc9('0x2b')]=_[_0x1fc9('0x26')](_0xb9e0e,_0x1fc9('0x25'));_0x48f997[_0x1fc9('0x2c')]=_[_0x1fc9('0x2d')](_0xdaffcf[_0x1fc9('0x2c')]);_0x48f997['filters']=_[_0x1fc9('0x2e')](_0x48f997[_0x1fc9('0x2b')],_0x48f997[_0x1fc9('0x2c')]);_0x5849a4['attributes']=_[_0x1fc9('0x2e')](_0x48f997[_0x1fc9('0x2b')],qs[_0x1fc9('0x2f')](_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x2f')]));_0x5849a4[_0x1fc9('0x30')]=_0x5849a4[_0x1fc9('0x30')]['length']?_0x5849a4[_0x1fc9('0x30')]:_0x48f997[_0x1fc9('0x2b')];if(!_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x31')](_0x1fc9('0x32'))){_0x5849a4[_0x1fc9('0x1a')]=qs[_0x1fc9('0x1a')](_0xdaffcf['query'][_0x1fc9('0x1a')]);_0x5849a4[_0x1fc9('0x18')]=qs[_0x1fc9('0x18')](_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x18')]);}_0x5849a4[_0x1fc9('0x33')]=qs[_0x1fc9('0x34')](_0xdaffcf[_0x1fc9('0x2c')]['sort']);_0x5849a4[_0x1fc9('0x35')]=qs[_0x1fc9('0x36')](_[_0x1fc9('0x37')](_0xdaffcf[_0x1fc9('0x2c')],_0x48f997[_0x1fc9('0x36')]),_0xb9e0e);if(_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x38')]){_0x5849a4[_0x1fc9('0x35')]=_[_0x1fc9('0x39')](_0x5849a4['where'],{'$or':_[_0x1fc9('0x26')](_0xb9e0e,function(_0x2e0e2f){if(_0x2e0e2f[_0x1fc9('0x29')]!==_0x1fc9('0x3a')){var _0xf68a44={};_0xf68a44[_0x2e0e2f[_0x1fc9('0x25')]]={'$like':'%'+_0xdaffcf[_0x1fc9('0x2c')]['filter']+'%'};return _0xf68a44;}})});}_0x5849a4=_['merge']({},_0x5849a4,_0xdaffcf[_0x1fc9('0x3b')]);var _0x115fbe={'where':_0x5849a4['where']};return db[_0x1fc9('0x27')]['count'](_0x115fbe)[_0x1fc9('0x23')](function(_0x47e754){_0x4f54b6[_0x1fc9('0x1b')]=_0x47e754;if(_0xdaffcf[_0x1fc9('0x2c')][_0x1fc9('0x3c')]){_0x5849a4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1fc9('0x3d')](_0x5849a4);})[_0x1fc9('0x23')](function(_0x4c4545){_0x4f54b6[_0x1fc9('0x3e')]=_0x4c4545;return _0x4f54b6;})['then'](respondWithFilteredResult(_0x3e35eb,_0x5849a4))[_0x1fc9('0x3f')](handleError(_0x3e35eb,null));};exports[_0x1fc9('0x40')]=function(_0x539aee,_0x6ace90){var _0x6b9111={'raw':![],'where':{'id':_0x539aee[_0x1fc9('0x41')]['id']}},_0x2e0b88={};_0x2e0b88[_0x1fc9('0x2b')]=_['keys'](db[_0x1fc9('0x27')][_0x1fc9('0x42')]);_0x2e0b88[_0x1fc9('0x2c')]=_['keys'](_0x539aee[_0x1fc9('0x2c')]);_0x2e0b88['filters']=_[_0x1fc9('0x2e')](_0x2e0b88[_0x1fc9('0x2b')],_0x2e0b88[_0x1fc9('0x2c')]);_0x6b9111[_0x1fc9('0x30')]=_['intersection'](_0x2e0b88[_0x1fc9('0x2b')],qs[_0x1fc9('0x2f')](_0x539aee[_0x1fc9('0x2c')]['fields']));_0x6b9111[_0x1fc9('0x30')]=_0x6b9111[_0x1fc9('0x30')][_0x1fc9('0x43')]?_0x6b9111[_0x1fc9('0x30')]:_0x2e0b88[_0x1fc9('0x2b')];if(_0x539aee[_0x1fc9('0x2c')][_0x1fc9('0x3c')]){_0x6b9111[_0x1fc9('0x44')]=[{'all':!![]}];}_0x6b9111=_[_0x1fc9('0x39')]({},_0x6b9111,_0x539aee[_0x1fc9('0x3b')]);return db[_0x1fc9('0x27')][_0x1fc9('0x45')](_0x6b9111)[_0x1fc9('0x23')](handleEntityNotFound(_0x6ace90,null))[_0x1fc9('0x23')](respondWithResult(_0x6ace90,null))['catch'](handleError(_0x6ace90,null));};exports['create']=function(_0x749d1a,_0x4865fd){return db[_0x1fc9('0x27')][_0x1fc9('0x46')](_0x749d1a[_0x1fc9('0x47')],{})[_0x1fc9('0x23')](respondWithResult(_0x4865fd,0xc9))[_0x1fc9('0x3f')](handleError(_0x4865fd,null));};exports[_0x1fc9('0x48')]=function(_0x5b03f3,_0x9206df){return db[_0x1fc9('0x27')][_0x1fc9('0x48')](_0x5b03f3['body'],{'raw':![],'individualHooks':!![]})[_0x1fc9('0x23')](respondWithResult(_0x9206df,0xc9))[_0x1fc9('0x3f')](handleError(_0x9206df,null));};exports['update']=function(_0x3b2caf,_0x4d023e){if(_0x3b2caf[_0x1fc9('0x47')]['id']){delete _0x3b2caf['body']['id'];}return db[_0x1fc9('0x27')][_0x1fc9('0x45')]({'where':{'id':_0x3b2caf[_0x1fc9('0x41')]['id']}})[_0x1fc9('0x23')](handleEntityNotFound(_0x4d023e,null))[_0x1fc9('0x23')](saveUpdates(_0x3b2caf['body'],null))[_0x1fc9('0x23')](respondWithResult(_0x4d023e,null))['catch'](handleError(_0x4d023e,null));};exports['destroy']=function(_0x16d09d,_0x4fe507){return db[_0x1fc9('0x27')][_0x1fc9('0x45')]({'where':{'id':_0x16d09d[_0x1fc9('0x41')]['id']}})[_0x1fc9('0x23')](handleEntityNotFound(_0x4fe507,null))[_0x1fc9('0x23')](removeEntity(_0x4fe507,null))[_0x1fc9('0x3f')](handleError(_0x4fe507,null));};exports[_0x1fc9('0x49')]=function(_0x5d2adc,_0x4dce7a){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x5d2adc[_0x1fc9('0x2c')][_0x1fc9('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x1fc9('0x23')](respondWithResult(_0x4dce7a,0xcc))['catch'](handleError(_0x4dce7a,null));};exports[_0x1fc9('0x4b')]=function(_0x2f20d0,_0x13e0c5,_0x578a45){return db['AnalyticCustomReport'][_0x1fc9('0x4c')]({'where':{'id':_0x2f20d0['params']['id']}})[_0x1fc9('0x23')](handleEntityNotFound(_0x13e0c5,null))[_0x1fc9('0x23')](function(_0x2c8688){if(_0x2c8688){return db[_0x1fc9('0x4d')][_0x1fc9('0x4e')](function(_0xf76cf){return db[_0x1fc9('0x27')]['destroy']({'where':{'CustomReportId':_0x2f20d0[_0x1fc9('0x41')]['id']},'transaction':_0xf76cf})[_0x1fc9('0x23')](function(_0x4d03ac){var _0x2561d7=_[_0x1fc9('0x26')](_0x2f20d0[_0x1fc9('0x47')],function(_0x3af0e7){delete _0x3af0e7['id'];_0x3af0e7[_0x1fc9('0x4f')]=_0x2f20d0[_0x1fc9('0x41')]['id'];return _0x3af0e7;});return db[_0x1fc9('0x27')][_0x1fc9('0x48')](_0x2561d7,{'transaction':_0xf76cf});});})[_0x1fc9('0x23')](function(){return db['AnalyticFieldReport'][_0x1fc9('0x3d')]({'where':{'CustomReportId':_0x2f20d0[_0x1fc9('0x41')]['id']}});});}})[_0x1fc9('0x23')](respondWithResult(_0x13e0c5,null))[_0x1fc9('0x3f')](handleError(_0x13e0c5,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 64eca63..ee3cecf 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 _0xa645=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x20dd53,_0x110375){var _0x3461a4=function(_0x5e304b){while(--_0x5e304b){_0x20dd53['push'](_0x20dd53['shift']());}};_0x3461a4(++_0x110375);}(_0xa645,0xcb));var _0x5a64=function(_0x35a772,_0x121fb4){_0x35a772=_0x35a772-0x0;var _0x43e4c5=_0xa645[_0x35a772];return _0x43e4c5;};'use strict';var _=require(_0x5a64('0x0'));var util=require(_0x5a64('0x1'));var logger=require(_0x5a64('0x2'))(_0x5a64('0x3'));var moment=require(_0x5a64('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a64('0x5'));var fs=require('fs');var path=require(_0x5a64('0x6'));var rimraf=require(_0x5a64('0x7'));var config=require(_0x5a64('0x8'));var attributes=require(_0x5a64('0x9'));module[_0x5a64('0xa')]=function(_0x1e3274,_0x148884){return _0x1e3274[_0x5a64('0xb')](_0x5a64('0xc'),attributes,{'tableName':_0x5a64('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12de=['AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2ac97f,_0x533ecb){var _0x572191=function(_0x3002ea){while(--_0x3002ea){_0x2ac97f['push'](_0x2ac97f['shift']());}};_0x572191(++_0x533ecb);}(_0x12de,0x69));var _0xe12d=function(_0xf70d3e,_0x451f4b){_0xf70d3e=_0xf70d3e-0x0;var _0x53a3af=_0x12de[_0xf70d3e];return _0x53a3af;};'use strict';var _=require(_0xe12d('0x0'));var util=require(_0xe12d('0x1'));var logger=require(_0xe12d('0x2'))(_0xe12d('0x3'));var moment=require(_0xe12d('0x4'));var BPromise=require(_0xe12d('0x5'));var rp=require(_0xe12d('0x6'));var fs=require('fs');var path=require(_0xe12d('0x7'));var rimraf=require(_0xe12d('0x8'));var config=require(_0xe12d('0x9'));var attributes=require('./analyticFieldReport.attributes');module[_0xe12d('0xa')]=function(_0x2553f5,_0x5c1839){return _0x2553f5[_0xe12d('0xb')](_0xe12d('0xc'),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 2496021..29756af 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 _0xb6db=['then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x305434,_0x4aa0b9){var _0x2fee2e=function(_0x236980){while(--_0x236980){_0x305434['push'](_0x305434['shift']());}};_0x2fee2e(++_0x4aa0b9);}(_0xb6db,0x16a));var _0xbb6d=function(_0x188726,_0x24f287){_0x188726=_0x188726-0x0;var _0x993137=_0xb6db[_0x188726];return _0x993137;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbb6d('0x0'));var BPromise=require(_0xbb6d('0x1'));var rs=require(_0xbb6d('0x2'));var fs=require('fs');var Redis=require(_0xbb6d('0x3'));var db=require(_0xbb6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb6d('0x5'))(_0xbb6d('0x6'));var config=require(_0xbb6d('0x7'));var jayson=require(_0xbb6d('0x8'));var client=jayson[_0xbb6d('0x9')][_0xbb6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c3778,_0x3d3ecf,_0x2caa11){return new BPromise(function(_0x382bc5,_0x5f5870){return client[_0xbb6d('0xb')](_0x3c3778,_0x2caa11)[_0xbb6d('0xc')](function(_0x599862){logger[_0xbb6d('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3d3ecf,_0xbb6d('0xe'));logger[_0xbb6d('0xf')](_0xbb6d('0x10'),_0x3d3ecf,_0xbb6d('0xe'),JSON[_0xbb6d('0x11')](_0x599862));if(_0x599862[_0xbb6d('0x12')]){if(_0x599862[_0xbb6d('0x12')][_0xbb6d('0x13')]===0x1f4){logger[_0xbb6d('0x12')](_0xbb6d('0x14'),_0x3d3ecf,_0x599862[_0xbb6d('0x12')][_0xbb6d('0x15')]);return _0x5f5870(_0x599862['error']['message']);}logger[_0xbb6d('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3d3ecf,_0x599862[_0xbb6d('0x12')][_0xbb6d('0x15')]);return _0x382bc5(_0x599862['error'][_0xbb6d('0x15')]);}else{logger[_0xbb6d('0xd')](_0xbb6d('0x14'),_0x3d3ecf,_0xbb6d('0xe'));_0x382bc5(_0x599862['result'][_0xbb6d('0x15')]);}})['catch'](function(_0xdb0027){logger[_0xbb6d('0x12')](_0xbb6d('0x14'),_0x3d3ecf,_0xdb0027);_0x5f5870(_0xdb0027);});});}
\ No newline at end of file
+var _0x8daa=['info','request\x20sent','debug','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3b5c45,_0x526798){var _0x2232e2=function(_0x1727fe){while(--_0x1727fe){_0x3b5c45['push'](_0x3b5c45['shift']());}};_0x2232e2(++_0x526798);}(_0x8daa,0x66));var _0xa8da=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x8daa[_0x207d2f];return _0x3c3498;};'use strict';var _=require(_0xa8da('0x0'));var util=require(_0xa8da('0x1'));var moment=require(_0xa8da('0x2'));var BPromise=require(_0xa8da('0x3'));var rs=require(_0xa8da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8da('0x6'))(_0xa8da('0x7'));var config=require(_0xa8da('0x8'));var jayson=require(_0xa8da('0x9'));var client=jayson[_0xa8da('0xa')][_0xa8da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf34ced,_0x44bbfc,_0x231533){return new BPromise(function(_0x4b8d4c,_0x3db1ac){return client['request'](_0xf34ced,_0x231533)[_0xa8da('0xc')](function(_0x1b32b0){logger[_0xa8da('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44bbfc,_0xa8da('0xe'));logger[_0xa8da('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x44bbfc,_0xa8da('0xe'),JSON[_0xa8da('0x10')](_0x1b32b0));if(_0x1b32b0[_0xa8da('0x11')]){if(_0x1b32b0[_0xa8da('0x11')][_0xa8da('0x12')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x44bbfc,_0x1b32b0[_0xa8da('0x11')][_0xa8da('0x13')]);return _0x3db1ac(_0x1b32b0[_0xa8da('0x11')]['message']);}logger[_0xa8da('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44bbfc,_0x1b32b0[_0xa8da('0x11')][_0xa8da('0x13')]);return _0x4b8d4c(_0x1b32b0[_0xa8da('0x11')][_0xa8da('0x13')]);}else{logger[_0xa8da('0xd')](_0xa8da('0x14'),_0x44bbfc,_0xa8da('0xe'));_0x4b8d4c(_0x1b32b0[_0xa8da('0x15')][_0xa8da('0x13')]);}})[_0xa8da('0x16')](function(_0x546bc9){logger[_0xa8da('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44bbfc,_0x546bc9);_0x3db1ac(_0x546bc9);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 361910b..9c4b3b5 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(_0x554196,_0x48c7aa){var _0x2d15a6=function(_0x59aa30){while(--_0x59aa30){_0x554196['push'](_0x554196['shift']());}};_0x2d15a6(++_0x48c7aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x1968b1,_0x58467d){var _0x447458=function(_0x4497c6){while(--_0x4497c6){_0x1968b1['push'](_0x1968b1['shift']());}};_0x447458(++_0x58467d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 f7d95ef..3492f58 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 _0x3189=['exports','name','STRING','TEXT','sequelize'];(function(_0x20a4da,_0x1e9021){var _0x33cdf4=function(_0x8e43bb){while(--_0x8e43bb){_0x20a4da['push'](_0x20a4da['shift']());}};_0x33cdf4(++_0x1e9021);}(_0x3189,0xae));var _0x9318=function(_0x130375,_0x4cee28){_0x130375=_0x130375-0x0;var _0x457d9e=_0x3189[_0x130375];return _0x457d9e;};'use strict';var Sequelize=require(_0x9318('0x0'));module[_0x9318('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9318('0x2')},'table':{'type':Sequelize[_0x9318('0x3')]},'metric':{'type':Sequelize[_0x9318('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd816=['sequelize','exports','name'];(function(_0x2eb608,_0xe8558){var _0x2bc39a=function(_0x34662b){while(--_0x34662b){_0x2eb608['push'](_0x2eb608['shift']());}};_0x2bc39a(++_0xe8558);}(_0xd816,0xd5));var _0x6d81=function(_0x420354,_0x395687){_0x420354=_0x420354-0x0;var _0x1cbbbe=_0xd816[_0x420354];return _0x1cbbbe;};'use strict';var Sequelize=require(_0x6d81('0x0'));module[_0x6d81('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6d81('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6695ff9..763dfb2 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3e94b1,_0x14218b){var _0x4b8663=function(_0x138ce0){while(--_0x138ce0){_0x3e94b1['push'](_0x3e94b1['shift']());}};_0x4b8663(++_0x14218b);}(_0x008c,0x188));var _0xc008=function(_0x34e84d,_0x3f3502){_0x34e84d=_0x34e84d-0x0;var _0x3f9125=_0x008c[_0x34e84d];return _0x3f9125;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x56ba3a,_0x32aa7d){var _0x5e2202=function(_0x9c8540){while(--_0x9c8540){_0x56ba3a['push'](_0x56ba3a['shift']());}};_0x5e2202(++_0x32aa7d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4068a3,_0x1c2cd3){_0x4068a3=_0x4068a3-0x0;var _0xcdea1=_0x7fbe[_0x4068a3];return _0xcdea1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 7c4b07c..33a473d 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 _0x4d49=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','api','moment','bluebird'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x4d49,0x141));var _0x94d4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4d49[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x94d4('0x0'));var logger=require('../../config/logger')(_0x94d4('0x1'));var moment=require(_0x94d4('0x2'));var BPromise=require(_0x94d4('0x3'));var rp=require(_0x94d4('0x4'));var fs=require('fs');var path=require(_0x94d4('0x5'));var rimraf=require(_0x94d4('0x6'));var config=require(_0x94d4('0x7'));var attributes=require(_0x94d4('0x8'));module[_0x94d4('0x9')]=function(_0x4dd133,_0x2b3127){return _0x4dd133[_0x94d4('0xa')](_0x94d4('0xb'),attributes,{'tableName':_0x94d4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f7a=['bluebird','../../config/environment','./analyticMetric.attributes','lodash','util','../../config/logger','api'];(function(_0x28b409,_0x9fe0f3){var _0x4c2d3d=function(_0x2255c9){while(--_0x2255c9){_0x28b409['push'](_0x28b409['shift']());}};_0x4c2d3d(++_0x9fe0f3);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x9f7a[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xa9f7('0x0'));var util=require(_0xa9f7('0x1'));var logger=require(_0xa9f7('0x2'))(_0xa9f7('0x3'));var moment=require('moment');var BPromise=require(_0xa9f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa9f7('0x5'));var attributes=require(_0xa9f7('0x6'));module['exports']=function(_0x499ff6,_0xc1334d){return _0x499ff6['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 38cae80..e7079f9 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 _0xbb79=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x3d51a5,_0x4b712f){var _0xbc7cde=function(_0x40e203){while(--_0x40e203){_0x3d51a5['push'](_0x3d51a5['shift']());}};_0xbc7cde(++_0x4b712f);}(_0xbb79,0xbb));var _0x9bb7=function(_0xdd6558,_0x48751d){_0xdd6558=_0xdd6558-0x0;var _0x124109=_0xbb79[_0xdd6558];return _0x124109;};'use strict';var _=require(_0x9bb7('0x0'));var util=require(_0x9bb7('0x1'));var moment=require(_0x9bb7('0x2'));var BPromise=require('bluebird');var rs=require(_0x9bb7('0x3'));var fs=require('fs');var Redis=require(_0x9bb7('0x4'));var db=require(_0x9bb7('0x5'))['db'];var utils=require(_0x9bb7('0x6'));var logger=require('../../config/logger')(_0x9bb7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9bb7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x313585,_0x5e76d2,_0x31ba03){return new BPromise(function(_0x3a12e4,_0x366bfe){return client['request'](_0x313585,_0x31ba03)[_0x9bb7('0x9')](function(_0x2e676c){logger[_0x9bb7('0xa')](_0x9bb7('0xb'),_0x5e76d2,_0x9bb7('0xc'));logger[_0x9bb7('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5e76d2,'request\x20sent',JSON[_0x9bb7('0xe')](_0x2e676c));if(_0x2e676c['error']){if(_0x2e676c[_0x9bb7('0xf')]['code']===0x1f4){logger[_0x9bb7('0xf')](_0x9bb7('0xb'),_0x5e76d2,_0x2e676c[_0x9bb7('0xf')][_0x9bb7('0x10')]);return _0x366bfe(_0x2e676c[_0x9bb7('0xf')][_0x9bb7('0x10')]);}logger[_0x9bb7('0xf')](_0x9bb7('0xb'),_0x5e76d2,_0x2e676c[_0x9bb7('0xf')]['message']);return _0x3a12e4(_0x2e676c[_0x9bb7('0xf')][_0x9bb7('0x10')]);}else{logger[_0x9bb7('0xa')](_0x9bb7('0xb'),_0x5e76d2,_0x9bb7('0xc'));_0x3a12e4(_0x2e676c[_0x9bb7('0x11')][_0x9bb7('0x10')]);}})[_0x9bb7('0x12')](function(_0x129e21){logger[_0x9bb7('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x5e76d2,_0x129e21);_0x366bfe(_0x129e21);});});}
\ No newline at end of file
+var _0xa033=['stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c9bdf,_0x3b30cd){var _0x5664a6=function(_0x4ea55c){while(--_0x4ea55c){_0x3c9bdf['push'](_0x3c9bdf['shift']());}};_0x5664a6(++_0x3b30cd);}(_0xa033,0x145));var _0x3a03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa033[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a03('0x0'));var util=require(_0x3a03('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a03('0x2'));var fs=require('fs');var Redis=require(_0x3a03('0x3'));var db=require(_0x3a03('0x4'))['db'];var utils=require(_0x3a03('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3a03('0x6'));var jayson=require(_0x3a03('0x7'));var client=jayson[_0x3a03('0x8')][_0x3a03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d17c9,_0x54d355,_0x127d55){return new BPromise(function(_0x3fc118,_0x27cc13){return client[_0x3a03('0xa')](_0x1d17c9,_0x127d55)['then'](function(_0x2eba7){logger[_0x3a03('0xb')](_0x3a03('0xc'),_0x54d355,_0x3a03('0xd'));logger[_0x3a03('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x54d355,_0x3a03('0xd'),JSON[_0x3a03('0xf')](_0x2eba7));if(_0x2eba7[_0x3a03('0x10')]){if(_0x2eba7['error']['code']===0x1f4){logger['error'](_0x3a03('0xc'),_0x54d355,_0x2eba7[_0x3a03('0x10')][_0x3a03('0x11')]);return _0x27cc13(_0x2eba7[_0x3a03('0x10')][_0x3a03('0x11')]);}logger['error'](_0x3a03('0xc'),_0x54d355,_0x2eba7[_0x3a03('0x10')][_0x3a03('0x11')]);return _0x3fc118(_0x2eba7[_0x3a03('0x10')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x54d355,'request\x20sent');_0x3fc118(_0x2eba7[_0x3a03('0x12')][_0x3a03('0x11')]);}})[_0x3a03('0x13')](function(_0x187b98){logger[_0x3a03('0x10')](_0x3a03('0xc'),_0x54d355,_0x187b98);_0x27cc13(_0x187b98);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 8b6dead..02bc7a4 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 _0x1115=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x253e0a,_0x3cef8e){var _0x24b388=function(_0x37f3ac){while(--_0x37f3ac){_0x253e0a['push'](_0x253e0a['shift']());}};_0x24b388(++_0x3cef8e);}(_0x1115,0x1b6));var _0x5111=function(_0x48b956,_0xb05185){_0x48b956=_0x48b956-0x0;var _0x5795b6=_0x1115[_0x48b956];return _0x5795b6;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['show']);router[_0x5111('0xc')]('/',auth['isAuthenticated'](),controller[_0x5111('0xd')]);router[_0x5111('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['delete'](_0x5111('0xb'),auth['isAuthenticated'](),controller[_0x5111('0x10')]);module[_0x5111('0x11')]=router;
\ No newline at end of file
+var _0xb957=['put','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','create'];(function(_0x583bef,_0x5b86f3){var _0x154875=function(_0x3f8b54){while(--_0x3f8b54){_0x583bef['push'](_0x583bef['shift']());}};_0x154875(++_0x5b86f3);}(_0xb957,0x6d));var _0x7b95=function(_0x317a7c,_0x322daf){_0x317a7c=_0x317a7c-0x0;var _0x25baca=_0xb957[_0x317a7c];return _0x25baca;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7b95('0x0'));var timeout=require('connect-timeout');var express=require(_0x7b95('0x1'));var router=express[_0x7b95('0x2')]();var fs_extra=require(_0x7b95('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b95('0x4'));var config=require(_0x7b95('0x5'));var controller=require(_0x7b95('0x6'));router[_0x7b95('0x7')]('/',auth[_0x7b95('0x8')](),controller['index']);router[_0x7b95('0x7')](_0x7b95('0x9'),auth[_0x7b95('0x8')](),controller['show']);router['post']('/',auth[_0x7b95('0x8')](),controller[_0x7b95('0xa')]);router[_0x7b95('0xb')](_0x7b95('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7b95('0x9'),auth[_0x7b95('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 722999a..ffe473a 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 _0x211e=['exports','sequelize'];(function(_0x14c064,_0x592fa8){var _0x1e0dc0=function(_0x30b630){while(--_0x30b630){_0x14c064['push'](_0x14c064['shift']());}};_0x1e0dc0(++_0x592fa8);}(_0x211e,0x165));var _0xe211=function(_0x3cb417,_0x5dabe){_0x3cb417=_0x3cb417-0x0;var _0xff6332=_0x211e[_0x3cb417];return _0xff6332;};'use strict';var Sequelize=require(_0xe211('0x0'));module[_0xe211('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xcf66=['sequelize','TEXT'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcf66,0x110));var _0x6cf6=function(_0x57435a,_0x1e783d){_0x57435a=_0x57435a-0x0;var _0x3e3561=_0xcf66[_0x57435a];return _0x3e3561;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module['exports']={'tree':{'type':Sequelize[_0x6cf6('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 8d2b531..c3d19f2 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 _0xc643=['merge','findAll','rows','catch','show','keys','includeAll','include','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL'];(function(_0x1c663b,_0x1c5e31){var _0x1dcc49=function(_0xcc2414){while(--_0xcc2414){_0x1c663b['push'](_0x1c663b['shift']());}};_0x1dcc49(++_0x1c5e31);}(_0xc643,0xa9));var _0x3c64=function(_0x6a5e9b,_0x2ac2f7){_0x6a5e9b=_0x6a5e9b-0x0;var _0x9d162d=_0xc643[_0x6a5e9b];return _0x9d162d;};'use strict';var emlformat=require(_0x3c64('0x0'));var rimraf=require(_0x3c64('0x1'));var zipdir=require(_0x3c64('0x2'));var jsonpatch=require(_0x3c64('0x3'));var rp=require('request-promise');var moment=require(_0x3c64('0x4'));var BPromise=require(_0x3c64('0x5'));var Mustache=require(_0x3c64('0x6'));var util=require(_0x3c64('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3c64('0x8'));var ejs=require(_0x3c64('0x9'));var fs=require('fs');var fs_extra=require(_0x3c64('0xa'));var _=require(_0x3c64('0xb'));var squel=require('squel');var crypto=require(_0x3c64('0xc'));var jsforce=require(_0x3c64('0xd'));var deskjs=require(_0x3c64('0xe'));var toCsv=require(_0x3c64('0x8'));var querystring=require(_0x3c64('0xf'));var Papa=require(_0x3c64('0x10'));var Redis=require('ioredis');var authService=require(_0x3c64('0x11'));var qs=require(_0x3c64('0x12'));var as=require(_0x3c64('0x13'));var hardwareService=require(_0x3c64('0x14'));var logger=require(_0x3c64('0x15'))(_0x3c64('0x16'));var utils=require(_0x3c64('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3c64('0x18'))['db'];function respondWithStatusCode(_0x1af007,_0x4487ea){_0x4487ea=_0x4487ea||0xcc;return function(_0xc66827){if(_0xc66827){return _0x1af007[_0x3c64('0x19')](_0x4487ea);}return _0x1af007[_0x3c64('0x1a')](_0x4487ea)[_0x3c64('0x1b')]();};}function respondWithResult(_0x1ca73a,_0x26e9b5){_0x26e9b5=_0x26e9b5||0xc8;return function(_0x426024){if(_0x426024){return _0x1ca73a[_0x3c64('0x1a')](_0x26e9b5)['json'](_0x426024);}};}function respondWithFilteredResult(_0x27b2cd,_0x58f1b7){return function(_0x4e4aff){if(_0x4e4aff){var _0x21f55a=typeof _0x58f1b7['offset']===_0x3c64('0x1c')&&typeof _0x58f1b7[_0x3c64('0x1d')]==='undefined';var _0x2fe7ae=_0x4e4aff['count'];var _0x14b5e9=_0x21f55a?0x0:_0x58f1b7[_0x3c64('0x1e')];var _0x5509de=_0x21f55a?_0x4e4aff[_0x3c64('0x1f')]:_0x58f1b7[_0x3c64('0x1e')]+_0x58f1b7[_0x3c64('0x1d')];var _0x14469d;if(_0x5509de>=_0x2fe7ae){_0x5509de=_0x2fe7ae;_0x14469d=0xc8;}else{_0x14469d=0xce;}_0x27b2cd[_0x3c64('0x1a')](_0x14469d);return _0x27b2cd[_0x3c64('0x20')]('Content-Range',_0x14b5e9+'-'+_0x5509de+'/'+_0x2fe7ae)[_0x3c64('0x21')](_0x4e4aff);}return null;};}function patchUpdates(_0x168d1b){return function(_0x408a0b){try{jsonpatch[_0x3c64('0x22')](_0x408a0b,_0x168d1b,!![]);}catch(_0x2aa09a){return BPromise[_0x3c64('0x23')](_0x2aa09a);}return _0x408a0b[_0x3c64('0x24')]();};}function saveUpdates(_0x31ee6d,_0x5ef6b2){return function(_0x32abcd){if(_0x32abcd){return _0x32abcd[_0x3c64('0x25')](_0x31ee6d)['then'](function(_0x48377d){return _0x48377d;});}return null;};}function removeEntity(_0x1400c0,_0x2561db){return function(_0x21db8b){if(_0x21db8b){return _0x21db8b[_0x3c64('0x26')]()[_0x3c64('0x27')](function(){_0x1400c0['status'](0xcc)[_0x3c64('0x1b')]();});}};}function handleEntityNotFound(_0x4740d7,_0x2b32f6){return function(_0x1fd3c4){if(!_0x1fd3c4){_0x4740d7[_0x3c64('0x19')](0x194);}return _0x1fd3c4;};}function handleError(_0x1d45f7,_0x3efe56){_0x3efe56=_0x3efe56||0x1f4;return function(_0x130e7a){logger[_0x3c64('0x28')](_0x130e7a[_0x3c64('0x29')]);if(_0x130e7a[_0x3c64('0x2a')]){delete _0x130e7a[_0x3c64('0x2a')];}_0x1d45f7[_0x3c64('0x1a')](_0x3efe56)[_0x3c64('0x2b')](_0x130e7a);};}exports[_0x3c64('0x2c')]=function(_0x2b10e8,_0x29b174){var _0x4dc7c3={},_0x4ed823={},_0x4744c5={'count':0x0,'rows':[]};var _0x378f79=_[_0x3c64('0x2d')](db[_0x3c64('0x2e')][_0x3c64('0x2f')],function(_0x5a63c4){return{'name':_0x5a63c4[_0x3c64('0x30')],'type':_0x5a63c4[_0x3c64('0x31')][_0x3c64('0x32')]};});_0x4ed823[_0x3c64('0x33')]=_[_0x3c64('0x2d')](_0x378f79,_0x3c64('0x2a'));_0x4ed823[_0x3c64('0x34')]=_['keys'](_0x2b10e8[_0x3c64('0x34')]);_0x4ed823['filters']=_[_0x3c64('0x35')](_0x4ed823[_0x3c64('0x33')],_0x4ed823[_0x3c64('0x34')]);_0x4dc7c3[_0x3c64('0x36')]=_[_0x3c64('0x35')](_0x4ed823[_0x3c64('0x33')],qs[_0x3c64('0x37')](_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x37')]));_0x4dc7c3[_0x3c64('0x36')]=_0x4dc7c3[_0x3c64('0x36')][_0x3c64('0x38')]?_0x4dc7c3[_0x3c64('0x36')]:_0x4ed823['model'];if(!_0x2b10e8[_0x3c64('0x34')]['hasOwnProperty'](_0x3c64('0x39'))){_0x4dc7c3[_0x3c64('0x1d')]=qs[_0x3c64('0x1d')](_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x1d')]);_0x4dc7c3[_0x3c64('0x1e')]=qs['offset'](_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x1e')]);}_0x4dc7c3[_0x3c64('0x3a')]=qs[_0x3c64('0x3b')](_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x3b')]);_0x4dc7c3[_0x3c64('0x3c')]=qs[_0x3c64('0x3d')](_[_0x3c64('0x3e')](_0x2b10e8[_0x3c64('0x34')],_0x4ed823[_0x3c64('0x3d')]),_0x378f79);if(_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x3f')]){_0x4dc7c3[_0x3c64('0x3c')]=_['merge'](_0x4dc7c3['where'],{'$or':_[_0x3c64('0x2d')](_0x378f79,function(_0x532d87){if(_0x532d87[_0x3c64('0x31')]!==_0x3c64('0x40')){var _0x5d34e5={};_0x5d34e5[_0x532d87[_0x3c64('0x2a')]]={'$like':'%'+_0x2b10e8[_0x3c64('0x34')][_0x3c64('0x3f')]+'%'};return _0x5d34e5;}})});}_0x4dc7c3=_[_0x3c64('0x41')]({},_0x4dc7c3,_0x2b10e8['options']);var _0x56ab53={'where':_0x4dc7c3[_0x3c64('0x3c')]};return db['AnalyticTreeReport'][_0x3c64('0x1f')](_0x56ab53)['then'](function(_0x1ff93f){_0x4744c5[_0x3c64('0x1f')]=_0x1ff93f;if(_0x2b10e8['query']['includeAll']){_0x4dc7c3['include']=[{'all':!![]}];}return db[_0x3c64('0x2e')][_0x3c64('0x42')](_0x4dc7c3);})[_0x3c64('0x27')](function(_0x3e160b){_0x4744c5[_0x3c64('0x43')]=_0x3e160b;return _0x4744c5;})[_0x3c64('0x27')](respondWithFilteredResult(_0x29b174,_0x4dc7c3))[_0x3c64('0x44')](handleError(_0x29b174,null));};exports[_0x3c64('0x45')]=function(_0x9a3d6f,_0x138315){var _0x3b810d={'raw':!![],'where':{'id':_0x9a3d6f['params']['id']}},_0x428401={};_0x428401['model']=_[_0x3c64('0x46')](db['AnalyticTreeReport'][_0x3c64('0x2f')]);_0x428401[_0x3c64('0x34')]=_[_0x3c64('0x46')](_0x9a3d6f['query']);_0x428401['filters']=_[_0x3c64('0x35')](_0x428401[_0x3c64('0x33')],_0x428401[_0x3c64('0x34')]);_0x3b810d[_0x3c64('0x36')]=_[_0x3c64('0x35')](_0x428401[_0x3c64('0x33')],qs[_0x3c64('0x37')](_0x9a3d6f['query'][_0x3c64('0x37')]));_0x3b810d['attributes']=_0x3b810d[_0x3c64('0x36')][_0x3c64('0x38')]?_0x3b810d[_0x3c64('0x36')]:_0x428401[_0x3c64('0x33')];if(_0x9a3d6f['query'][_0x3c64('0x47')]){_0x3b810d[_0x3c64('0x48')]=[{'all':!![]}];}_0x3b810d=_[_0x3c64('0x41')]({},_0x3b810d,_0x9a3d6f[_0x3c64('0x49')]);return db[_0x3c64('0x2e')][_0x3c64('0x4a')](_0x3b810d)[_0x3c64('0x27')](handleEntityNotFound(_0x138315,null))['then'](respondWithResult(_0x138315,null))[_0x3c64('0x44')](handleError(_0x138315,null));};exports[_0x3c64('0x4b')]=function(_0x3e5d01,_0x61768a){return db[_0x3c64('0x2e')][_0x3c64('0x4b')](_0x3e5d01[_0x3c64('0x4c')],{})['then'](respondWithResult(_0x61768a,0xc9))[_0x3c64('0x44')](handleError(_0x61768a,null));};exports[_0x3c64('0x25')]=function(_0x1f96e3,_0x2f7972){if(_0x1f96e3['body']['id']){delete _0x1f96e3[_0x3c64('0x4c')]['id'];}return db[_0x3c64('0x2e')][_0x3c64('0x4a')]({'where':{'id':_0x1f96e3[_0x3c64('0x4d')]['id']}})[_0x3c64('0x27')](handleEntityNotFound(_0x2f7972,null))[_0x3c64('0x27')](saveUpdates(_0x1f96e3[_0x3c64('0x4c')],null))[_0x3c64('0x27')](respondWithResult(_0x2f7972,null))[_0x3c64('0x44')](handleError(_0x2f7972,null));};exports['destroy']=function(_0x2055ff,_0x18abfc){return db['AnalyticTreeReport'][_0x3c64('0x4a')]({'where':{'id':_0x2055ff['params']['id']}})['then'](handleEntityNotFound(_0x18abfc,null))[_0x3c64('0x27')](removeEntity(_0x18abfc,null))[_0x3c64('0x44')](handleError(_0x18abfc,null));};
\ No newline at end of file
+var _0x93a6=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','stack','name','send','map','AnalyticTreeReport','rawAttributes','model','keys','query','intersection','attributes','fields'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0x93a6,0x179));var _0x693a=function(_0x27ff4d,_0x41a7d6){_0x27ff4d=_0x27ff4d-0x0;var _0x803d72=_0x93a6[_0x27ff4d];return _0x803d72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x693a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x693a('0x1'));var rp=require(_0x693a('0x2'));var moment=require(_0x693a('0x3'));var BPromise=require(_0x693a('0x4'));var Mustache=require(_0x693a('0x5'));var util=require(_0x693a('0x6'));var path=require(_0x693a('0x7'));var sox=require(_0x693a('0x8'));var csv=require(_0x693a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x693a('0xa'));var _=require(_0x693a('0xb'));var squel=require(_0x693a('0xc'));var crypto=require(_0x693a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x693a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x693a('0xf'));var Redis=require(_0x693a('0x10'));var authService=require(_0x693a('0x11'));var qs=require(_0x693a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x693a('0x13'));var logger=require(_0x693a('0x14'))(_0x693a('0x15'));var utils=require(_0x693a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x693a('0x17'))['db'];function respondWithStatusCode(_0x3ba090,_0x44f248){_0x44f248=_0x44f248||0xcc;return function(_0x1c02f2){if(_0x1c02f2){return _0x3ba090[_0x693a('0x18')](_0x44f248);}return _0x3ba090[_0x693a('0x19')](_0x44f248)[_0x693a('0x1a')]();};}function respondWithResult(_0x5e37e5,_0x26a8d1){_0x26a8d1=_0x26a8d1||0xc8;return function(_0x12d22f){if(_0x12d22f){return _0x5e37e5[_0x693a('0x19')](_0x26a8d1)['json'](_0x12d22f);}};}function respondWithFilteredResult(_0x4b3f1d,_0x5ad414){return function(_0x13f81b){if(_0x13f81b){var _0x3e55af=typeof _0x5ad414[_0x693a('0x1b')]===_0x693a('0x1c')&&typeof _0x5ad414['limit']===_0x693a('0x1c');var _0x54fba0=_0x13f81b[_0x693a('0x1d')];var _0x1fc963=_0x3e55af?0x0:_0x5ad414[_0x693a('0x1b')];var _0x4a7e5c=_0x3e55af?_0x13f81b[_0x693a('0x1d')]:_0x5ad414['offset']+_0x5ad414[_0x693a('0x1e')];var _0x39159c;if(_0x4a7e5c>=_0x54fba0){_0x4a7e5c=_0x54fba0;_0x39159c=0xc8;}else{_0x39159c=0xce;}_0x4b3f1d[_0x693a('0x19')](_0x39159c);return _0x4b3f1d[_0x693a('0x1f')](_0x693a('0x20'),_0x1fc963+'-'+_0x4a7e5c+'/'+_0x54fba0)[_0x693a('0x21')](_0x13f81b);}return null;};}function patchUpdates(_0x33cdfc){return function(_0x16a742){try{jsonpatch[_0x693a('0x22')](_0x16a742,_0x33cdfc,!![]);}catch(_0x591a37){return BPromise[_0x693a('0x23')](_0x591a37);}return _0x16a742['save']();};}function saveUpdates(_0x208ee9,_0x1840ec){return function(_0x395d19){if(_0x395d19){return _0x395d19['update'](_0x208ee9)[_0x693a('0x24')](function(_0xc73d82){return _0xc73d82;});}return null;};}function removeEntity(_0x1de215,_0x77c40d){return function(_0x912578){if(_0x912578){return _0x912578['destroy']()['then'](function(){_0x1de215[_0x693a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34c768,_0x5bb94c){return function(_0x286f4d){if(!_0x286f4d){_0x34c768[_0x693a('0x18')](0x194);}return _0x286f4d;};}function handleError(_0x445052,_0x11e1b3){_0x11e1b3=_0x11e1b3||0x1f4;return function(_0x6d731f){logger['error'](_0x6d731f[_0x693a('0x25')]);if(_0x6d731f[_0x693a('0x26')]){delete _0x6d731f[_0x693a('0x26')];}_0x445052[_0x693a('0x19')](_0x11e1b3)[_0x693a('0x27')](_0x6d731f);};}exports['index']=function(_0x44411d,_0x2809f2){var _0x4201e5={},_0x561f48={},_0x406250={'count':0x0,'rows':[]};var _0x3e4d60=_[_0x693a('0x28')](db[_0x693a('0x29')][_0x693a('0x2a')],function(_0x1a3edf){return{'name':_0x1a3edf['fieldName'],'type':_0x1a3edf['type']['key']};});_0x561f48[_0x693a('0x2b')]=_[_0x693a('0x28')](_0x3e4d60,'name');_0x561f48['query']=_[_0x693a('0x2c')](_0x44411d[_0x693a('0x2d')]);_0x561f48['filters']=_[_0x693a('0x2e')](_0x561f48[_0x693a('0x2b')],_0x561f48[_0x693a('0x2d')]);_0x4201e5[_0x693a('0x2f')]=_[_0x693a('0x2e')](_0x561f48['model'],qs[_0x693a('0x30')](_0x44411d['query'][_0x693a('0x30')]));_0x4201e5[_0x693a('0x2f')]=_0x4201e5[_0x693a('0x2f')][_0x693a('0x31')]?_0x4201e5[_0x693a('0x2f')]:_0x561f48[_0x693a('0x2b')];if(!_0x44411d[_0x693a('0x2d')][_0x693a('0x32')](_0x693a('0x33'))){_0x4201e5[_0x693a('0x1e')]=qs[_0x693a('0x1e')](_0x44411d['query'][_0x693a('0x1e')]);_0x4201e5[_0x693a('0x1b')]=qs[_0x693a('0x1b')](_0x44411d[_0x693a('0x2d')][_0x693a('0x1b')]);}_0x4201e5[_0x693a('0x34')]=qs[_0x693a('0x35')](_0x44411d[_0x693a('0x2d')][_0x693a('0x35')]);_0x4201e5[_0x693a('0x36')]=qs[_0x693a('0x37')](_['pick'](_0x44411d['query'],_0x561f48[_0x693a('0x37')]),_0x3e4d60);if(_0x44411d['query'][_0x693a('0x38')]){_0x4201e5[_0x693a('0x36')]=_['merge'](_0x4201e5['where'],{'$or':_[_0x693a('0x28')](_0x3e4d60,function(_0x1d1856){if(_0x1d1856[_0x693a('0x39')]!==_0x693a('0x3a')){var _0x58b009={};_0x58b009[_0x1d1856[_0x693a('0x26')]]={'$like':'%'+_0x44411d['query']['filter']+'%'};return _0x58b009;}})});}_0x4201e5=_[_0x693a('0x3b')]({},_0x4201e5,_0x44411d[_0x693a('0x3c')]);var _0x541a70={'where':_0x4201e5[_0x693a('0x36')]};return db['AnalyticTreeReport'][_0x693a('0x1d')](_0x541a70)['then'](function(_0x2dfb67){_0x406250['count']=_0x2dfb67;if(_0x44411d[_0x693a('0x2d')][_0x693a('0x3d')]){_0x4201e5[_0x693a('0x3e')]=[{'all':!![]}];}return db[_0x693a('0x29')][_0x693a('0x3f')](_0x4201e5);})[_0x693a('0x24')](function(_0x17dc45){_0x406250['rows']=_0x17dc45;return _0x406250;})[_0x693a('0x24')](respondWithFilteredResult(_0x2809f2,_0x4201e5))[_0x693a('0x40')](handleError(_0x2809f2,null));};exports['show']=function(_0xbec6d4,_0x39b5a6){var _0x5c19e7={'raw':!![],'where':{'id':_0xbec6d4[_0x693a('0x41')]['id']}},_0x3ecdcb={};_0x3ecdcb[_0x693a('0x2b')]=_[_0x693a('0x2c')](db[_0x693a('0x29')][_0x693a('0x2a')]);_0x3ecdcb[_0x693a('0x2d')]=_['keys'](_0xbec6d4[_0x693a('0x2d')]);_0x3ecdcb[_0x693a('0x37')]=_[_0x693a('0x2e')](_0x3ecdcb[_0x693a('0x2b')],_0x3ecdcb[_0x693a('0x2d')]);_0x5c19e7[_0x693a('0x2f')]=_[_0x693a('0x2e')](_0x3ecdcb['model'],qs['fields'](_0xbec6d4['query'][_0x693a('0x30')]));_0x5c19e7[_0x693a('0x2f')]=_0x5c19e7['attributes'][_0x693a('0x31')]?_0x5c19e7['attributes']:_0x3ecdcb[_0x693a('0x2b')];if(_0xbec6d4[_0x693a('0x2d')][_0x693a('0x3d')]){_0x5c19e7[_0x693a('0x3e')]=[{'all':!![]}];}_0x5c19e7=_[_0x693a('0x3b')]({},_0x5c19e7,_0xbec6d4['options']);return db[_0x693a('0x29')][_0x693a('0x42')](_0x5c19e7)[_0x693a('0x24')](handleEntityNotFound(_0x39b5a6,null))[_0x693a('0x24')](respondWithResult(_0x39b5a6,null))[_0x693a('0x40')](handleError(_0x39b5a6,null));};exports[_0x693a('0x43')]=function(_0x2344ad,_0x26afb2){return db[_0x693a('0x29')][_0x693a('0x43')](_0x2344ad[_0x693a('0x44')],{})[_0x693a('0x24')](respondWithResult(_0x26afb2,0xc9))[_0x693a('0x40')](handleError(_0x26afb2,null));};exports[_0x693a('0x45')]=function(_0x123eb2,_0x35731b){if(_0x123eb2[_0x693a('0x44')]['id']){delete _0x123eb2[_0x693a('0x44')]['id'];}return db[_0x693a('0x29')]['find']({'where':{'id':_0x123eb2[_0x693a('0x41')]['id']}})[_0x693a('0x24')](handleEntityNotFound(_0x35731b,null))[_0x693a('0x24')](saveUpdates(_0x123eb2['body'],null))['then'](respondWithResult(_0x35731b,null))['catch'](handleError(_0x35731b,null));};exports[_0x693a('0x46')]=function(_0x544140,_0x591aa7){return db['AnalyticTreeReport']['find']({'where':{'id':_0x544140[_0x693a('0x41')]['id']}})[_0x693a('0x24')](handleEntityNotFound(_0x591aa7,null))[_0x693a('0x24')](removeEntity(_0x591aa7,null))[_0x693a('0x40')](handleError(_0x591aa7,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index bab2f6a..7147816 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 _0x32c2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x32a635,_0x553600){var _0x4f2736=function(_0x4ea48c){while(--_0x4ea48c){_0x32a635['push'](_0x32a635['shift']());}};_0x4f2736(++_0x553600);}(_0x32c2,0x1e0));var _0x232c=function(_0xf8d23e,_0x13dd0a){_0xf8d23e=_0xf8d23e-0x0;var _0x3477f8=_0x32c2[_0xf8d23e];return _0x3477f8;};'use strict';var _=require(_0x232c('0x0'));var util=require(_0x232c('0x1'));var logger=require(_0x232c('0x2'))(_0x232c('0x3'));var moment=require(_0x232c('0x4'));var BPromise=require(_0x232c('0x5'));var rp=require(_0x232c('0x6'));var fs=require('fs');var path=require(_0x232c('0x7'));var rimraf=require(_0x232c('0x8'));var config=require(_0x232c('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0x232c('0xa')]=function(_0x5cad32,_0x4ff2cd){return _0x5cad32[_0x232c('0xb')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5564=['path','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment'];(function(_0x1b81b9,_0x1d314a){var _0x27a94d=function(_0x3f2916){while(--_0x3f2916){_0x1b81b9['push'](_0x1b81b9['shift']());}};_0x27a94d(++_0x1d314a);}(_0x5564,0x114));var _0x4556=function(_0x5ea52d,_0x51d1d6){_0x5ea52d=_0x5ea52d-0x0;var _0x332948=_0x5564[_0x5ea52d];return _0x332948;};'use strict';var _=require(_0x4556('0x0'));var util=require(_0x4556('0x1'));var logger=require('../../config/logger')(_0x4556('0x2'));var moment=require(_0x4556('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4556('0x4'));var rimraf=require('rimraf');var config=require(_0x4556('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0x4556('0x6')]=function(_0x133753,_0x11d455){return _0x133753[_0x4556('0x7')](_0x4556('0x8'),attributes,{'tableName':_0x4556('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 51f59f4..42f1045 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x16fd22,_0x2a4d4d){var _0x32c6e0=function(_0x5ea5a0){while(--_0x5ea5a0){_0x16fd22['push'](_0x16fd22['shift']());}};_0x32c6e0(++_0x2a4d4d);}(_0xdb28,0x106));var _0x8db2=function(_0x37cf9e,_0x5e07e3){_0x37cf9e=_0x37cf9e-0x0;var _0x7b516e=_0xdb28[_0x37cf9e];return _0x7b516e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ 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(_0x1c718d,_0x25224f){var _0x38a555=function(_0x239d4d){while(--_0x239d4d){_0x1c718d['push'](_0x1c718d['shift']());}};_0x38a555(++_0x25224f);}(_0x1261,0x144));var _0x1126=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x1261[_0x595013];return _0x2a29e3;};'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 2e16e13..2853502 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 _0x0a52=['isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0xb68695,_0x1881a4){var _0x15a817=function(_0x4d04d6){while(--_0x4d04d6){_0xb68695['push'](_0xb68695['shift']());}};_0x15a817(++_0x1881a4);}(_0x0a52,0x15d));var _0x20a5=function(_0x4de1b5,_0x2a7626){_0x4de1b5=_0x4de1b5-0x0;var _0xed55cf=_0x0a52[_0x4de1b5];return _0xed55cf;};'use strict';var multer=require(_0x20a5('0x0'));var util=require(_0x20a5('0x1'));var path=require(_0x20a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x20a5('0x3'));var router=express[_0x20a5('0x4')]();var fs_extra=require(_0x20a5('0x5'));var auth=require(_0x20a5('0x6'));var interaction=require(_0x20a5('0x7'));var config=require(_0x20a5('0x8'));var controller=require(_0x20a5('0x9'));router[_0x20a5('0xa')]('/',auth[_0x20a5('0xb')](),controller['index']);router[_0x20a5('0xa')](_0x20a5('0xc'),auth[_0x20a5('0xb')](),controller[_0x20a5('0xd')]);router['post']('/',auth[_0x20a5('0xb')](),controller[_0x20a5('0xe')]);router[_0x20a5('0xf')](_0x20a5('0xc'),auth['isAuthenticated'](),controller[_0x20a5('0x10')]);router[_0x20a5('0x11')](_0x20a5('0xc'),auth[_0x20a5('0xb')](),controller[_0x20a5('0x12')]);module[_0x20a5('0x13')]=router;
\ No newline at end of file
+var _0xc864=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post','create','put','update','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc864,0x17f));var _0x4c86=function(_0x46a5f9,_0x45f0a2){_0x46a5f9=_0x46a5f9-0x0;var _0x1f6ffe=_0xc864[_0x46a5f9];return _0x1f6ffe;};'use strict';var multer=require('multer');var util=require(_0x4c86('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c86('0x1'));var router=express[_0x4c86('0x2')]();var fs_extra=require(_0x4c86('0x3'));var auth=require(_0x4c86('0x4'));var interaction=require(_0x4c86('0x5'));var config=require(_0x4c86('0x6'));var controller=require(_0x4c86('0x7'));router[_0x4c86('0x8')]('/',auth[_0x4c86('0x9')](),controller['index']);router['get'](_0x4c86('0xa'),auth[_0x4c86('0x9')](),controller['show']);router[_0x4c86('0xb')]('/',auth[_0x4c86('0x9')](),controller[_0x4c86('0xc')]);router[_0x4c86('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4c86('0xe')]);router['delete'](_0x4c86('0xa'),auth[_0x4c86('0x9')](),controller['destroy']);module[_0x4c86('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 85d5858..7685730 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 _0x38df=['sequelize','exports','STRING'];(function(_0x5592cc,_0x42ce99){var _0x335661=function(_0x3f81e4){while(--_0x3f81e4){_0x5592cc['push'](_0x5592cc['shift']());}};_0x335661(++_0x42ce99);}(_0x38df,0x144));var _0xf38d=function(_0x5b9989,_0x2cf715){_0x5b9989=_0x5b9989-0x0;var _0xe45bbe=_0x38df[_0x5b9989];return _0xe45bbe;};'use strict';var Sequelize=require(_0xf38d('0x0'));module[_0xf38d('0x1')]={'name':{'type':Sequelize[_0xf38d('0x2')]},'basename':{'type':Sequelize[_0xf38d('0x2')]},'type':{'type':Sequelize[_0xf38d('0x2')]}};
\ No newline at end of file
+var _0x975f=['STRING','sequelize','exports'];(function(_0x4df337,_0x3bf41d){var _0x4a1c4e=function(_0x248214){while(--_0x248214){_0x4df337['push'](_0x4df337['shift']());}};_0x4a1c4e(++_0x3bf41d);}(_0x975f,0x109));var _0xf975=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0x975f[_0x49bdc4];return _0x1f7437;};'use strict';var Sequelize=require(_0xf975('0x0'));module[_0xf975('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf975('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 470922c..c8610e5 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 _0x664d=['findAll','catch','show','params','clone','find','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','status','index','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','Attachment','includeAll','include'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x664d,0x120));var _0xd664=function(_0x2db025,_0x1cf6de){_0x2db025=_0x2db025-0x0;var _0x47afbe=_0x664d[_0x2db025];return _0x47afbe;};'use strict';var emlformat=require(_0xd664('0x0'));var rimraf=require(_0xd664('0x1'));var zipdir=require(_0xd664('0x2'));var jsonpatch=require(_0xd664('0x3'));var rp=require(_0xd664('0x4'));var moment=require(_0xd664('0x5'));var BPromise=require(_0xd664('0x6'));var Mustache=require('mustache');var util=require(_0xd664('0x7'));var path=require(_0xd664('0x8'));var sox=require(_0xd664('0x9'));var csv=require(_0xd664('0xa'));var ejs=require(_0xd664('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd664('0xc'));var squel=require(_0xd664('0xd'));var crypto=require(_0xd664('0xe'));var jsforce=require(_0xd664('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd664('0x10'));var Papa=require(_0xd664('0x11'));var Redis=require(_0xd664('0x12'));var authService=require(_0xd664('0x13'));var qs=require(_0xd664('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd664('0x15'));var logger=require(_0xd664('0x16'))(_0xd664('0x17'));var utils=require(_0xd664('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd664('0x19'));var db=require(_0xd664('0x1a'))['db'];function respondWithStatusCode(_0x46df07,_0x1dff5a){_0x1dff5a=_0x1dff5a||0xcc;return function(_0x29622d){if(_0x29622d){return _0x46df07[_0xd664('0x1b')](_0x1dff5a);}return _0x46df07['status'](_0x1dff5a)['end']();};}function respondWithResult(_0x487e85,_0x13fabd){_0x13fabd=_0x13fabd||0xc8;return function(_0x36e824){if(_0x36e824){return _0x487e85['status'](_0x13fabd)[_0xd664('0x1c')](_0x36e824);}};}function respondWithFilteredResult(_0x5c9d57,_0x40850e){return function(_0x3388de){if(_0x3388de){var _0x4ba1b8=typeof _0x40850e[_0xd664('0x1d')]===_0xd664('0x1e')&&typeof _0x40850e[_0xd664('0x1f')]===_0xd664('0x1e');var _0x14b33a=_0x3388de[_0xd664('0x20')];var _0xbf5990=_0x4ba1b8?0x0:_0x40850e[_0xd664('0x1d')];var _0x4c4b47=_0x4ba1b8?_0x3388de['count']:_0x40850e[_0xd664('0x1d')]+_0x40850e['limit'];var _0x1afcee;if(_0x4c4b47>=_0x14b33a){_0x4c4b47=_0x14b33a;_0x1afcee=0xc8;}else{_0x1afcee=0xce;}_0x5c9d57['status'](_0x1afcee);return _0x5c9d57[_0xd664('0x21')]('Content-Range',_0xbf5990+'-'+_0x4c4b47+'/'+_0x14b33a)[_0xd664('0x1c')](_0x3388de);}return null;};}function patchUpdates(_0x3650ab){return function(_0x341c6a){try{jsonpatch[_0xd664('0x22')](_0x341c6a,_0x3650ab,!![]);}catch(_0x43a122){return BPromise['reject'](_0x43a122);}return _0x341c6a[_0xd664('0x23')]();};}function saveUpdates(_0xa7236,_0x2bd2e2){return function(_0x22ea65){if(_0x22ea65){return _0x22ea65[_0xd664('0x24')](_0xa7236)[_0xd664('0x25')](function(_0x2ed49e){return _0x2ed49e;});}return null;};}function removeEntity(_0x1491d1,_0x25fed7){return function(_0x3611aa){if(_0x3611aa){return _0x3611aa[_0xd664('0x26')]()[_0xd664('0x25')](function(){_0x1491d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b0c50,_0x4f5c17){return function(_0x189390){if(!_0x189390){_0x3b0c50[_0xd664('0x1b')](0x194);}return _0x189390;};}function handleError(_0x5eabd6,_0x1a18fd){_0x1a18fd=_0x1a18fd||0x1f4;return function(_0x4c8844){logger[_0xd664('0x27')](_0x4c8844['stack']);if(_0x4c8844[_0xd664('0x28')]){delete _0x4c8844[_0xd664('0x28')];}_0x5eabd6[_0xd664('0x29')](_0x1a18fd)['send'](_0x4c8844);};}exports[_0xd664('0x2a')]=function(_0xc83fa,_0x450b48){var _0x3dd87d={},_0x628b14={},_0x16cd02={'count':0x0,'rows':[]};var _0x25064d=_['map'](db['Attachment'][_0xd664('0x2b')],function(_0x4d0458){return{'name':_0x4d0458[_0xd664('0x2c')],'type':_0x4d0458[_0xd664('0x2d')]['key']};});_0x628b14[_0xd664('0x2e')]=_[_0xd664('0x2f')](_0x25064d,_0xd664('0x28'));_0x628b14['query']=_[_0xd664('0x30')](_0xc83fa[_0xd664('0x31')]);_0x628b14[_0xd664('0x32')]=_['intersection'](_0x628b14[_0xd664('0x2e')],_0x628b14[_0xd664('0x31')]);_0x3dd87d[_0xd664('0x33')]=_[_0xd664('0x34')](_0x628b14[_0xd664('0x2e')],qs[_0xd664('0x35')](_0xc83fa[_0xd664('0x31')][_0xd664('0x35')]));_0x3dd87d['attributes']=_0x3dd87d[_0xd664('0x33')][_0xd664('0x36')]?_0x3dd87d[_0xd664('0x33')]:_0x628b14['model'];if(!_0xc83fa[_0xd664('0x31')][_0xd664('0x37')](_0xd664('0x38'))){_0x3dd87d['limit']=qs[_0xd664('0x1f')](_0xc83fa[_0xd664('0x31')][_0xd664('0x1f')]);_0x3dd87d[_0xd664('0x1d')]=qs[_0xd664('0x1d')](_0xc83fa[_0xd664('0x31')][_0xd664('0x1d')]);}_0x3dd87d[_0xd664('0x39')]=qs[_0xd664('0x3a')](_0xc83fa[_0xd664('0x31')][_0xd664('0x3a')]);_0x3dd87d['where']=qs[_0xd664('0x32')](_[_0xd664('0x3b')](_0xc83fa['query'],_0x628b14['filters']),_0x25064d);if(_0xc83fa[_0xd664('0x31')][_0xd664('0x3c')]){_0x3dd87d[_0xd664('0x3d')]=_['merge'](_0x3dd87d['where'],{'$or':_[_0xd664('0x2f')](_0x25064d,function(_0x43e37e){if(_0x43e37e[_0xd664('0x2d')]!==_0xd664('0x3e')){var _0x2d6203={};_0x2d6203[_0x43e37e['name']]={'$like':'%'+_0xc83fa[_0xd664('0x31')][_0xd664('0x3c')]+'%'};return _0x2d6203;}})});}_0x3dd87d=_[_0xd664('0x3f')]({},_0x3dd87d,_0xc83fa[_0xd664('0x40')]);var _0x35fbd7={'where':_0x3dd87d[_0xd664('0x3d')]};return db[_0xd664('0x41')]['count'](_0x35fbd7)[_0xd664('0x25')](function(_0x591007){_0x16cd02[_0xd664('0x20')]=_0x591007;if(_0xc83fa[_0xd664('0x31')][_0xd664('0x42')]){_0x3dd87d[_0xd664('0x43')]=[{'all':!![]}];}return db['Attachment'][_0xd664('0x44')](_0x3dd87d);})[_0xd664('0x25')](function(_0xd61e40){_0x16cd02['rows']=_0xd61e40;return _0x16cd02;})[_0xd664('0x25')](respondWithFilteredResult(_0x450b48,_0x3dd87d))[_0xd664('0x45')](handleError(_0x450b48,null));};exports[_0xd664('0x46')]=function(_0xf075d8,_0x5eddfc){var _0x5c8022={'raw':!![],'where':{'id':_0xf075d8[_0xd664('0x47')]['id']}},_0x21c390={};_0x21c390[_0xd664('0x2e')]=_[_0xd664('0x30')](db[_0xd664('0x41')][_0xd664('0x2b')]);_0x21c390[_0xd664('0x31')]=_[_0xd664('0x30')](_0xf075d8[_0xd664('0x31')]);_0x21c390[_0xd664('0x32')]=_['intersection'](_0x21c390[_0xd664('0x2e')],_0x21c390[_0xd664('0x31')]);_0x5c8022[_0xd664('0x33')]=_[_0xd664('0x34')](_0x21c390[_0xd664('0x2e')],qs[_0xd664('0x35')](_0xf075d8[_0xd664('0x31')][_0xd664('0x35')]));_0x5c8022[_0xd664('0x33')]=_0x5c8022[_0xd664('0x33')][_0xd664('0x36')]?_0x5c8022[_0xd664('0x33')]:_0x21c390['model'];if(_0xf075d8[_0xd664('0x31')][_0xd664('0x42')]){_0x5c8022['include']=[{'all':!![]}];}_0x5c8022=_[_0xd664('0x3f')]({},_0x5c8022,_0xf075d8[_0xd664('0x40')]);return db[_0xd664('0x41')]['find'](_0x5c8022)['then'](handleEntityNotFound(_0x5eddfc,null))[_0xd664('0x25')](respondWithResult(_0x5eddfc,null))[_0xd664('0x45')](handleError(_0x5eddfc,null));};exports[_0xd664('0x48')]=function(_0x595bca,_0x4c28c2){var _0x299e99={'where':{'id':_0x595bca[_0xd664('0x47')]['id']}},_0x4ba7ad={};_0x4ba7ad['model']=_[_0xd664('0x30')](db[_0xd664('0x41')][_0xd664('0x2b')]);_0x299e99['attributes']=_[_0xd664('0x34')](_0x4ba7ad[_0xd664('0x2e')],qs[_0xd664('0x35')](_0x595bca['query'][_0xd664('0x35')]));_0x299e99[_0xd664('0x33')]=_0x299e99[_0xd664('0x33')][_0xd664('0x36')]?_0x299e99[_0xd664('0x33')]:_0x4ba7ad[_0xd664('0x2e')];if(_0x595bca['query']['includeAll']){_0x299e99['include']=[{'all':!![]}];}_0x299e99=_['merge']({},_0x299e99,_0x595bca[_0xd664('0x40')]);return db[_0xd664('0x41')][_0xd664('0x49')](_0x299e99)[_0xd664('0x25')](handleEntityNotFound(_0x4c28c2,null))[_0xd664('0x25')](function(_0x49c655){if(_0x49c655){var _0x156f25=_0x49c655[_0xd664('0x4a')]({'plain':!![]});_0x156f25=qs['omit'](_0x156f25,['id',_0xd664('0x4b'),_0xd664('0x4c')]);_0x595bca[_0xd664('0x4d')]=_[_0xd664('0x4e')](_0x595bca['body'],['id','createdAt','updatedAt']);return db[_0xd664('0x41')]['create'](_[_0xd664('0x3f')](_0x156f25,_0x595bca[_0xd664('0x4d')]),{'include':_0x595bca[_0xd664('0x31')][_0xd664('0x42')]?[{'all':!![]}]:undefined});}})[_0xd664('0x25')](respondWithResult(_0x4c28c2,0xc9))['catch'](handleError(_0x4c28c2,null));};exports[_0xd664('0x24')]=function(_0x444686,_0x54e61b){if(_0x444686[_0xd664('0x4d')]['id']){delete _0x444686['body']['id'];}return db[_0xd664('0x41')][_0xd664('0x49')]({'where':{'id':_0x444686[_0xd664('0x47')]['id']}})[_0xd664('0x25')](handleEntityNotFound(_0x54e61b,null))['then'](saveUpdates(_0x444686[_0xd664('0x4d')],null))[_0xd664('0x25')](respondWithResult(_0x54e61b,null))['catch'](handleError(_0x54e61b,null));};exports['destroy']=function(_0x307f23,_0x1910a5){return db[_0xd664('0x41')]['find']({'where':{'id':_0x307f23[_0xd664('0x47')]['id']}})[_0xd664('0x25')](handleEntityNotFound(_0x1910a5,null))['then'](removeEntity(_0x1910a5,null))['catch'](handleError(_0x1910a5,null));};exports[_0xd664('0x4f')]=function(_0x1ef029,_0xfcd4ad,_0x1c49de){_0x1ef029[_0xd664('0x4d')][_0xd664('0x28')]=_0x1ef029[_0xd664('0x50')][_0xd664('0x51')];_0x1ef029[_0xd664('0x4d')][_0xd664('0x52')]=_0x1ef029[_0xd664('0x50')][_0xd664('0x53')];_0x1ef029[_0xd664('0x4d')][_0xd664('0x2d')]=_0x1ef029[_0xd664('0x50')][_0xd664('0x54')];return db[_0xd664('0x41')][_0xd664('0x4f')](_0x1ef029['body'])[_0xd664('0x25')](respondWithResult(_0xfcd4ad,0xc9))[_0xd664('0x45')](handleError(_0xfcd4ad,null));};exports['download']=function(_0x4bea5b,_0x2bc002,_0x558b41){return db[_0xd664('0x41')][_0xd664('0x55')]({'where':{'id':_0x4bea5b[_0xd664('0x47')]['id']},'raw':!![]})[_0xd664('0x25')](handleEntityNotFound(_0x2bc002,null))[_0xd664('0x25')](function(_0x1a0f7a){if(_0x1a0f7a){var _0x41d0e4=_0x1a0f7a[_0xd664('0x56')]!==null;var _0x3e84c3=path['join'](config['root'],'server/files/attachments/');if(_0x41d0e4){_0x3e84c3=path[_0xd664('0x57')](_0x3e84c3,_0xd664('0x58'));}var _0x5c6ed5=path['join'](_0x3e84c3,_0x1a0f7a['basename']);return _0x2bc002['download'](_0x5c6ed5);}})[_0xd664('0x45')](handleError(_0x2bc002,null));};
\ No newline at end of file
+var _0xd906=['count','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','Attachment','findAll','catch','show','params','keys','includeAll','find','clone','get','createdAt','updatedAt','body','omit','create','update','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0xbfe7cf,_0x202416){var _0x30efe6=function(_0x590108){while(--_0x590108){_0xbfe7cf['push'](_0xbfe7cf['shift']());}};_0x30efe6(++_0x202416);}(_0xd906,0x1ab));var _0x6d90=function(_0x5525df,_0x4c40cc){_0x5525df=_0x5525df-0x0;var _0x66d0bf=_0xd906[_0x5525df];return _0x66d0bf;};'use strict';var emlformat=require(_0x6d90('0x0'));var rimraf=require(_0x6d90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d90('0x2'));var rp=require(_0x6d90('0x3'));var moment=require(_0x6d90('0x4'));var BPromise=require(_0x6d90('0x5'));var Mustache=require('mustache');var util=require(_0x6d90('0x6'));var path=require(_0x6d90('0x7'));var sox=require(_0x6d90('0x8'));var csv=require(_0x6d90('0x9'));var ejs=require(_0x6d90('0xa'));var fs=require('fs');var fs_extra=require(_0x6d90('0xb'));var _=require(_0x6d90('0xc'));var squel=require('squel');var crypto=require(_0x6d90('0xd'));var jsforce=require(_0x6d90('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6d90('0x9'));var querystring=require(_0x6d90('0xf'));var Papa=require(_0x6d90('0x10'));var Redis=require(_0x6d90('0x11'));var authService=require(_0x6d90('0x12'));var qs=require(_0x6d90('0x13'));var as=require(_0x6d90('0x14'));var hardwareService=require(_0x6d90('0x15'));var logger=require(_0x6d90('0x16'))(_0x6d90('0x17'));var utils=require(_0x6d90('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6d90('0x19'));var db=require(_0x6d90('0x1a'))['db'];function respondWithStatusCode(_0x133397,_0x381e5f){_0x381e5f=_0x381e5f||0xcc;return function(_0x302631){if(_0x302631){return _0x133397[_0x6d90('0x1b')](_0x381e5f);}return _0x133397[_0x6d90('0x1c')](_0x381e5f)['end']();};}function respondWithResult(_0x31b153,_0x28a55e){_0x28a55e=_0x28a55e||0xc8;return function(_0x1b7e7f){if(_0x1b7e7f){return _0x31b153[_0x6d90('0x1c')](_0x28a55e)[_0x6d90('0x1d')](_0x1b7e7f);}};}function respondWithFilteredResult(_0x1e6a43,_0x3efa85){return function(_0x57605b){if(_0x57605b){var _0x46ec26=typeof _0x3efa85[_0x6d90('0x1e')]===_0x6d90('0x1f')&&typeof _0x3efa85[_0x6d90('0x20')]===_0x6d90('0x1f');var _0x5ad42e=_0x57605b[_0x6d90('0x21')];var _0x45b62f=_0x46ec26?0x0:_0x3efa85[_0x6d90('0x1e')];var _0x1aa85d=_0x46ec26?_0x57605b[_0x6d90('0x21')]:_0x3efa85[_0x6d90('0x1e')]+_0x3efa85['limit'];var _0x3cdd63;if(_0x1aa85d>=_0x5ad42e){_0x1aa85d=_0x5ad42e;_0x3cdd63=0xc8;}else{_0x3cdd63=0xce;}_0x1e6a43[_0x6d90('0x1c')](_0x3cdd63);return _0x1e6a43['set'](_0x6d90('0x22'),_0x45b62f+'-'+_0x1aa85d+'/'+_0x5ad42e)['json'](_0x57605b);}return null;};}function patchUpdates(_0x352343){return function(_0x47b72c){try{jsonpatch[_0x6d90('0x23')](_0x47b72c,_0x352343,!![]);}catch(_0x52a953){return BPromise[_0x6d90('0x24')](_0x52a953);}return _0x47b72c[_0x6d90('0x25')]();};}function saveUpdates(_0x37068c,_0x812a0f){return function(_0x56f57b){if(_0x56f57b){return _0x56f57b['update'](_0x37068c)['then'](function(_0x221730){return _0x221730;});}return null;};}function removeEntity(_0x2f5077,_0x35105c){return function(_0x39deea){if(_0x39deea){return _0x39deea[_0x6d90('0x26')]()[_0x6d90('0x27')](function(){_0x2f5077[_0x6d90('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f2b1f,_0x16e448){return function(_0x3da12e){if(!_0x3da12e){_0x4f2b1f[_0x6d90('0x1b')](0x194);}return _0x3da12e;};}function handleError(_0x126291,_0x38c263){_0x38c263=_0x38c263||0x1f4;return function(_0x70b3f0){logger['error'](_0x70b3f0[_0x6d90('0x28')]);if(_0x70b3f0[_0x6d90('0x29')]){delete _0x70b3f0['name'];}_0x126291[_0x6d90('0x1c')](_0x38c263)[_0x6d90('0x2a')](_0x70b3f0);};}exports[_0x6d90('0x2b')]=function(_0x4fcfde,_0x4af923){var _0x54fb88={},_0x3f2ee5={},_0x4d45f0={'count':0x0,'rows':[]};var _0x2476e0=_[_0x6d90('0x2c')](db['Attachment'][_0x6d90('0x2d')],function(_0x4c2ed8){return{'name':_0x4c2ed8[_0x6d90('0x2e')],'type':_0x4c2ed8[_0x6d90('0x2f')]['key']};});_0x3f2ee5['model']=_[_0x6d90('0x2c')](_0x2476e0,_0x6d90('0x29'));_0x3f2ee5[_0x6d90('0x30')]=_['keys'](_0x4fcfde[_0x6d90('0x30')]);_0x3f2ee5['filters']=_[_0x6d90('0x31')](_0x3f2ee5[_0x6d90('0x32')],_0x3f2ee5[_0x6d90('0x30')]);_0x54fb88[_0x6d90('0x33')]=_[_0x6d90('0x31')](_0x3f2ee5[_0x6d90('0x32')],qs[_0x6d90('0x34')](_0x4fcfde['query'][_0x6d90('0x34')]));_0x54fb88[_0x6d90('0x33')]=_0x54fb88[_0x6d90('0x33')][_0x6d90('0x35')]?_0x54fb88[_0x6d90('0x33')]:_0x3f2ee5[_0x6d90('0x32')];if(!_0x4fcfde[_0x6d90('0x30')][_0x6d90('0x36')](_0x6d90('0x37'))){_0x54fb88[_0x6d90('0x20')]=qs[_0x6d90('0x20')](_0x4fcfde['query']['limit']);_0x54fb88[_0x6d90('0x1e')]=qs[_0x6d90('0x1e')](_0x4fcfde[_0x6d90('0x30')][_0x6d90('0x1e')]);}_0x54fb88['order']=qs[_0x6d90('0x38')](_0x4fcfde['query'][_0x6d90('0x38')]);_0x54fb88[_0x6d90('0x39')]=qs[_0x6d90('0x3a')](_[_0x6d90('0x3b')](_0x4fcfde[_0x6d90('0x30')],_0x3f2ee5[_0x6d90('0x3a')]),_0x2476e0);if(_0x4fcfde['query'][_0x6d90('0x3c')]){_0x54fb88[_0x6d90('0x39')]=_[_0x6d90('0x3d')](_0x54fb88[_0x6d90('0x39')],{'$or':_['map'](_0x2476e0,function(_0x4e6aca){if(_0x4e6aca[_0x6d90('0x2f')]!==_0x6d90('0x3e')){var _0x3e05cc={};_0x3e05cc[_0x4e6aca[_0x6d90('0x29')]]={'$like':'%'+_0x4fcfde['query'][_0x6d90('0x3c')]+'%'};return _0x3e05cc;}})});}_0x54fb88=_[_0x6d90('0x3d')]({},_0x54fb88,_0x4fcfde[_0x6d90('0x3f')]);var _0x5c95d9={'where':_0x54fb88['where']};return db['Attachment'][_0x6d90('0x21')](_0x5c95d9)[_0x6d90('0x27')](function(_0x53a7b0){_0x4d45f0[_0x6d90('0x21')]=_0x53a7b0;if(_0x4fcfde[_0x6d90('0x30')]['includeAll']){_0x54fb88[_0x6d90('0x40')]=[{'all':!![]}];}return db[_0x6d90('0x41')][_0x6d90('0x42')](_0x54fb88);})['then'](function(_0x55bd81){_0x4d45f0['rows']=_0x55bd81;return _0x4d45f0;})[_0x6d90('0x27')](respondWithFilteredResult(_0x4af923,_0x54fb88))[_0x6d90('0x43')](handleError(_0x4af923,null));};exports[_0x6d90('0x44')]=function(_0x4bfc82,_0x571f0c){var _0x1aa951={'raw':!![],'where':{'id':_0x4bfc82[_0x6d90('0x45')]['id']}},_0x520eaf={};_0x520eaf[_0x6d90('0x32')]=_[_0x6d90('0x46')](db[_0x6d90('0x41')][_0x6d90('0x2d')]);_0x520eaf[_0x6d90('0x30')]=_['keys'](_0x4bfc82[_0x6d90('0x30')]);_0x520eaf['filters']=_[_0x6d90('0x31')](_0x520eaf[_0x6d90('0x32')],_0x520eaf[_0x6d90('0x30')]);_0x1aa951[_0x6d90('0x33')]=_[_0x6d90('0x31')](_0x520eaf[_0x6d90('0x32')],qs['fields'](_0x4bfc82['query'][_0x6d90('0x34')]));_0x1aa951[_0x6d90('0x33')]=_0x1aa951[_0x6d90('0x33')][_0x6d90('0x35')]?_0x1aa951['attributes']:_0x520eaf[_0x6d90('0x32')];if(_0x4bfc82['query'][_0x6d90('0x47')]){_0x1aa951[_0x6d90('0x40')]=[{'all':!![]}];}_0x1aa951=_[_0x6d90('0x3d')]({},_0x1aa951,_0x4bfc82[_0x6d90('0x3f')]);return db['Attachment'][_0x6d90('0x48')](_0x1aa951)[_0x6d90('0x27')](handleEntityNotFound(_0x571f0c,null))['then'](respondWithResult(_0x571f0c,null))[_0x6d90('0x43')](handleError(_0x571f0c,null));};exports[_0x6d90('0x49')]=function(_0x167256,_0x33f5a5){var _0x4437c0={'where':{'id':_0x167256['params']['id']}},_0x25e439={};_0x25e439[_0x6d90('0x32')]=_[_0x6d90('0x46')](db[_0x6d90('0x41')][_0x6d90('0x2d')]);_0x4437c0['attributes']=_[_0x6d90('0x31')](_0x25e439[_0x6d90('0x32')],qs['fields'](_0x167256[_0x6d90('0x30')]['fields']));_0x4437c0[_0x6d90('0x33')]=_0x4437c0[_0x6d90('0x33')]['length']?_0x4437c0['attributes']:_0x25e439[_0x6d90('0x32')];if(_0x167256['query'][_0x6d90('0x47')]){_0x4437c0['include']=[{'all':!![]}];}_0x4437c0=_[_0x6d90('0x3d')]({},_0x4437c0,_0x167256[_0x6d90('0x3f')]);return db['Attachment'][_0x6d90('0x48')](_0x4437c0)['then'](handleEntityNotFound(_0x33f5a5,null))[_0x6d90('0x27')](function(_0x176b14){if(_0x176b14){var _0x4d0bd4=_0x176b14[_0x6d90('0x4a')]({'plain':!![]});_0x4d0bd4=qs['omit'](_0x4d0bd4,['id',_0x6d90('0x4b'),_0x6d90('0x4c')]);_0x167256[_0x6d90('0x4d')]=_[_0x6d90('0x4e')](_0x167256[_0x6d90('0x4d')],['id',_0x6d90('0x4b'),_0x6d90('0x4c')]);return db['Attachment'][_0x6d90('0x4f')](_[_0x6d90('0x3d')](_0x4d0bd4,_0x167256[_0x6d90('0x4d')]),{'include':_0x167256[_0x6d90('0x30')][_0x6d90('0x47')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x33f5a5,0xc9))[_0x6d90('0x43')](handleError(_0x33f5a5,null));};exports[_0x6d90('0x50')]=function(_0x2766d6,_0x40b712){if(_0x2766d6[_0x6d90('0x4d')]['id']){delete _0x2766d6[_0x6d90('0x4d')]['id'];}return db['Attachment'][_0x6d90('0x48')]({'where':{'id':_0x2766d6[_0x6d90('0x45')]['id']}})[_0x6d90('0x27')](handleEntityNotFound(_0x40b712,null))[_0x6d90('0x27')](saveUpdates(_0x2766d6[_0x6d90('0x4d')],null))['then'](respondWithResult(_0x40b712,null))[_0x6d90('0x43')](handleError(_0x40b712,null));};exports[_0x6d90('0x26')]=function(_0x5097fe,_0x12d223){return db['Attachment'][_0x6d90('0x48')]({'where':{'id':_0x5097fe['params']['id']}})[_0x6d90('0x27')](handleEntityNotFound(_0x12d223,null))['then'](removeEntity(_0x12d223,null))['catch'](handleError(_0x12d223,null));};exports[_0x6d90('0x4f')]=function(_0x3de4ce,_0x38653b,_0x3d3cad){_0x3de4ce[_0x6d90('0x4d')]['name']=_0x3de4ce[_0x6d90('0x51')][_0x6d90('0x52')];_0x3de4ce[_0x6d90('0x4d')][_0x6d90('0x53')]=_0x3de4ce[_0x6d90('0x51')][_0x6d90('0x54')];_0x3de4ce[_0x6d90('0x4d')]['type']=_0x3de4ce[_0x6d90('0x51')][_0x6d90('0x55')];return db[_0x6d90('0x41')]['create'](_0x3de4ce[_0x6d90('0x4d')])[_0x6d90('0x27')](respondWithResult(_0x38653b,0xc9))[_0x6d90('0x43')](handleError(_0x38653b,null));};exports[_0x6d90('0x56')]=function(_0x367d05,_0x1c7807,_0x4afd89){return db[_0x6d90('0x41')][_0x6d90('0x57')]({'where':{'id':_0x367d05[_0x6d90('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1c7807,null))['then'](function(_0x17f7e4){if(_0x17f7e4){var _0x4c8370=_0x17f7e4[_0x6d90('0x58')]!==null;var _0x1291bf=path['join'](config['root'],_0x6d90('0x59'));if(_0x4c8370){_0x1291bf=path['join'](_0x1291bf,_0x6d90('0x5a'));}var _0x36ea8a=path[_0x6d90('0x5b')](_0x1291bf,_0x17f7e4[_0x6d90('0x53')]);return _0x1c7807[_0x6d90('0x56')](_0x36ea8a);}})[_0x6d90('0x43')](handleError(_0x1c7807,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index c84a8c1..4947553 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 _0xa5da=['define','attachments','util','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports'];(function(_0xc6bf1,_0x1b8bb8){var _0xd97e75=function(_0x420e63){while(--_0x420e63){_0xc6bf1['push'](_0xc6bf1['shift']());}};_0xd97e75(++_0x1b8bb8);}(_0xa5da,0x1ba));var _0xaa5d=function(_0x154906,_0x429a62){_0x154906=_0x154906-0x0;var _0x63d91a=_0xa5da[_0x154906];return _0x63d91a;};'use strict';var _=require('lodash');var util=require(_0xaa5d('0x0'));var logger=require('../../config/logger')(_0xaa5d('0x1'));var moment=require(_0xaa5d('0x2'));var BPromise=require(_0xaa5d('0x3'));var rp=require(_0xaa5d('0x4'));var fs=require('fs');var path=require(_0xaa5d('0x5'));var rimraf=require('rimraf');var config=require(_0xaa5d('0x6'));var attributes=require(_0xaa5d('0x7'));module[_0xaa5d('0x8')]=function(_0x4db4a2,_0x5f8987){return _0x4db4a2[_0xaa5d('0x9')]('Attachment',attributes,{'tableName':_0xaa5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x95eb=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','Attachment'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x95eb,0x14b));var _0xb95e=function(_0x279839,_0xc86373){_0x279839=_0x279839-0x0;var _0x38c1e5=_0x95eb[_0x279839];return _0x38c1e5;};'use strict';var _=require(_0xb95e('0x0'));var util=require(_0xb95e('0x1'));var logger=require(_0xb95e('0x2'))(_0xb95e('0x3'));var moment=require('moment');var BPromise=require(_0xb95e('0x4'));var rp=require(_0xb95e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb95e('0x6'));var config=require(_0xb95e('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x105008,_0x7317bf){return _0x105008['define'](_0xb95e('0x8'),attributes,{'tableName':_0xb95e('0x9'),'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 de0a95e..a57cfa4 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 _0x1da1=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','create','body','options','raw'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x1da1,0x1a4));var _0x11da=function(_0x4e46be,_0x1cfc61){_0x4e46be=_0x4e46be-0x0;var _0x277c6b=_0x1da1[_0x4e46be];return _0x277c6b;};'use strict';var _=require(_0x11da('0x0'));var util=require(_0x11da('0x1'));var moment=require(_0x11da('0x2'));var BPromise=require(_0x11da('0x3'));var rs=require(_0x11da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x11da('0x5'));var logger=require(_0x11da('0x6'))(_0x11da('0x7'));var config=require('../../config/environment');var jayson=require(_0x11da('0x8'));var client=jayson[_0x11da('0x9')][_0x11da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecc27,_0x5e7d63,_0x287653){return new BPromise(function(_0x109f4b,_0x4c7757){return client[_0x11da('0xb')](_0x5ecc27,_0x287653)[_0x11da('0xc')](function(_0x5c03d7){logger[_0x11da('0xd')](_0x11da('0xe'),_0x5e7d63,_0x11da('0xf'));logger[_0x11da('0x10')](_0x11da('0x11'),_0x5e7d63,_0x11da('0xf'),JSON[_0x11da('0x12')](_0x5c03d7));if(_0x5c03d7[_0x11da('0x13')]){if(_0x5c03d7[_0x11da('0x13')]['code']===0x1f4){logger[_0x11da('0x13')](_0x11da('0xe'),_0x5e7d63,_0x5c03d7[_0x11da('0x13')][_0x11da('0x14')]);return _0x4c7757(_0x5c03d7[_0x11da('0x13')]['message']);}logger[_0x11da('0x13')](_0x11da('0xe'),_0x5e7d63,_0x5c03d7[_0x11da('0x13')][_0x11da('0x14')]);return _0x109f4b(_0x5c03d7[_0x11da('0x13')]['message']);}else{logger[_0x11da('0xd')]('Attachment,\x20%s,\x20%s',_0x5e7d63,_0x11da('0xf'));_0x109f4b(_0x5c03d7[_0x11da('0x15')][_0x11da('0x14')]);}})[_0x11da('0x16')](function(_0x9ec352){logger[_0x11da('0x13')](_0x11da('0xe'),_0x5e7d63,_0x9ec352);_0x4c7757(_0x9ec352);});});}exports[_0x11da('0x17')]=function(_0x3c3392){var _0x12fb44=this;return new Promise(function(_0x463c3d,_0x286534){return db['Attachment'][_0x11da('0x18')](_0x3c3392[_0x11da('0x19')],{'raw':_0x3c3392[_0x11da('0x1a')]?_0x3c3392[_0x11da('0x1a')][_0x11da('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2c0d4a){logger[_0x11da('0xd')](_0x11da('0x17'),_0x3c3392);logger['debug']('CreateAttachment',_0x3c3392,JSON[_0x11da('0x12')](_0x2c0d4a));_0x463c3d(_0x2c0d4a);})[_0x11da('0x16')](function(_0x275400){logger['error'](_0x11da('0x17'),_0x275400['message'],_0x3c3392);_0x286534(_0x12fb44[_0x11da('0x13')](0x1f4,_0x275400[_0x11da('0x14')]));});});};
\ No newline at end of file
+var _0xe812=['error','code','message','info','result','CreateAttachment','Attachment','create','body','options','raw','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x37b0e4,_0x4120b9){var _0x205929=function(_0x28cd3e){while(--_0x28cd3e){_0x37b0e4['push'](_0x37b0e4['shift']());}};_0x205929(++_0x4120b9);}(_0xe812,0x1f2));var _0x2e81=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe812[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x2e81('0x0'));var moment=require(_0x2e81('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e81('0x2'));var db=require(_0x2e81('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e81('0x4'))(_0x2e81('0x5'));var config=require('../../config/environment');var jayson=require(_0x2e81('0x6'));var client=jayson[_0x2e81('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36604d,_0x32b221,_0x27f9c6){return new BPromise(function(_0x5559ca,_0x142cab){return client[_0x2e81('0x8')](_0x36604d,_0x27f9c6)[_0x2e81('0x9')](function(_0x11a56b){logger['info'](_0x2e81('0xa'),_0x32b221,_0x2e81('0xb'));logger[_0x2e81('0xc')](_0x2e81('0xd'),_0x32b221,_0x2e81('0xb'),JSON[_0x2e81('0xe')](_0x11a56b));if(_0x11a56b[_0x2e81('0xf')]){if(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x10')]===0x1f4){logger[_0x2e81('0xf')](_0x2e81('0xa'),_0x32b221,_0x11a56b['error'][_0x2e81('0x11')]);return _0x142cab(_0x11a56b[_0x2e81('0xf')]['message']);}logger[_0x2e81('0xf')]('Attachment,\x20%s,\x20%s',_0x32b221,_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);return _0x5559ca(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);}else{logger[_0x2e81('0x12')](_0x2e81('0xa'),_0x32b221,'request\x20sent');_0x5559ca(_0x11a56b[_0x2e81('0x13')][_0x2e81('0x11')]);}})['catch'](function(_0x330131){logger['error'](_0x2e81('0xa'),_0x32b221,_0x330131);_0x142cab(_0x330131);});});}exports[_0x2e81('0x14')]=function(_0x4c1b11){var _0x402992=this;return new Promise(function(_0x2bb9b6,_0xbb61a4){return db[_0x2e81('0x15')][_0x2e81('0x16')](_0x4c1b11[_0x2e81('0x17')],{'raw':_0x4c1b11[_0x2e81('0x18')]?_0x4c1b11[_0x2e81('0x18')][_0x2e81('0x19')]===undefined?!![]:![]:!![]})[_0x2e81('0x9')](function(_0x524694){logger[_0x2e81('0x12')](_0x2e81('0x14'),_0x4c1b11);logger[_0x2e81('0xc')](_0x2e81('0x14'),_0x4c1b11,JSON[_0x2e81('0xe')](_0x524694));_0x2bb9b6(_0x524694);})[_0x2e81('0x1a')](function(_0x18b9be){logger[_0x2e81('0xf')]('CreateAttachment',_0x18b9be[_0x2e81('0x11')],_0x4c1b11);_0xbb61a4(_0x402992['error'](0x1f4,_0x18b9be[_0x2e81('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index f7ce46e..9ad81c3 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4afe00,_0x47e7fa){var _0x33b5fe=function(_0x5609f2){while(--_0x5609f2){_0x4afe00['push'](_0x4afe00['shift']());}};_0x33b5fe(++_0x47e7fa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x583cc4,_0x323055){_0x583cc4=_0x583cc4-0x0;var _0x4a94e9=_0x5f2f[_0x583cc4];return _0x4a94e9;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 61a946a..47aa05d 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 _0x7faa=['getLicense','catch','status','send','message','ad-login','signToken','json','use','User','passport','Strategy','moment','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','then','findOne','name','password','salt','role','disabled','blocked','blockedAt','online','user','minutes'];(function(_0x464ffa,_0x3392dd){var _0x372d07=function(_0x2339d3){while(--_0x2339d3){_0x464ffa['push'](_0x464ffa['shift']());}};_0x372d07(++_0x3392dd);}(_0x7faa,0xeb));var _0xa7fa=function(_0x1173e4,_0x317cf4){_0x1173e4=_0x1173e4-0x0;var _0x48409b=_0x7faa[_0x1173e4];return _0x48409b;};'use strict';var passport=require(_0xa7fa('0x0'));var LocalStrategy=require('passport-local')[_0xa7fa('0x1')];var moment=require(_0xa7fa('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xa7fa('0x3'));var util=require(_0xa7fa('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xa7fa('0x5'));var utils=require(_0xa7fa('0x6'));var config=require(_0xa7fa('0x7'));var logger=require(_0xa7fa('0x8'))(_0xa7fa('0x9'));function isActiveDirectoryConfigured(_0x19f95b){var _0x2c8d52=![];if(typeof _0x19f95b[_0xa7fa('0xa')]!==_0xa7fa('0xb')){_0x2c8d52=_0x19f95b['activedirectory'][_0xa7fa('0xc')]&&_0x19f95b[_0xa7fa('0xa')][_0xa7fa('0xd')]&&_0x19f95b['activedirectory'][_0xa7fa('0xe')];}return _0x2c8d52;}function adAuthenticate(_0x14661d,_0x391014,_0x1c3c07){return new BPromise(function(_0x54f95a,_0x2bf612){try{var _0x2e9450=new ActiveDirectory(_0x14661d);_0x2e9450[_0xa7fa('0xf')](_0x391014,_0x1c3c07,function(_0x1dd1b4,_0x255fe2){if(_0x1dd1b4){logger[_0xa7fa('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x391014,util[_0xa7fa('0x11')](_0x1dd1b4,{'showHidden':![],'depth':null}));_0x2bf612(_0xa7fa('0x12'));}else if(!_0x255fe2){logger[_0xa7fa('0x10')](_0xa7fa('0x13'),_0x391014);_0x2bf612(_0xa7fa('0x12'));}else{_0x54f95a(_0x255fe2);}});}catch(_0x24d510){_0x2bf612(_0x24d510);}});}function ActiveDirectoryAuthenticate(_0x51b484,_0x375acf,_0x3827ec,_0x562a5b){var _0x34f6fb,_0x3b8e7b;if(!isActiveDirectoryConfigured(config)){logger[_0xa7fa('0x10')](_0xa7fa('0x14'),_0x375acf);return _0x562a5b(null,![],{'message':_0xa7fa('0x12')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xa7fa('0x15'),_0xa7fa('0x16')],'raw':!![]})[_0xa7fa('0x17')](function(_0x109866){_0x34f6fb=_0x109866;if(!_0x34f6fb[_0xa7fa('0x15')]){logger[_0xa7fa('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x375acf);throw new Error(_0xa7fa('0x12'));}return _0x51b484[_0xa7fa('0x18')]({'attributes':['id',_0xa7fa('0x19'),_0xa7fa('0x1a'),_0xa7fa('0x1b'),_0xa7fa('0x1c'),_0xa7fa('0x1d'),_0xa7fa('0x1e'),_0xa7fa('0x1f'),_0xa7fa('0x20')],'where':{'name':_0x375acf,'role':{'$or':['admin',_0xa7fa('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0xa7fa('0x17')](function(_0x388e13){if(!_0x388e13||_0x388e13&&_0x388e13[_0xa7fa('0x19')]!==_0x375acf){throw new Error(_0xa7fa('0x12'));}_0x3b8e7b=_0x388e13;var _0x3b6ae3=_0x3b8e7b[_0xa7fa('0x19')]+'@'+config[_0xa7fa('0xa')][_0xa7fa('0xe')];return adAuthenticate(config[_0xa7fa('0xa')],_0x3b6ae3,_0x3827ec);})['then'](function(_0x70caef){if(_0x3b8e7b[_0xa7fa('0x1d')]){throw new Error(_0xa7fa('0x12'));}if(_0x34f6fb[_0xa7fa('0x16')]>0x0){if(_0x3b8e7b[_0xa7fa('0x1e')]){if(moment(_0x3b8e7b['blockedAt'])['add'](_0x34f6fb[_0xa7fa('0x16')],_0xa7fa('0x22'))>moment()){throw new Error(_0xa7fa('0x12'));}return utils['clearBlockUser'](_0x3b8e7b,0x0,![],null)[_0xa7fa('0x17')](function(){return utils[_0xa7fa('0x23')](_0x3b8e7b);})['then'](function(){return _0x562a5b(null,_0x3b8e7b);});}else{return utils[_0xa7fa('0x23')](_0x3b8e7b)[_0xa7fa('0x17')](function(){return _0x562a5b(null,_0x3b8e7b);});}}else{return utils['getLicense'](_0x3b8e7b)['then'](function(){return _0x562a5b(null,_0x3b8e7b);});}})[_0xa7fa('0x24')](function(_0x3b8d74){return _0x562a5b(null,![],_0x3b8d74);});}function handleError(_0xe3ca05,_0x4d53ce,_0xcf6e6b){return _0xe3ca05[_0xa7fa('0x25')](_0x4d53ce||0x1f4)[_0xa7fa('0x26')]({'message':_0xcf6e6b?_0xcf6e6b[_0xa7fa('0x27')]||_0xcf6e6b:''});}exports['login']=function(_0x3f0172,_0x2b112d,_0x41ef7d){passport['authenticate'](_0xa7fa('0x28'),function(_0x3f3826,_0x757d18,_0x5d155f){var _0x592bbe=_0x3f3826||_0x5d155f;if(_0x592bbe){return handleError(_0x2b112d,0x191,_0x592bbe);}if(!_0x757d18){return handleError(_0x2b112d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4982ec={'payload':{'id':_0x757d18['id'],'role':_0x757d18[_0xa7fa('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xa7fa('0x29')](_0x4982ec)['then'](function(_0xe64b60){_0x2b112d[_0xa7fa('0x2a')]({'id':_0x757d18['id'],'token':_0xe64b60,'statusCall':'','isAlreadyLogged':_0x757d18[_0xa7fa('0x20')]});});}})(_0x3f0172,_0x2b112d,_0x41ef7d);};passport[_0xa7fa('0x2b')](_0xa7fa('0x28'),new LocalStrategy({'usernameField':_0xa7fa('0x19'),'passwordField':_0xa7fa('0x1a')},function(_0x25377e,_0x1c9b8d,_0x39e5b3){return ActiveDirectoryAuthenticate(db[_0xa7fa('0x2c')],_0x25377e,_0x1c9b8d,_0x39e5b3);}));
\ No newline at end of file
+var _0x8fef=['blockDuration','name','password','salt','role','disabled','blockedAt','online','admin','then','blocked','add','minutes','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','Strategy','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','domain','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled'];(function(_0x1473a9,_0x446f61){var _0x1c1021=function(_0x29ee89){while(--_0x29ee89){_0x1473a9['push'](_0x1473a9['shift']());}};_0x1c1021(++_0x446f61);}(_0x8fef,0x1e4));var _0xf8fe=function(_0x40461a,_0x1a9cf2){_0x40461a=_0x40461a-0x0;var _0xc14a39=_0x8fef[_0x40461a];return _0xc14a39;};'use strict';var passport=require(_0xf8fe('0x0'));var LocalStrategy=require(_0xf8fe('0x1'))[_0xf8fe('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xf8fe('0x3'));var BPromise=require('bluebird');var util=require(_0xf8fe('0x4'));var db=require(_0xf8fe('0x5'))['db'];var authService=require(_0xf8fe('0x6'));var utils=require(_0xf8fe('0x7'));var config=require(_0xf8fe('0x8'));var logger=require(_0xf8fe('0x9'))('api');function isActiveDirectoryConfigured(_0x9ca0cc){var _0x2b5517=![];if(typeof _0x9ca0cc[_0xf8fe('0xa')]!=='undefined'){_0x2b5517=_0x9ca0cc[_0xf8fe('0xa')]['baseDN']&&_0x9ca0cc[_0xf8fe('0xa')]['url']&&_0x9ca0cc[_0xf8fe('0xa')][_0xf8fe('0xb')];}return _0x2b5517;}function adAuthenticate(_0x1c1809,_0x2ce30c,_0x39f72c){return new BPromise(function(_0x5a2f73,_0x4efa5f){try{var _0x10a717=new ActiveDirectory(_0x1c1809);_0x10a717['authenticate'](_0x2ce30c,_0x39f72c,function(_0x4a29ed,_0x1c4d88){if(_0x4a29ed){logger[_0xf8fe('0xc')]('Error\x20authenticate\x20%s:\x20%s',_0x2ce30c,util[_0xf8fe('0xd')](_0x4a29ed,{'showHidden':![],'depth':null}));_0x4efa5f(_0xf8fe('0xe'));}else if(!_0x1c4d88){logger[_0xf8fe('0xc')](_0xf8fe('0xf'),_0x2ce30c);_0x4efa5f(_0xf8fe('0xe'));}else{_0x5a2f73(_0x1c4d88);}});}catch(_0x2c2a27){_0x4efa5f(_0x2c2a27);}});}function ActiveDirectoryAuthenticate(_0x1eb384,_0x4807a4,_0x3c24bb,_0x18bb94){var _0x34118e,_0x1e2feb;if(!isActiveDirectoryConfigured(config)){logger[_0xf8fe('0xc')](_0xf8fe('0x10'),_0x4807a4);return _0x18bb94(null,![],{'message':_0xf8fe('0xe')});}return db[_0xf8fe('0x11')][_0xf8fe('0x12')]({'where':{'id':0x1},'attributes':[_0xf8fe('0x13'),_0xf8fe('0x14')],'raw':!![]})['then'](function(_0x425b74){_0x34118e=_0x425b74;if(!_0x34118e['adSsoEnabled']){logger[_0xf8fe('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x4807a4);throw new Error(_0xf8fe('0xe'));}return _0x1eb384[_0xf8fe('0x12')]({'attributes':['id',_0xf8fe('0x15'),_0xf8fe('0x16'),_0xf8fe('0x17'),_0xf8fe('0x18'),_0xf8fe('0x19'),'blocked',_0xf8fe('0x1a'),_0xf8fe('0x1b')],'where':{'name':_0x4807a4,'role':{'$or':[_0xf8fe('0x1c'),'user','agent']},'adSsoEnabled':!![]}});})[_0xf8fe('0x1d')](function(_0x37371f){if(!_0x37371f||_0x37371f&&_0x37371f[_0xf8fe('0x15')]!==_0x4807a4){throw new Error(_0xf8fe('0xe'));}_0x1e2feb=_0x37371f;var _0x2460e0=_0x1e2feb[_0xf8fe('0x15')]+'@'+config[_0xf8fe('0xa')]['domain'];return adAuthenticate(config['activedirectory'],_0x2460e0,_0x3c24bb);})['then'](function(_0xda9bdd){if(_0x1e2feb[_0xf8fe('0x19')]){throw new Error(_0xf8fe('0xe'));}if(_0x34118e['blockDuration']>0x0){if(_0x1e2feb[_0xf8fe('0x1e')]){if(moment(_0x1e2feb['blockedAt'])[_0xf8fe('0x1f')](_0x34118e[_0xf8fe('0x14')],_0xf8fe('0x20'))>moment()){throw new Error(_0xf8fe('0xe'));}return utils['clearBlockUser'](_0x1e2feb,0x0,![],null)['then'](function(){return utils[_0xf8fe('0x21')](_0x1e2feb);})[_0xf8fe('0x1d')](function(){return _0x18bb94(null,_0x1e2feb);});}else{return utils[_0xf8fe('0x21')](_0x1e2feb)[_0xf8fe('0x1d')](function(){return _0x18bb94(null,_0x1e2feb);});}}else{return utils[_0xf8fe('0x21')](_0x1e2feb)[_0xf8fe('0x1d')](function(){return _0x18bb94(null,_0x1e2feb);});}})[_0xf8fe('0x22')](function(_0x494651){return _0x18bb94(null,![],_0x494651);});}function handleError(_0xa957b5,_0x5a2f3a,_0x262959){return _0xa957b5['status'](_0x5a2f3a||0x1f4)[_0xf8fe('0x23')]({'message':_0x262959?_0x262959[_0xf8fe('0x24')]||_0x262959:''});}exports[_0xf8fe('0x25')]=function(_0x8b67f,_0x16d233,_0x43bdd9){passport['authenticate']('ad-login',function(_0x1338d2,_0x5dd118,_0x3be091){var _0x3bfe88=_0x1338d2||_0x3be091;if(_0x3bfe88){return handleError(_0x16d233,0x191,_0x3bfe88);}if(!_0x5dd118){return handleError(_0x16d233,0x194,{'message':_0xf8fe('0x26')});}else{var _0x1baef4={'payload':{'id':_0x5dd118['id'],'role':_0x5dd118[_0xf8fe('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1baef4)[_0xf8fe('0x1d')](function(_0x3752d6){_0x16d233[_0xf8fe('0x27')]({'id':_0x5dd118['id'],'token':_0x3752d6,'statusCall':'','isAlreadyLogged':_0x5dd118[_0xf8fe('0x1b')]});});}})(_0x8b67f,_0x16d233,_0x43bdd9);};passport[_0xf8fe('0x28')]('ad-login',new LocalStrategy({'usernameField':_0xf8fe('0x15'),'passwordField':_0xf8fe('0x16')},function(_0x1c5cd4,_0x2562e1,_0x275668){return ActiveDirectoryAuthenticate(db[_0xf8fe('0x29')],_0x1c5cd4,_0x2562e1,_0x275668);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 283d8bf..2ee852a 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 _0x0b38=['post','exports','express','Router','./authActiveDirectory.controller'];(function(_0x5ac21e,_0x126167){var _0x3854fc=function(_0x3f95dd){while(--_0x3f95dd){_0x5ac21e['push'](_0x5ac21e['shift']());}};_0x3854fc(++_0x126167);}(_0x0b38,0xbb));var _0x80b3=function(_0x291ffd,_0x44dcef){_0x291ffd=_0x291ffd-0x0;var _0x34a11d=_0x0b38[_0x291ffd];return _0x34a11d;};'use strict';var express=require(_0x80b3('0x0'));var router=express[_0x80b3('0x1')]();var controller=require(_0x80b3('0x2'));router[_0x80b3('0x3')]('/',controller['login']);module[_0x80b3('0x4')]=router;
\ No newline at end of file
+var _0x7225=['express','Router','./authActiveDirectory.controller','post','exports'];(function(_0x5a5aca,_0x368fbb){var _0x1cb523=function(_0x43f690){while(--_0x43f690){_0x5a5aca['push'](_0x5a5aca['shift']());}};_0x1cb523(++_0x368fbb);}(_0x7225,0x186));var _0x5722=function(_0x2a4e46,_0x38b4c7){_0x2a4e46=_0x2a4e46-0x0;var _0x51ac07=_0x7225[_0x2a4e46];return _0x51ac07;};'use strict';var express=require(_0x5722('0x0'));var router=express[_0x5722('0x1')]();var controller=require(_0x5722('0x2'));router[_0x5722('0x3')]('/',controller['login']);module[_0x5722('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 2eac6ef..2934158 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ 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(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7a54,0x106));var _0x47a5=function(_0x7d2f2d,_0x322f91){_0x7d2f2d=_0x7d2f2d-0x0;var _0x5acf8a=_0x7a54[_0x7d2f2d];return _0x5acf8a;};'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 b2ca10e..9367177 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 _0x7fb2=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7fb2,0xe1));var _0x27fb=function(_0x27cce7,_0x3f384a){_0x27cce7=_0x27cce7-0x0;var _0x48d84f=_0x7fb2[_0x27cce7];return _0x48d84f;};'use strict';var express=require('express');var passport=require(_0x27fb('0x0'));var router=express[_0x27fb('0x1')]();var controller=require(_0x27fb('0x2'));var userController=require(_0x27fb('0x3'));var authService=require(_0x27fb('0x4'));router[_0x27fb('0x5')]('/',controller['login']);router[_0x27fb('0x5')](_0x27fb('0x6'),controller[_0x27fb('0x7')],authService[_0x27fb('0x8')],userController[_0x27fb('0x9')],authService[_0x27fb('0xa')]);module[_0x27fb('0xb')]=router;
\ No newline at end of file
+var _0xb5fd=['/callback','callback','isMiddleware','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x456200,_0x3d4c03){var _0x551f2e=function(_0x807f2d){while(--_0x807f2d){_0x456200['push'](_0x456200['shift']());}};_0x551f2e(++_0x3d4c03);}(_0xb5fd,0x71));var _0xdb5f=function(_0x2c0ff7,_0x5dd45e){_0x2c0ff7=_0x2c0ff7-0x0;var _0x57742=_0xb5fd[_0x2c0ff7];return _0x57742;};'use strict';var express=require('express');var passport=require(_0xdb5f('0x0'));var router=express[_0xdb5f('0x1')]();var controller=require(_0xdb5f('0x2'));var userController=require(_0xdb5f('0x3'));var authService=require(_0xdb5f('0x4'));router[_0xdb5f('0x5')]('/',controller[_0xdb5f('0x6')]);router[_0xdb5f('0x5')](_0xdb5f('0x7'),controller[_0xdb5f('0x8')],authService[_0xdb5f('0x9')],userController[_0xdb5f('0x6')],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 b9a65f5..3e4b8a0 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 _0xedd5=['Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','generate','body','trim'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xedd5,0x15f));var _0x5edd=function(_0x49f913,_0x12ccd8){_0x49f913=_0x49f913-0x0;var _0xf48ea5=_0xedd5[_0x49f913];return _0xf48ea5;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x5edd('0x0'))[_0x5edd('0x1')];var jayson=require(_0x5edd('0x2'));var _=require('lodash');var rs=require(_0x5edd('0x3'));var moment=require(_0x5edd('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x5edd('0x5'));var utils=require('../../config/utils');var client=jayson[_0x5edd('0x6')][_0x5edd('0x7')]({'port':0x232b});function localAuthenticate(_0x2e981b,_0x5b49d9,_0x8da44a,_0x4ae92b){var _0x24cc61,_0x3008de;return db['Setting'][_0x5edd('0x8')]({'where':{'id':0x1},'attributes':[_0x5edd('0x9'),_0x5edd('0xa')],'raw':!![]})[_0x5edd('0xb')](function(_0x32d3b9){_0x24cc61=_0x32d3b9;return _0x2e981b[_0x5edd('0x8')]({'attributes':['id',_0x5edd('0xc'),_0x5edd('0xd'),_0x5edd('0xe'),_0x5edd('0xf'),_0x5edd('0x10'),_0x5edd('0x11'),_0x5edd('0x12'),_0x5edd('0x13')],'where':{'name':_0x5b49d9,'role':{'$or':[_0x5edd('0x14'),'user',_0x5edd('0x15')]}}});})[_0x5edd('0xb')](function(_0x2254cf){if(!_0x2254cf||_0x2254cf&&_0x2254cf[_0x5edd('0xc')]!==_0x5b49d9){throw new Error(_0x5edd('0x16'));}else{_0x3008de=_0x2254cf;return _0x3008de;}})[_0x5edd('0xb')](function(){_0x3008de[_0x5edd('0x17')](_0x8da44a,function(_0x1eab2d,_0x1011dd){var _0x2b7bb2=_0x3008de[_0x5edd('0x13')]+0x1;if(_0x1eab2d){return _0x4ae92b(_0x1eab2d);}else if(!_0x1011dd){if(_0x3008de[_0x5edd('0x10')]){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else if(_0x24cc61[_0x5edd('0x9')]>0x0){if(_0x3008de['blocked']){if(_0x24cc61[_0x5edd('0xa')]>0x0){if(moment(_0x3008de[_0x5edd('0x12')])[_0x5edd('0x18')](_0x24cc61[_0x5edd('0xa')],_0x5edd('0x19'))>moment()){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else{return utils[_0x5edd('0x1a')](_0x3008de,_0x2b7bb2,![],null)[_0x5edd('0xb')](function(){return _0x4ae92b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}}else{if(_0x2b7bb2>=_0x24cc61[_0x5edd('0x9')]){return utils[_0x5edd('0x1a')](_0x3008de,0x0,!![],moment())[_0x5edd('0xb')](function(){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});});}else{return utils[_0x5edd('0x1a')](_0x3008de,_0x2b7bb2,![],null)['then'](function(){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});});}}}else{return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}}else{if(_0x3008de[_0x5edd('0x10')]){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else if(_0x24cc61[_0x5edd('0x9')]>0x0){if(_0x3008de[_0x5edd('0x11')]){if(_0x24cc61[_0x5edd('0xa')]>0x0){if(moment(_0x3008de[_0x5edd('0x12')])[_0x5edd('0x18')](_0x24cc61[_0x5edd('0xa')],'minutes')>moment()){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else{return utils[_0x5edd('0x1a')](_0x3008de,0x0,![],null)[_0x5edd('0xb')](function(){return utils[_0x5edd('0x1b')](_0x3008de);})[_0x5edd('0xb')](function(){return _0x4ae92b(null,_0x3008de);});}}else{return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}}else{return utils[_0x5edd('0x1a')](_0x3008de,0x0,![],null)['then'](function(){return utils[_0x5edd('0x1b')](_0x3008de);})['then'](function(){return _0x4ae92b(null,_0x3008de);})['catch'](function(_0x30dc6a){return _0x4ae92b(null,![],_0x30dc6a);});}}else{if(_0x3008de[_0x5edd('0x11')]){return _0x4ae92b(null,![],{'message':_0x5edd('0x16')});}else{return utils[_0x5edd('0x1b')](_0x3008de)['then'](function(){return _0x4ae92b(null,_0x3008de);});}}}});})[_0x5edd('0x1c')](function(_0x1414e3){return _0x4ae92b(null,![],_0x1414e3);});}function sendServiceMail(_0x3b7577){return db['MailAccount'][_0x5edd('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x5edd('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x5edd('0x1f'),'include':[{'model':db[_0x5edd('0x20')],'as':_0x5edd('0x20')}]}]})[_0x5edd('0xb')](function(_0x1ba669){if(!_0x1ba669){throw new Error(_0x5edd('0x21'));}var _0x186e94=_0x1ba669[_0x5edd('0x22')]();var _0x2b4499={'account':_0x186e94,'message':_[_0x5edd('0x23')]({'from':util['format'](_0x5edd('0x24'),_0x1ba669[_0x5edd('0xc')],_0x1ba669[_0x5edd('0x1e')]||_0x1ba669[_0x5edd('0x1f')]['user'])},_0x3b7577)};return client[_0x5edd('0x25')](_0x5edd('0x26'),_0x2b4499);})[_0x5edd('0xb')](function(_0x5583b5){if(_0x5583b5[_0x5edd('0x27')]){throw new Error(util[_0x5edd('0x28')](_0x5edd('0x29'),_0x5583b5[_0x5edd('0x27')][_0x5edd('0x2a')]||JSON['stringify'](_0x5583b5[_0x5edd('0x27')])));}return!![];});}function handleError(_0x566d56,_0x2cee93,_0x1cd46f){return _0x566d56[_0x5edd('0x2b')](_0x2cee93||0x1f4)[_0x5edd('0x2c')]({'message':_0x1cd46f?_0x1cd46f[_0x5edd('0x2a')]||_0x1cd46f:''});}exports[_0x5edd('0x2d')]=function(_0x1311c6,_0x13eaa7,_0x3a3e89){passport[_0x5edd('0x17')](_0x5edd('0x2e'),function(_0x271734,_0x55cafb,_0x2221fa){var _0x458cbc=_0x271734||_0x2221fa;if(_0x458cbc){return handleError(_0x13eaa7,0x191,_0x458cbc);}if(!_0x55cafb){return handleError(_0x13eaa7,0x194,{'message':_0x5edd('0x2f')});}else{var _0x3e05ab={'payload':{'id':_0x55cafb['id'],'role':_0x55cafb[_0x5edd('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x5edd('0x30')](_0x3e05ab)['then'](function(_0x565d9b){_0x13eaa7[_0x5edd('0x31')]({'id':_0x55cafb['id'],'token':_0x565d9b,'statusCall':'','isAlreadyLogged':_0x55cafb['online']});});}})(_0x1311c6,_0x13eaa7,_0x3a3e89);};exports[_0x5edd('0x32')]=function(_0x25b173,_0x5c5858){if(!_0x25b173['body'][_0x5edd('0x1e')]){return handleError(_0x5c5858,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1b5d37=rs[_0x5edd('0x33')]();_0x25b173[_0x5edd('0x34')][_0x5edd('0x1e')]=_0x25b173[_0x5edd('0x34')][_0x5edd('0x1e')][_0x5edd('0x35')]()['toLowerCase']();var _0x3ea620;return db[_0x5edd('0x36')][_0x5edd('0x8')]({'where':{'id':0x1},'attributes':[_0x5edd('0x9'),_0x5edd('0xa')],'raw':!![]})['then'](function(_0x325c9b){_0x3ea620=_0x325c9b;return db[_0x5edd('0x37')]['find']({'where':{'email':_0x25b173[_0x5edd('0x34')]['email']}});})[_0x5edd('0xb')](function(_0x1b0c58){if(!_0x1b0c58){throw new Error(_0x5edd('0x38'));}if(_0x1b0c58[_0x5edd('0x10')]){throw new Error(_0x5edd('0x39'));}if(_0x1b0c58[_0x5edd('0x11')]){if(moment(_0x1b0c58[_0x5edd('0x12')])[_0x5edd('0x18')](_0x3ea620['blockDuration'],_0x5edd('0x19'))>moment()){throw new Error(_0x5edd('0x3a'));}else{_0x1b0c58[_0x5edd('0x11')]=![];_0x1b0c58[_0x5edd('0x12')]=null;}}_0x1b0c58[_0x5edd('0x3b')]=_0x1b5d37;_0x1b0c58[_0x5edd('0x3c')]=Date[_0x5edd('0x3d')]()+0x36ee80;return _0x1b0c58[_0x5edd('0x3e')]();})[_0x5edd('0xb')](function(){return sendServiceMail({'to':_0x25b173[_0x5edd('0x34')]['email'],'subject':_0x5edd('0x3f'),'text':_0x5edd('0x40')+_0x5edd('0x41')+_0x5edd('0x42')+_0x25b173[_0x5edd('0x43')][_0x5edd('0x44')]+_0x5edd('0x45')+_0x1b5d37+'\x0a\x0a'+_0x5edd('0x46')});})[_0x5edd('0xb')](function(){_0x5c5858['status'](0xc8)[_0x5edd('0x2c')]({'message':_0x5edd('0x47')});})[_0x5edd('0x1c')](function(_0x542eef){return handleError(_0x5c5858,0x1f4,_0x542eef);});};exports[_0x5edd('0x48')]=function(_0x4bca8f,_0x233b19){return db[_0x5edd('0x37')][_0x5edd('0x1d')]({'where':{'resetPasswordToken':_0x4bca8f[_0x5edd('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x5edd('0x3d')]()}}})[_0x5edd('0xb')](function(_0x399e22){if(!_0x399e22){throw new Error(_0x5edd('0x4a'));}return db[_0x5edd('0x36')][_0x5edd('0x8')]({'attributes':['id',_0x5edd('0x4b'),_0x5edd('0x4c'),'passwordHistoryLimit']})[_0x5edd('0xb')](function(_0xb43205){if(_0xb43205[_0x5edd('0x4b')])authService[_0x5edd('0x4d')](_0x4bca8f[_0x5edd('0x34')]['password']);if(!_0xb43205[_0x5edd('0x4c')]||!_0x399e22[_0x5edd('0x4e')])return _0x399e22;authService[_0x5edd('0x4f')](_0x4bca8f[_0x5edd('0x34')][_0x5edd('0xd')],_0x399e22[_0x5edd('0x4e')],_0xb43205['passwordHistoryLimit']);return _0x399e22;})[_0x5edd('0xb')](function(){_0x399e22[_0x5edd('0xd')]=_0x4bca8f[_0x5edd('0x34')]['password'];_0x399e22[_0x5edd('0x3b')]=null;_0x399e22['resetPasswordExpires']=null;return _0x399e22[_0x5edd('0x3e')]();});})[_0x5edd('0xb')](function(){_0x233b19[_0x5edd('0x2b')](0xc8)['send']({'message':_0x5edd('0x50')});})[_0x5edd('0x1c')](function(_0x529184){return handleError(_0x233b19,0x1f4,_0x529184);});};passport['use'](_0x5edd('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3f4322,_0x3053cf,_0x188abe){return localAuthenticate(db['User'],_0x3f4322,_0x3053cf,_0x188abe);}));
\ No newline at end of file
+var _0xce11=['then','name','password','salt','role','blocked','blockedAt','admin','user','agent','authenticate','loginAttempts','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','add','clearBlockUser','minutes','getLicense','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','SendMail','error','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','body','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','catch','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','status','use','local-login','util','passport','passport-local','Strategy','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce11,0x97));var _0x1ce1=function(_0x277fd9,_0x2c4ae8){_0x277fd9=_0x277fd9-0x0;var _0x4c1296=_0xce11[_0x277fd9];return _0x4c1296;};'use strict';var util=require(_0x1ce1('0x0'));var passport=require(_0x1ce1('0x1'));var LocalStrategy=require(_0x1ce1('0x2'))[_0x1ce1('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x1ce1('0x4'));var moment=require(_0x1ce1('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x1ce1('0x6'));var utils=require(_0x1ce1('0x7'));var client=jayson[_0x1ce1('0x8')][_0x1ce1('0x9')]({'port':0x232b});function localAuthenticate(_0x4b206b,_0x3be155,_0x45fbc2,_0x42037d){var _0x2a7e86,_0x28652b;return db['Setting'][_0x1ce1('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x1ce1('0xb')](function(_0x1d73d5){_0x2a7e86=_0x1d73d5;return _0x4b206b['findOne']({'attributes':['id',_0x1ce1('0xc'),_0x1ce1('0xd'),_0x1ce1('0xe'),_0x1ce1('0xf'),'disabled',_0x1ce1('0x10'),_0x1ce1('0x11'),'loginAttempts'],'where':{'name':_0x3be155,'role':{'$or':[_0x1ce1('0x12'),_0x1ce1('0x13'),_0x1ce1('0x14')]}}});})[_0x1ce1('0xb')](function(_0x983d72){if(!_0x983d72||_0x983d72&&_0x983d72['name']!==_0x3be155){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x28652b=_0x983d72;return _0x28652b;}})[_0x1ce1('0xb')](function(){_0x28652b[_0x1ce1('0x15')](_0x45fbc2,function(_0x176edf,_0x2836b2){var _0x60163f=_0x28652b[_0x1ce1('0x16')]+0x1;if(_0x176edf){return _0x42037d(_0x176edf);}else if(!_0x2836b2){if(_0x28652b[_0x1ce1('0x17')]){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}else if(_0x2a7e86[_0x1ce1('0x19')]>0x0){if(_0x28652b[_0x1ce1('0x10')]){if(_0x2a7e86[_0x1ce1('0x1a')]>0x0){if(moment(_0x28652b['blockedAt'])[_0x1ce1('0x1b')](_0x2a7e86[_0x1ce1('0x1a')],'minutes')>moment()){return _0x42037d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1ce1('0x1c')](_0x28652b,_0x60163f,![],null)['then'](function(){return _0x42037d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}}else{if(_0x60163f>=_0x2a7e86['allowedLoginAttempts']){return utils[_0x1ce1('0x1c')](_0x28652b,0x0,!![],moment())['then'](function(){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});});}else{return utils['clearBlockUser'](_0x28652b,_0x60163f,![],null)[_0x1ce1('0xb')](function(){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});});}}}else{return _0x42037d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x28652b[_0x1ce1('0x17')]){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}else if(_0x2a7e86[_0x1ce1('0x19')]>0x0){if(_0x28652b[_0x1ce1('0x10')]){if(_0x2a7e86[_0x1ce1('0x1a')]>0x0){if(moment(_0x28652b['blockedAt'])[_0x1ce1('0x1b')](_0x2a7e86[_0x1ce1('0x1a')],_0x1ce1('0x1d'))>moment()){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}else{return utils['clearBlockUser'](_0x28652b,0x0,![],null)[_0x1ce1('0xb')](function(){return utils[_0x1ce1('0x1e')](_0x28652b);})[_0x1ce1('0xb')](function(){return _0x42037d(null,_0x28652b);});}}else{return _0x42037d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x28652b,0x0,![],null)[_0x1ce1('0xb')](function(){return utils[_0x1ce1('0x1e')](_0x28652b);})[_0x1ce1('0xb')](function(){return _0x42037d(null,_0x28652b);})['catch'](function(_0x29419d){return _0x42037d(null,![],_0x29419d);});}}else{if(_0x28652b[_0x1ce1('0x10')]){return _0x42037d(null,![],{'message':_0x1ce1('0x18')});}else{return utils[_0x1ce1('0x1e')](_0x28652b)[_0x1ce1('0xb')](function(){return _0x42037d(null,_0x28652b);});}}}});})['catch'](function(_0x240a5a){return _0x42037d(null,![],_0x240a5a);});}function sendServiceMail(_0x194171){return db[_0x1ce1('0x1f')][_0x1ce1('0x20')]({'where':{'service':!![]},'attributes':['id',_0x1ce1('0xc'),_0x1ce1('0x21')],'include':[{'model':db[_0x1ce1('0x22')],'as':_0x1ce1('0x23'),'include':[{'model':db[_0x1ce1('0x24')],'as':_0x1ce1('0x24')}]}]})['then'](function(_0x2be45d){if(!_0x2be45d){throw new Error(_0x1ce1('0x25'));}var _0x38d5a0=_0x2be45d['getSmtpOptions']();var _0x10adc3={'account':_0x38d5a0,'message':_[_0x1ce1('0x26')]({'from':util[_0x1ce1('0x27')]('\x22%s\x22\x20<%s>',_0x2be45d['name'],_0x2be45d['email']||_0x2be45d['Smtp'][_0x1ce1('0x13')])},_0x194171)};return client['request'](_0x1ce1('0x28'),_0x10adc3);})['then'](function(_0x143dab){if(_0x143dab['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x143dab['error']['message']||JSON['stringify'](_0x143dab[_0x1ce1('0x29')])));}return!![];});}function handleError(_0x1f01c5,_0x32a4ed,_0xa0e751){return _0x1f01c5['status'](_0x32a4ed||0x1f4)['send']({'message':_0xa0e751?_0xa0e751[_0x1ce1('0x2a')]||_0xa0e751:''});}exports['login']=function(_0x2bc018,_0x53f731,_0x499abf){passport[_0x1ce1('0x15')]('local-login',function(_0x51579f,_0x268045,_0x2b813e){var _0x2b6132=_0x51579f||_0x2b813e;if(_0x2b6132){return handleError(_0x53f731,0x191,_0x2b6132);}if(!_0x268045){return handleError(_0x53f731,0x194,{'message':_0x1ce1('0x2b')});}else{var _0x378611={'payload':{'id':_0x268045['id'],'role':_0x268045[_0x1ce1('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x1ce1('0x2c')](_0x378611)[_0x1ce1('0xb')](function(_0x12a568){_0x53f731[_0x1ce1('0x2d')]({'id':_0x268045['id'],'token':_0x12a568,'statusCall':'','isAlreadyLogged':_0x268045[_0x1ce1('0x2e')]});});}})(_0x2bc018,_0x53f731,_0x499abf);};exports['forgot']=function(_0x2251f7,_0x5b8ace){if(!_0x2251f7['body'][_0x1ce1('0x21')]){return handleError(_0x5b8ace,0x1f4,{'message':_0x1ce1('0x2f')});}var _0x426bfd=rs['generate']();_0x2251f7['body'][_0x1ce1('0x21')]=_0x2251f7['body'][_0x1ce1('0x21')][_0x1ce1('0x30')]()[_0x1ce1('0x31')]();var _0xbe69ba;return db[_0x1ce1('0x32')][_0x1ce1('0xa')]({'where':{'id':0x1},'attributes':[_0x1ce1('0x19'),_0x1ce1('0x1a')],'raw':!![]})[_0x1ce1('0xb')](function(_0x2dc58e){_0xbe69ba=_0x2dc58e;return db['User'][_0x1ce1('0x20')]({'where':{'email':_0x2251f7[_0x1ce1('0x33')]['email']}});})['then'](function(_0x43da5c){if(!_0x43da5c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x43da5c['disabled']){throw new Error(_0x1ce1('0x34'));}if(_0x43da5c[_0x1ce1('0x10')]){if(moment(_0x43da5c[_0x1ce1('0x11')])['add'](_0xbe69ba[_0x1ce1('0x1a')],_0x1ce1('0x1d'))>moment()){throw new Error(_0x1ce1('0x35'));}else{_0x43da5c[_0x1ce1('0x10')]=![];_0x43da5c[_0x1ce1('0x11')]=null;}}_0x43da5c[_0x1ce1('0x36')]=_0x426bfd;_0x43da5c[_0x1ce1('0x37')]=Date[_0x1ce1('0x38')]()+0x36ee80;return _0x43da5c[_0x1ce1('0x39')]();})[_0x1ce1('0xb')](function(){return sendServiceMail({'to':_0x2251f7[_0x1ce1('0x33')][_0x1ce1('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x1ce1('0x3a')+_0x1ce1('0x3b')+_0x1ce1('0x3c')+_0x2251f7[_0x1ce1('0x3d')][_0x1ce1('0x3e')]+_0x1ce1('0x3f')+_0x426bfd+'\x0a\x0a'+_0x1ce1('0x40')});})['then'](function(){_0x5b8ace['status'](0xc8)[_0x1ce1('0x41')]({'message':_0x1ce1('0x42')});})[_0x1ce1('0x43')](function(_0x9b9c7f){return handleError(_0x5b8ace,0x1f4,_0x9b9c7f);});};exports[_0x1ce1('0x44')]=function(_0x3d4088,_0x38a8cb){return db[_0x1ce1('0x45')][_0x1ce1('0x20')]({'where':{'resetPasswordToken':_0x3d4088[_0x1ce1('0x46')][_0x1ce1('0x47')],'resetPasswordExpires':{'$gt':Date[_0x1ce1('0x38')]()}}})['then'](function(_0xadc288){if(!_0xadc288){throw new Error(_0x1ce1('0x48'));}return db[_0x1ce1('0x32')][_0x1ce1('0xa')]({'attributes':['id',_0x1ce1('0x49'),_0x1ce1('0x4a'),'passwordHistoryLimit']})[_0x1ce1('0xb')](function(_0xb9dd4c){if(_0xb9dd4c[_0x1ce1('0x49')])authService['validatePasswordPattern'](_0x3d4088['body'][_0x1ce1('0xd')]);if(!_0xb9dd4c['enforcePasswordHistory']||!_0xadc288[_0x1ce1('0x4b')])return _0xadc288;authService[_0x1ce1('0x4c')](_0x3d4088[_0x1ce1('0x33')]['password'],_0xadc288['previousPasswords'],_0xb9dd4c[_0x1ce1('0x4d')]);return _0xadc288;})['then'](function(){_0xadc288[_0x1ce1('0xd')]=_0x3d4088[_0x1ce1('0x33')]['password'];_0xadc288['resetPasswordToken']=null;_0xadc288[_0x1ce1('0x37')]=null;return _0xadc288[_0x1ce1('0x39')]();});})[_0x1ce1('0xb')](function(){_0x38a8cb[_0x1ce1('0x4e')](0xc8)[_0x1ce1('0x41')]({'message':'Password\x20reset!'});})['catch'](function(_0x2790cc){return handleError(_0x38a8cb,0x1f4,_0x2790cc);});};passport[_0x1ce1('0x4f')](_0x1ce1('0x50'),new LocalStrategy({'usernameField':_0x1ce1('0xc'),'passwordField':_0x1ce1('0xd')},function(_0x1ba786,_0xf66cf0,_0x21cfe1){return localAuthenticate(db['User'],_0x1ba786,_0xf66cf0,_0x21cfe1);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a2d7cf0..dac8218 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 _0x3649=['/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller','post','login'];(function(_0x83770f,_0x5eef79){var _0x141355=function(_0x58bf71){while(--_0x58bf71){_0x83770f['push'](_0x83770f['shift']());}};_0x141355(++_0x5eef79);}(_0x3649,0xb8));var _0x9364=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3649[_0x187ee1];return _0x388160;};'use strict';var express=require(_0x9364('0x0'));var router=express[_0x9364('0x1')]();var controller=require(_0x9364('0x2'));router[_0x9364('0x3')]('/',controller[_0x9364('0x4')]);router[_0x9364('0x3')](_0x9364('0x5'),controller[_0x9364('0x6')]);router[_0x9364('0x3')](_0x9364('0x7'),controller[_0x9364('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0xc2a0=['/reset/:token','Router','/forgot','post'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc2a0,0xed));var _0x0c2a=function(_0x2e60d8,_0x47679c){_0x2e60d8=_0x2e60d8-0x0;var _0x5a3c2c=_0xc2a0[_0x2e60d8];return _0x5a3c2c;};'use strict';var express=require('express');var router=express[_0x0c2a('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router['post'](_0x0c2a('0x1'),controller['forgot']);router[_0x0c2a('0x2')](_0x0c2a('0x3'),controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 7b69f0f..87e3ba9 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 _0x01bb=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0xb5c068,_0x1d2497){var _0x1f39c7=function(_0x26eb87){while(--_0x26eb87){_0xb5c068['push'](_0xb5c068['shift']());}};_0x1f39c7(++_0x1d2497);}(_0x01bb,0x7e));var _0xb01b=function(_0x224541,_0x2be610){_0x224541=_0x224541-0x0;var _0x5025b0=_0x01bb[_0x224541];return _0x5025b0;};'use strict';var Sequelize=require(_0xb01b('0x0'));module[_0xb01b('0x1')]={'name':{'type':Sequelize[_0xb01b('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb01b('0x2')]},'description':{'type':Sequelize[_0xb01b('0x2')]},'status':{'type':Sequelize[_0xb01b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb01b('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x009f=['INTEGER','STRING','BOOLEAN'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x009f,0x70));var _0xf009=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0x009f[_0x5e2152];return _0x5ddcf6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf009('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0xf009('0x0')]},'description':{'type':Sequelize[_0xf009('0x0')]},'status':{'type':Sequelize[_0xf009('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf009('0x2')],'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 6c66999..d3a5194 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 _0xeba5=['json','apply','reject','update','then','stack','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','intersection','body','find','destroy','params','addConditions','ids','getConditions','findOne','Condition','pick','addActions','Action','omit','getActions','length','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range'];(function(_0xa8b7ae,_0x227520){var _0x4c4ba4=function(_0x44689e){while(--_0x44689e){_0xa8b7ae['push'](_0xa8b7ae['shift']());}};_0x4c4ba4(++_0x227520);}(_0xeba5,0x7f));var _0x5eba=function(_0x3452d9,_0x3c78d6){_0x3452d9=_0x3452d9-0x0;var _0x42bb77=_0xeba5[_0x3452d9];return _0x42bb77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5eba('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5eba('0x1'));var moment=require(_0x5eba('0x2'));var BPromise=require(_0x5eba('0x3'));var Mustache=require(_0x5eba('0x4'));var util=require('util');var path=require(_0x5eba('0x5'));var sox=require('sox');var csv=require(_0x5eba('0x6'));var ejs=require(_0x5eba('0x7'));var fs=require('fs');var fs_extra=require(_0x5eba('0x8'));var _=require(_0x5eba('0x9'));var squel=require('squel');var crypto=require(_0x5eba('0xa'));var jsforce=require(_0x5eba('0xb'));var deskjs=require(_0x5eba('0xc'));var toCsv=require(_0x5eba('0x6'));var querystring=require('querystring');var Papa=require(_0x5eba('0xd'));var Redis=require(_0x5eba('0xe'));var authService=require(_0x5eba('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5eba('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5eba('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x5eba('0x12'));var licenseUtil=require(_0x5eba('0x13'));var db=require(_0x5eba('0x14'))['db'];function respondWithStatusCode(_0xbdfaac,_0x387873){_0x387873=_0x387873||0xcc;return function(_0x54794c){if(_0x54794c){return _0xbdfaac['sendStatus'](_0x387873);}return _0xbdfaac[_0x5eba('0x15')](_0x387873)[_0x5eba('0x16')]();};}function respondWithResult(_0x59f301,_0x1877e1){_0x1877e1=_0x1877e1||0xc8;return function(_0x1d7cd8){if(_0x1d7cd8){return _0x59f301[_0x5eba('0x15')](_0x1877e1)['json'](_0x1d7cd8);}};}function respondWithFilteredResult(_0x3522bf,_0x2eeb22){return function(_0x38a7fc){if(_0x38a7fc){var _0x58027=typeof _0x2eeb22['offset']===_0x5eba('0x17')&&typeof _0x2eeb22[_0x5eba('0x18')]===_0x5eba('0x17');var _0x2f65f5=_0x38a7fc[_0x5eba('0x19')];var _0x27b7ad=_0x58027?0x0:_0x2eeb22[_0x5eba('0x1a')];var _0x421307=_0x58027?_0x38a7fc[_0x5eba('0x19')]:_0x2eeb22['offset']+_0x2eeb22['limit'];var _0x86c572;if(_0x421307>=_0x2f65f5){_0x421307=_0x2f65f5;_0x86c572=0xc8;}else{_0x86c572=0xce;}_0x3522bf['status'](_0x86c572);return _0x3522bf[_0x5eba('0x1b')](_0x5eba('0x1c'),_0x27b7ad+'-'+_0x421307+'/'+_0x2f65f5)[_0x5eba('0x1d')](_0x38a7fc);}return null;};}function patchUpdates(_0x3c20d0){return function(_0x1262b1){try{jsonpatch[_0x5eba('0x1e')](_0x1262b1,_0x3c20d0,!![]);}catch(_0x24ae75){return BPromise[_0x5eba('0x1f')](_0x24ae75);}return _0x1262b1['save']();};}function saveUpdates(_0x32720d,_0x3b3615){return function(_0x1ad6c4){if(_0x1ad6c4){return _0x1ad6c4[_0x5eba('0x20')](_0x32720d)[_0x5eba('0x21')](function(_0x4e19bc){return _0x4e19bc;});}return null;};}function removeEntity(_0x3ebd67,_0x85eb11){return function(_0x3e47ba){if(_0x3e47ba){return _0x3e47ba['destroy']()[_0x5eba('0x21')](function(){_0x3ebd67[_0x5eba('0x15')](0xcc)[_0x5eba('0x16')]();});}};}function handleEntityNotFound(_0x3e8fe5,_0x5932d8){return function(_0x55b753){if(!_0x55b753){_0x3e8fe5['sendStatus'](0x194);}return _0x55b753;};}function handleError(_0xae2dbf,_0x200e0a){_0x200e0a=_0x200e0a||0x1f4;return function(_0x1cb8b0){logger['error'](_0x1cb8b0[_0x5eba('0x22')]);if(_0x1cb8b0[_0x5eba('0x23')]){delete _0x1cb8b0[_0x5eba('0x23')];}_0xae2dbf[_0x5eba('0x15')](_0x200e0a)[_0x5eba('0x24')](_0x1cb8b0);};}exports[_0x5eba('0x25')]=function(_0x192535,_0x3eee8a){var _0x35739f={},_0x513510={},_0x3c2891={'count':0x0,'rows':[]};var _0x1c72f2=_[_0x5eba('0x26')](db[_0x5eba('0x27')][_0x5eba('0x28')],function(_0x1e13ef){return{'name':_0x1e13ef['fieldName'],'type':_0x1e13ef[_0x5eba('0x29')][_0x5eba('0x2a')]};});_0x513510[_0x5eba('0x2b')]=_[_0x5eba('0x26')](_0x1c72f2,_0x5eba('0x23'));_0x513510[_0x5eba('0x2c')]=_[_0x5eba('0x2d')](_0x192535[_0x5eba('0x2c')]);_0x513510[_0x5eba('0x2e')]=_['intersection'](_0x513510[_0x5eba('0x2b')],_0x513510[_0x5eba('0x2c')]);_0x35739f[_0x5eba('0x2f')]=_['intersection'](_0x513510[_0x5eba('0x2b')],qs[_0x5eba('0x30')](_0x192535[_0x5eba('0x2c')]['fields']));_0x35739f[_0x5eba('0x2f')]=_0x35739f[_0x5eba('0x2f')]['length']?_0x35739f['attributes']:_0x513510[_0x5eba('0x2b')];if(!_0x192535['query'][_0x5eba('0x31')](_0x5eba('0x32'))){_0x35739f[_0x5eba('0x18')]=qs[_0x5eba('0x18')](_0x192535['query'][_0x5eba('0x18')]);_0x35739f[_0x5eba('0x1a')]=qs[_0x5eba('0x1a')](_0x192535[_0x5eba('0x2c')]['offset']);}_0x35739f[_0x5eba('0x33')]=qs[_0x5eba('0x34')](_0x192535[_0x5eba('0x2c')][_0x5eba('0x34')]);_0x35739f['where']=qs[_0x5eba('0x2e')](_['pick'](_0x192535[_0x5eba('0x2c')],_0x513510[_0x5eba('0x2e')]),_0x1c72f2);if(_0x192535['query'][_0x5eba('0x35')]){_0x35739f[_0x5eba('0x36')]=_[_0x5eba('0x37')](_0x35739f[_0x5eba('0x36')],{'$or':_['map'](_0x1c72f2,function(_0x2007a3){if(_0x2007a3[_0x5eba('0x29')]!==_0x5eba('0x38')){var _0x3df351={};_0x3df351[_0x2007a3[_0x5eba('0x23')]]={'$like':'%'+_0x192535[_0x5eba('0x2c')][_0x5eba('0x35')]+'%'};return _0x3df351;}})});}_0x35739f=_[_0x5eba('0x37')]({},_0x35739f,_0x192535[_0x5eba('0x39')]);var _0x2c1a44={'where':_0x35739f['where']};return db['Automation'][_0x5eba('0x19')](_0x2c1a44)[_0x5eba('0x21')](function(_0x4a6bfc){_0x3c2891[_0x5eba('0x19')]=_0x4a6bfc;if(_0x192535['query'][_0x5eba('0x3a')]){_0x35739f[_0x5eba('0x3b')]=[{'all':!![]}];}return db['Automation'][_0x5eba('0x3c')](_0x35739f);})[_0x5eba('0x21')](function(_0x13bcc5){_0x3c2891['rows']=_0x13bcc5;return _0x3c2891;})[_0x5eba('0x21')](respondWithFilteredResult(_0x3eee8a,_0x35739f))[_0x5eba('0x3d')](handleError(_0x3eee8a,null));};exports['show']=function(_0x1f3a72,_0x42c7d3){var _0x384468={'raw':![],'where':{'id':_0x1f3a72['params']['id']}},_0x34e1c0={};_0x34e1c0[_0x5eba('0x2b')]=_[_0x5eba('0x2d')](db[_0x5eba('0x27')][_0x5eba('0x28')]);_0x34e1c0[_0x5eba('0x2c')]=_[_0x5eba('0x2d')](_0x1f3a72[_0x5eba('0x2c')]);_0x34e1c0[_0x5eba('0x2e')]=_[_0x5eba('0x3e')](_0x34e1c0['model'],_0x34e1c0[_0x5eba('0x2c')]);_0x384468[_0x5eba('0x2f')]=_[_0x5eba('0x3e')](_0x34e1c0[_0x5eba('0x2b')],qs['fields'](_0x1f3a72[_0x5eba('0x2c')]['fields']));_0x384468[_0x5eba('0x2f')]=_0x384468[_0x5eba('0x2f')]['length']?_0x384468[_0x5eba('0x2f')]:_0x34e1c0['model'];if(_0x1f3a72[_0x5eba('0x2c')][_0x5eba('0x3a')]){_0x384468[_0x5eba('0x3b')]=[{'all':!![]}];}_0x384468=_[_0x5eba('0x37')]({},_0x384468,_0x1f3a72['options']);return db['Automation']['find'](_0x384468)[_0x5eba('0x21')](handleEntityNotFound(_0x42c7d3,null))[_0x5eba('0x21')](respondWithResult(_0x42c7d3,null))[_0x5eba('0x3d')](handleError(_0x42c7d3,null));};exports['create']=function(_0x1b45f1,_0xcbdda6){return db[_0x5eba('0x27')]['create'](_0x1b45f1[_0x5eba('0x3f')],{})[_0x5eba('0x21')](respondWithResult(_0xcbdda6,0xc9))[_0x5eba('0x3d')](handleError(_0xcbdda6,null));};exports[_0x5eba('0x20')]=function(_0x322213,_0x525d4c){if(_0x322213[_0x5eba('0x3f')]['id']){delete _0x322213[_0x5eba('0x3f')]['id'];}return db[_0x5eba('0x27')][_0x5eba('0x40')]({'where':{'id':_0x322213['params']['id']}})['then'](handleEntityNotFound(_0x525d4c,null))['then'](saveUpdates(_0x322213['body'],null))['then'](respondWithResult(_0x525d4c,null))[_0x5eba('0x3d')](handleError(_0x525d4c,null));};exports[_0x5eba('0x41')]=function(_0x518898,_0x32dec6){return db[_0x5eba('0x27')][_0x5eba('0x40')]({'where':{'id':_0x518898[_0x5eba('0x42')]['id']}})[_0x5eba('0x21')](handleEntityNotFound(_0x32dec6,null))[_0x5eba('0x21')](removeEntity(_0x32dec6,null))[_0x5eba('0x3d')](handleError(_0x32dec6,null));};exports[_0x5eba('0x43')]=function(_0x5da50e,_0x1685db,_0x5b4ea8){return db['Condition'][_0x5eba('0x40')]({'where':{'id':_0x5da50e[_0x5eba('0x42')]['id']}})[_0x5eba('0x21')](handleEntityNotFound(_0x1685db,null))[_0x5eba('0x21')](function(_0x4434ef){if(_0x4434ef){return _0x4434ef[_0x5eba('0x43')](_0x5da50e[_0x5eba('0x3f')][_0x5eba('0x44')],_['omit'](_0x5da50e[_0x5eba('0x3f')],['ids','id'])||{});}})[_0x5eba('0x21')](respondWithResult(_0x1685db,null))[_0x5eba('0x3d')](handleError(_0x1685db,null));};exports[_0x5eba('0x45')]=function(_0x473f98,_0x15af50,_0xf46ce8){var _0x3e26e8={};var _0x53d2c6={};var _0x5efb58;var _0x3626e5;return db[_0x5eba('0x27')][_0x5eba('0x46')]({'where':{'id':_0x473f98[_0x5eba('0x42')]['id']}})[_0x5eba('0x21')](handleEntityNotFound(_0x15af50,null))[_0x5eba('0x21')](function(_0x178983){if(_0x178983){_0x5efb58=_0x178983;_0x53d2c6[_0x5eba('0x2b')]=_[_0x5eba('0x2d')](db[_0x5eba('0x47')]['rawAttributes']);_0x53d2c6[_0x5eba('0x2c')]=_['keys'](_0x473f98[_0x5eba('0x2c')]);_0x53d2c6[_0x5eba('0x2e')]=_[_0x5eba('0x3e')](_0x53d2c6['model'],_0x53d2c6[_0x5eba('0x2c')]);_0x3e26e8[_0x5eba('0x2f')]=_[_0x5eba('0x3e')](_0x53d2c6[_0x5eba('0x2b')],qs['fields'](_0x473f98['query'][_0x5eba('0x30')]));_0x3e26e8[_0x5eba('0x2f')]=_0x3e26e8['attributes']['length']?_0x3e26e8['attributes']:_0x53d2c6['model'];_0x3e26e8[_0x5eba('0x33')]=qs[_0x5eba('0x34')](_0x473f98['query'][_0x5eba('0x34')]);_0x3e26e8[_0x5eba('0x36')]=qs[_0x5eba('0x2e')](_[_0x5eba('0x48')](_0x473f98[_0x5eba('0x2c')],_0x53d2c6[_0x5eba('0x2e')]));if(_0x473f98['query']['filter']){_0x3e26e8[_0x5eba('0x36')]=_[_0x5eba('0x37')](_0x3e26e8[_0x5eba('0x36')],{'$or':_['map'](_0x3e26e8[_0x5eba('0x2f')],function(_0x2e9009){var _0x43358a={};_0x43358a[_0x2e9009]={'$like':'%'+_0x473f98[_0x5eba('0x2c')][_0x5eba('0x35')]+'%'};return _0x43358a;})});}_0x3e26e8=_[_0x5eba('0x37')]({},_0x3e26e8,_0x473f98[_0x5eba('0x39')]);return _0x5efb58['getConditions'](_0x3e26e8);}})[_0x5eba('0x21')](function(_0x48cdec){if(_0x48cdec){_0x3626e5=_0x48cdec['length'];if(!_0x473f98[_0x5eba('0x2c')][_0x5eba('0x31')](_0x5eba('0x32'))){_0x3e26e8[_0x5eba('0x18')]=qs['limit'](_0x473f98[_0x5eba('0x2c')][_0x5eba('0x18')]);_0x3e26e8[_0x5eba('0x1a')]=qs['offset'](_0x473f98[_0x5eba('0x2c')][_0x5eba('0x1a')]);}return _0x5efb58['getConditions'](_0x3e26e8);}})[_0x5eba('0x21')](function(_0x2751bd){if(_0x2751bd){return _0x2751bd?{'count':_0x3626e5,'rows':_0x2751bd}:null;}})[_0x5eba('0x21')](respondWithResult(_0x15af50,null))[_0x5eba('0x3d')](handleError(_0x15af50,null));};exports[_0x5eba('0x49')]=function(_0x2242b3,_0x3da64d,_0x1a2882){return db[_0x5eba('0x4a')][_0x5eba('0x40')]({'where':{'id':_0x2242b3[_0x5eba('0x42')]['id']}})['then'](handleEntityNotFound(_0x3da64d,null))['then'](function(_0x36d89b){if(_0x36d89b){return _0x36d89b['addActions'](_0x2242b3[_0x5eba('0x3f')]['ids'],_[_0x5eba('0x4b')](_0x2242b3[_0x5eba('0x3f')],['ids','id'])||{});}})['then'](respondWithResult(_0x3da64d,null))[_0x5eba('0x3d')](handleError(_0x3da64d,null));};exports[_0x5eba('0x4c')]=function(_0x582b61,_0x3ea3e5,_0xe6e0a4){var _0x4f7b0f={};var _0x245c3f={};var _0x47df18;var _0x4becfb;return db['Automation'][_0x5eba('0x46')]({'where':{'id':_0x582b61['params']['id']}})[_0x5eba('0x21')](handleEntityNotFound(_0x3ea3e5,null))[_0x5eba('0x21')](function(_0x149f8b){if(_0x149f8b){_0x47df18=_0x149f8b;_0x245c3f[_0x5eba('0x2b')]=_['keys'](db[_0x5eba('0x4a')][_0x5eba('0x28')]);_0x245c3f[_0x5eba('0x2c')]=_[_0x5eba('0x2d')](_0x582b61[_0x5eba('0x2c')]);_0x245c3f[_0x5eba('0x2e')]=_[_0x5eba('0x3e')](_0x245c3f[_0x5eba('0x2b')],_0x245c3f['query']);_0x4f7b0f[_0x5eba('0x2f')]=_[_0x5eba('0x3e')](_0x245c3f[_0x5eba('0x2b')],qs[_0x5eba('0x30')](_0x582b61[_0x5eba('0x2c')][_0x5eba('0x30')]));_0x4f7b0f[_0x5eba('0x2f')]=_0x4f7b0f[_0x5eba('0x2f')][_0x5eba('0x4d')]?_0x4f7b0f[_0x5eba('0x2f')]:_0x245c3f[_0x5eba('0x2b')];_0x4f7b0f[_0x5eba('0x33')]=qs['sort'](_0x582b61[_0x5eba('0x2c')]['sort']);_0x4f7b0f[_0x5eba('0x36')]=qs[_0x5eba('0x2e')](_[_0x5eba('0x48')](_0x582b61['query'],_0x245c3f['filters']));if(_0x582b61[_0x5eba('0x2c')]['filter']){_0x4f7b0f[_0x5eba('0x36')]=_[_0x5eba('0x37')](_0x4f7b0f[_0x5eba('0x36')],{'$or':_[_0x5eba('0x26')](_0x4f7b0f[_0x5eba('0x2f')],function(_0x3b4f9c){var _0x56ae1b={};_0x56ae1b[_0x3b4f9c]={'$like':'%'+_0x582b61[_0x5eba('0x2c')][_0x5eba('0x35')]+'%'};return _0x56ae1b;})});}_0x4f7b0f=_[_0x5eba('0x37')]({},_0x4f7b0f,_0x582b61['options']);return _0x47df18[_0x5eba('0x4c')](_0x4f7b0f);}})[_0x5eba('0x21')](function(_0x92d50d){if(_0x92d50d){_0x4becfb=_0x92d50d[_0x5eba('0x4d')];if(!_0x582b61[_0x5eba('0x2c')][_0x5eba('0x31')](_0x5eba('0x32'))){_0x4f7b0f[_0x5eba('0x18')]=qs[_0x5eba('0x18')](_0x582b61[_0x5eba('0x2c')]['limit']);_0x4f7b0f[_0x5eba('0x1a')]=qs[_0x5eba('0x1a')](_0x582b61[_0x5eba('0x2c')]['offset']);}return _0x47df18[_0x5eba('0x4c')](_0x4f7b0f);}})['then'](function(_0x2b0e5b){if(_0x2b0e5b){return _0x2b0e5b?{'count':_0x4becfb,'rows':_0x2b0e5b}:null;}})['then'](respondWithResult(_0x3ea3e5,null))[_0x5eba('0x3d')](handleError(_0x3ea3e5,null));};
\ No newline at end of file
+var _0x7394=['name','index','map','Automation','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','rows','catch','params','include','create','body','find','addConditions','ids','omit','getConditions','findOne','Condition','addActions','getActions','Action','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','then','error','stack'];(function(_0x1cebe9,_0x37885e){var _0x54003c=function(_0xbd8272){while(--_0xbd8272){_0x1cebe9['push'](_0x1cebe9['shift']());}};_0x54003c(++_0x37885e);}(_0x7394,0x7d));var _0x4739=function(_0x5a311f,_0xd938b7){_0x5a311f=_0x5a311f-0x0;var _0x53675d=_0x7394[_0x5a311f];return _0x53675d;};'use strict';var emlformat=require(_0x4739('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4739('0x1'));var moment=require(_0x4739('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4739('0x3'));var util=require(_0x4739('0x4'));var path=require('path');var sox=require(_0x4739('0x5'));var csv=require(_0x4739('0x6'));var ejs=require(_0x4739('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4739('0x8'));var squel=require(_0x4739('0x9'));var crypto=require(_0x4739('0xa'));var jsforce=require(_0x4739('0xb'));var deskjs=require(_0x4739('0xc'));var toCsv=require(_0x4739('0x6'));var querystring=require(_0x4739('0xd'));var Papa=require(_0x4739('0xe'));var Redis=require(_0x4739('0xf'));var authService=require(_0x4739('0x10'));var qs=require(_0x4739('0x11'));var as=require(_0x4739('0x12'));var hardwareService=require(_0x4739('0x13'));var logger=require(_0x4739('0x14'))(_0x4739('0x15'));var utils=require(_0x4739('0x16'));var config=require(_0x4739('0x17'));var licenseUtil=require(_0x4739('0x18'));var db=require(_0x4739('0x19'))['db'];function respondWithStatusCode(_0x5a6b83,_0x554d42){_0x554d42=_0x554d42||0xcc;return function(_0x42272c){if(_0x42272c){return _0x5a6b83[_0x4739('0x1a')](_0x554d42);}return _0x5a6b83[_0x4739('0x1b')](_0x554d42)[_0x4739('0x1c')]();};}function respondWithResult(_0x1b9c4c,_0x5e61a5){_0x5e61a5=_0x5e61a5||0xc8;return function(_0x36abb8){if(_0x36abb8){return _0x1b9c4c[_0x4739('0x1b')](_0x5e61a5)[_0x4739('0x1d')](_0x36abb8);}};}function respondWithFilteredResult(_0x5569d9,_0x424999){return function(_0x4f9d0c){if(_0x4f9d0c){var _0x4756ad=typeof _0x424999[_0x4739('0x1e')]===_0x4739('0x1f')&&typeof _0x424999[_0x4739('0x20')]===_0x4739('0x1f');var _0xa23ee6=_0x4f9d0c[_0x4739('0x21')];var _0x2dd69b=_0x4756ad?0x0:_0x424999[_0x4739('0x1e')];var _0x4b312c=_0x4756ad?_0x4f9d0c[_0x4739('0x21')]:_0x424999[_0x4739('0x1e')]+_0x424999[_0x4739('0x20')];var _0x4441d5;if(_0x4b312c>=_0xa23ee6){_0x4b312c=_0xa23ee6;_0x4441d5=0xc8;}else{_0x4441d5=0xce;}_0x5569d9['status'](_0x4441d5);return _0x5569d9[_0x4739('0x22')]('Content-Range',_0x2dd69b+'-'+_0x4b312c+'/'+_0xa23ee6)[_0x4739('0x1d')](_0x4f9d0c);}return null;};}function patchUpdates(_0x20b058){return function(_0x4057a4){try{jsonpatch['apply'](_0x4057a4,_0x20b058,!![]);}catch(_0x566c7e){return BPromise[_0x4739('0x23')](_0x566c7e);}return _0x4057a4['save']();};}function saveUpdates(_0x231a26,_0x4063fd){return function(_0x5bebfc){if(_0x5bebfc){return _0x5bebfc[_0x4739('0x24')](_0x231a26)['then'](function(_0x3d46a6){return _0x3d46a6;});}return null;};}function removeEntity(_0x481078,_0x35c7e8){return function(_0x488cc5){if(_0x488cc5){return _0x488cc5[_0x4739('0x25')]()[_0x4739('0x26')](function(){_0x481078['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d60a,_0x2e82d2){return function(_0x269530){if(!_0x269530){_0x21d60a[_0x4739('0x1a')](0x194);}return _0x269530;};}function handleError(_0x47513e,_0x1c44c8){_0x1c44c8=_0x1c44c8||0x1f4;return function(_0x21f469){logger[_0x4739('0x27')](_0x21f469[_0x4739('0x28')]);if(_0x21f469[_0x4739('0x29')]){delete _0x21f469['name'];}_0x47513e[_0x4739('0x1b')](_0x1c44c8)['send'](_0x21f469);};}exports[_0x4739('0x2a')]=function(_0x3c24c2,_0x2ba5fb){var _0x426187={},_0x48e50e={},_0x578497={'count':0x0,'rows':[]};var _0x3d9336=_[_0x4739('0x2b')](db[_0x4739('0x2c')][_0x4739('0x2d')],function(_0x5de28f){return{'name':_0x5de28f['fieldName'],'type':_0x5de28f['type'][_0x4739('0x2e')]};});_0x48e50e[_0x4739('0x2f')]=_[_0x4739('0x2b')](_0x3d9336,_0x4739('0x29'));_0x48e50e[_0x4739('0x30')]=_[_0x4739('0x31')](_0x3c24c2['query']);_0x48e50e[_0x4739('0x32')]=_[_0x4739('0x33')](_0x48e50e['model'],_0x48e50e[_0x4739('0x30')]);_0x426187['attributes']=_[_0x4739('0x33')](_0x48e50e['model'],qs[_0x4739('0x34')](_0x3c24c2['query']['fields']));_0x426187[_0x4739('0x35')]=_0x426187[_0x4739('0x35')][_0x4739('0x36')]?_0x426187[_0x4739('0x35')]:_0x48e50e[_0x4739('0x2f')];if(!_0x3c24c2[_0x4739('0x30')][_0x4739('0x37')](_0x4739('0x38'))){_0x426187[_0x4739('0x20')]=qs[_0x4739('0x20')](_0x3c24c2[_0x4739('0x30')]['limit']);_0x426187[_0x4739('0x1e')]=qs[_0x4739('0x1e')](_0x3c24c2[_0x4739('0x30')][_0x4739('0x1e')]);}_0x426187[_0x4739('0x39')]=qs[_0x4739('0x3a')](_0x3c24c2[_0x4739('0x30')][_0x4739('0x3a')]);_0x426187[_0x4739('0x3b')]=qs[_0x4739('0x32')](_[_0x4739('0x3c')](_0x3c24c2[_0x4739('0x30')],_0x48e50e[_0x4739('0x32')]),_0x3d9336);if(_0x3c24c2[_0x4739('0x30')]['filter']){_0x426187[_0x4739('0x3b')]=_[_0x4739('0x3d')](_0x426187[_0x4739('0x3b')],{'$or':_[_0x4739('0x2b')](_0x3d9336,function(_0xd2c236){if(_0xd2c236[_0x4739('0x3e')]!==_0x4739('0x3f')){var _0x10b6a3={};_0x10b6a3[_0xd2c236[_0x4739('0x29')]]={'$like':'%'+_0x3c24c2[_0x4739('0x30')][_0x4739('0x40')]+'%'};return _0x10b6a3;}})});}_0x426187=_[_0x4739('0x3d')]({},_0x426187,_0x3c24c2[_0x4739('0x41')]);var _0x573a00={'where':_0x426187[_0x4739('0x3b')]};return db[_0x4739('0x2c')][_0x4739('0x21')](_0x573a00)[_0x4739('0x26')](function(_0x45b96d){_0x578497[_0x4739('0x21')]=_0x45b96d;if(_0x3c24c2[_0x4739('0x30')][_0x4739('0x42')]){_0x426187['include']=[{'all':!![]}];}return db[_0x4739('0x2c')]['findAll'](_0x426187);})[_0x4739('0x26')](function(_0x4b5ab1){_0x578497[_0x4739('0x43')]=_0x4b5ab1;return _0x578497;})[_0x4739('0x26')](respondWithFilteredResult(_0x2ba5fb,_0x426187))[_0x4739('0x44')](handleError(_0x2ba5fb,null));};exports['show']=function(_0x54f109,_0x500a51){var _0x246854={'raw':![],'where':{'id':_0x54f109[_0x4739('0x45')]['id']}},_0x5d3e01={};_0x5d3e01[_0x4739('0x2f')]=_[_0x4739('0x31')](db[_0x4739('0x2c')][_0x4739('0x2d')]);_0x5d3e01[_0x4739('0x30')]=_[_0x4739('0x31')](_0x54f109[_0x4739('0x30')]);_0x5d3e01[_0x4739('0x32')]=_[_0x4739('0x33')](_0x5d3e01['model'],_0x5d3e01[_0x4739('0x30')]);_0x246854['attributes']=_['intersection'](_0x5d3e01[_0x4739('0x2f')],qs[_0x4739('0x34')](_0x54f109[_0x4739('0x30')][_0x4739('0x34')]));_0x246854[_0x4739('0x35')]=_0x246854['attributes'][_0x4739('0x36')]?_0x246854[_0x4739('0x35')]:_0x5d3e01['model'];if(_0x54f109[_0x4739('0x30')][_0x4739('0x42')]){_0x246854[_0x4739('0x46')]=[{'all':!![]}];}_0x246854=_[_0x4739('0x3d')]({},_0x246854,_0x54f109[_0x4739('0x41')]);return db[_0x4739('0x2c')]['find'](_0x246854)[_0x4739('0x26')](handleEntityNotFound(_0x500a51,null))['then'](respondWithResult(_0x500a51,null))[_0x4739('0x44')](handleError(_0x500a51,null));};exports[_0x4739('0x47')]=function(_0x159772,_0x2f7515){return db['Automation']['create'](_0x159772['body'],{})['then'](respondWithResult(_0x2f7515,0xc9))['catch'](handleError(_0x2f7515,null));};exports[_0x4739('0x24')]=function(_0x1b47c0,_0xcfdca7){if(_0x1b47c0[_0x4739('0x48')]['id']){delete _0x1b47c0[_0x4739('0x48')]['id'];}return db[_0x4739('0x2c')][_0x4739('0x49')]({'where':{'id':_0x1b47c0[_0x4739('0x45')]['id']}})[_0x4739('0x26')](handleEntityNotFound(_0xcfdca7,null))[_0x4739('0x26')](saveUpdates(_0x1b47c0['body'],null))[_0x4739('0x26')](respondWithResult(_0xcfdca7,null))[_0x4739('0x44')](handleError(_0xcfdca7,null));};exports['destroy']=function(_0x39011d,_0xf23deb){return db[_0x4739('0x2c')][_0x4739('0x49')]({'where':{'id':_0x39011d['params']['id']}})[_0x4739('0x26')](handleEntityNotFound(_0xf23deb,null))[_0x4739('0x26')](removeEntity(_0xf23deb,null))[_0x4739('0x44')](handleError(_0xf23deb,null));};exports['addConditions']=function(_0x430c57,_0x2de77b,_0x4238e6){return db['Condition'][_0x4739('0x49')]({'where':{'id':_0x430c57[_0x4739('0x45')]['id']}})[_0x4739('0x26')](handleEntityNotFound(_0x2de77b,null))[_0x4739('0x26')](function(_0xb03373){if(_0xb03373){return _0xb03373[_0x4739('0x4a')](_0x430c57['body'][_0x4739('0x4b')],_[_0x4739('0x4c')](_0x430c57[_0x4739('0x48')],[_0x4739('0x4b'),'id'])||{});}})[_0x4739('0x26')](respondWithResult(_0x2de77b,null))['catch'](handleError(_0x2de77b,null));};exports[_0x4739('0x4d')]=function(_0x2c1837,_0x3f41ab,_0x26134f){var _0x202a6f={};var _0x8d91bc={};var _0x1cb0bc;var _0x247504;return db['Automation'][_0x4739('0x4e')]({'where':{'id':_0x2c1837[_0x4739('0x45')]['id']}})[_0x4739('0x26')](handleEntityNotFound(_0x3f41ab,null))[_0x4739('0x26')](function(_0x117379){if(_0x117379){_0x1cb0bc=_0x117379;_0x8d91bc[_0x4739('0x2f')]=_['keys'](db[_0x4739('0x4f')]['rawAttributes']);_0x8d91bc[_0x4739('0x30')]=_[_0x4739('0x31')](_0x2c1837['query']);_0x8d91bc[_0x4739('0x32')]=_['intersection'](_0x8d91bc[_0x4739('0x2f')],_0x8d91bc[_0x4739('0x30')]);_0x202a6f[_0x4739('0x35')]=_[_0x4739('0x33')](_0x8d91bc['model'],qs[_0x4739('0x34')](_0x2c1837[_0x4739('0x30')]['fields']));_0x202a6f[_0x4739('0x35')]=_0x202a6f[_0x4739('0x35')]['length']?_0x202a6f[_0x4739('0x35')]:_0x8d91bc[_0x4739('0x2f')];_0x202a6f[_0x4739('0x39')]=qs[_0x4739('0x3a')](_0x2c1837['query'][_0x4739('0x3a')]);_0x202a6f['where']=qs[_0x4739('0x32')](_[_0x4739('0x3c')](_0x2c1837[_0x4739('0x30')],_0x8d91bc['filters']));if(_0x2c1837[_0x4739('0x30')][_0x4739('0x40')]){_0x202a6f['where']=_[_0x4739('0x3d')](_0x202a6f['where'],{'$or':_[_0x4739('0x2b')](_0x202a6f['attributes'],function(_0x500848){var _0x504f17={};_0x504f17[_0x500848]={'$like':'%'+_0x2c1837[_0x4739('0x30')][_0x4739('0x40')]+'%'};return _0x504f17;})});}_0x202a6f=_['merge']({},_0x202a6f,_0x2c1837[_0x4739('0x41')]);return _0x1cb0bc[_0x4739('0x4d')](_0x202a6f);}})[_0x4739('0x26')](function(_0x281d86){if(_0x281d86){_0x247504=_0x281d86['length'];if(!_0x2c1837[_0x4739('0x30')]['hasOwnProperty'](_0x4739('0x38'))){_0x202a6f[_0x4739('0x20')]=qs['limit'](_0x2c1837[_0x4739('0x30')]['limit']);_0x202a6f[_0x4739('0x1e')]=qs[_0x4739('0x1e')](_0x2c1837[_0x4739('0x30')][_0x4739('0x1e')]);}return _0x1cb0bc[_0x4739('0x4d')](_0x202a6f);}})[_0x4739('0x26')](function(_0x2cf0fe){if(_0x2cf0fe){return _0x2cf0fe?{'count':_0x247504,'rows':_0x2cf0fe}:null;}})[_0x4739('0x26')](respondWithResult(_0x3f41ab,null))[_0x4739('0x44')](handleError(_0x3f41ab,null));};exports[_0x4739('0x50')]=function(_0x13b4c2,_0x1a8b49,_0x50ffbb){return db['Action'][_0x4739('0x49')]({'where':{'id':_0x13b4c2[_0x4739('0x45')]['id']}})[_0x4739('0x26')](handleEntityNotFound(_0x1a8b49,null))[_0x4739('0x26')](function(_0x25e040){if(_0x25e040){return _0x25e040['addActions'](_0x13b4c2[_0x4739('0x48')][_0x4739('0x4b')],_['omit'](_0x13b4c2[_0x4739('0x48')],[_0x4739('0x4b'),'id'])||{});}})[_0x4739('0x26')](respondWithResult(_0x1a8b49,null))[_0x4739('0x44')](handleError(_0x1a8b49,null));};exports[_0x4739('0x51')]=function(_0x83c573,_0x27cc28,_0x1a5663){var _0x3f95d9={};var _0x572f4b={};var _0x47a577;var _0x53373d;return db[_0x4739('0x2c')][_0x4739('0x4e')]({'where':{'id':_0x83c573['params']['id']}})[_0x4739('0x26')](handleEntityNotFound(_0x27cc28,null))[_0x4739('0x26')](function(_0x568ed9){if(_0x568ed9){_0x47a577=_0x568ed9;_0x572f4b[_0x4739('0x2f')]=_[_0x4739('0x31')](db[_0x4739('0x52')][_0x4739('0x2d')]);_0x572f4b[_0x4739('0x30')]=_['keys'](_0x83c573['query']);_0x572f4b[_0x4739('0x32')]=_['intersection'](_0x572f4b[_0x4739('0x2f')],_0x572f4b[_0x4739('0x30')]);_0x3f95d9['attributes']=_[_0x4739('0x33')](_0x572f4b[_0x4739('0x2f')],qs[_0x4739('0x34')](_0x83c573[_0x4739('0x30')]['fields']));_0x3f95d9[_0x4739('0x35')]=_0x3f95d9[_0x4739('0x35')][_0x4739('0x36')]?_0x3f95d9[_0x4739('0x35')]:_0x572f4b['model'];_0x3f95d9[_0x4739('0x39')]=qs[_0x4739('0x3a')](_0x83c573['query'][_0x4739('0x3a')]);_0x3f95d9[_0x4739('0x3b')]=qs[_0x4739('0x32')](_[_0x4739('0x3c')](_0x83c573[_0x4739('0x30')],_0x572f4b[_0x4739('0x32')]));if(_0x83c573['query'][_0x4739('0x40')]){_0x3f95d9[_0x4739('0x3b')]=_[_0x4739('0x3d')](_0x3f95d9['where'],{'$or':_[_0x4739('0x2b')](_0x3f95d9['attributes'],function(_0x51b85d){var _0x47676b={};_0x47676b[_0x51b85d]={'$like':'%'+_0x83c573[_0x4739('0x30')][_0x4739('0x40')]+'%'};return _0x47676b;})});}_0x3f95d9=_['merge']({},_0x3f95d9,_0x83c573[_0x4739('0x41')]);return _0x47a577[_0x4739('0x51')](_0x3f95d9);}})[_0x4739('0x26')](function(_0x536ff9){if(_0x536ff9){_0x53373d=_0x536ff9[_0x4739('0x36')];if(!_0x83c573[_0x4739('0x30')][_0x4739('0x37')](_0x4739('0x38'))){_0x3f95d9['limit']=qs[_0x4739('0x20')](_0x83c573[_0x4739('0x30')][_0x4739('0x20')]);_0x3f95d9[_0x4739('0x1e')]=qs[_0x4739('0x1e')](_0x83c573['query'][_0x4739('0x1e')]);}return _0x47a577['getActions'](_0x3f95d9);}})[_0x4739('0x26')](function(_0x737057){if(_0x737057){return _0x737057?{'count':_0x53373d,'rows':_0x737057}:null;}})[_0x4739('0x26')](respondWithResult(_0x27cc28,null))[_0x4739('0x44')](handleError(_0x27cc28,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 2cca657..b1591e4 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 _0x1af7=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util'];(function(_0x1bfe07,_0x35116f){var _0x17e158=function(_0xd542e8){while(--_0xd542e8){_0x1bfe07['push'](_0x1bfe07['shift']());}};_0x17e158(++_0x35116f);}(_0x1af7,0x11c));var _0x71af=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1af7[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x71af('0x0'));var util=require(_0x71af('0x1'));var logger=require(_0x71af('0x2'))(_0x71af('0x3'));var moment=require(_0x71af('0x4'));var BPromise=require(_0x71af('0x5'));var rp=require(_0x71af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71af('0x7'));var config=require(_0x71af('0x8'));var attributes=require(_0x71af('0x9'));module[_0x71af('0xa')]=function(_0x30ec80,_0x1906b1){return _0x30ec80[_0x71af('0xb')]('Automation',attributes,{'tableName':_0x71af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfa8=['bluebird','path','rimraf','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x4009e3,_0x5c1e1d){var _0x49a75f=function(_0x2b2d6d){while(--_0x2b2d6d){_0x4009e3['push'](_0x4009e3['shift']());}};_0x49a75f(++_0x5c1e1d);}(_0xcfa8,0x133));var _0x8cfa=function(_0x19548d,_0x1e3502){_0x19548d=_0x19548d-0x0;var _0x2926fe=_0xcfa8[_0x19548d];return _0x2926fe;};'use strict';var _=require(_0x8cfa('0x0'));var util=require(_0x8cfa('0x1'));var logger=require(_0x8cfa('0x2'))(_0x8cfa('0x3'));var moment=require(_0x8cfa('0x4'));var BPromise=require(_0x8cfa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cfa('0x6'));var rimraf=require(_0x8cfa('0x7'));var config=require('../../config/environment');var attributes=require(_0x8cfa('0x8'));module['exports']=function(_0x42d714,_0xeefafb){return _0x42d714[_0x8cfa('0x9')](_0x8cfa('0xa'),attributes,{'tableName':_0x8cfa('0xb'),'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 ae9e732..484ed9b 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 _0xfb11=['info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x53fcd0,_0x294576){var _0x456acb=function(_0x3a28d2){while(--_0x3a28d2){_0x53fcd0['push'](_0x53fcd0['shift']());}};_0x456acb(++_0x294576);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xfb11[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}
\ No newline at end of file
+var _0x6739=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x59a188,_0x475add){var _0x16af5b=function(_0x4b17ce){while(--_0x4b17ce){_0x59a188['push'](_0x59a188['shift']());}};_0x16af5b(++_0x475add);}(_0x6739,0xd3));var _0x9673=function(_0x138cbc,_0xac550){_0x138cbc=_0x138cbc-0x0;var _0x3421bf=_0x6739[_0x138cbc];return _0x3421bf;};'use strict';var _=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var moment=require(_0x9673('0x2'));var BPromise=require(_0x9673('0x3'));var rs=require(_0x9673('0x4'));var fs=require('fs');var Redis=require(_0x9673('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9673('0x6'))('rpc');var config=require(_0x9673('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9673('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ad052,_0x3f82df,_0x4981d9){return new BPromise(function(_0x4e1dd5,_0x39b0f0){return client[_0x9673('0x9')](_0x3ad052,_0x4981d9)[_0x9673('0xa')](function(_0x509966){logger[_0x9673('0xb')](_0x9673('0xc'),_0x3f82df,_0x9673('0xd'));logger['debug'](_0x9673('0xe'),_0x3f82df,_0x9673('0xd'),JSON[_0x9673('0xf')](_0x509966));if(_0x509966[_0x9673('0x10')]){if(_0x509966['error'][_0x9673('0x11')]===0x1f4){logger[_0x9673('0x10')](_0x9673('0xc'),_0x3f82df,_0x509966[_0x9673('0x10')]['message']);return _0x39b0f0(_0x509966[_0x9673('0x10')][_0x9673('0x12')]);}logger['error'](_0x9673('0xc'),_0x3f82df,_0x509966[_0x9673('0x10')][_0x9673('0x12')]);return _0x4e1dd5(_0x509966['error'][_0x9673('0x12')]);}else{logger['info'](_0x9673('0xc'),_0x3f82df,'request\x20sent');_0x4e1dd5(_0x509966['result'][_0x9673('0x12')]);}})['catch'](function(_0x3d5642){logger[_0x9673('0x10')]('Automation,\x20%s,\x20%s',_0x3f82df,_0x3d5642);_0x39b0f0(_0x3d5642);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 8ad8946..979aad1 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 _0x49c4=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x41b7fb,_0x141853){var _0x22435b=function(_0x474c97){while(--_0x474c97){_0x41b7fb['push'](_0x41b7fb['shift']());}};_0x22435b(++_0x141853);}(_0x49c4,0x9b));var _0x449c=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x49c4[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x449c('0x0'));var util=require('util');var path=require(_0x449c('0x1'));var timeout=require(_0x449c('0x2'));var express=require(_0x449c('0x3'));var router=express[_0x449c('0x4')]();var fs_extra=require(_0x449c('0x5'));var auth=require(_0x449c('0x6'));var interaction=require(_0x449c('0x7'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x449c('0x8')]('/',auth[_0x449c('0x9')](),controller[_0x449c('0xa')]);router[_0x449c('0x8')](_0x449c('0xb'),auth[_0x449c('0x9')](),controller[_0x449c('0xc')]);router[_0x449c('0x8')](_0x449c('0xd'),auth[_0x449c('0x9')](),controller[_0x449c('0xe')]);router[_0x449c('0x8')](_0x449c('0xf'),auth[_0x449c('0x9')](),controller[_0x449c('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x449c('0x11')]);router[_0x449c('0x12')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x449c('0x12')](_0x449c('0xf'),auth[_0x449c('0x9')](),controller[_0x449c('0x13')]);router['put'](_0x449c('0xb'),auth['isAuthenticated'](),controller[_0x449c('0x14')]);router['delete'](_0x449c('0xb'),auth[_0x449c('0x9')](),controller[_0x449c('0x15')]);module[_0x449c('0x16')]=router;
\ No newline at end of file
+var _0x56e6=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','put'];(function(_0x582d6a,_0x501f14){var _0x1837eb=function(_0x5517ee){while(--_0x5517ee){_0x582d6a['push'](_0x582d6a['shift']());}};_0x1837eb(++_0x501f14);}(_0x56e6,0x6b));var _0x656e=function(_0x57cadd,_0x49cac1){_0x57cadd=_0x57cadd-0x0;var _0x46644b=_0x56e6[_0x57cadd];return _0x46644b;};'use strict';var multer=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var path=require(_0x656e('0x2'));var timeout=require(_0x656e('0x3'));var express=require(_0x656e('0x4'));var router=express[_0x656e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x656e('0x6'));var interaction=require(_0x656e('0x7'));var config=require(_0x656e('0x8'));var controller=require(_0x656e('0x9'));router[_0x656e('0xa')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0xc')]);router['get'](_0x656e('0xd'),auth[_0x656e('0xb')](),controller[_0x656e('0xe')]);router[_0x656e('0xa')](_0x656e('0xf'),auth[_0x656e('0xb')](),controller[_0x656e('0x10')]);router[_0x656e('0xa')](_0x656e('0x11'),auth[_0x656e('0xb')](),controller[_0x656e('0x12')]);router[_0x656e('0x13')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0x14')]);router['post']('/:id/conditions',auth[_0x656e('0xb')](),controller[_0x656e('0x15')]);router[_0x656e('0x13')](_0x656e('0x11'),auth['isAuthenticated'](),controller['addActions']);router[_0x656e('0x16')](_0x656e('0xd'),auth['isAuthenticated'](),controller[_0x656e('0x17')]);router['delete'](_0x656e('0xd'),auth[_0x656e('0xb')](),controller[_0x656e('0x18')]);module[_0x656e('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 370595b..d11cb51 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 _0x870a=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#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,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr'];(function(_0x286e00,_0x1d34bb){var _0x146039=function(_0xe96072){while(--_0xe96072){_0x286e00['push'](_0x286e00['shift']());}};_0x146039(++_0x1d34bb);}(_0x870a,0x1e9));var _0xa870=function(_0x485c75,_0x1edc7c){_0x485c75=_0x485c75-0x0;var _0x441e22=_0x870a[_0x485c75];return _0x441e22;};'use strict';var Sequelize=require(_0xa870('0x0'));module[_0xa870('0x1')]={'name':{'type':Sequelize[_0xa870('0x2')],'unique':_0xa870('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xa870('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xa870('0x2')]},'active':{'type':Sequelize[_0xa870('0x5')],'defaultValue':0x0,'comment':_0xa870('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa870('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)[_0xa870('0x8')],'defaultValue':0x3,'comment':_0xa870('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa870('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa870('0x2')],'defaultValue':_0xa870('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xa870('0x10')](_0xa870('0x11'),_0xa870('0x12'),_0xa870('0x13')),'defaultValue':_0xa870('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa870('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa870('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa870('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa870('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xa870('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa870('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa870('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa870('0x7')](0x9)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa870('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xa870('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa870('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa870('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa870('0x10')](_0xa870('0x1b'),_0xa870('0x1c')),'defaultValue':_0xa870('0x1b')},'dialPrefix':{'type':Sequelize[_0xa870('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa870('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xa870('0x7')](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa870('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa870('0x7')](0x5)[_0xa870('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa870('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa870('0x25')}};
\ No newline at end of file
+var _0x5fcc=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0x5fcc,0x161));var _0xc5fc=function(_0x1416ba,_0xd7bfec){_0x1416ba=_0x1416ba-0x0;var _0x593f41=_0x5fcc[_0x1416ba];return _0x593f41;};'use strict';var Sequelize=require(_0xc5fc('0x0'));module[_0xc5fc('0x1')]={'name':{'type':Sequelize[_0xc5fc('0x2')],'unique':_0xc5fc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc5fc('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xc5fc('0x5')},'description':{'type':Sequelize[_0xc5fc('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc5fc('0x6')},'limitCalls':{'type':Sequelize[_0xc5fc('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc5fc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc5fc('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc5fc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc5fc('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xc5fc('0x4')](_0xc5fc('0xe'),'never',_0xc5fc('0xf')),'defaultValue':_0xc5fc('0xe')},'dialAMDActive':{'type':Sequelize[_0xc5fc('0x10')],'defaultValue':0x0,'comment':_0xc5fc('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc5fc('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc5fc('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc5fc('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc5fc('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc5fc('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc5fc('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc5fc('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc5fc('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc5fc('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc5fc('0x19'),_0xc5fc('0x1a')),'defaultValue':_0xc5fc('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5fc('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc5fc('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5fc('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 8691720..2cbb11f 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 _0xbd9f=['h.id','ci.item','ci.OrderBY','OrderBy','join','h.ContactId\x20=\x20ci.CmContactId','sequelize','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','Campaign','rawAttributes','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','params','keys','fields','length','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','clone','createdAt','updatedAt','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','findOne','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','CmListId','toString','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','cm_contacts','cm_hopper_additional_phones'];(function(_0x1f5b26,_0x3ea474){var _0x5c7e3d=function(_0x270a3e){while(--_0x270a3e){_0x1f5b26['push'](_0x1f5b26['shift']());}};_0x5c7e3d(++_0x3ea474);}(_0xbd9f,0x98));var _0xfbd9=function(_0x1537d2,_0x60fc97){_0x1537d2=_0x1537d2-0x0;var _0x35e330=_0xbd9f[_0x1537d2];return _0x35e330;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfbd9('0x0'));var rp=require('request-promise');var moment=require(_0xfbd9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xfbd9('0x2'));var util=require('util');var path=require(_0xfbd9('0x3'));var sox=require(_0xfbd9('0x4'));var csv=require(_0xfbd9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbd9('0x6'));var _=require('lodash');var squel=require(_0xfbd9('0x7'));var crypto=require(_0xfbd9('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xfbd9('0x9'));var toCsv=require(_0xfbd9('0x5'));var querystring=require(_0xfbd9('0xa'));var Papa=require('papaparse');var Redis=require(_0xfbd9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xfbd9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbd9('0xd'));var logger=require(_0xfbd9('0xe'))('api');var utils=require(_0xfbd9('0xf'));var config=require(_0xfbd9('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbd9('0x11'))['db'];function respondWithStatusCode(_0x301770,_0x1a4a0e){_0x1a4a0e=_0x1a4a0e||0xcc;return function(_0x527707){if(_0x527707){return _0x301770[_0xfbd9('0x12')](_0x1a4a0e);}return _0x301770['status'](_0x1a4a0e)['end']();};}function respondWithResult(_0x36113b,_0x35adb1){_0x35adb1=_0x35adb1||0xc8;return function(_0x159743){if(_0x159743){return _0x36113b[_0xfbd9('0x13')](_0x35adb1)['json'](_0x159743);}};}function respondWithFilteredResult(_0x2fef54,_0x9f8390){return function(_0x2b9553){if(_0x2b9553){var _0x58d553=typeof _0x9f8390[_0xfbd9('0x14')]===_0xfbd9('0x15')&&typeof _0x9f8390['limit']===_0xfbd9('0x15');var _0x516dcf=_0x2b9553[_0xfbd9('0x16')];var _0x13918f=_0x58d553?0x0:_0x9f8390['offset'];var _0x3ed394=_0x58d553?_0x2b9553[_0xfbd9('0x16')]:_0x9f8390[_0xfbd9('0x14')]+_0x9f8390[_0xfbd9('0x17')];var _0x35bf78;if(_0x3ed394>=_0x516dcf){_0x3ed394=_0x516dcf;_0x35bf78=0xc8;}else{_0x35bf78=0xce;}_0x2fef54[_0xfbd9('0x13')](_0x35bf78);return _0x2fef54[_0xfbd9('0x18')](_0xfbd9('0x19'),_0x13918f+'-'+_0x3ed394+'/'+_0x516dcf)[_0xfbd9('0x1a')](_0x2b9553);}return null;};}function patchUpdates(_0x1b1eea){return function(_0x2d2c6e){try{jsonpatch[_0xfbd9('0x1b')](_0x2d2c6e,_0x1b1eea,!![]);}catch(_0x2fc10b){return BPromise[_0xfbd9('0x1c')](_0x2fc10b);}return _0x2d2c6e[_0xfbd9('0x1d')]();};}function saveUpdates(_0x32f9bb,_0x12140b){return function(_0x4d3020){if(_0x4d3020){return _0x4d3020[_0xfbd9('0x1e')](_0x32f9bb)[_0xfbd9('0x1f')](function(_0x175373){return _0x175373;});}return null;};}function removeEntity(_0x299dd2,_0x237313){return function(_0x39da76){if(_0x39da76){return _0x39da76[_0xfbd9('0x20')]()[_0xfbd9('0x1f')](function(){var _0x3624f3=_0x39da76[_0xfbd9('0x21')]({'plain':!![]});var _0x1b0cc5='IvrCampaigns';return db[_0xfbd9('0x22')][_0xfbd9('0x20')]({'where':{'type':_0x1b0cc5,'resourceId':_0x3624f3['id']}})[_0xfbd9('0x1f')](function(){return _0x39da76;});})['then'](function(){_0x299dd2['status'](0xcc)[_0xfbd9('0x23')]();});}};}function handleEntityNotFound(_0x4d0104,_0x3c8cca){return function(_0x58de44){if(!_0x58de44){_0x4d0104['sendStatus'](0x194);}return _0x58de44;};}function handleError(_0x3a6a0,_0x5a00ff){_0x5a00ff=_0x5a00ff||0x1f4;return function(_0x303257){logger[_0xfbd9('0x24')](_0x303257[_0xfbd9('0x25')]);if(_0x303257[_0xfbd9('0x26')]){delete _0x303257[_0xfbd9('0x26')];}_0x3a6a0[_0xfbd9('0x13')](_0x5a00ff)[_0xfbd9('0x27')](_0x303257);};}exports['index']=function(_0x27dc31,_0x179b8e){var _0x2728c9={},_0x4515b5={},_0x43f09b={'count':0x0,'rows':[]};var _0x17936b=_[_0xfbd9('0x28')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')],function(_0x1f66d1){return{'name':_0x1f66d1['fieldName'],'type':_0x1f66d1['type'][_0xfbd9('0x2b')]};});_0x4515b5[_0xfbd9('0x2c')]=_[_0xfbd9('0x28')](_0x17936b,_0xfbd9('0x26'));_0x4515b5[_0xfbd9('0x2d')]=_['keys'](_0x27dc31[_0xfbd9('0x2d')]);_0x4515b5[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x4515b5[_0xfbd9('0x2c')],_0x4515b5[_0xfbd9('0x2d')]);_0x2728c9[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x4515b5[_0xfbd9('0x2c')],qs['fields'](_0x27dc31[_0xfbd9('0x2d')]['fields']));_0x2728c9[_0xfbd9('0x30')]=_0x2728c9['attributes']['length']?_0x2728c9[_0xfbd9('0x30')]:_0x4515b5[_0xfbd9('0x2c')];if(!_0x27dc31['query'][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x2728c9[_0xfbd9('0x17')]=qs['limit'](_0x27dc31[_0xfbd9('0x2d')]['limit']);_0x2728c9[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x27dc31['query'][_0xfbd9('0x14')]);}_0x2728c9[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x27dc31[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x2728c9[_0xfbd9('0x35')]=qs[_0xfbd9('0x2e')](_[_0xfbd9('0x36')](_0x27dc31['query'],_0x4515b5[_0xfbd9('0x2e')]),_0x17936b);if(_0x27dc31[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x2728c9[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x2728c9['where'],{'$or':_[_0xfbd9('0x28')](_0x17936b,function(_0x5b7040){if(_0x5b7040[_0xfbd9('0x39')]!=='VIRTUAL'){var _0x1b88c5={};_0x1b88c5[_0x5b7040[_0xfbd9('0x26')]]={'$like':'%'+_0x27dc31[_0xfbd9('0x2d')]['filter']+'%'};return _0x1b88c5;}})});}_0x2728c9=_[_0xfbd9('0x38')]({},_0x2728c9,_0x27dc31[_0xfbd9('0x3a')]);var _0x16bfdf={'where':_0x2728c9[_0xfbd9('0x35')]};return db[_0xfbd9('0x29')][_0xfbd9('0x16')](_0x16bfdf)[_0xfbd9('0x1f')](function(_0x55f3dc){_0x43f09b[_0xfbd9('0x16')]=_0x55f3dc;if(_0x27dc31[_0xfbd9('0x2d')]['includeAll']){_0x2728c9[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x29')][_0xfbd9('0x3c')](_0x2728c9);})[_0xfbd9('0x1f')](function(_0x2eaa5d){_0x43f09b['rows']=_0x2eaa5d;return _0x43f09b;})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x179b8e,_0x2728c9))['catch'](handleError(_0x179b8e,null));};exports['show']=function(_0x443cdc,_0x5d8a94){var _0xa19c47={'raw':![],'where':{'id':_0x443cdc[_0xfbd9('0x3d')]['id']}},_0x1aa6d3={};_0x1aa6d3[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')]);_0x1aa6d3['query']=_[_0xfbd9('0x3e')](_0x443cdc[_0xfbd9('0x2d')]);_0x1aa6d3['filters']=_[_0xfbd9('0x2f')](_0x1aa6d3[_0xfbd9('0x2c')],_0x1aa6d3[_0xfbd9('0x2d')]);_0xa19c47[_0xfbd9('0x30')]=_['intersection'](_0x1aa6d3[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x443cdc[_0xfbd9('0x2d')]['fields']));_0xa19c47['attributes']=_0xa19c47[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0xa19c47[_0xfbd9('0x30')]:_0x1aa6d3[_0xfbd9('0x2c')];if(_0x443cdc[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0xa19c47[_0xfbd9('0x3b')]=[{'all':!![]}];}_0xa19c47=_[_0xfbd9('0x38')]({},_0xa19c47,_0x443cdc[_0xfbd9('0x3a')]);return db[_0xfbd9('0x29')]['find'](_0xa19c47)[_0xfbd9('0x1f')](handleEntityNotFound(_0x5d8a94,null))[_0xfbd9('0x1f')](respondWithResult(_0x5d8a94,null))[_0xfbd9('0x42')](handleError(_0x5d8a94,null));};exports[_0xfbd9('0x43')]=function(_0x4add02,_0x5d2576){return db['Campaign'][_0xfbd9('0x43')](_0x4add02[_0xfbd9('0x44')],{})[_0xfbd9('0x1f')](function(_0x11365a){var _0x484523=_0x4add02['user'][_0xfbd9('0x21')]({'plain':!![]});if(!_0x484523)throw new Error(_0xfbd9('0x45'));if(_0x484523[_0xfbd9('0x46')]==='user'){var _0x3e3d94=_0x11365a[_0xfbd9('0x21')]({'plain':!![]});var _0x5ccd07=_0xfbd9('0x47');return db[_0xfbd9('0x48')][_0xfbd9('0x49')]({'where':{'name':_0x5ccd07,'userProfileId':_0x484523[_0xfbd9('0x4a')]},'raw':!![]})[_0xfbd9('0x1f')](function(_0x5dbaa6){if(_0x5dbaa6&&_0x5dbaa6[_0xfbd9('0x4b')]===0x0){return db[_0xfbd9('0x22')][_0xfbd9('0x43')]({'name':_0x3e3d94[_0xfbd9('0x26')],'resourceId':_0x3e3d94['id'],'type':_0x5dbaa6[_0xfbd9('0x26')],'sectionId':_0x5dbaa6['id']},{})['then'](function(){return _0x11365a;});}else{return _0x11365a;}})[_0xfbd9('0x42')](function(_0x310b73){logger[_0xfbd9('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x310b73);throw _0x310b73;});}return _0x11365a;})['then'](respondWithResult(_0x5d2576,0xc9))[_0xfbd9('0x42')](handleError(_0x5d2576,null));};exports[_0xfbd9('0x4c')]=function(_0xe4d9f,_0x84cddb){var _0x18ac89={'where':{'id':_0xe4d9f[_0xfbd9('0x3d')]['id']}},_0x3406c8={};_0x3406c8[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x29')][_0xfbd9('0x2a')]);_0x18ac89[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x3406c8['model'],qs['fields'](_0xe4d9f[_0xfbd9('0x2d')][_0xfbd9('0x3f')]));_0x18ac89['attributes']=_0x18ac89[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x18ac89[_0xfbd9('0x30')]:_0x3406c8['model'];if(_0xe4d9f[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x18ac89[_0xfbd9('0x3b')]=[{'all':!![]}];}_0x18ac89=_['merge']({},_0x18ac89,_0xe4d9f[_0xfbd9('0x3a')]);return db[_0xfbd9('0x29')][_0xfbd9('0x49')](_0x18ac89)[_0xfbd9('0x1f')](handleEntityNotFound(_0x84cddb,null))[_0xfbd9('0x1f')](function(_0x5b7187){if(_0x5b7187){var _0x2e53f8=_0x5b7187['get']({'plain':!![]});_0x2e53f8=qs['omit'](_0x2e53f8,['id',_0xfbd9('0x4d'),_0xfbd9('0x4e')]);_0xe4d9f['body']=_[_0xfbd9('0x4f')](_0xe4d9f['body'],['id',_0xfbd9('0x4d'),_0xfbd9('0x4e')]);return db[_0xfbd9('0x29')][_0xfbd9('0x43')](_[_0xfbd9('0x38')](_0x2e53f8,_0xe4d9f[_0xfbd9('0x44')]),{'include':_0xe4d9f['query'][_0xfbd9('0x41')]?[{'all':!![]}]:undefined})[_0xfbd9('0x1f')](function(_0x683623){var _0x42bc46=_0xe4d9f['user'][_0xfbd9('0x21')]({'plain':!![]});if(!_0x42bc46)throw new Error(_0xfbd9('0x45'));if(_0x42bc46['role']==='user'){var _0x5c287b=_0x683623[_0xfbd9('0x21')]({'plain':!![]});var _0x41416a=_0xfbd9('0x47');return db['UserProfileSection'][_0xfbd9('0x49')]({'where':{'name':_0x41416a,'userProfileId':_0x42bc46[_0xfbd9('0x4a')]},'raw':!![]})[_0xfbd9('0x1f')](function(_0x366b9a){if(_0x366b9a&&_0x366b9a[_0xfbd9('0x4b')]===0x0){return db['UserProfileResource'][_0xfbd9('0x43')]({'name':_0x5c287b[_0xfbd9('0x26')],'resourceId':_0x5c287b['id'],'type':_0x366b9a[_0xfbd9('0x26')],'sectionId':_0x366b9a['id']},{})[_0xfbd9('0x1f')](function(){return _0x683623;});}else{return _0x683623;}})[_0xfbd9('0x42')](function(_0x50651b){logger[_0xfbd9('0x24')](_0xfbd9('0x50'),_0x50651b);throw _0x50651b;});}return _0x683623;});}})[_0xfbd9('0x1f')](respondWithResult(_0x84cddb,0xc9))['catch'](handleError(_0x84cddb,null));};exports[_0xfbd9('0x1e')]=function(_0x5b5284,_0xb25879){if(_0x5b5284[_0xfbd9('0x44')]['id']){delete _0x5b5284[_0xfbd9('0x44')]['id'];}return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x5b5284['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0xb25879,null))[_0xfbd9('0x1f')](saveUpdates(_0x5b5284['body'],null))['then'](respondWithResult(_0xb25879,null))[_0xfbd9('0x42')](handleError(_0xb25879,null));};exports['destroy']=function(_0x6f3c37,_0x260949){return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x6f3c37[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x260949,null))['then'](removeEntity(_0x260949,null))['catch'](handleError(_0x260949,null));};exports[_0xfbd9('0x51')]=function(_0x3d1698,_0x2de072,_0x935dc4){var _0x2fb24a={'raw':!![],'where':{}};var _0x3b59c0={};var _0x243b1d={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')]['findOne']({'where':{'id':_0x3d1698['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x2de072,null))[_0xfbd9('0x1f')](function(_0x7d7cc4){if(_0x7d7cc4){_0x3b59c0['model']=_['keys'](db[_0xfbd9('0x52')]['rawAttributes']);_0x3b59c0['query']=_[_0xfbd9('0x3e')](_0x3d1698[_0xfbd9('0x2d')]);_0x3b59c0['filters']=_[_0xfbd9('0x2f')](_0x3b59c0[_0xfbd9('0x2c')],_0x3b59c0[_0xfbd9('0x2d')]);_0x2fb24a[_0xfbd9('0x30')]=_['intersection'](_0x3b59c0[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x3d1698[_0xfbd9('0x2d')]['fields']));_0x2fb24a[_0xfbd9('0x30')]=_0x2fb24a['attributes'][_0xfbd9('0x40')]?_0x2fb24a[_0xfbd9('0x30')]:_0x3b59c0[_0xfbd9('0x2c')];if(!_0x3d1698[_0xfbd9('0x2d')]['hasOwnProperty'](_0xfbd9('0x32'))){_0x2fb24a[_0xfbd9('0x17')]=qs['limit'](_0x3d1698[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x2fb24a[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x3d1698[_0xfbd9('0x2d')]['offset']);}_0x2fb24a[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x3d1698[_0xfbd9('0x2d')]['sort']);_0x2fb24a['where']=qs['filters'](_['pick'](_0x3d1698[_0xfbd9('0x2d')],_0x3b59c0[_0xfbd9('0x2e')]));_0x2fb24a['where'][_0xfbd9('0x53')]=_0x7d7cc4['id'];if(_0x3d1698[_0xfbd9('0x2d')]['filter']){_0x2fb24a['where']=_[_0xfbd9('0x38')](_0x2fb24a[_0xfbd9('0x35')],{'$or':_['map'](_0x2fb24a[_0xfbd9('0x30')],function(_0x3c97b3){var _0x555d8e={};_0x555d8e[_0x3c97b3]={'$like':'%'+_0x3d1698[_0xfbd9('0x2d')]['filter']+'%'};return _0x555d8e;})});}_0x2fb24a=_['merge']({},_0x2fb24a,_0x3d1698[_0xfbd9('0x3a')]);return db[_0xfbd9('0x52')][_0xfbd9('0x16')]({'where':_0x2fb24a[_0xfbd9('0x35')]})[_0xfbd9('0x1f')](function(_0x411a37){_0x243b1d['count']=_0x411a37;if(_0x3d1698[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x2fb24a[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x52')]['findAll'](_0x2fb24a);})['then'](function(_0x20292a){_0x243b1d[_0xfbd9('0x54')]=_0x20292a;return _0x243b1d;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x2de072,_0x2fb24a))[_0xfbd9('0x42')](handleError(_0x2de072,null));};exports[_0xfbd9('0x55')]=function(_0x527e7b,_0x31e50e,_0xb6f4ee){var _0x1ba4fc={'raw':!![],'where':{}};var _0x26311b={};var _0x4a5a05={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x527e7b['params']['id']}})['then'](handleEntityNotFound(_0x31e50e,null))[_0xfbd9('0x1f')](function(_0x2cd315){if(_0x2cd315){_0x26311b[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x56')][_0xfbd9('0x2a')]);_0x26311b[_0xfbd9('0x2d')]=_[_0xfbd9('0x3e')](_0x527e7b[_0xfbd9('0x2d')]);_0x26311b[_0xfbd9('0x2e')]=_['intersection'](_0x26311b['model'],_0x26311b['query']);_0x1ba4fc[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x26311b[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x3f')]));_0x1ba4fc['attributes']=_0x1ba4fc[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x1ba4fc[_0xfbd9('0x30')]:_0x26311b[_0xfbd9('0x2c')];if(!_0x527e7b[_0xfbd9('0x2d')]['hasOwnProperty'](_0xfbd9('0x32'))){_0x1ba4fc[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x1ba4fc[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x527e7b['query'][_0xfbd9('0x14')]);}_0x1ba4fc['order']=qs[_0xfbd9('0x34')](_0x527e7b[_0xfbd9('0x2d')]['sort']);_0x1ba4fc['where']=qs[_0xfbd9('0x2e')](_['pick'](_0x527e7b[_0xfbd9('0x2d')],_0x26311b[_0xfbd9('0x2e')]));_0x1ba4fc[_0xfbd9('0x35')][_0xfbd9('0x53')]=_0x2cd315['id'];if(_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x1ba4fc['where']=_[_0xfbd9('0x38')](_0x1ba4fc[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x1ba4fc[_0xfbd9('0x30')],function(_0x596e34){var _0x8049d8={};_0x8049d8[_0x596e34]={'$like':'%'+_0x527e7b[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x8049d8;})});}_0x1ba4fc=_[_0xfbd9('0x38')]({},_0x1ba4fc,_0x527e7b[_0xfbd9('0x3a')]);return db['CmHopperHistory'][_0xfbd9('0x16')]({'where':_0x1ba4fc['where']})[_0xfbd9('0x1f')](function(_0x4cf720){_0x4a5a05['count']=_0x4cf720;if(_0x527e7b[_0xfbd9('0x2d')]['includeAll']){_0x1ba4fc[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x56')][_0xfbd9('0x3c')](_0x1ba4fc);})['then'](function(_0x821f1e){_0x4a5a05['rows']=_0x821f1e;return _0x4a5a05;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x31e50e,_0x1ba4fc))[_0xfbd9('0x42')](handleError(_0x31e50e,null));};exports[_0xfbd9('0x57')]=function(_0x304d68,_0x27dd2e,_0x51f33a){var _0x4ddfc6={'raw':!![],'where':{}};var _0x26deb3={};var _0x2bb227={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')]['findOne']({'where':{'id':_0x304d68[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x27dd2e,null))['then'](function(_0x5a0f34){if(_0x5a0f34){_0x26deb3[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db['CmHopperFinal'][_0xfbd9('0x2a')]);_0x26deb3['query']=_[_0xfbd9('0x3e')](_0x304d68[_0xfbd9('0x2d')]);_0x26deb3[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x26deb3['model'],_0x26deb3[_0xfbd9('0x2d')]);_0x4ddfc6[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x26deb3[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x304d68['query'][_0xfbd9('0x3f')]));_0x4ddfc6[_0xfbd9('0x30')]=_0x4ddfc6[_0xfbd9('0x30')]['length']?_0x4ddfc6['attributes']:_0x26deb3[_0xfbd9('0x2c')];if(!_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x4ddfc6[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x304d68[_0xfbd9('0x2d')]['limit']);_0x4ddfc6[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x14')]);}_0x4ddfc6[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x4ddfc6[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0x304d68[_0xfbd9('0x2d')],_0x26deb3['filters']));_0x4ddfc6['where'][_0xfbd9('0x53')]=_0x5a0f34['id'];if(_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x4ddfc6[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x4ddfc6['where'],{'$or':_[_0xfbd9('0x28')](_0x4ddfc6[_0xfbd9('0x30')],function(_0x66b429){var _0x4f5ac1={};_0x4f5ac1[_0x66b429]={'$like':'%'+_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x4f5ac1;})});}_0x4ddfc6=_[_0xfbd9('0x38')]({},_0x4ddfc6,_0x304d68[_0xfbd9('0x3a')]);return db[_0xfbd9('0x58')]['count']({'where':_0x4ddfc6['where']})['then'](function(_0x4648b2){_0x2bb227[_0xfbd9('0x16')]=_0x4648b2;if(_0x304d68[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x4ddfc6['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xfbd9('0x3c')](_0x4ddfc6);})[_0xfbd9('0x1f')](function(_0x27bc94){_0x2bb227['rows']=_0x27bc94;return _0x2bb227;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x27dd2e,_0x4ddfc6))['catch'](handleError(_0x27dd2e,null));};exports['getHopperBlacks']=function(_0x1de195,_0x4c70de,_0x1a3fc5){var _0x304594={'raw':!![],'where':{}};var _0x3582c1={};var _0x239267={'count':0x0,'rows':[]};return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0x1de195[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4c70de,null))[_0xfbd9('0x1f')](function(_0x5aada3){if(_0x5aada3){_0x3582c1[_0xfbd9('0x2c')]=_[_0xfbd9('0x3e')](db[_0xfbd9('0x5a')][_0xfbd9('0x2a')]);_0x3582c1['query']=_[_0xfbd9('0x3e')](_0x1de195['query']);_0x3582c1[_0xfbd9('0x2e')]=_['intersection'](_0x3582c1['model'],_0x3582c1['query']);_0x304594[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x3582c1[_0xfbd9('0x2c')],qs[_0xfbd9('0x3f')](_0x1de195['query'][_0xfbd9('0x3f')]));_0x304594['attributes']=_0x304594[_0xfbd9('0x30')][_0xfbd9('0x40')]?_0x304594['attributes']:_0x3582c1[_0xfbd9('0x2c')];if(!_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x304594[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x304594[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x14')]);}_0x304594[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0x1de195['query']['sort']);_0x304594[_0xfbd9('0x35')]=qs[_0xfbd9('0x2e')](_[_0xfbd9('0x36')](_0x1de195[_0xfbd9('0x2d')],_0x3582c1[_0xfbd9('0x2e')]));_0x304594[_0xfbd9('0x35')][_0xfbd9('0x53')]=_0x5aada3['id'];if(_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x304594['where']=_[_0xfbd9('0x38')](_0x304594[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x304594[_0xfbd9('0x30')],function(_0x16ea14){var _0x358cd6={};_0x358cd6[_0x16ea14]={'$like':'%'+_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x358cd6;})});}_0x304594=_['merge']({},_0x304594,_0x1de195[_0xfbd9('0x3a')]);return db[_0xfbd9('0x5a')][_0xfbd9('0x16')]({'where':_0x304594[_0xfbd9('0x35')]})[_0xfbd9('0x1f')](function(_0x5db30a){_0x239267['count']=_0x5db30a;if(_0x1de195[_0xfbd9('0x2d')][_0xfbd9('0x41')]){_0x304594[_0xfbd9('0x3b')]=[{'all':!![]}];}return db[_0xfbd9('0x5a')][_0xfbd9('0x3c')](_0x304594);})[_0xfbd9('0x1f')](function(_0x246599){_0x239267[_0xfbd9('0x54')]=_0x246599;return _0x239267;});}})[_0xfbd9('0x1f')](respondWithFilteredResult(_0x4c70de,_0x304594))[_0xfbd9('0x42')](handleError(_0x4c70de,null));};exports['getLists']=function(_0x3b07aa,_0x50fa49,_0x19b565){var _0x5cf769={};var _0x1c6093={};var _0x5a3d9d;var _0x228b74;return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0x3b07aa[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x50fa49,null))['then'](function(_0x2090bc){if(_0x2090bc){_0x5a3d9d=_0x2090bc;_0x1c6093[_0xfbd9('0x2c')]=_['keys'](db['CmList'][_0xfbd9('0x2a')]);_0x1c6093[_0xfbd9('0x2d')]=_['keys'](_0x3b07aa[_0xfbd9('0x2d')]);_0x1c6093[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x1c6093[_0xfbd9('0x2c')],_0x1c6093['query']);_0x5cf769[_0xfbd9('0x30')]=_[_0xfbd9('0x2f')](_0x1c6093['model'],qs[_0xfbd9('0x3f')](_0x3b07aa['query'][_0xfbd9('0x3f')]));_0x5cf769[_0xfbd9('0x30')]=_0x5cf769[_0xfbd9('0x30')]['length']?_0x5cf769['attributes']:_0x1c6093[_0xfbd9('0x2c')];_0x5cf769[_0xfbd9('0x33')]=qs['sort'](_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x5cf769[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0x3b07aa['query'],_0x1c6093[_0xfbd9('0x2e')]));if(_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x37')]){_0x5cf769[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x5cf769[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x5cf769['attributes'],function(_0x1330ca){var _0x23467e={};_0x23467e[_0x1330ca]={'$like':'%'+_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x23467e;})});}_0x5cf769=_[_0xfbd9('0x38')]({},_0x5cf769,_0x3b07aa[_0xfbd9('0x3a')]);return _0x5a3d9d[_0xfbd9('0x5b')](_0x5cf769);}})[_0xfbd9('0x1f')](function(_0x3cee54){if(_0x3cee54){_0x228b74=_0x3cee54['length'];if(!_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x31')](_0xfbd9('0x32'))){_0x5cf769[_0xfbd9('0x17')]=qs[_0xfbd9('0x17')](_0x3b07aa[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x5cf769[_0xfbd9('0x14')]=qs[_0xfbd9('0x14')](_0x3b07aa['query']['offset']);}return _0x5a3d9d['getLists'](_0x5cf769);}})[_0xfbd9('0x1f')](function(_0xdb663){if(_0xdb663){return _0xdb663?{'count':_0x228b74,'rows':_0xdb663}:null;}})[_0xfbd9('0x1f')](respondWithResult(_0x50fa49,null))[_0xfbd9('0x42')](handleError(_0x50fa49,null));};exports[_0xfbd9('0x5c')]=function(_0xed8d73,_0x4226dd,_0x209d04){var _0x359bb8,_0x555179;var _0x16c43=[];var _0x4d2d4a=moment()[_0xfbd9('0x5d')](_0xfbd9('0x5e'));return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0xed8d73[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x4226dd,null))[_0xfbd9('0x1f')](function(_0x6dd950){if(_0x6dd950){_0x555179=_0x6dd950;return _0x6dd950[_0xfbd9('0x5c')](_0xed8d73[_0xfbd9('0x44')][_0xfbd9('0x5f')],_[_0xfbd9('0x4f')](_0xed8d73[_0xfbd9('0x44')],[_0xfbd9('0x5f'),'id'])||{});}return null;})['spread'](function(_0x4186f2){var _0x45b4f6;var _0x57f0c9;_0x359bb8=_0x4186f2||[];var _0x538e9d=[];if(_0x4186f2){for(var _0x26b11a=0x0;_0x26b11a<_0x4186f2[_0xfbd9('0x40')];_0x26b11a+=0x1){var _0x3d3271=_0x4186f2[_0x26b11a][_0xfbd9('0x21')]({'plain':!![]});_0x555179[_0xfbd9('0x60')]=_0xed8d73[_0xfbd9('0x44')][_0xfbd9('0x60')]?_0xed8d73[_0xfbd9('0x44')]['dialCheckDuplicateType']:_0x555179['dialCheckDuplicateType'];switch(_0x555179[_0xfbd9('0x60')]){case _0xfbd9('0x61'):_0x45b4f6=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x64'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x66'),'ContactId',_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')](),_0xfbd9('0x67'))[_0xfbd9('0x69')](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),'CampaignId')[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27','createdAt')[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')]('deletedAt\x20IS\x20NULL')['where'](_0xfbd9('0x70'),_0x3d3271['CmListId'][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71'))['where'](_0xfbd9('0x72'),squel['select']()[_0xfbd9('0x69')]('COALESCE(calleridnum,\x27\x27)')[_0xfbd9('0x6f')](_0xfbd9('0x73'))[_0xfbd9('0x35')](_0xfbd9('0x74'),_0xed8d73['params']['id'][_0xfbd9('0x6e')]()))[_0xfbd9('0x35')](_0xfbd9('0x72'),squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x75'))[_0xfbd9('0x6f')](_0xfbd9('0x64'))['where'](_0xfbd9('0x74'),_0xed8d73[_0xfbd9('0x3d')]['id'][_0xfbd9('0x6e')]())))[_0xfbd9('0x6e')]();break;case _0xfbd9('0x76'):_0x45b4f6=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x64'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x66'),_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()['field'](_0xfbd9('0x6a'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')](),_0xfbd9('0x67'))['field'](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),_0xfbd9('0x53'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))['field']('\x27'+_0x4d2d4a+'\x27','updatedAt')[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')](_0xfbd9('0x77'))[_0xfbd9('0x35')]('ListId\x20=\x20?',_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71'))[_0xfbd9('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x75'))[_0xfbd9('0x6f')](_0xfbd9('0x64'))[_0xfbd9('0x35')](_0xfbd9('0x74'),_0xed8d73['params']['id'][_0xfbd9('0x6e')]())))['toString']();break;default:_0x45b4f6=squel[_0xfbd9('0x62')]()['into'](_0xfbd9('0x64'))[_0xfbd9('0x65')]([_0xfbd9('0x6a'),_0xfbd9('0x66'),_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),'phone')[_0xfbd9('0x69')](_0xfbd9('0x6b'),'scheduledAt')['field']('id','ContactId')['field'](_0x3d3271[_0xfbd9('0x6d')]['toString'](),_0xfbd9('0x67'))[_0xfbd9('0x69')](_0xed8d73['params']['id'][_0xfbd9('0x6e')](),_0xfbd9('0x53'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))['from'](_0xfbd9('0x78'))[_0xfbd9('0x35')]('deletedAt\x20IS\x20NULL')[_0xfbd9('0x35')]('ListId\x20=\x20?',_0x3d3271[_0xfbd9('0x6d')][_0xfbd9('0x6e')]())[_0xfbd9('0x35')](_0xfbd9('0x71')))['toString']();}_0x57f0c9=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x79'))[_0xfbd9('0x65')](['cmHopperId',_0xfbd9('0x66'),_0xfbd9('0x6a'),'OrderBy',_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x7a'),'id')[_0xfbd9('0x69')](_0xfbd9('0x6b'),_0xfbd9('0x66'))['field'](_0xfbd9('0x7b'),_0xfbd9('0x6a'))[_0xfbd9('0x69')](_0xfbd9('0x7c'),_0xfbd9('0x7d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4d'))[_0xfbd9('0x69')]('\x27'+_0x4d2d4a+'\x27',_0xfbd9('0x4e'))[_0xfbd9('0x6f')]('cm_contact_has_items','ci')[_0xfbd9('0x7e')](_0xfbd9('0x64'),'h',_0xfbd9('0x7f'))[_0xfbd9('0x35')]('h.ListId\x20=\x20?',_0x3d3271['CmListId'][_0xfbd9('0x6e')]())['where']('h.CampaignId=?',_0xed8d73[_0xfbd9('0x3d')]['id'][_0xfbd9('0x6e')]())[_0xfbd9('0x35')]('h.createdAt\x20=\x20?',_0x4d2d4a))['toString']();_0x538e9d['push'](db[_0xfbd9('0x80')][_0xfbd9('0x2d')](_0x45b4f6));_0x16c43[_0xfbd9('0x81')](db[_0xfbd9('0x80')][_0xfbd9('0x2d')](_0x57f0c9));}return BPromise[_0xfbd9('0x82')](_0x538e9d);}})[_0xfbd9('0x1f')](function(){return BPromise['all'](_0x16c43);})['then'](function(){return _0x359bb8;})[_0xfbd9('0x1f')](respondWithResult(_0x4226dd,null))[_0xfbd9('0x42')](handleError(_0x4226dd,null));};exports[_0xfbd9('0x83')]=function(_0x2711e5,_0x166238,_0x59e460){return db['Campaign'][_0xfbd9('0x49')]({'where':{'id':_0x2711e5['params']['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x166238,null))[_0xfbd9('0x1f')](function(_0x3e4416){if(_0x3e4416){return _0x3e4416[_0xfbd9('0x83')](_0x2711e5[_0xfbd9('0x2d')]['ids']);}})[_0xfbd9('0x1f')](function(_0xcb6afc){if(_0xcb6afc){return db['CmHopper'][_0xfbd9('0x20')]({'where':{'ListId':_0x2711e5[_0xfbd9('0x2d')][_0xfbd9('0x5f')],'CampaignId':_0x2711e5['params']['id']}})[_0xfbd9('0x1f')](function(){return _0xcb6afc;});}})['then'](respondWithStatusCode(_0x166238,null))['catch'](handleError(_0x166238,null));};exports[_0xfbd9('0x84')]=function(_0xb24a8a,_0x53c930,_0x186429){var _0x411f9e={};var _0x16a131={};var _0x5c444e;var _0x1f97bb;return db[_0xfbd9('0x29')][_0xfbd9('0x59')]({'where':{'id':_0xb24a8a[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x53c930,null))[_0xfbd9('0x1f')](function(_0xc4d6ec){if(_0xc4d6ec){_0x5c444e=_0xc4d6ec;_0x16a131['model']=_[_0xfbd9('0x3e')](db['CmList'][_0xfbd9('0x2a')]);_0x16a131['query']=_['keys'](_0xb24a8a[_0xfbd9('0x2d')]);_0x16a131[_0xfbd9('0x2e')]=_[_0xfbd9('0x2f')](_0x16a131[_0xfbd9('0x2c')],_0x16a131[_0xfbd9('0x2d')]);_0x411f9e['attributes']=_['intersection'](_0x16a131[_0xfbd9('0x2c')],qs['fields'](_0xb24a8a[_0xfbd9('0x2d')]['fields']));_0x411f9e[_0xfbd9('0x30')]=_0x411f9e[_0xfbd9('0x30')]['length']?_0x411f9e['attributes']:_0x16a131['model'];_0x411f9e[_0xfbd9('0x33')]=qs[_0xfbd9('0x34')](_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x34')]);_0x411f9e[_0xfbd9('0x35')]=qs['filters'](_[_0xfbd9('0x36')](_0xb24a8a['query'],_0x16a131[_0xfbd9('0x2e')]));if(_0xb24a8a['query'][_0xfbd9('0x37')]){_0x411f9e[_0xfbd9('0x35')]=_[_0xfbd9('0x38')](_0x411f9e[_0xfbd9('0x35')],{'$or':_[_0xfbd9('0x28')](_0x411f9e[_0xfbd9('0x30')],function(_0x6e7c5f){var _0x23f9a5={};_0x23f9a5[_0x6e7c5f]={'$like':'%'+_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x37')]+'%'};return _0x23f9a5;})});}_0x411f9e=_[_0xfbd9('0x38')]({},_0x411f9e,_0xb24a8a['options']);return _0x5c444e['getBlackLists'](_0x411f9e);}})['then'](function(_0x5004a4){if(_0x5004a4){_0x1f97bb=_0x5004a4[_0xfbd9('0x40')];if(!_0xb24a8a['query']['hasOwnProperty'](_0xfbd9('0x32'))){_0x411f9e['limit']=qs[_0xfbd9('0x17')](_0xb24a8a[_0xfbd9('0x2d')][_0xfbd9('0x17')]);_0x411f9e[_0xfbd9('0x14')]=qs['offset'](_0xb24a8a['query'][_0xfbd9('0x14')]);}return _0x5c444e[_0xfbd9('0x84')](_0x411f9e);}})[_0xfbd9('0x1f')](function(_0x1b595b){if(_0x1b595b){return _0x1b595b?{'count':_0x1f97bb,'rows':_0x1b595b}:null;}})[_0xfbd9('0x1f')](respondWithResult(_0x53c930,null))[_0xfbd9('0x42')](handleError(_0x53c930,null));};exports[_0xfbd9('0x85')]=function(_0x2e8e68,_0x578b32,_0x4e9cc0){var _0x53326c,_0xc9b979;var _0x390b08=[];var _0x38cfeb=moment()[_0xfbd9('0x5d')](_0xfbd9('0x5e'));return db['Campaign'][_0xfbd9('0x49')]({'where':{'id':_0x2e8e68[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](handleEntityNotFound(_0x578b32,null))[_0xfbd9('0x1f')](function(_0x3b826d){if(_0x3b826d){_0xc9b979=_0x3b826d;return _0x3b826d[_0xfbd9('0x85')](_0x2e8e68[_0xfbd9('0x44')]['ids'],_[_0xfbd9('0x4f')](_0x2e8e68[_0xfbd9('0x44')],[_0xfbd9('0x5f'),'id'])||{});}return null;})[_0xfbd9('0x86')](function(_0x38445a){var _0x4555dd;var _0x3aae2a;_0x53326c=_0x38445a||[];var _0x5160f3=[];if(_0x38445a){for(var _0x5acda9=0x0;_0x5acda9<_0x38445a[_0xfbd9('0x40')];_0x5acda9+=0x1){var _0x461471=_0x38445a[_0x5acda9][_0xfbd9('0x21')]({'plain':!![]});_0x4555dd=squel[_0xfbd9('0x62')]()[_0xfbd9('0x63')](_0xfbd9('0x87'))[_0xfbd9('0x65')](['phone',_0xfbd9('0x6c'),_0xfbd9('0x67'),_0xfbd9('0x53'),_0xfbd9('0x4d'),_0xfbd9('0x4e')],squel[_0xfbd9('0x68')]()[_0xfbd9('0x69')](_0xfbd9('0x6a'),'phone')[_0xfbd9('0x69')]('id',_0xfbd9('0x6c'))[_0xfbd9('0x69')](_0x461471['CmListId'][_0xfbd9('0x6e')](),'ListId')[_0xfbd9('0x69')](_0x2e8e68['params']['id']['toString'](),_0xfbd9('0x53'))['field'](_0xfbd9('0x6b'),_0xfbd9('0x4d'))[_0xfbd9('0x69')](_0xfbd9('0x6b'),'updatedAt')[_0xfbd9('0x6f')]('cm_contacts')[_0xfbd9('0x35')](_0xfbd9('0x77'))[_0xfbd9('0x35')](_0xfbd9('0x70'),_0x461471[_0xfbd9('0x6d')]['toString']())[_0xfbd9('0x35')](_0xfbd9('0x71')))[_0xfbd9('0x6e')]();_0x5160f3[_0xfbd9('0x81')](db['sequelize'][_0xfbd9('0x2d')](_0x4555dd));}return BPromise[_0xfbd9('0x82')](_0x5160f3);}})['then'](function(){return _0x53326c;})[_0xfbd9('0x1f')](respondWithResult(_0x578b32,null))[_0xfbd9('0x42')](handleError(_0x578b32,null));};exports['removeBlackLists']=function(_0x40dd26,_0x192241,_0x2a419b){return db[_0xfbd9('0x29')][_0xfbd9('0x49')]({'where':{'id':_0x40dd26[_0xfbd9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x192241,null))[_0xfbd9('0x1f')](function(_0x19ffd5){if(_0x19ffd5){return _0x19ffd5[_0xfbd9('0x88')](_0x40dd26[_0xfbd9('0x2d')][_0xfbd9('0x5f')]);}})[_0xfbd9('0x1f')](function(_0x5aa56e){if(_0x5aa56e){return db['CmHopperBlack'][_0xfbd9('0x20')]({'where':{'ListId':_0x40dd26[_0xfbd9('0x2d')][_0xfbd9('0x5f')],'CampaignId':_0x40dd26[_0xfbd9('0x3d')]['id']}})[_0xfbd9('0x1f')](function(){return _0x5aa56e;});}})[_0xfbd9('0x1f')](respondWithStatusCode(_0x192241,null))[_0xfbd9('0x42')](handleError(_0x192241,null));};
\ No newline at end of file
+var _0x09ef=['updatedAt','createdAt','userProfileId','getHoppers','findOne','CmHopper','findAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','from','into','cm_contacts','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','length','find','create','body','user','IvrCampaigns','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x09ef,0x15e));var _0xf09e=function(_0x34da07,_0x458514){_0x34da07=_0x34da07-0x0;var _0xb2467e=_0x09ef[_0x34da07];return _0xb2467e;};'use strict';var emlformat=require(_0xf09e('0x0'));var rimraf=require(_0xf09e('0x1'));var zipdir=require(_0xf09e('0x2'));var jsonpatch=require(_0xf09e('0x3'));var rp=require(_0xf09e('0x4'));var moment=require(_0xf09e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf09e('0x6'));var util=require('util');var path=require(_0xf09e('0x7'));var sox=require(_0xf09e('0x8'));var csv=require(_0xf09e('0x9'));var ejs=require(_0xf09e('0xa'));var fs=require('fs');var fs_extra=require(_0xf09e('0xb'));var _=require(_0xf09e('0xc'));var squel=require(_0xf09e('0xd'));var crypto=require(_0xf09e('0xe'));var jsforce=require(_0xf09e('0xf'));var deskjs=require(_0xf09e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf09e('0x11'));var Papa=require(_0xf09e('0x12'));var Redis=require(_0xf09e('0x13'));var authService=require(_0xf09e('0x14'));var qs=require(_0xf09e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf09e('0x16'))(_0xf09e('0x17'));var utils=require('../../config/utils');var config=require(_0xf09e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf09e('0x19'))['db'];function respondWithStatusCode(_0xcea7b1,_0x2d974f){_0x2d974f=_0x2d974f||0xcc;return function(_0x12ecc3){if(_0x12ecc3){return _0xcea7b1[_0xf09e('0x1a')](_0x2d974f);}return _0xcea7b1[_0xf09e('0x1b')](_0x2d974f)['end']();};}function respondWithResult(_0x43e7e9,_0x505b6d){_0x505b6d=_0x505b6d||0xc8;return function(_0x38f7de){if(_0x38f7de){return _0x43e7e9[_0xf09e('0x1b')](_0x505b6d)[_0xf09e('0x1c')](_0x38f7de);}};}function respondWithFilteredResult(_0x4a3c58,_0x17b604){return function(_0x3a6bd0){if(_0x3a6bd0){var _0x4f88f1=typeof _0x17b604[_0xf09e('0x1d')]===_0xf09e('0x1e')&&typeof _0x17b604[_0xf09e('0x1f')]===_0xf09e('0x1e');var _0x3abeae=_0x3a6bd0['count'];var _0x21d713=_0x4f88f1?0x0:_0x17b604[_0xf09e('0x1d')];var _0x435bb8=_0x4f88f1?_0x3a6bd0[_0xf09e('0x20')]:_0x17b604[_0xf09e('0x1d')]+_0x17b604[_0xf09e('0x1f')];var _0x105934;if(_0x435bb8>=_0x3abeae){_0x435bb8=_0x3abeae;_0x105934=0xc8;}else{_0x105934=0xce;}_0x4a3c58[_0xf09e('0x1b')](_0x105934);return _0x4a3c58[_0xf09e('0x21')](_0xf09e('0x22'),_0x21d713+'-'+_0x435bb8+'/'+_0x3abeae)[_0xf09e('0x1c')](_0x3a6bd0);}return null;};}function patchUpdates(_0x4c5a1f){return function(_0x19c044){try{jsonpatch[_0xf09e('0x23')](_0x19c044,_0x4c5a1f,!![]);}catch(_0x3a24ba){return BPromise[_0xf09e('0x24')](_0x3a24ba);}return _0x19c044['save']();};}function saveUpdates(_0x454133,_0x5e95cb){return function(_0x4533c5){if(_0x4533c5){return _0x4533c5[_0xf09e('0x25')](_0x454133)[_0xf09e('0x26')](function(_0x1dea86){return _0x1dea86;});}return null;};}function removeEntity(_0x18bd4f,_0xb9f4c3){return function(_0x5bb343){if(_0x5bb343){return _0x5bb343[_0xf09e('0x27')]()[_0xf09e('0x26')](function(){var _0x300bc5=_0x5bb343[_0xf09e('0x28')]({'plain':!![]});var _0x5d6d27='IvrCampaigns';return db[_0xf09e('0x29')][_0xf09e('0x27')]({'where':{'type':_0x5d6d27,'resourceId':_0x300bc5['id']}})['then'](function(){return _0x5bb343;});})[_0xf09e('0x26')](function(){_0x18bd4f[_0xf09e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7f76b0,_0x1a698f){return function(_0xf49fc4){if(!_0xf49fc4){_0x7f76b0['sendStatus'](0x194);}return _0xf49fc4;};}function handleError(_0x125717,_0xfa0588){_0xfa0588=_0xfa0588||0x1f4;return function(_0x2fc707){logger[_0xf09e('0x2a')](_0x2fc707[_0xf09e('0x2b')]);if(_0x2fc707['name']){delete _0x2fc707[_0xf09e('0x2c')];}_0x125717[_0xf09e('0x1b')](_0xfa0588)['send'](_0x2fc707);};}exports['index']=function(_0x5efdb9,_0x3e3da0){var _0x32214c={},_0x32e492={},_0x3eeff9={'count':0x0,'rows':[]};var _0x1c787e=_['map'](db[_0xf09e('0x2d')][_0xf09e('0x2e')],function(_0x41a2a0){return{'name':_0x41a2a0[_0xf09e('0x2f')],'type':_0x41a2a0[_0xf09e('0x30')][_0xf09e('0x31')]};});_0x32e492[_0xf09e('0x32')]=_[_0xf09e('0x33')](_0x1c787e,_0xf09e('0x2c'));_0x32e492[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x5efdb9[_0xf09e('0x34')]);_0x32e492['filters']=_[_0xf09e('0x36')](_0x32e492[_0xf09e('0x32')],_0x32e492[_0xf09e('0x34')]);_0x32214c[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x32e492[_0xf09e('0x32')],qs['fields'](_0x5efdb9[_0xf09e('0x34')]['fields']));_0x32214c['attributes']=_0x32214c[_0xf09e('0x37')]['length']?_0x32214c[_0xf09e('0x37')]:_0x32e492[_0xf09e('0x32')];if(!_0x5efdb9[_0xf09e('0x34')][_0xf09e('0x38')](_0xf09e('0x39'))){_0x32214c['limit']=qs[_0xf09e('0x1f')](_0x5efdb9['query']['limit']);_0x32214c['offset']=qs[_0xf09e('0x1d')](_0x5efdb9[_0xf09e('0x34')]['offset']);}_0x32214c[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x5efdb9[_0xf09e('0x34')]['sort']);_0x32214c['where']=qs[_0xf09e('0x3c')](_[_0xf09e('0x3d')](_0x5efdb9['query'],_0x32e492[_0xf09e('0x3c')]),_0x1c787e);if(_0x5efdb9[_0xf09e('0x34')][_0xf09e('0x3e')]){_0x32214c[_0xf09e('0x3f')]=_[_0xf09e('0x40')](_0x32214c[_0xf09e('0x3f')],{'$or':_[_0xf09e('0x33')](_0x1c787e,function(_0x5dc2f8){if(_0x5dc2f8[_0xf09e('0x30')]!==_0xf09e('0x41')){var _0x540fc9={};_0x540fc9[_0x5dc2f8[_0xf09e('0x2c')]]={'$like':'%'+_0x5efdb9[_0xf09e('0x34')][_0xf09e('0x3e')]+'%'};return _0x540fc9;}})});}_0x32214c=_[_0xf09e('0x40')]({},_0x32214c,_0x5efdb9[_0xf09e('0x42')]);var _0x1807fa={'where':_0x32214c[_0xf09e('0x3f')]};return db['Campaign'][_0xf09e('0x20')](_0x1807fa)['then'](function(_0x34cc5f){_0x3eeff9['count']=_0x34cc5f;if(_0x5efdb9[_0xf09e('0x34')][_0xf09e('0x43')]){_0x32214c[_0xf09e('0x44')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x32214c);})[_0xf09e('0x26')](function(_0x3a5cf4){_0x3eeff9[_0xf09e('0x45')]=_0x3a5cf4;return _0x3eeff9;})[_0xf09e('0x26')](respondWithFilteredResult(_0x3e3da0,_0x32214c))[_0xf09e('0x46')](handleError(_0x3e3da0,null));};exports[_0xf09e('0x47')]=function(_0x369714,_0x5b5bee){var _0x454371={'raw':![],'where':{'id':_0x369714[_0xf09e('0x48')]['id']}},_0x2e3e9f={};_0x2e3e9f['model']=_[_0xf09e('0x35')](db[_0xf09e('0x2d')][_0xf09e('0x2e')]);_0x2e3e9f[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x369714[_0xf09e('0x34')]);_0x2e3e9f[_0xf09e('0x3c')]=_['intersection'](_0x2e3e9f['model'],_0x2e3e9f[_0xf09e('0x34')]);_0x454371[_0xf09e('0x37')]=_['intersection'](_0x2e3e9f['model'],qs[_0xf09e('0x49')](_0x369714['query'][_0xf09e('0x49')]));_0x454371[_0xf09e('0x37')]=_0x454371[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x454371[_0xf09e('0x37')]:_0x2e3e9f[_0xf09e('0x32')];if(_0x369714[_0xf09e('0x34')][_0xf09e('0x43')]){_0x454371[_0xf09e('0x44')]=[{'all':!![]}];}_0x454371=_[_0xf09e('0x40')]({},_0x454371,_0x369714[_0xf09e('0x42')]);return db['Campaign'][_0xf09e('0x4b')](_0x454371)['then'](handleEntityNotFound(_0x5b5bee,null))[_0xf09e('0x26')](respondWithResult(_0x5b5bee,null))[_0xf09e('0x46')](handleError(_0x5b5bee,null));};exports[_0xf09e('0x4c')]=function(_0x5a27a5,_0x3150e5){return db[_0xf09e('0x2d')][_0xf09e('0x4c')](_0x5a27a5[_0xf09e('0x4d')],{})['then'](function(_0x49563e){var _0x11ae3a=_0x5a27a5['user'][_0xf09e('0x28')]({'plain':!![]});if(!_0x11ae3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11ae3a['role']===_0xf09e('0x4e')){var _0x5c1e65=_0x49563e['get']({'plain':!![]});var _0xf652d6=_0xf09e('0x4f');return db[_0xf09e('0x50')][_0xf09e('0x4b')]({'where':{'name':_0xf652d6,'userProfileId':_0x11ae3a['userProfileId']},'raw':!![]})[_0xf09e('0x26')](function(_0x439a79){if(_0x439a79&&_0x439a79[_0xf09e('0x51')]===0x0){return db[_0xf09e('0x29')][_0xf09e('0x4c')]({'name':_0x5c1e65[_0xf09e('0x2c')],'resourceId':_0x5c1e65['id'],'type':_0x439a79[_0xf09e('0x2c')],'sectionId':_0x439a79['id']},{})[_0xf09e('0x26')](function(){return _0x49563e;});}else{return _0x49563e;}})[_0xf09e('0x46')](function(_0x1f5551){logger[_0xf09e('0x2a')](_0xf09e('0x52'),_0x1f5551);throw _0x1f5551;});}return _0x49563e;})['then'](respondWithResult(_0x3150e5,0xc9))[_0xf09e('0x46')](handleError(_0x3150e5,null));};exports[_0xf09e('0x53')]=function(_0x319b82,_0x3214cb){var _0x4e364d={'where':{'id':_0x319b82[_0xf09e('0x48')]['id']}},_0x3b51f7={};_0x3b51f7['model']=_[_0xf09e('0x35')](db['Campaign'][_0xf09e('0x2e')]);_0x4e364d['attributes']=_[_0xf09e('0x36')](_0x3b51f7[_0xf09e('0x32')],qs['fields'](_0x319b82[_0xf09e('0x34')][_0xf09e('0x49')]));_0x4e364d[_0xf09e('0x37')]=_0x4e364d[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x4e364d[_0xf09e('0x37')]:_0x3b51f7['model'];if(_0x319b82[_0xf09e('0x34')][_0xf09e('0x43')]){_0x4e364d[_0xf09e('0x44')]=[{'all':!![]}];}_0x4e364d=_[_0xf09e('0x40')]({},_0x4e364d,_0x319b82[_0xf09e('0x42')]);return db[_0xf09e('0x2d')][_0xf09e('0x4b')](_0x4e364d)['then'](handleEntityNotFound(_0x3214cb,null))[_0xf09e('0x26')](function(_0x111542){if(_0x111542){var _0x467b56=_0x111542[_0xf09e('0x28')]({'plain':!![]});_0x467b56=qs[_0xf09e('0x54')](_0x467b56,['id','createdAt',_0xf09e('0x55')]);_0x319b82['body']=_[_0xf09e('0x54')](_0x319b82[_0xf09e('0x4d')],['id',_0xf09e('0x56'),_0xf09e('0x55')]);return db[_0xf09e('0x2d')][_0xf09e('0x4c')](_[_0xf09e('0x40')](_0x467b56,_0x319b82[_0xf09e('0x4d')]),{'include':_0x319b82[_0xf09e('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xf09e('0x26')](function(_0x351c77){var _0x15e371=_0x319b82[_0xf09e('0x4e')][_0xf09e('0x28')]({'plain':!![]});if(!_0x15e371)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15e371['role']===_0xf09e('0x4e')){var _0xef0ba6=_0x351c77['get']({'plain':!![]});var _0x28e51b='IvrCampaigns';return db[_0xf09e('0x50')][_0xf09e('0x4b')]({'where':{'name':_0x28e51b,'userProfileId':_0x15e371[_0xf09e('0x57')]},'raw':!![]})[_0xf09e('0x26')](function(_0xc0b477){if(_0xc0b477&&_0xc0b477[_0xf09e('0x51')]===0x0){return db[_0xf09e('0x29')][_0xf09e('0x4c')]({'name':_0xef0ba6[_0xf09e('0x2c')],'resourceId':_0xef0ba6['id'],'type':_0xc0b477[_0xf09e('0x2c')],'sectionId':_0xc0b477['id']},{})['then'](function(){return _0x351c77;});}else{return _0x351c77;}})['catch'](function(_0x329540){logger[_0xf09e('0x2a')](_0xf09e('0x52'),_0x329540);throw _0x329540;});}return _0x351c77;});}})['then'](respondWithResult(_0x3214cb,0xc9))[_0xf09e('0x46')](handleError(_0x3214cb,null));};exports[_0xf09e('0x25')]=function(_0x10f4b2,_0x4775d1){if(_0x10f4b2['body']['id']){delete _0x10f4b2[_0xf09e('0x4d')]['id'];}return db[_0xf09e('0x2d')][_0xf09e('0x4b')]({'where':{'id':_0x10f4b2['params']['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x4775d1,null))[_0xf09e('0x26')](saveUpdates(_0x10f4b2[_0xf09e('0x4d')],null))[_0xf09e('0x26')](respondWithResult(_0x4775d1,null))['catch'](handleError(_0x4775d1,null));};exports['destroy']=function(_0x2545e2,_0x33ee1b){return db[_0xf09e('0x2d')][_0xf09e('0x4b')]({'where':{'id':_0x2545e2[_0xf09e('0x48')]['id']}})['then'](handleEntityNotFound(_0x33ee1b,null))[_0xf09e('0x26')](removeEntity(_0x33ee1b,null))[_0xf09e('0x46')](handleError(_0x33ee1b,null));};exports[_0xf09e('0x58')]=function(_0x8a9d36,_0x4e1b9a,_0x561081){var _0x2a1def={'raw':!![],'where':{}};var _0x2a7017={};var _0x3d9d9d={'count':0x0,'rows':[]};return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x8a9d36[_0xf09e('0x48')]['id']}})['then'](handleEntityNotFound(_0x4e1b9a,null))[_0xf09e('0x26')](function(_0x892b28){if(_0x892b28){_0x2a7017['model']=_[_0xf09e('0x35')](db[_0xf09e('0x5a')][_0xf09e('0x2e')]);_0x2a7017[_0xf09e('0x34')]=_['keys'](_0x8a9d36['query']);_0x2a7017[_0xf09e('0x3c')]=_[_0xf09e('0x36')](_0x2a7017['model'],_0x2a7017['query']);_0x2a1def['attributes']=_[_0xf09e('0x36')](_0x2a7017[_0xf09e('0x32')],qs[_0xf09e('0x49')](_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x49')]));_0x2a1def['attributes']=_0x2a1def[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x2a1def[_0xf09e('0x37')]:_0x2a7017[_0xf09e('0x32')];if(!_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x38')]('nolimit')){_0x2a1def['limit']=qs[_0xf09e('0x1f')](_0x8a9d36[_0xf09e('0x34')]['limit']);_0x2a1def[_0xf09e('0x1d')]=qs[_0xf09e('0x1d')](_0x8a9d36['query'][_0xf09e('0x1d')]);}_0x2a1def[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x3b')]);_0x2a1def[_0xf09e('0x3f')]=qs[_0xf09e('0x3c')](_['pick'](_0x8a9d36[_0xf09e('0x34')],_0x2a7017['filters']));_0x2a1def['where']['CampaignId']=_0x892b28['id'];if(_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x3e')]){_0x2a1def[_0xf09e('0x3f')]=_[_0xf09e('0x40')](_0x2a1def[_0xf09e('0x3f')],{'$or':_[_0xf09e('0x33')](_0x2a1def[_0xf09e('0x37')],function(_0x16e6f0){var _0x293fa3={};_0x293fa3[_0x16e6f0]={'$like':'%'+_0x8a9d36[_0xf09e('0x34')][_0xf09e('0x3e')]+'%'};return _0x293fa3;})});}_0x2a1def=_[_0xf09e('0x40')]({},_0x2a1def,_0x8a9d36[_0xf09e('0x42')]);return db[_0xf09e('0x5a')][_0xf09e('0x20')]({'where':_0x2a1def[_0xf09e('0x3f')]})[_0xf09e('0x26')](function(_0x3a4b07){_0x3d9d9d[_0xf09e('0x20')]=_0x3a4b07;if(_0x8a9d36['query'][_0xf09e('0x43')]){_0x2a1def[_0xf09e('0x44')]=[{'all':!![]}];}return db[_0xf09e('0x5a')][_0xf09e('0x5b')](_0x2a1def);})[_0xf09e('0x26')](function(_0x15d178){_0x3d9d9d[_0xf09e('0x45')]=_0x15d178;return _0x3d9d9d;});}})[_0xf09e('0x26')](respondWithFilteredResult(_0x4e1b9a,_0x2a1def))['catch'](handleError(_0x4e1b9a,null));};exports[_0xf09e('0x5c')]=function(_0x3ee14a,_0x1b83a3,_0x34caeb){var _0x3c8c6d={'raw':!![],'where':{}};var _0x513143={};var _0x3a068f={'count':0x0,'rows':[]};return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x3ee14a[_0xf09e('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b83a3,null))[_0xf09e('0x26')](function(_0x4ca72d){if(_0x4ca72d){_0x513143[_0xf09e('0x32')]=_[_0xf09e('0x35')](db[_0xf09e('0x5d')][_0xf09e('0x2e')]);_0x513143[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x3ee14a[_0xf09e('0x34')]);_0x513143['filters']=_[_0xf09e('0x36')](_0x513143[_0xf09e('0x32')],_0x513143['query']);_0x3c8c6d[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x513143['model'],qs[_0xf09e('0x49')](_0x3ee14a[_0xf09e('0x34')]['fields']));_0x3c8c6d[_0xf09e('0x37')]=_0x3c8c6d[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x3c8c6d['attributes']:_0x513143[_0xf09e('0x32')];if(!_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x38')](_0xf09e('0x39'))){_0x3c8c6d['limit']=qs[_0xf09e('0x1f')](_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x1f')]);_0x3c8c6d['offset']=qs['offset'](_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x1d')]);}_0x3c8c6d[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x3b')]);_0x3c8c6d[_0xf09e('0x3f')]=qs[_0xf09e('0x3c')](_[_0xf09e('0x3d')](_0x3ee14a[_0xf09e('0x34')],_0x513143[_0xf09e('0x3c')]));_0x3c8c6d[_0xf09e('0x3f')][_0xf09e('0x5e')]=_0x4ca72d['id'];if(_0x3ee14a[_0xf09e('0x34')]['filter']){_0x3c8c6d['where']=_[_0xf09e('0x40')](_0x3c8c6d[_0xf09e('0x3f')],{'$or':_[_0xf09e('0x33')](_0x3c8c6d[_0xf09e('0x37')],function(_0x21fe79){var _0xe76c68={};_0xe76c68[_0x21fe79]={'$like':'%'+_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x3e')]+'%'};return _0xe76c68;})});}_0x3c8c6d=_[_0xf09e('0x40')]({},_0x3c8c6d,_0x3ee14a[_0xf09e('0x42')]);return db[_0xf09e('0x5d')][_0xf09e('0x20')]({'where':_0x3c8c6d[_0xf09e('0x3f')]})['then'](function(_0x8930b9){_0x3a068f['count']=_0x8930b9;if(_0x3ee14a[_0xf09e('0x34')][_0xf09e('0x43')]){_0x3c8c6d[_0xf09e('0x44')]=[{'all':!![]}];}return db[_0xf09e('0x5d')][_0xf09e('0x5b')](_0x3c8c6d);})[_0xf09e('0x26')](function(_0x2bf284){_0x3a068f[_0xf09e('0x45')]=_0x2bf284;return _0x3a068f;});}})[_0xf09e('0x26')](respondWithFilteredResult(_0x1b83a3,_0x3c8c6d))[_0xf09e('0x46')](handleError(_0x1b83a3,null));};exports[_0xf09e('0x5f')]=function(_0x37ba6b,_0x4be762,_0x571d1f){var _0x2e376c={'raw':!![],'where':{}};var _0x1d9a96={};var _0x572e19={'count':0x0,'rows':[]};return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x37ba6b[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x4be762,null))[_0xf09e('0x26')](function(_0x578200){if(_0x578200){_0x1d9a96['model']=_[_0xf09e('0x35')](db[_0xf09e('0x60')][_0xf09e('0x2e')]);_0x1d9a96[_0xf09e('0x34')]=_['keys'](_0x37ba6b[_0xf09e('0x34')]);_0x1d9a96[_0xf09e('0x3c')]=_['intersection'](_0x1d9a96[_0xf09e('0x32')],_0x1d9a96[_0xf09e('0x34')]);_0x2e376c[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x1d9a96[_0xf09e('0x32')],qs['fields'](_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x49')]));_0x2e376c[_0xf09e('0x37')]=_0x2e376c[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x2e376c[_0xf09e('0x37')]:_0x1d9a96['model'];if(!_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x38')](_0xf09e('0x39'))){_0x2e376c[_0xf09e('0x1f')]=qs[_0xf09e('0x1f')](_0x37ba6b['query'][_0xf09e('0x1f')]);_0x2e376c[_0xf09e('0x1d')]=qs[_0xf09e('0x1d')](_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x1d')]);}_0x2e376c[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x37ba6b['query'][_0xf09e('0x3b')]);_0x2e376c['where']=qs[_0xf09e('0x3c')](_[_0xf09e('0x3d')](_0x37ba6b[_0xf09e('0x34')],_0x1d9a96[_0xf09e('0x3c')]));_0x2e376c['where'][_0xf09e('0x5e')]=_0x578200['id'];if(_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x3e')]){_0x2e376c[_0xf09e('0x3f')]=_[_0xf09e('0x40')](_0x2e376c[_0xf09e('0x3f')],{'$or':_['map'](_0x2e376c[_0xf09e('0x37')],function(_0x41504d){var _0x552ced={};_0x552ced[_0x41504d]={'$like':'%'+_0x37ba6b[_0xf09e('0x34')]['filter']+'%'};return _0x552ced;})});}_0x2e376c=_['merge']({},_0x2e376c,_0x37ba6b['options']);return db['CmHopperFinal']['count']({'where':_0x2e376c[_0xf09e('0x3f')]})[_0xf09e('0x26')](function(_0x485da5){_0x572e19[_0xf09e('0x20')]=_0x485da5;if(_0x37ba6b[_0xf09e('0x34')][_0xf09e('0x43')]){_0x2e376c['include']=[{'all':!![]}];}return db[_0xf09e('0x60')][_0xf09e('0x5b')](_0x2e376c);})[_0xf09e('0x26')](function(_0x28d7a1){_0x572e19[_0xf09e('0x45')]=_0x28d7a1;return _0x572e19;});}})['then'](respondWithFilteredResult(_0x4be762,_0x2e376c))[_0xf09e('0x46')](handleError(_0x4be762,null));};exports[_0xf09e('0x61')]=function(_0x2a2969,_0x2cc9df,_0x3f5e99){var _0x380a63={'raw':!![],'where':{}};var _0x17ac0c={};var _0x382dd2={'count':0x0,'rows':[]};return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x2a2969['params']['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x2cc9df,null))[_0xf09e('0x26')](function(_0x342b4c){if(_0x342b4c){_0x17ac0c[_0xf09e('0x32')]=_[_0xf09e('0x35')](db[_0xf09e('0x62')][_0xf09e('0x2e')]);_0x17ac0c[_0xf09e('0x34')]=_['keys'](_0x2a2969[_0xf09e('0x34')]);_0x17ac0c['filters']=_[_0xf09e('0x36')](_0x17ac0c[_0xf09e('0x32')],_0x17ac0c[_0xf09e('0x34')]);_0x380a63[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x17ac0c[_0xf09e('0x32')],qs['fields'](_0x2a2969[_0xf09e('0x34')][_0xf09e('0x49')]));_0x380a63['attributes']=_0x380a63[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x380a63['attributes']:_0x17ac0c['model'];if(!_0x2a2969[_0xf09e('0x34')][_0xf09e('0x38')]('nolimit')){_0x380a63['limit']=qs[_0xf09e('0x1f')](_0x2a2969[_0xf09e('0x34')][_0xf09e('0x1f')]);_0x380a63['offset']=qs[_0xf09e('0x1d')](_0x2a2969[_0xf09e('0x34')][_0xf09e('0x1d')]);}_0x380a63['order']=qs[_0xf09e('0x3b')](_0x2a2969['query'][_0xf09e('0x3b')]);_0x380a63['where']=qs['filters'](_[_0xf09e('0x3d')](_0x2a2969[_0xf09e('0x34')],_0x17ac0c[_0xf09e('0x3c')]));_0x380a63[_0xf09e('0x3f')][_0xf09e('0x5e')]=_0x342b4c['id'];if(_0x2a2969[_0xf09e('0x34')]['filter']){_0x380a63[_0xf09e('0x3f')]=_[_0xf09e('0x40')](_0x380a63[_0xf09e('0x3f')],{'$or':_[_0xf09e('0x33')](_0x380a63[_0xf09e('0x37')],function(_0x57e2bb){var _0x443ee5={};_0x443ee5[_0x57e2bb]={'$like':'%'+_0x2a2969[_0xf09e('0x34')]['filter']+'%'};return _0x443ee5;})});}_0x380a63=_[_0xf09e('0x40')]({},_0x380a63,_0x2a2969[_0xf09e('0x42')]);return db[_0xf09e('0x62')][_0xf09e('0x20')]({'where':_0x380a63['where']})['then'](function(_0x282356){_0x382dd2[_0xf09e('0x20')]=_0x282356;if(_0x2a2969[_0xf09e('0x34')][_0xf09e('0x43')]){_0x380a63['include']=[{'all':!![]}];}return db[_0xf09e('0x62')][_0xf09e('0x5b')](_0x380a63);})[_0xf09e('0x26')](function(_0x51d6de){_0x382dd2[_0xf09e('0x45')]=_0x51d6de;return _0x382dd2;});}})[_0xf09e('0x26')](respondWithFilteredResult(_0x2cc9df,_0x380a63))[_0xf09e('0x46')](handleError(_0x2cc9df,null));};exports[_0xf09e('0x63')]=function(_0x27e234,_0x1d2910,_0x347b13){var _0x5082a8={};var _0x765d9a={};var _0x103e2b;var _0x196b74;return db[_0xf09e('0x2d')]['findOne']({'where':{'id':_0x27e234[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x1d2910,null))['then'](function(_0x3e80c2){if(_0x3e80c2){_0x103e2b=_0x3e80c2;_0x765d9a[_0xf09e('0x32')]=_[_0xf09e('0x35')](db['CmList'][_0xf09e('0x2e')]);_0x765d9a[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x27e234['query']);_0x765d9a[_0xf09e('0x3c')]=_[_0xf09e('0x36')](_0x765d9a[_0xf09e('0x32')],_0x765d9a['query']);_0x5082a8[_0xf09e('0x37')]=_[_0xf09e('0x36')](_0x765d9a[_0xf09e('0x32')],qs[_0xf09e('0x49')](_0x27e234[_0xf09e('0x34')][_0xf09e('0x49')]));_0x5082a8[_0xf09e('0x37')]=_0x5082a8[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x5082a8[_0xf09e('0x37')]:_0x765d9a[_0xf09e('0x32')];_0x5082a8[_0xf09e('0x3a')]=qs[_0xf09e('0x3b')](_0x27e234[_0xf09e('0x34')][_0xf09e('0x3b')]);_0x5082a8[_0xf09e('0x3f')]=qs['filters'](_[_0xf09e('0x3d')](_0x27e234[_0xf09e('0x34')],_0x765d9a[_0xf09e('0x3c')]));if(_0x27e234[_0xf09e('0x34')]['filter']){_0x5082a8[_0xf09e('0x3f')]=_['merge'](_0x5082a8['where'],{'$or':_[_0xf09e('0x33')](_0x5082a8[_0xf09e('0x37')],function(_0x1dcf11){var _0x10d807={};_0x10d807[_0x1dcf11]={'$like':'%'+_0x27e234[_0xf09e('0x34')]['filter']+'%'};return _0x10d807;})});}_0x5082a8=_['merge']({},_0x5082a8,_0x27e234[_0xf09e('0x42')]);return _0x103e2b[_0xf09e('0x63')](_0x5082a8);}})['then'](function(_0x40424c){if(_0x40424c){_0x196b74=_0x40424c[_0xf09e('0x4a')];if(!_0x27e234[_0xf09e('0x34')][_0xf09e('0x38')](_0xf09e('0x39'))){_0x5082a8[_0xf09e('0x1f')]=qs[_0xf09e('0x1f')](_0x27e234[_0xf09e('0x34')][_0xf09e('0x1f')]);_0x5082a8[_0xf09e('0x1d')]=qs[_0xf09e('0x1d')](_0x27e234[_0xf09e('0x34')][_0xf09e('0x1d')]);}return _0x103e2b[_0xf09e('0x63')](_0x5082a8);}})[_0xf09e('0x26')](function(_0x419fba){if(_0x419fba){return _0x419fba?{'count':_0x196b74,'rows':_0x419fba}:null;}})['then'](respondWithResult(_0x1d2910,null))[_0xf09e('0x46')](handleError(_0x1d2910,null));};exports[_0xf09e('0x64')]=function(_0x39983d,_0x2d44ae,_0x280671){var _0x3f21a7,_0x573479;var _0x29c245=[];var _0x4c2027=moment()[_0xf09e('0x65')](_0xf09e('0x66'));return db[_0xf09e('0x2d')]['find']({'where':{'id':_0x39983d[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x2d44ae,null))['then'](function(_0xb61785){if(_0xb61785){_0x573479=_0xb61785;return _0xb61785['addLists'](_0x39983d[_0xf09e('0x4d')][_0xf09e('0x67')],_['omit'](_0x39983d[_0xf09e('0x4d')],[_0xf09e('0x67'),'id'])||{});}return null;})[_0xf09e('0x68')](function(_0x1baf0b){var _0x46b872;var _0x39ebda;_0x3f21a7=_0x1baf0b||[];var _0x38943c=[];if(_0x1baf0b){for(var _0x51e3fa=0x0;_0x51e3fa<_0x1baf0b[_0xf09e('0x4a')];_0x51e3fa+=0x1){var _0x363379=_0x1baf0b[_0x51e3fa][_0xf09e('0x28')]({'plain':!![]});_0x573479[_0xf09e('0x69')]=_0x39983d[_0xf09e('0x4d')][_0xf09e('0x69')]?_0x39983d[_0xf09e('0x4d')][_0xf09e('0x69')]:_0x573479[_0xf09e('0x69')];switch(_0x573479[_0xf09e('0x69')]){case _0xf09e('0x6a'):_0x46b872=squel[_0xf09e('0x6b')]()['into'](_0xf09e('0x6c'))[_0xf09e('0x6d')]([_0xf09e('0x6e'),_0xf09e('0x6f'),_0xf09e('0x70'),_0xf09e('0x71'),'CampaignId',_0xf09e('0x56'),'updatedAt'],squel[_0xf09e('0x72')]()[_0xf09e('0x73')](_0xf09e('0x6e'),_0xf09e('0x6e'))['field'](_0xf09e('0x74'),'scheduledAt')['field']('id','ContactId')[_0xf09e('0x73')](_0x363379[_0xf09e('0x75')][_0xf09e('0x76')](),_0xf09e('0x71'))[_0xf09e('0x73')](_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')](),_0xf09e('0x5e'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x56'))['field']('\x27'+_0x4c2027+'\x27',_0xf09e('0x55'))['from']('cm_contacts')['where'](_0xf09e('0x77'))[_0xf09e('0x3f')](_0xf09e('0x78'),_0x363379[_0xf09e('0x75')][_0xf09e('0x76')]())[_0xf09e('0x3f')](_0xf09e('0x79'))[_0xf09e('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xf09e('0x7a'))['from'](_0xf09e('0x7b'))[_0xf09e('0x3f')](_0xf09e('0x7c'),_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')]()))['where'](_0xf09e('0x7d'),squel[_0xf09e('0x72')]()[_0xf09e('0x73')](_0xf09e('0x7e'))[_0xf09e('0x7f')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x39983d['params']['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x46b872=squel['insert']()[_0xf09e('0x80')](_0xf09e('0x6c'))[_0xf09e('0x6d')]([_0xf09e('0x6e'),_0xf09e('0x6f'),'ContactId','ListId',_0xf09e('0x5e'),'createdAt',_0xf09e('0x55')],squel[_0xf09e('0x72')]()['field'](_0xf09e('0x6e'),_0xf09e('0x6e'))[_0xf09e('0x73')](_0xf09e('0x74'),_0xf09e('0x6f'))[_0xf09e('0x73')]('id','ContactId')[_0xf09e('0x73')](_0x363379[_0xf09e('0x75')][_0xf09e('0x76')](),_0xf09e('0x71'))[_0xf09e('0x73')](_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')](),_0xf09e('0x5e'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x56'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27','updatedAt')['from'](_0xf09e('0x81'))[_0xf09e('0x3f')](_0xf09e('0x77'))['where'](_0xf09e('0x78'),_0x363379[_0xf09e('0x75')][_0xf09e('0x76')]())[_0xf09e('0x3f')](_0xf09e('0x79'))[_0xf09e('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf09e('0x72')]()[_0xf09e('0x73')]('COALESCE(phone,\x27\x27)')[_0xf09e('0x7f')]('cm_hopper')[_0xf09e('0x3f')](_0xf09e('0x7c'),_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')]())))[_0xf09e('0x76')]();break;default:_0x46b872=squel['insert']()[_0xf09e('0x80')]('cm_hopper')[_0xf09e('0x6d')]([_0xf09e('0x6e'),_0xf09e('0x6f'),'ContactId',_0xf09e('0x71'),_0xf09e('0x5e'),_0xf09e('0x56'),_0xf09e('0x55')],squel[_0xf09e('0x72')]()[_0xf09e('0x73')]('phone',_0xf09e('0x6e'))[_0xf09e('0x73')](_0xf09e('0x74'),_0xf09e('0x6f'))[_0xf09e('0x73')]('id',_0xf09e('0x70'))['field'](_0x363379[_0xf09e('0x75')][_0xf09e('0x76')](),_0xf09e('0x71'))['field'](_0x39983d[_0xf09e('0x48')]['id'][_0xf09e('0x76')](),_0xf09e('0x5e'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x56'))['field']('\x27'+_0x4c2027+'\x27',_0xf09e('0x55'))[_0xf09e('0x7f')](_0xf09e('0x81'))[_0xf09e('0x3f')](_0xf09e('0x77'))[_0xf09e('0x3f')](_0xf09e('0x78'),_0x363379[_0xf09e('0x75')][_0xf09e('0x76')]())['where'](_0xf09e('0x79')))[_0xf09e('0x76')]();}_0x39ebda=squel['insert']()[_0xf09e('0x80')]('cm_hopper_additional_phones')['fromQuery'](['cmHopperId',_0xf09e('0x6f'),_0xf09e('0x6e'),_0xf09e('0x82'),'createdAt','updatedAt'],squel[_0xf09e('0x72')]()[_0xf09e('0x73')]('h.id','id')[_0xf09e('0x73')](_0xf09e('0x74'),_0xf09e('0x6f'))[_0xf09e('0x73')](_0xf09e('0x83'),_0xf09e('0x6e'))[_0xf09e('0x73')]('ci.OrderBY',_0xf09e('0x82'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x56'))[_0xf09e('0x73')]('\x27'+_0x4c2027+'\x27',_0xf09e('0x55'))[_0xf09e('0x7f')](_0xf09e('0x84'),'ci')['join']('cm_hopper','h',_0xf09e('0x85'))['where'](_0xf09e('0x86'),_0x363379[_0xf09e('0x75')][_0xf09e('0x76')]())[_0xf09e('0x3f')](_0xf09e('0x87'),_0x39983d['params']['id']['toString']())[_0xf09e('0x3f')](_0xf09e('0x88'),_0x4c2027))['toString']();_0x38943c[_0xf09e('0x89')](db[_0xf09e('0x8a')][_0xf09e('0x34')](_0x46b872));_0x29c245[_0xf09e('0x89')](db[_0xf09e('0x8a')]['query'](_0x39ebda));}return BPromise[_0xf09e('0x8b')](_0x38943c);}})[_0xf09e('0x26')](function(){return BPromise[_0xf09e('0x8b')](_0x29c245);})['then'](function(){return _0x3f21a7;})['then'](respondWithResult(_0x2d44ae,null))['catch'](handleError(_0x2d44ae,null));};exports['removeLists']=function(_0x1582c0,_0x486fc7,_0xed5bf7){return db['Campaign'][_0xf09e('0x4b')]({'where':{'id':_0x1582c0[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x486fc7,null))[_0xf09e('0x26')](function(_0x430261){if(_0x430261){return _0x430261[_0xf09e('0x8c')](_0x1582c0['query']['ids']);}})[_0xf09e('0x26')](function(_0x1cd2da){if(_0x1cd2da){return db['CmHopper']['destroy']({'where':{'ListId':_0x1582c0['query'][_0xf09e('0x67')],'CampaignId':_0x1582c0[_0xf09e('0x48')]['id']}})['then'](function(){return _0x1cd2da;});}})[_0xf09e('0x26')](respondWithStatusCode(_0x486fc7,null))[_0xf09e('0x46')](handleError(_0x486fc7,null));};exports[_0xf09e('0x8d')]=function(_0x2b88e3,_0xcaa94e,_0x3f056f){var _0x5b7ca4={};var _0x480950={};var _0x3ef5c8;var _0x16e979;return db[_0xf09e('0x2d')][_0xf09e('0x59')]({'where':{'id':_0x2b88e3[_0xf09e('0x48')]['id']}})['then'](handleEntityNotFound(_0xcaa94e,null))[_0xf09e('0x26')](function(_0x1e8449){if(_0x1e8449){_0x3ef5c8=_0x1e8449;_0x480950[_0xf09e('0x32')]=_[_0xf09e('0x35')](db['CmList'][_0xf09e('0x2e')]);_0x480950[_0xf09e('0x34')]=_[_0xf09e('0x35')](_0x2b88e3['query']);_0x480950['filters']=_[_0xf09e('0x36')](_0x480950['model'],_0x480950[_0xf09e('0x34')]);_0x5b7ca4[_0xf09e('0x37')]=_['intersection'](_0x480950[_0xf09e('0x32')],qs[_0xf09e('0x49')](_0x2b88e3[_0xf09e('0x34')][_0xf09e('0x49')]));_0x5b7ca4[_0xf09e('0x37')]=_0x5b7ca4[_0xf09e('0x37')][_0xf09e('0x4a')]?_0x5b7ca4[_0xf09e('0x37')]:_0x480950[_0xf09e('0x32')];_0x5b7ca4[_0xf09e('0x3a')]=qs['sort'](_0x2b88e3['query']['sort']);_0x5b7ca4[_0xf09e('0x3f')]=qs['filters'](_[_0xf09e('0x3d')](_0x2b88e3[_0xf09e('0x34')],_0x480950[_0xf09e('0x3c')]));if(_0x2b88e3[_0xf09e('0x34')][_0xf09e('0x3e')]){_0x5b7ca4['where']=_[_0xf09e('0x40')](_0x5b7ca4['where'],{'$or':_[_0xf09e('0x33')](_0x5b7ca4[_0xf09e('0x37')],function(_0xa7a8b7){var _0x3f4f13={};_0x3f4f13[_0xa7a8b7]={'$like':'%'+_0x2b88e3[_0xf09e('0x34')]['filter']+'%'};return _0x3f4f13;})});}_0x5b7ca4=_[_0xf09e('0x40')]({},_0x5b7ca4,_0x2b88e3['options']);return _0x3ef5c8[_0xf09e('0x8d')](_0x5b7ca4);}})[_0xf09e('0x26')](function(_0x26b689){if(_0x26b689){_0x16e979=_0x26b689[_0xf09e('0x4a')];if(!_0x2b88e3[_0xf09e('0x34')]['hasOwnProperty'](_0xf09e('0x39'))){_0x5b7ca4[_0xf09e('0x1f')]=qs[_0xf09e('0x1f')](_0x2b88e3[_0xf09e('0x34')][_0xf09e('0x1f')]);_0x5b7ca4[_0xf09e('0x1d')]=qs[_0xf09e('0x1d')](_0x2b88e3[_0xf09e('0x34')][_0xf09e('0x1d')]);}return _0x3ef5c8[_0xf09e('0x8d')](_0x5b7ca4);}})['then'](function(_0x533f0c){if(_0x533f0c){return _0x533f0c?{'count':_0x16e979,'rows':_0x533f0c}:null;}})[_0xf09e('0x26')](respondWithResult(_0xcaa94e,null))[_0xf09e('0x46')](handleError(_0xcaa94e,null));};exports[_0xf09e('0x8e')]=function(_0x34b791,_0x161081,_0x1d0c69){var _0x4b4241,_0x1e8e9b;var _0xdf651c=[];var _0x5083f0=moment()['format'](_0xf09e('0x66'));return db['Campaign'][_0xf09e('0x4b')]({'where':{'id':_0x34b791['params']['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x161081,null))[_0xf09e('0x26')](function(_0x21325d){if(_0x21325d){_0x1e8e9b=_0x21325d;return _0x21325d['addBlackLists'](_0x34b791[_0xf09e('0x4d')][_0xf09e('0x67')],_[_0xf09e('0x54')](_0x34b791[_0xf09e('0x4d')],['ids','id'])||{});}return null;})[_0xf09e('0x68')](function(_0x3b8f0b){var _0x47ea9d;var _0x55b86d;_0x4b4241=_0x3b8f0b||[];var _0x1fc3cb=[];if(_0x3b8f0b){for(var _0x3d2d69=0x0;_0x3d2d69<_0x3b8f0b['length'];_0x3d2d69+=0x1){var _0x15a838=_0x3b8f0b[_0x3d2d69][_0xf09e('0x28')]({'plain':!![]});_0x47ea9d=squel[_0xf09e('0x6b')]()['into'](_0xf09e('0x8f'))[_0xf09e('0x6d')]([_0xf09e('0x6e'),_0xf09e('0x70'),'ListId',_0xf09e('0x5e'),_0xf09e('0x56'),_0xf09e('0x55')],squel[_0xf09e('0x72')]()[_0xf09e('0x73')](_0xf09e('0x6e'),'phone')[_0xf09e('0x73')]('id',_0xf09e('0x70'))[_0xf09e('0x73')](_0x15a838['CmListId'][_0xf09e('0x76')](),_0xf09e('0x71'))['field'](_0x34b791[_0xf09e('0x48')]['id'][_0xf09e('0x76')](),_0xf09e('0x5e'))['field'](_0xf09e('0x74'),_0xf09e('0x56'))[_0xf09e('0x73')](_0xf09e('0x74'),_0xf09e('0x55'))['from'](_0xf09e('0x81'))['where'](_0xf09e('0x77'))['where'](_0xf09e('0x78'),_0x15a838['CmListId'][_0xf09e('0x76')]())[_0xf09e('0x3f')](_0xf09e('0x79')))['toString']();_0x1fc3cb['push'](db['sequelize'][_0xf09e('0x34')](_0x47ea9d));}return BPromise[_0xf09e('0x8b')](_0x1fc3cb);}})[_0xf09e('0x26')](function(){return _0x4b4241;})[_0xf09e('0x26')](respondWithResult(_0x161081,null))[_0xf09e('0x46')](handleError(_0x161081,null));};exports[_0xf09e('0x90')]=function(_0x34861a,_0x3e0ca9,_0x536ab5){return db['Campaign']['find']({'where':{'id':_0x34861a[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](handleEntityNotFound(_0x3e0ca9,null))[_0xf09e('0x26')](function(_0x53000d){if(_0x53000d){return _0x53000d[_0xf09e('0x90')](_0x34861a['query']['ids']);}})[_0xf09e('0x26')](function(_0x1788ac){if(_0x1788ac){return db['CmHopperBlack'][_0xf09e('0x27')]({'where':{'ListId':_0x34861a[_0xf09e('0x34')][_0xf09e('0x67')],'CampaignId':_0x34861a[_0xf09e('0x48')]['id']}})[_0xf09e('0x26')](function(){return _0x1788ac;});}})[_0xf09e('0x26')](respondWithStatusCode(_0x3e0ca9,null))[_0xf09e('0x46')](handleError(_0x3e0ca9,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 15dbd73..478b3c3 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(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x1850e2,_0x7dab61){var _0x1f5de4=function(_0x2cfb85){while(--_0x2cfb85){_0x1850e2['push'](_0x1850e2['shift']());}};_0x1f5de4(++_0x7dab61);}(_0x7a54,0x106));var _0x47a5=function(_0x13bb5c,_0x456dd0){_0x13bb5c=_0x13bb5c-0x0;var _0x4beac6=_0x7a54[_0x13bb5c];return _0x4beac6;};'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 e2979a4..b0c6694 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 _0x5c4a=['include','model','map','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit'];(function(_0x1fb4a0,_0x48a602){var _0x1094e7=function(_0x25fcd5){while(--_0x25fcd5){_0x1fb4a0['push'](_0x1fb4a0['shift']());}};_0x1094e7(++_0x48a602);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x5489c5,_0x554605){_0x5489c5=_0x5489c5-0x0;var _0x2f460d=_0x5c4a[_0x5489c5];return _0x2f460d;};'use strict';var _=require('lodash');var util=require(_0xa5c4('0x0'));var moment=require(_0xa5c4('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5c4('0x2'));var fs=require('fs');var Redis=require(_0xa5c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5c4('0x4'));var logger=require(_0xa5c4('0x5'))(_0xa5c4('0x6'));var config=require(_0xa5c4('0x7'));var jayson=require(_0xa5c4('0x8'));var client=jayson['client'][_0xa5c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4210e8,_0x163c03,_0x435ccb){return new BPromise(function(_0x1d7316,_0x123e2b){return client['request'](_0x4210e8,_0x435ccb)[_0xa5c4('0xa')](function(_0x3a4d97){logger[_0xa5c4('0xb')]('Campaign,\x20%s,\x20%s',_0x163c03,'request\x20sent');logger[_0xa5c4('0xc')]('Campaign,\x20%s,\x20%s,\x20%s',_0x163c03,_0xa5c4('0xd'),JSON[_0xa5c4('0xe')](_0x3a4d97));if(_0x3a4d97['error']){if(_0x3a4d97[_0xa5c4('0xf')][_0xa5c4('0x10')]===0x1f4){logger[_0xa5c4('0xf')](_0xa5c4('0x11'),_0x163c03,_0x3a4d97[_0xa5c4('0xf')][_0xa5c4('0x12')]);return _0x123e2b(_0x3a4d97[_0xa5c4('0xf')][_0xa5c4('0x12')]);}logger['error'](_0xa5c4('0x11'),_0x163c03,_0x3a4d97['error']['message']);return _0x1d7316(_0x3a4d97[_0xa5c4('0xf')]['message']);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x163c03,_0xa5c4('0xd'));_0x1d7316(_0x3a4d97[_0xa5c4('0x13')][_0xa5c4('0x12')]);}})[_0xa5c4('0x14')](function(_0x19bc66){logger[_0xa5c4('0xf')]('Campaign,\x20%s,\x20%s',_0x163c03,_0x19bc66);_0x123e2b(_0x19bc66);});});}exports[_0xa5c4('0x15')]=function(_0x4ebdeb){var _0x5dc8ab=this;return new Promise(function(_0x39da3c,_0xab0eb7){return db[_0xa5c4('0x16')]['findAll']({'raw':_0x4ebdeb[_0xa5c4('0x17')]?_0x4ebdeb[_0xa5c4('0x17')][_0xa5c4('0x18')]===undefined?!![]:![]:!![],'where':_0x4ebdeb[_0xa5c4('0x17')]?_0x4ebdeb['options'][_0xa5c4('0x19')]||null:null,'attributes':_0x4ebdeb[_0xa5c4('0x17')]?_0x4ebdeb[_0xa5c4('0x17')][_0xa5c4('0x1a')]||null:null,'limit':_0x4ebdeb[_0xa5c4('0x17')]?_0x4ebdeb['options'][_0xa5c4('0x1b')]||null:null,'include':_0x4ebdeb['options']?_0x4ebdeb[_0xa5c4('0x17')]['include']?_['map'](_0x4ebdeb[_0xa5c4('0x17')][_0xa5c4('0x1c')],function(_0x325976){return{'model':db[_0x325976[_0xa5c4('0x1d')]],'as':_0x325976['as'],'attributes':_0x325976[_0xa5c4('0x1a')],'include':_0x325976['include']?_[_0xa5c4('0x1e')](_0x325976[_0xa5c4('0x1c')],function(_0x5a2a2f){return{'model':db[_0x5a2a2f[_0xa5c4('0x1d')]],'as':_0x5a2a2f['as'],'attributes':_0x5a2a2f[_0xa5c4('0x1a')],'include':_0x5a2a2f['include']?_['map'](_0x5a2a2f[_0xa5c4('0x1c')],function(_0x47acf6){return{'model':db[_0x47acf6[_0xa5c4('0x1d')]],'as':_0x47acf6['as'],'attributes':_0x47acf6['attributes']};}):[]};}):[]};}):[]:[]})[_0xa5c4('0xa')](function(_0x106168){logger['info'](_0xa5c4('0x15'),_0x4ebdeb);logger[_0xa5c4('0xc')](_0xa5c4('0x15'),_0x4ebdeb,JSON['stringify'](_0x106168));_0x39da3c(_0x106168);})[_0xa5c4('0x14')](function(_0x51164f){logger[_0xa5c4('0xf')](_0xa5c4('0x15'),_0x51164f[_0xa5c4('0x12')],_0x4ebdeb);_0xab0eb7(_0x5dc8ab[_0xa5c4('0xf')](0x1f4,_0x51164f[_0xa5c4('0x12')]));});});};
\ No newline at end of file
+var _0xadec=['catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','GetCampaign'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xadec,0x156));var _0xcade=function(_0x54681d,_0x5f28a7){_0x54681d=_0x54681d-0x0;var _0x52357e=_0xadec[_0x54681d];return _0x52357e;};'use strict';var _=require(_0xcade('0x0'));var util=require(_0xcade('0x1'));var moment=require(_0xcade('0x2'));var BPromise=require(_0xcade('0x3'));var rs=require(_0xcade('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcade('0x5'))(_0xcade('0x6'));var config=require(_0xcade('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51d665,_0x1fe48f,_0x4c36e8){return new BPromise(function(_0x625da7,_0x5bebbe){return client['request'](_0x51d665,_0x4c36e8)[_0xcade('0x8')](function(_0x182658){logger[_0xcade('0x9')]('Campaign,\x20%s,\x20%s',_0x1fe48f,_0xcade('0xa'));logger[_0xcade('0xb')](_0xcade('0xc'),_0x1fe48f,_0xcade('0xa'),JSON[_0xcade('0xd')](_0x182658));if(_0x182658[_0xcade('0xe')]){if(_0x182658[_0xcade('0xe')][_0xcade('0xf')]===0x1f4){logger[_0xcade('0xe')](_0xcade('0x10'),_0x1fe48f,_0x182658[_0xcade('0xe')][_0xcade('0x11')]);return _0x5bebbe(_0x182658[_0xcade('0xe')][_0xcade('0x11')]);}logger['error'](_0xcade('0x10'),_0x1fe48f,_0x182658[_0xcade('0xe')][_0xcade('0x11')]);return _0x625da7(_0x182658['error'][_0xcade('0x11')]);}else{logger[_0xcade('0x9')]('Campaign,\x20%s,\x20%s',_0x1fe48f,_0xcade('0xa'));_0x625da7(_0x182658[_0xcade('0x12')][_0xcade('0x11')]);}})['catch'](function(_0x1678cd){logger[_0xcade('0xe')](_0xcade('0x10'),_0x1fe48f,_0x1678cd);_0x5bebbe(_0x1678cd);});});}exports['GetCampaign']=function(_0x126272){var _0x124e64=this;return new Promise(function(_0x1c7be1,_0x1c54a0){return db[_0xcade('0x13')][_0xcade('0x14')]({'raw':_0x126272[_0xcade('0x15')]?_0x126272['options'][_0xcade('0x16')]===undefined?!![]:![]:!![],'where':_0x126272[_0xcade('0x15')]?_0x126272[_0xcade('0x15')][_0xcade('0x17')]||null:null,'attributes':_0x126272[_0xcade('0x15')]?_0x126272['options']['attributes']||null:null,'limit':_0x126272[_0xcade('0x15')]?_0x126272['options'][_0xcade('0x18')]||null:null,'include':_0x126272[_0xcade('0x15')]?_0x126272[_0xcade('0x15')][_0xcade('0x19')]?_[_0xcade('0x1a')](_0x126272[_0xcade('0x15')][_0xcade('0x19')],function(_0x264df7){return{'model':db[_0x264df7[_0xcade('0x1b')]],'as':_0x264df7['as'],'attributes':_0x264df7[_0xcade('0x1c')],'include':_0x264df7[_0xcade('0x19')]?_[_0xcade('0x1a')](_0x264df7['include'],function(_0x4139b3){return{'model':db[_0x4139b3[_0xcade('0x1b')]],'as':_0x4139b3['as'],'attributes':_0x4139b3['attributes'],'include':_0x4139b3[_0xcade('0x19')]?_[_0xcade('0x1a')](_0x4139b3[_0xcade('0x19')],function(_0x264f53){return{'model':db[_0x264f53[_0xcade('0x1b')]],'as':_0x264f53['as'],'attributes':_0x264f53[_0xcade('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcade('0x8')](function(_0x4bbe2a){logger[_0xcade('0x9')](_0xcade('0x1d'),_0x126272);logger[_0xcade('0xb')](_0xcade('0x1d'),_0x126272,JSON[_0xcade('0xd')](_0x4bbe2a));_0x1c7be1(_0x4bbe2a);})[_0xcade('0x1e')](function(_0x31fe0d){logger[_0xcade('0xe')]('GetCampaign',_0x31fe0d[_0xcade('0x11')],_0x126272);_0x1c54a0(_0x124e64[_0xcade('0xe')](0x1f4,_0x31fe0d[_0xcade('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index fbfeea9..d27a32c 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 _0x1d1a=['get','index','/:id','show','/:id/hoppers','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','addLists','addBlackLists','put','update','destroy','delete','/:id/blacklists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1d1a,0x1da));var _0xa1d1=function(_0x49c147,_0x50816b){_0x49c147=_0x49c147-0x0;var _0x576ba3=_0x1d1a[_0x49c147];return _0x576ba3;};'use strict';var multer=require(_0xa1d1('0x0'));var util=require(_0xa1d1('0x1'));var path=require(_0xa1d1('0x2'));var timeout=require(_0xa1d1('0x3'));var express=require('express');var router=express[_0xa1d1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa1d1('0x5'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xa1d1('0x6')]('/',auth['isAuthenticated'](),controller[_0xa1d1('0x7')]);router[_0xa1d1('0x6')](_0xa1d1('0x8'),auth['isAuthenticated'](),controller[_0xa1d1('0x9')]);router['get'](_0xa1d1('0xa'),auth[_0xa1d1('0xb')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0xa1d1('0xb')](),controller[_0xa1d1('0xc')]);router[_0xa1d1('0x6')](_0xa1d1('0xd'),auth['isAuthenticated'](),controller[_0xa1d1('0xe')]);router[_0xa1d1('0x6')](_0xa1d1('0xf'),auth['isAuthenticated'](),controller[_0xa1d1('0x10')]);router[_0xa1d1('0x6')](_0xa1d1('0x11'),auth['isAuthenticated'](),controller['getLists']);router[_0xa1d1('0x6')]('/:id/blacklists',auth[_0xa1d1('0xb')](),controller[_0xa1d1('0x12')]);router[_0xa1d1('0x13')]('/',auth[_0xa1d1('0xb')](),controller[_0xa1d1('0x14')]);router[_0xa1d1('0x13')]('/:id/clone',auth[_0xa1d1('0xb')](),controller['clone']);router['post']('/:id/lists',auth[_0xa1d1('0xb')](),controller[_0xa1d1('0x15')]);router[_0xa1d1('0x13')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xa1d1('0x16')]);router[_0xa1d1('0x17')](_0xa1d1('0x8'),auth[_0xa1d1('0xb')](),controller[_0xa1d1('0x18')]);router['delete'](_0xa1d1('0x8'),auth['isAuthenticated'](),controller[_0xa1d1('0x19')]);router['delete'](_0xa1d1('0x11'),auth[_0xa1d1('0xb')](),controller['removeLists']);router[_0xa1d1('0x1a')](_0xa1d1('0x1b'),auth['isAuthenticated'](),controller[_0xa1d1('0x1c')]);module[_0xa1d1('0x1d')]=router;
\ No newline at end of file
+var _0x93af=['removeBlackLists','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','removeLists'];(function(_0x1ae56b,_0x5aecab){var _0x2c0594=function(_0x1d50a5){while(--_0x1d50a5){_0x1ae56b['push'](_0x1ae56b['shift']());}};_0x2c0594(++_0x5aecab);}(_0x93af,0x1af));var _0xf93a=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x93af[_0x2ce6d5];return _0x32d272;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf93a('0x0'));var express=require(_0xf93a('0x1'));var router=express[_0xf93a('0x2')]();var fs_extra=require(_0xf93a('0x3'));var auth=require(_0xf93a('0x4'));var interaction=require(_0xf93a('0x5'));var config=require('../../config/environment');var controller=require(_0xf93a('0x6'));router[_0xf93a('0x7')]('/',auth[_0xf93a('0x8')](),controller[_0xf93a('0x9')]);router[_0xf93a('0x7')](_0xf93a('0xa'),auth[_0xf93a('0x8')](),controller[_0xf93a('0xb')]);router['get'](_0xf93a('0xc'),auth[_0xf93a('0x8')](),controller['getHoppers']);router[_0xf93a('0x7')](_0xf93a('0xd'),auth['isAuthenticated'](),controller[_0xf93a('0xe')]);router[_0xf93a('0x7')](_0xf93a('0xf'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x10')]);router['get'](_0xf93a('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xf93a('0x7')](_0xf93a('0x12'),auth[_0xf93a('0x8')](),controller['getLists']);router[_0xf93a('0x7')](_0xf93a('0x13'),auth['isAuthenticated'](),controller[_0xf93a('0x14')]);router[_0xf93a('0x15')]('/',auth[_0xf93a('0x8')](),controller[_0xf93a('0x16')]);router[_0xf93a('0x15')](_0xf93a('0x17'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x18')]);router[_0xf93a('0x15')]('/:id/lists',auth[_0xf93a('0x8')](),controller[_0xf93a('0x19')]);router[_0xf93a('0x15')](_0xf93a('0x13'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x1a')]);router[_0xf93a('0x1b')](_0xf93a('0xa'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x1c')]);router[_0xf93a('0x1d')](_0xf93a('0xa'),auth[_0xf93a('0x8')](),controller['destroy']);router[_0xf93a('0x1d')](_0xf93a('0x12'),auth[_0xf93a('0x8')](),controller[_0xf93a('0x1e')]);router[_0xf93a('0x1d')](_0xf93a('0x13'),auth['isAuthenticated'](),controller[_0xf93a('0x1f')]);module[_0xf93a('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 0c63974..eba7ede 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 _0x30a3=['exports','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x57e0fa,_0x3151ba){var _0x3ed56f=function(_0x55baa1){while(--_0x55baa1){_0x57e0fa['push'](_0x57e0fa['shift']());}};_0x3ed56f(++_0x3151ba);}(_0x30a3,0x11f));var _0x330a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x330a('0x0'));module[_0x330a('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x330a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x330a('0x3')],'get':function(){return this[_0x330a('0x4')](_0x330a('0x5'));}}};
\ No newline at end of file
+var _0x2335=['sequelize','STRING','VIRTUAL','getDataValue','key'];(function(_0x31a119,_0x17e6ca){var _0x2d6e6a=function(_0x3faa80){while(--_0x3faa80){_0x31a119['push'](_0x31a119['shift']());}};_0x2d6e6a(++_0x17e6ca);}(_0x2335,0x177));var _0x5233=function(_0x4ebd43,_0x29607b){_0x4ebd43=_0x4ebd43-0x0;var _0x1ed678=_0x2335[_0x4ebd43];return _0x1ed678;};'use strict';var Sequelize=require(_0x5233('0x0'));module['exports']={'key':{'type':Sequelize[_0x5233('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x5233('0x1')]},'name':{'type':Sequelize[_0x5233('0x2')],'get':function(){return this[_0x5233('0x3')](_0x5233('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index c038ce4..c729548 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 _0x429f=['then','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','CannedAnswer','include','findAll','show','rawAttributes','catch','update','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','get','CannedAnswers'];(function(_0xefc2da,_0x4f29e2){var _0x3ba265=function(_0x263855){while(--_0x263855){_0xefc2da['push'](_0xefc2da['shift']());}};_0x3ba265(++_0x4f29e2);}(_0x429f,0x7c));var _0xf429=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0x429f[_0x139b85];return _0x1e833f;};'use strict';var emlformat=require(_0xf429('0x0'));var rimraf=require(_0xf429('0x1'));var zipdir=require(_0xf429('0x2'));var jsonpatch=require(_0xf429('0x3'));var rp=require(_0xf429('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf429('0x5'));var util=require(_0xf429('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf429('0x7'));var ejs=require(_0xf429('0x8'));var fs=require('fs');var fs_extra=require(_0xf429('0x9'));var _=require(_0xf429('0xa'));var squel=require(_0xf429('0xb'));var crypto=require(_0xf429('0xc'));var jsforce=require(_0xf429('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf429('0x7'));var querystring=require(_0xf429('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf429('0xf'));var as=require(_0xf429('0x10'));var hardwareService=require(_0xf429('0x11'));var logger=require(_0xf429('0x12'))('api');var utils=require(_0xf429('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf429('0x14'));var db=require(_0xf429('0x15'))['db'];function respondWithStatusCode(_0x844fc7,_0x2576b3){_0x2576b3=_0x2576b3||0xcc;return function(_0x5592db){if(_0x5592db){return _0x844fc7[_0xf429('0x16')](_0x2576b3);}return _0x844fc7[_0xf429('0x17')](_0x2576b3)[_0xf429('0x18')]();};}function respondWithResult(_0x2a52e2,_0x26f8ee){_0x26f8ee=_0x26f8ee||0xc8;return function(_0x53d4c5){if(_0x53d4c5){return _0x2a52e2['status'](_0x26f8ee)[_0xf429('0x19')](_0x53d4c5);}};}function respondWithFilteredResult(_0x1eca0a,_0x43d907){return function(_0x2b51e0){if(_0x2b51e0){var _0x46bbcc=typeof _0x43d907[_0xf429('0x1a')]===_0xf429('0x1b')&&typeof _0x43d907[_0xf429('0x1c')]===_0xf429('0x1b');var _0x263773=_0x2b51e0['count'];var _0x3dd81a=_0x46bbcc?0x0:_0x43d907[_0xf429('0x1a')];var _0x5389d5=_0x46bbcc?_0x2b51e0[_0xf429('0x1d')]:_0x43d907[_0xf429('0x1a')]+_0x43d907[_0xf429('0x1c')];var _0x1e989a;if(_0x5389d5>=_0x263773){_0x5389d5=_0x263773;_0x1e989a=0xc8;}else{_0x1e989a=0xce;}_0x1eca0a[_0xf429('0x17')](_0x1e989a);return _0x1eca0a[_0xf429('0x1e')]('Content-Range',_0x3dd81a+'-'+_0x5389d5+'/'+_0x263773)[_0xf429('0x19')](_0x2b51e0);}return null;};}function patchUpdates(_0x47ddd3){return function(_0x473176){try{jsonpatch['apply'](_0x473176,_0x47ddd3,!![]);}catch(_0x31389a){return BPromise[_0xf429('0x1f')](_0x31389a);}return _0x473176[_0xf429('0x20')]();};}function saveUpdates(_0x7d344d,_0x4e4e8d){return function(_0x1ca28a){if(_0x1ca28a){return _0x1ca28a['update'](_0x7d344d)['then'](function(_0x53b5b2){return _0x53b5b2;});}return null;};}function removeEntity(_0x478d17,_0x4ca3f4){return function(_0x3568ed){if(_0x3568ed){return _0x3568ed[_0xf429('0x21')]()['then'](function(){var _0x139bbb=_0x3568ed[_0xf429('0x22')]({'plain':!![]});var _0x1db4a2=_0xf429('0x23');return db['UserProfileResource'][_0xf429('0x21')]({'where':{'type':_0x1db4a2,'resourceId':_0x139bbb['id']}})[_0xf429('0x24')](function(){return _0x3568ed;});})['then'](function(){_0x478d17['status'](0xcc)[_0xf429('0x18')]();});}};}function handleEntityNotFound(_0x440db4,_0x1d4041){return function(_0x528d82){if(!_0x528d82){_0x440db4[_0xf429('0x16')](0x194);}return _0x528d82;};}function handleError(_0x428fd6,_0x4a2926){_0x4a2926=_0x4a2926||0x1f4;return function(_0x1e81d0){logger[_0xf429('0x25')](_0x1e81d0['stack']);if(_0x1e81d0[_0xf429('0x26')]){delete _0x1e81d0[_0xf429('0x26')];}_0x428fd6[_0xf429('0x17')](_0x4a2926)[_0xf429('0x27')](_0x1e81d0);};}exports[_0xf429('0x28')]=function(_0x4638cb,_0x64e18c){var _0x35fd4d={},_0x5ddf50={},_0x5989a5={'count':0x0,'rows':[]};var _0x4da090=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x3c740d){return{'name':_0x3c740d[_0xf429('0x29')],'type':_0x3c740d[_0xf429('0x2a')][_0xf429('0x2b')]};});_0x5ddf50[_0xf429('0x2c')]=_[_0xf429('0x2d')](_0x4da090,_0xf429('0x26'));_0x5ddf50[_0xf429('0x2e')]=_[_0xf429('0x2f')](_0x4638cb[_0xf429('0x2e')]);_0x5ddf50[_0xf429('0x30')]=_[_0xf429('0x31')](_0x5ddf50[_0xf429('0x2c')],_0x5ddf50[_0xf429('0x2e')]);_0x35fd4d['attributes']=_[_0xf429('0x31')](_0x5ddf50[_0xf429('0x2c')],qs[_0xf429('0x32')](_0x4638cb[_0xf429('0x2e')][_0xf429('0x32')]));_0x35fd4d[_0xf429('0x33')]=_0x35fd4d['attributes'][_0xf429('0x34')]?_0x35fd4d['attributes']:_0x5ddf50[_0xf429('0x2c')];if(!_0x4638cb[_0xf429('0x2e')][_0xf429('0x35')]('nolimit')){_0x35fd4d[_0xf429('0x1c')]=qs[_0xf429('0x1c')](_0x4638cb[_0xf429('0x2e')]['limit']);_0x35fd4d[_0xf429('0x1a')]=qs['offset'](_0x4638cb[_0xf429('0x2e')]['offset']);}_0x35fd4d[_0xf429('0x36')]=qs['sort'](_0x4638cb[_0xf429('0x2e')][_0xf429('0x37')]);_0x35fd4d['where']=qs[_0xf429('0x30')](_[_0xf429('0x38')](_0x4638cb[_0xf429('0x2e')],_0x5ddf50[_0xf429('0x30')]),_0x4da090);if(_0x4638cb['query'][_0xf429('0x39')]){_0x35fd4d['where']=_[_0xf429('0x3a')](_0x35fd4d[_0xf429('0x3b')],{'$or':[{'key':{'$like':'%'+_0x4638cb[_0xf429('0x2e')][_0xf429('0x39')]+'%'}},{'value':{'$like':'%'+_0x4638cb[_0xf429('0x2e')][_0xf429('0x39')]+'%'}}]});}_0x35fd4d=_[_0xf429('0x3a')]({},_0x35fd4d,_0x4638cb[_0xf429('0x3c')]);var _0xaeb4a5={'where':_0x35fd4d['where']};return db[_0xf429('0x3d')]['count'](_0xaeb4a5)['then'](function(_0x57541a){_0x5989a5[_0xf429('0x1d')]=_0x57541a;if(_0x4638cb[_0xf429('0x2e')]['includeAll']){_0x35fd4d[_0xf429('0x3e')]=[{'all':!![]}];}return db[_0xf429('0x3d')][_0xf429('0x3f')](_0x35fd4d);})[_0xf429('0x24')](function(_0x251abe){_0x5989a5['rows']=_0x251abe;return _0x5989a5;})[_0xf429('0x24')](respondWithFilteredResult(_0x64e18c,_0x35fd4d))['catch'](handleError(_0x64e18c,null));};exports[_0xf429('0x40')]=function(_0x5b9a8c,_0x3fa81){var _0x4db010={'raw':!![],'where':{'id':_0x5b9a8c['params']['id']}},_0x4e8d64={};_0x4e8d64[_0xf429('0x2c')]=_[_0xf429('0x2f')](db['CannedAnswer'][_0xf429('0x41')]);_0x4e8d64[_0xf429('0x2e')]=_[_0xf429('0x2f')](_0x5b9a8c[_0xf429('0x2e')]);_0x4e8d64[_0xf429('0x30')]=_[_0xf429('0x31')](_0x4e8d64[_0xf429('0x2c')],_0x4e8d64['query']);_0x4db010[_0xf429('0x33')]=_[_0xf429('0x31')](_0x4e8d64[_0xf429('0x2c')],qs[_0xf429('0x32')](_0x5b9a8c[_0xf429('0x2e')][_0xf429('0x32')]));_0x4db010[_0xf429('0x33')]=_0x4db010[_0xf429('0x33')][_0xf429('0x34')]?_0x4db010[_0xf429('0x33')]:_0x4e8d64[_0xf429('0x2c')];if(_0x5b9a8c['query']['includeAll']){_0x4db010[_0xf429('0x3e')]=[{'all':!![]}];}_0x4db010=_['merge']({},_0x4db010,_0x5b9a8c['options']);return db[_0xf429('0x3d')]['find'](_0x4db010)[_0xf429('0x24')](handleEntityNotFound(_0x3fa81,null))[_0xf429('0x24')](respondWithResult(_0x3fa81,null))[_0xf429('0x42')](handleError(_0x3fa81,null));};exports[_0xf429('0x43')]=function(_0x557921,_0x436bbc){if(_0x557921[_0xf429('0x44')]['id']){delete _0x557921[_0xf429('0x44')]['id'];}return db[_0xf429('0x3d')][_0xf429('0x45')]({'where':{'id':_0x557921['params']['id']}})['then'](handleEntityNotFound(_0x436bbc,null))[_0xf429('0x24')](saveUpdates(_0x557921[_0xf429('0x44')],null))[_0xf429('0x24')](respondWithResult(_0x436bbc,null))['catch'](handleError(_0x436bbc,null));};exports[_0xf429('0x21')]=function(_0x32e02c,_0x48b3d6){return db[_0xf429('0x3d')][_0xf429('0x45')]({'where':{'id':_0x32e02c[_0xf429('0x46')]['id']}})[_0xf429('0x24')](handleEntityNotFound(_0x48b3d6,null))[_0xf429('0x24')](removeEntity(_0x48b3d6,null))[_0xf429('0x42')](handleError(_0x48b3d6,null));};exports[_0xf429('0x47')]=function(_0x4d03f0,_0x487de7){var _0x3237a6={'key':_0x4d03f0[_0xf429('0x44')]['key']};if(_0x4d03f0[_0xf429('0x44')][_0xf429('0x48')]){_0x3237a6[_0xf429('0x48')]=_0x4d03f0[_0xf429('0x44')]['MailAccountId'];}else if(_0x4d03f0[_0xf429('0x44')][_0xf429('0x49')]){_0x3237a6['SmsAccountId']=_0x4d03f0[_0xf429('0x44')][_0xf429('0x49')];}else if(_0x4d03f0[_0xf429('0x44')][_0xf429('0x4a')]){_0x3237a6[_0xf429('0x4a')]=_0x4d03f0[_0xf429('0x44')]['OpenchannelAccountId'];}else if(_0x4d03f0['body']['ChatWebsiteId']){_0x3237a6['ChatWebsiteId']=_0x4d03f0[_0xf429('0x44')]['ChatWebsiteId'];}return db[_0xf429('0x3d')][_0xf429('0x45')]({'where':_0x3237a6})['then'](function(_0x57c8e6){if(_0x57c8e6){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xf429('0x3d')]['create'](_0x4d03f0[_0xf429('0x44')]);})['then'](function(_0x47e2af){var _0x3f201c=_0x4d03f0['user'][_0xf429('0x22')]({'plain':!![]});if(!_0x3f201c)throw new Error(_0xf429('0x4b'));if(_0x3f201c[_0xf429('0x4c')]===_0xf429('0x4d')){var _0x22bfdb=_0x47e2af[_0xf429('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xf429('0x23'),'userProfileId':_0x3f201c[_0xf429('0x4e')]},'raw':!![]})[_0xf429('0x24')](function(_0x571190){if(_0x571190&&_0x571190[_0xf429('0x4f')]===0x0){return db['UserProfileResource'][_0xf429('0x47')]({'name':_0x22bfdb[_0xf429('0x26')],'resourceId':_0x22bfdb['id'],'type':_0x571190[_0xf429('0x26')],'sectionId':_0x571190['id']},{})['then'](function(){return _0x47e2af;});}else{return _0x47e2af;}})[_0xf429('0x42')](function(_0x4420a1){logger[_0xf429('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4420a1);throw _0x4420a1;});}return _0x47e2af;})[_0xf429('0x24')](respondWithResult(_0x487de7,0xc9))[_0xf429('0x42')](handleError(_0x487de7,null));};
\ No newline at end of file
+var _0xb622=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','offset','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring'];(function(_0xb92641,_0x442c8a){var _0x869bc=function(_0xa98c2d){while(--_0xa98c2d){_0xb92641['push'](_0xb92641['shift']());}};_0x869bc(++_0x442c8a);}(_0xb622,0x9c));var _0x2b62=function(_0x8075e5,_0x1dc2cb){_0x8075e5=_0x8075e5-0x0;var _0x3b4139=_0xb622[_0x8075e5];return _0x3b4139;};'use strict';var emlformat=require(_0x2b62('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b62('0x1'));var jsonpatch=require(_0x2b62('0x2'));var rp=require(_0x2b62('0x3'));var moment=require(_0x2b62('0x4'));var BPromise=require(_0x2b62('0x5'));var Mustache=require(_0x2b62('0x6'));var util=require(_0x2b62('0x7'));var path=require(_0x2b62('0x8'));var sox=require(_0x2b62('0x9'));var csv=require(_0x2b62('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b62('0xb'));var _=require(_0x2b62('0xc'));var squel=require(_0x2b62('0xd'));var crypto=require(_0x2b62('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2b62('0xa'));var querystring=require(_0x2b62('0xf'));var Papa=require(_0x2b62('0x10'));var Redis=require(_0x2b62('0x11'));var authService=require(_0x2b62('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b62('0x13'));var hardwareService=require(_0x2b62('0x14'));var logger=require('../../config/logger')(_0x2b62('0x15'));var utils=require(_0x2b62('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2b62('0x17'))['db'];function respondWithStatusCode(_0xcf8a02,_0x4fa13f){_0x4fa13f=_0x4fa13f||0xcc;return function(_0x175aa8){if(_0x175aa8){return _0xcf8a02[_0x2b62('0x18')](_0x4fa13f);}return _0xcf8a02[_0x2b62('0x19')](_0x4fa13f)[_0x2b62('0x1a')]();};}function respondWithResult(_0x2cf2db,_0x6cfa34){_0x6cfa34=_0x6cfa34||0xc8;return function(_0x3f52e8){if(_0x3f52e8){return _0x2cf2db[_0x2b62('0x19')](_0x6cfa34)[_0x2b62('0x1b')](_0x3f52e8);}};}function respondWithFilteredResult(_0xc36bf6,_0x5b0d95){return function(_0x5d3c59){if(_0x5d3c59){var _0x426406=typeof _0x5b0d95['offset']===_0x2b62('0x1c')&&typeof _0x5b0d95[_0x2b62('0x1d')]===_0x2b62('0x1c');var _0x306edc=_0x5d3c59[_0x2b62('0x1e')];var _0x20309c=_0x426406?0x0:_0x5b0d95['offset'];var _0x29b296=_0x426406?_0x5d3c59['count']:_0x5b0d95['offset']+_0x5b0d95['limit'];var _0x113fe8;if(_0x29b296>=_0x306edc){_0x29b296=_0x306edc;_0x113fe8=0xc8;}else{_0x113fe8=0xce;}_0xc36bf6['status'](_0x113fe8);return _0xc36bf6['set'](_0x2b62('0x1f'),_0x20309c+'-'+_0x29b296+'/'+_0x306edc)[_0x2b62('0x1b')](_0x5d3c59);}return null;};}function patchUpdates(_0x3ef155){return function(_0x1e4b79){try{jsonpatch[_0x2b62('0x20')](_0x1e4b79,_0x3ef155,!![]);}catch(_0x3f4b61){return BPromise[_0x2b62('0x21')](_0x3f4b61);}return _0x1e4b79[_0x2b62('0x22')]();};}function saveUpdates(_0x11ef4a,_0x165ecb){return function(_0x1b7d53){if(_0x1b7d53){return _0x1b7d53[_0x2b62('0x23')](_0x11ef4a)[_0x2b62('0x24')](function(_0x3cfe5c){return _0x3cfe5c;});}return null;};}function removeEntity(_0xd5a862,_0x8fb80c){return function(_0xc32a20){if(_0xc32a20){return _0xc32a20[_0x2b62('0x25')]()[_0x2b62('0x24')](function(){var _0x504fdf=_0xc32a20[_0x2b62('0x26')]({'plain':!![]});var _0x2f95b4='CannedAnswers';return db[_0x2b62('0x27')][_0x2b62('0x25')]({'where':{'type':_0x2f95b4,'resourceId':_0x504fdf['id']}})['then'](function(){return _0xc32a20;});})[_0x2b62('0x24')](function(){_0xd5a862[_0x2b62('0x19')](0xcc)[_0x2b62('0x1a')]();});}};}function handleEntityNotFound(_0x34f347,_0x553ceb){return function(_0x54063b){if(!_0x54063b){_0x34f347['sendStatus'](0x194);}return _0x54063b;};}function handleError(_0x3a470a,_0xecfc82){_0xecfc82=_0xecfc82||0x1f4;return function(_0x6b8d5c){logger['error'](_0x6b8d5c['stack']);if(_0x6b8d5c[_0x2b62('0x28')]){delete _0x6b8d5c['name'];}_0x3a470a[_0x2b62('0x19')](_0xecfc82)[_0x2b62('0x29')](_0x6b8d5c);};}exports['index']=function(_0x240b96,_0x2b3d86){var _0x44b3cd={},_0x2fed68={},_0x21174a={'count':0x0,'rows':[]};var _0x1c317a=_['map'](db[_0x2b62('0x2a')][_0x2b62('0x2b')],function(_0x9667e1){return{'name':_0x9667e1[_0x2b62('0x2c')],'type':_0x9667e1[_0x2b62('0x2d')][_0x2b62('0x2e')]};});_0x2fed68[_0x2b62('0x2f')]=_[_0x2b62('0x30')](_0x1c317a,_0x2b62('0x28'));_0x2fed68['query']=_['keys'](_0x240b96[_0x2b62('0x31')]);_0x2fed68[_0x2b62('0x32')]=_[_0x2b62('0x33')](_0x2fed68['model'],_0x2fed68[_0x2b62('0x31')]);_0x44b3cd['attributes']=_[_0x2b62('0x33')](_0x2fed68[_0x2b62('0x2f')],qs['fields'](_0x240b96[_0x2b62('0x31')][_0x2b62('0x34')]));_0x44b3cd[_0x2b62('0x35')]=_0x44b3cd[_0x2b62('0x35')]['length']?_0x44b3cd['attributes']:_0x2fed68[_0x2b62('0x2f')];if(!_0x240b96['query']['hasOwnProperty']('nolimit')){_0x44b3cd[_0x2b62('0x1d')]=qs['limit'](_0x240b96[_0x2b62('0x31')][_0x2b62('0x1d')]);_0x44b3cd[_0x2b62('0x36')]=qs[_0x2b62('0x36')](_0x240b96['query'][_0x2b62('0x36')]);}_0x44b3cd['order']=qs[_0x2b62('0x37')](_0x240b96[_0x2b62('0x31')][_0x2b62('0x37')]);_0x44b3cd[_0x2b62('0x38')]=qs[_0x2b62('0x32')](_[_0x2b62('0x39')](_0x240b96[_0x2b62('0x31')],_0x2fed68[_0x2b62('0x32')]),_0x1c317a);if(_0x240b96[_0x2b62('0x31')][_0x2b62('0x3a')]){_0x44b3cd[_0x2b62('0x38')]=_[_0x2b62('0x3b')](_0x44b3cd[_0x2b62('0x38')],{'$or':[{'key':{'$like':'%'+_0x240b96['query'][_0x2b62('0x3a')]+'%'}},{'value':{'$like':'%'+_0x240b96['query'][_0x2b62('0x3a')]+'%'}}]});}_0x44b3cd=_[_0x2b62('0x3b')]({},_0x44b3cd,_0x240b96['options']);var _0x25b618={'where':_0x44b3cd[_0x2b62('0x38')]};return db[_0x2b62('0x2a')][_0x2b62('0x1e')](_0x25b618)[_0x2b62('0x24')](function(_0x239123){_0x21174a[_0x2b62('0x1e')]=_0x239123;if(_0x240b96['query'][_0x2b62('0x3c')]){_0x44b3cd[_0x2b62('0x3d')]=[{'all':!![]}];}return db[_0x2b62('0x2a')][_0x2b62('0x3e')](_0x44b3cd);})[_0x2b62('0x24')](function(_0x2de21a){_0x21174a[_0x2b62('0x3f')]=_0x2de21a;return _0x21174a;})[_0x2b62('0x24')](respondWithFilteredResult(_0x2b3d86,_0x44b3cd))[_0x2b62('0x40')](handleError(_0x2b3d86,null));};exports[_0x2b62('0x41')]=function(_0x56d56d,_0x311ebc){var _0x49eb64={'raw':!![],'where':{'id':_0x56d56d['params']['id']}},_0x330b38={};_0x330b38['model']=_[_0x2b62('0x42')](db[_0x2b62('0x2a')][_0x2b62('0x2b')]);_0x330b38['query']=_['keys'](_0x56d56d[_0x2b62('0x31')]);_0x330b38[_0x2b62('0x32')]=_[_0x2b62('0x33')](_0x330b38[_0x2b62('0x2f')],_0x330b38['query']);_0x49eb64[_0x2b62('0x35')]=_[_0x2b62('0x33')](_0x330b38[_0x2b62('0x2f')],qs['fields'](_0x56d56d[_0x2b62('0x31')][_0x2b62('0x34')]));_0x49eb64[_0x2b62('0x35')]=_0x49eb64[_0x2b62('0x35')][_0x2b62('0x43')]?_0x49eb64['attributes']:_0x330b38[_0x2b62('0x2f')];if(_0x56d56d[_0x2b62('0x31')]['includeAll']){_0x49eb64[_0x2b62('0x3d')]=[{'all':!![]}];}_0x49eb64=_['merge']({},_0x49eb64,_0x56d56d['options']);return db['CannedAnswer'][_0x2b62('0x44')](_0x49eb64)[_0x2b62('0x24')](handleEntityNotFound(_0x311ebc,null))[_0x2b62('0x24')](respondWithResult(_0x311ebc,null))['catch'](handleError(_0x311ebc,null));};exports[_0x2b62('0x23')]=function(_0x525506,_0xdc8987){if(_0x525506[_0x2b62('0x45')]['id']){delete _0x525506['body']['id'];}return db[_0x2b62('0x2a')][_0x2b62('0x44')]({'where':{'id':_0x525506['params']['id']}})['then'](handleEntityNotFound(_0xdc8987,null))[_0x2b62('0x24')](saveUpdates(_0x525506[_0x2b62('0x45')],null))['then'](respondWithResult(_0xdc8987,null))[_0x2b62('0x40')](handleError(_0xdc8987,null));};exports[_0x2b62('0x25')]=function(_0x377b12,_0x5b756a){return db[_0x2b62('0x2a')]['find']({'where':{'id':_0x377b12[_0x2b62('0x46')]['id']}})[_0x2b62('0x24')](handleEntityNotFound(_0x5b756a,null))[_0x2b62('0x24')](removeEntity(_0x5b756a,null))[_0x2b62('0x40')](handleError(_0x5b756a,null));};exports[_0x2b62('0x47')]=function(_0x401605,_0xd0586){var _0x28e2d5={'key':_0x401605['body']['key']};if(_0x401605[_0x2b62('0x45')][_0x2b62('0x48')]){_0x28e2d5[_0x2b62('0x48')]=_0x401605[_0x2b62('0x45')][_0x2b62('0x48')];}else if(_0x401605[_0x2b62('0x45')][_0x2b62('0x49')]){_0x28e2d5[_0x2b62('0x49')]=_0x401605['body'][_0x2b62('0x49')];}else if(_0x401605[_0x2b62('0x45')]['OpenchannelAccountId']){_0x28e2d5['OpenchannelAccountId']=_0x401605[_0x2b62('0x45')][_0x2b62('0x4a')];}else if(_0x401605['body']['ChatWebsiteId']){_0x28e2d5[_0x2b62('0x4b')]=_0x401605['body'][_0x2b62('0x4b')];}return db[_0x2b62('0x2a')][_0x2b62('0x44')]({'where':_0x28e2d5})['then'](function(_0x9f4049){if(_0x9f4049){throw new db['Sequelize'][(_0x2b62('0x4c'))](_0x2b62('0x4d'));}return db[_0x2b62('0x2a')][_0x2b62('0x47')](_0x401605['body']);})['then'](function(_0x24b40b){var _0x44d0ba=_0x401605[_0x2b62('0x4e')][_0x2b62('0x26')]({'plain':!![]});if(!_0x44d0ba)throw new Error(_0x2b62('0x4f'));if(_0x44d0ba[_0x2b62('0x50')]===_0x2b62('0x4e')){var _0x255d89=_0x24b40b[_0x2b62('0x26')]({'plain':!![]});return db[_0x2b62('0x51')][_0x2b62('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x44d0ba[_0x2b62('0x52')]},'raw':!![]})[_0x2b62('0x24')](function(_0x34aefd){if(_0x34aefd&&_0x34aefd[_0x2b62('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x255d89[_0x2b62('0x28')],'resourceId':_0x255d89['id'],'type':_0x34aefd['name'],'sectionId':_0x34aefd['id']},{})[_0x2b62('0x24')](function(){return _0x24b40b;});}else{return _0x24b40b;}})['catch'](function(_0x4cb53f){logger[_0x2b62('0x54')](_0x2b62('0x55'),_0x4cb53f);throw _0x4cb53f;});}return _0x24b40b;})['then'](respondWithResult(_0xd0586,0xc9))[_0x2b62('0x40')](handleError(_0xd0586,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index aa22889..7c307e6 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 _0x534f=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer'];(function(_0x1fc12c,_0x21650a){var _0x56d915=function(_0x365e1c){while(--_0x365e1c){_0x1fc12c['push'](_0x1fc12c['shift']());}};_0x56d915(++_0x21650a);}(_0x534f,0x1a3));var _0xf534=function(_0xb43e19,_0x375fc8){_0xb43e19=_0xb43e19-0x0;var _0x4f0433=_0x534f[_0xb43e19];return _0x4f0433;};'use strict';var _=require(_0xf534('0x0'));var util=require(_0xf534('0x1'));var logger=require(_0xf534('0x2'))(_0xf534('0x3'));var moment=require(_0xf534('0x4'));var BPromise=require(_0xf534('0x5'));var rp=require(_0xf534('0x6'));var fs=require('fs');var path=require(_0xf534('0x7'));var rimraf=require(_0xf534('0x8'));var config=require(_0xf534('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0xf534('0xa')]=function(_0x1469f9,_0x599575){return _0x1469f9[_0xf534('0xb')](_0xf534('0xc'),attributes,{'tableName':_0xf534('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf534('0xe'),'collate':_0xf534('0xf')});};
\ No newline at end of file
+var _0x0be6=['request-promise','rimraf','../../config/environment','exports','tools_canned_answers','utf8mb4','../../config/logger','api','moment'];(function(_0x342905,_0x2c44dd){var _0x4253dc=function(_0x4a61fc){while(--_0x4a61fc){_0x342905['push'](_0x342905['shift']());}};_0x4253dc(++_0x2c44dd);}(_0x0be6,0xa8));var _0x60be=function(_0x127311,_0x868b16){_0x127311=_0x127311-0x0;var _0x40b215=_0x0be6[_0x127311];return _0x40b215;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x60be('0x0'))(_0x60be('0x1'));var moment=require(_0x60be('0x2'));var BPromise=require('bluebird');var rp=require(_0x60be('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60be('0x4'));var config=require(_0x60be('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x60be('0x6')]=function(_0x3c717e,_0x1a53c9){return _0x3c717e['define']('CannedAnswer',attributes,{'tableName':_0x60be('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x60be('0x8'),'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 549ebc3..97223c9 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(_0x3089cf,_0x5d05f1){var _0x3a4fa5=function(_0x23b413){while(--_0x23b413){_0x3089cf['push'](_0x3089cf['shift']());}};_0x3a4fa5(++_0x5d05f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x4e34a1,_0x2ea388){var _0x39483d=function(_0x410f36){while(--_0x410f36){_0x4e34a1['push'](_0x4e34a1['shift']());}};_0x39483d(++_0x2ea388);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 9a61d03..f1c8f2c 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 _0x7205=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x7205,0x1c9));var _0x5720=function(_0x22300c,_0x7c2ef9){_0x22300c=_0x22300c-0x0;var _0x36c7ff=_0x7205[_0x22300c];return _0x36c7ff;};'use strict';var multer=require('multer');var util=require(_0x5720('0x0'));var path=require(_0x5720('0x1'));var timeout=require(_0x5720('0x2'));var express=require(_0x5720('0x3'));var router=express[_0x5720('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5720('0x5'));var interaction=require(_0x5720('0x6'));var config=require(_0x5720('0x7'));var controller=require(_0x5720('0x8'));router[_0x5720('0x9')]('/',auth[_0x5720('0xa')](),controller[_0x5720('0xb')]);router[_0x5720('0x9')](_0x5720('0xc'),auth[_0x5720('0xa')](),controller[_0x5720('0xd')]);router[_0x5720('0xe')]('/',auth['isAuthenticated'](),controller[_0x5720('0xf')]);router['put'](_0x5720('0xc'),auth[_0x5720('0xa')](),controller[_0x5720('0x10')]);router['delete'](_0x5720('0xc'),auth['isAuthenticated'](),controller[_0x5720('0x11')]);module[_0x5720('0x12')]=router;
\ No newline at end of file
+var _0x52ec=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ef05a,_0x48eafc){var _0x2e3898=function(_0x1e5bdb){while(--_0x1e5bdb){_0x3ef05a['push'](_0x3ef05a['shift']());}};_0x2e3898(++_0x48eafc);}(_0x52ec,0xe9));var _0xc52e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x52ec[_0x75f869];return _0x10af8b;};'use strict';var multer=require(_0xc52e('0x0'));var util=require('util');var path=require(_0xc52e('0x1'));var timeout=require(_0xc52e('0x2'));var express=require(_0xc52e('0x3'));var router=express[_0xc52e('0x4')]();var fs_extra=require(_0xc52e('0x5'));var auth=require(_0xc52e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc52e('0x7'));var controller=require('./cannedAnswer.controller');router[_0xc52e('0x8')]('/',auth[_0xc52e('0x9')](),controller[_0xc52e('0xa')]);router[_0xc52e('0x8')](_0xc52e('0xb'),auth[_0xc52e('0x9')](),controller[_0xc52e('0xc')]);router[_0xc52e('0xd')]('/',auth['isAuthenticated'](),controller[_0xc52e('0xe')]);router[_0xc52e('0xf')](_0xc52e('0xb'),auth[_0xc52e('0x9')](),controller[_0xc52e('0x10')]);router[_0xc52e('0x11')]('/:id',auth[_0xc52e('0x9')](),controller[_0xc52e('0x12')]);module[_0xc52e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index c9a9071..b1772a1 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 _0x5088=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x25f4a8,_0x3138bf){var _0x323777=function(_0x1101d8){while(--_0x1101d8){_0x25f4a8['push'](_0x25f4a8['shift']());}};_0x323777(++_0x3138bf);}(_0x5088,0xa9));var _0x8508=function(_0x54cda0,_0x3bf6e9){_0x54cda0=_0x54cda0-0x0;var _0x26f2c2=_0x5088[_0x54cda0];return _0x26f2c2;};'use strict';var Sequelize=require('sequelize');module[_0x8508('0x0')]={'calldate':{'type':Sequelize[_0x8508('0x1')],'allowNull':![],'defaultValue':_0x8508('0x2')},'clid':{'type':Sequelize[_0x8508('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8508('0x3')]},'dcontext':{'type':Sequelize[_0x8508('0x3')]},'channel':{'type':Sequelize[_0x8508('0x3')]},'dstchannel':{'type':Sequelize[_0x8508('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8508('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8508('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8508('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8508('0x3')]},'userfield':{'type':Sequelize[_0x8508('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x8508('0x3')]},'sequence':{'type':Sequelize[_0x8508('0x3')]},'peeraccount':{'type':Sequelize[_0x8508('0x3')]},'type':{'type':Sequelize[_0x8508('0x3')]},'tag':{'type':Sequelize[_0x8508('0x3')]}};
\ No newline at end of file
+var _0x7b37=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x2c6a0d,_0x28a135){var _0x4f9bde=function(_0x2e0f3d){while(--_0x2e0f3d){_0x2c6a0d['push'](_0x2c6a0d['shift']());}};_0x4f9bde(++_0x28a135);}(_0x7b37,0xd9));var _0x77b3=function(_0x48b6c6,_0xba4073){_0x48b6c6=_0x48b6c6-0x0;var _0x1bcc9a=_0x7b37[_0x48b6c6];return _0x1bcc9a;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x77b3('0x2')},'clid':{'type':Sequelize[_0x77b3('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x77b3('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x77b3('0x3')]},'dstchannel':{'type':Sequelize[_0x77b3('0x3')]},'lastapp':{'type':Sequelize[_0x77b3('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x77b3('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x77b3('0x3')]},'linkedid':{'type':Sequelize[_0x77b3('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x77b3('0x3')]},'type':{'type':Sequelize[_0x77b3('0x3')]},'tag':{'type':Sequelize[_0x77b3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 80e58e2..939e32b 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 _0x7fbe=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','body','catch','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','Cdr','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x4371a4,_0xa00fbb){var _0x427524=function(_0x3ab338){while(--_0x3ab338){_0x4371a4['push'](_0x4371a4['shift']());}};_0x427524(++_0xa00fbb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x7fbe[_0x3cea78];return _0x33b66b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['map'](_0x219554,_0xe7fb('0x32'));_0xd3fffe['query']=_[_0xe7fb('0x33')](_0x4fd290[_0xe7fb('0x34')]);_0xd3fffe[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0xd3fffe['model'],_0xd3fffe[_0xe7fb('0x34')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x36')](_0xd3fffe[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x4fd290['query'][_0xe7fb('0x39')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x38')];if(!_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3b')](_0xe7fb('0x3c'))){_0x251807['limit']=qs[_0xe7fb('0x20')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x20')]);_0x251807['offset']=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3e')]);_0x251807[_0xe7fb('0x3f')]=qs[_0xe7fb('0x35')](_[_0xe7fb('0x40')](_0x4fd290[_0xe7fb('0x34')],_0xd3fffe[_0xe7fb('0x35')]),_0x219554);if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x41')]){_0x251807[_0xe7fb('0x3f')]=_[_0xe7fb('0x42')](_0x251807[_0xe7fb('0x3f')],{'$or':_[_0xe7fb('0x2c')](_0x219554,function(_0x21e35c){if(_0x21e35c['type']!==_0xe7fb('0x43')){var _0x23f9f9={};_0x23f9f9[_0x21e35c[_0xe7fb('0x32')]]={'$like':'%'+_0x4fd290[_0xe7fb('0x34')]['filter']+'%'};return _0x23f9f9;}})});}_0x251807=_[_0xe7fb('0x42')]({},_0x251807,_0x4fd290[_0xe7fb('0x44')]);var _0xd472d={'where':_0x251807[_0xe7fb('0x3f')]};return db['Cdr'][_0xe7fb('0x21')](_0xd472d)[_0xe7fb('0x26')](function(_0x34265f){_0x5f265f[_0xe7fb('0x21')]=_0x34265f;if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x45')]){_0x251807['include']=[{'all':!![]}];}return db[_0xe7fb('0x2d')][_0xe7fb('0x46')](_0x251807);})[_0xe7fb('0x26')](function(_0x4b263d){_0x5f265f[_0xe7fb('0x47')]=_0x4b263d;return _0x5f265f;})[_0xe7fb('0x26')](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5a01ae,_0x5ed3d4){var _0x5e0153={'raw':!![],'where':{'id':_0x5a01ae[_0xe7fb('0x48')]['id']}},_0x900d67={};_0x900d67[_0xe7fb('0x38')]=_['keys'](db[_0xe7fb('0x2d')]['rawAttributes']);_0x900d67[_0xe7fb('0x34')]=_[_0xe7fb('0x33')](_0x5a01ae['query']);_0x900d67[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],_0x900d67[_0xe7fb('0x34')]);_0x5e0153['attributes']=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x5a01ae['query'][_0xe7fb('0x39')]));_0x5e0153[_0xe7fb('0x37')]=_0x5e0153[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x5e0153[_0xe7fb('0x37')]:_0x900d67['model'];if(_0x5a01ae[_0xe7fb('0x34')]['includeAll']){_0x5e0153[_0xe7fb('0x49')]=[{'all':!![]}];}_0x5e0153=_[_0xe7fb('0x42')]({},_0x5e0153,_0x5a01ae[_0xe7fb('0x44')]);return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')](_0x5e0153)['then'](handleEntityNotFound(_0x5ed3d4,null))[_0xe7fb('0x26')](respondWithResult(_0x5ed3d4,null))['catch'](handleError(_0x5ed3d4,null));};exports['create']=function(_0x12c828,_0x3d740f){return db[_0xe7fb('0x2d')]['create'](_0x12c828[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](respondWithResult(_0x3d740f,0xc9))['catch'](handleError(_0x3d740f,null));};exports['update']=function(_0x284bcb,_0x42270b){if(_0x284bcb[_0xe7fb('0x4b')]['id']){delete _0x284bcb[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')]({'where':{'id':_0x284bcb[_0xe7fb('0x48')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x42270b,null))['then'](saveUpdates(_0x284bcb[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x42270b,null))[_0xe7fb('0x4c')](handleError(_0x42270b,null));};exports[_0xe7fb('0x4d')]=function(_0x5cedfb,_0x25347b){return db['Cdr'][_0xe7fb('0x4a')]({'where':{'id':_0x5cedfb['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x25347b,null))['then'](removeEntity(_0x25347b,null))[_0xe7fb('0x4c')](handleError(_0x25347b,null));};exports['describe']=function(_0x1fff6c,_0x1b6442){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x1b6442,null))[_0xe7fb('0x4c')](handleError(_0x1b6442,null));};
\ No newline at end of file
+var _0x277c=['destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','Cdr','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then'];(function(_0x17467c,_0x6fc6e2){var _0x81fc45=function(_0x116413){while(--_0x116413){_0x17467c['push'](_0x17467c['shift']());}};_0x81fc45(++_0x6fc6e2);}(_0x277c,0x153));var _0xc277=function(_0x18f419,_0x5216d1){_0x18f419=_0x18f419-0x0;var _0x429f9e=_0x277c[_0x18f419];return _0x429f9e;};'use strict';var emlformat=require(_0xc277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc277('0x1'));var jsonpatch=require(_0xc277('0x2'));var rp=require(_0xc277('0x3'));var moment=require(_0xc277('0x4'));var BPromise=require(_0xc277('0x5'));var Mustache=require(_0xc277('0x6'));var util=require(_0xc277('0x7'));var path=require(_0xc277('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc277('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0xd'));var querystring=require(_0xc277('0xe'));var Papa=require(_0xc277('0xf'));var Redis=require(_0xc277('0x10'));var authService=require(_0xc277('0x11'));var qs=require(_0xc277('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc277('0x13'))(_0xc277('0x14'));var utils=require(_0xc277('0x15'));var config=require(_0xc277('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc277('0x17'))['db'];function respondWithStatusCode(_0x4a7700,_0xb6b933){_0xb6b933=_0xb6b933||0xcc;return function(_0x2bba87){if(_0x2bba87){return _0x4a7700[_0xc277('0x18')](_0xb6b933);}return _0x4a7700[_0xc277('0x19')](_0xb6b933)['end']();};}function respondWithResult(_0x222bc8,_0x182d35){_0x182d35=_0x182d35||0xc8;return function(_0x8895bd){if(_0x8895bd){return _0x222bc8['status'](_0x182d35)['json'](_0x8895bd);}};}function respondWithFilteredResult(_0x178e6d,_0x5c212c){return function(_0x46d20c){if(_0x46d20c){var _0x5d73f8=typeof _0x5c212c[_0xc277('0x1a')]===_0xc277('0x1b')&&typeof _0x5c212c[_0xc277('0x1c')]==='undefined';var _0x5cdb4b=_0x46d20c[_0xc277('0x1d')];var _0x4d23a7=_0x5d73f8?0x0:_0x5c212c['offset'];var _0x1e1a9b=_0x5d73f8?_0x46d20c[_0xc277('0x1d')]:_0x5c212c[_0xc277('0x1a')]+_0x5c212c[_0xc277('0x1c')];var _0xe2b7c1;if(_0x1e1a9b>=_0x5cdb4b){_0x1e1a9b=_0x5cdb4b;_0xe2b7c1=0xc8;}else{_0xe2b7c1=0xce;}_0x178e6d[_0xc277('0x19')](_0xe2b7c1);return _0x178e6d[_0xc277('0x1e')]('Content-Range',_0x4d23a7+'-'+_0x1e1a9b+'/'+_0x5cdb4b)['json'](_0x46d20c);}return null;};}function patchUpdates(_0x697d6f){return function(_0x28900e){try{jsonpatch[_0xc277('0x1f')](_0x28900e,_0x697d6f,!![]);}catch(_0x28b7b1){return BPromise[_0xc277('0x20')](_0x28b7b1);}return _0x28900e[_0xc277('0x21')]();};}function saveUpdates(_0xb4685f,_0x42cb0b){return function(_0x1bc888){if(_0x1bc888){return _0x1bc888[_0xc277('0x22')](_0xb4685f)[_0xc277('0x23')](function(_0x57a198){return _0x57a198;});}return null;};}function removeEntity(_0x2b9936,_0x21af1b){return function(_0x54b2e1){if(_0x54b2e1){return _0x54b2e1[_0xc277('0x24')]()['then'](function(){_0x2b9936['status'](0xcc)[_0xc277('0x25')]();});}};}function handleEntityNotFound(_0x57b03,_0x1583b6){return function(_0x436784){if(!_0x436784){_0x57b03[_0xc277('0x18')](0x194);}return _0x436784;};}function handleError(_0x3aa598,_0x37b893){_0x37b893=_0x37b893||0x1f4;return function(_0x9ad1c5){logger[_0xc277('0x26')](_0x9ad1c5[_0xc277('0x27')]);if(_0x9ad1c5[_0xc277('0x28')]){delete _0x9ad1c5['name'];}_0x3aa598['status'](_0x37b893)[_0xc277('0x29')](_0x9ad1c5);};}exports[_0xc277('0x2a')]=function(_0x4ebb0f,_0x4efc1e){var _0x388717={},_0x3bc773={},_0x37e27b={'count':0x0,'rows':[]};var _0x21c78c=_[_0xc277('0x2b')](db['Cdr'][_0xc277('0x2c')],function(_0x5edf7e){return{'name':_0x5edf7e[_0xc277('0x2d')],'type':_0x5edf7e[_0xc277('0x2e')][_0xc277('0x2f')]};});_0x3bc773[_0xc277('0x30')]=_['map'](_0x21c78c,_0xc277('0x28'));_0x3bc773['query']=_[_0xc277('0x31')](_0x4ebb0f[_0xc277('0x32')]);_0x3bc773[_0xc277('0x33')]=_[_0xc277('0x34')](_0x3bc773['model'],_0x3bc773[_0xc277('0x32')]);_0x388717[_0xc277('0x35')]=_['intersection'](_0x3bc773[_0xc277('0x30')],qs['fields'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x36')]));_0x388717[_0xc277('0x35')]=_0x388717[_0xc277('0x35')][_0xc277('0x37')]?_0x388717[_0xc277('0x35')]:_0x3bc773[_0xc277('0x30')];if(!_0x4ebb0f[_0xc277('0x32')][_0xc277('0x38')](_0xc277('0x39'))){_0x388717[_0xc277('0x1c')]=qs['limit'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1c')]);_0x388717[_0xc277('0x1a')]=qs['offset'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1a')]);}_0x388717[_0xc277('0x3a')]=qs[_0xc277('0x3b')](_0x4ebb0f[_0xc277('0x32')]['sort']);_0x388717['where']=qs[_0xc277('0x33')](_['pick'](_0x4ebb0f[_0xc277('0x32')],_0x3bc773[_0xc277('0x33')]),_0x21c78c);if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]){_0x388717[_0xc277('0x3d')]=_[_0xc277('0x3e')](_0x388717[_0xc277('0x3d')],{'$or':_[_0xc277('0x2b')](_0x21c78c,function(_0x2e35b5){if(_0x2e35b5[_0xc277('0x2e')]!==_0xc277('0x3f')){var _0x4eaa6c={};_0x4eaa6c[_0x2e35b5[_0xc277('0x28')]]={'$like':'%'+_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]+'%'};return _0x4eaa6c;}})});}_0x388717=_['merge']({},_0x388717,_0x4ebb0f[_0xc277('0x40')]);var _0x278a92={'where':_0x388717['where']};return db['Cdr'][_0xc277('0x1d')](_0x278a92)[_0xc277('0x23')](function(_0x22c5b3){_0x37e27b[_0xc277('0x1d')]=_0x22c5b3;if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x41')]){_0x388717[_0xc277('0x42')]=[{'all':!![]}];}return db['Cdr'][_0xc277('0x43')](_0x388717);})[_0xc277('0x23')](function(_0x142ca6){_0x37e27b['rows']=_0x142ca6;return _0x37e27b;})['then'](respondWithFilteredResult(_0x4efc1e,_0x388717))['catch'](handleError(_0x4efc1e,null));};exports['show']=function(_0x519f14,_0x25723a){var _0x4a26e3={'raw':!![],'where':{'id':_0x519f14[_0xc277('0x44')]['id']}},_0x46fda3={};_0x46fda3[_0xc277('0x30')]=_['keys'](db[_0xc277('0x45')][_0xc277('0x2c')]);_0x46fda3[_0xc277('0x32')]=_[_0xc277('0x31')](_0x519f14['query']);_0x46fda3[_0xc277('0x33')]=_[_0xc277('0x34')](_0x46fda3['model'],_0x46fda3[_0xc277('0x32')]);_0x4a26e3[_0xc277('0x35')]=_[_0xc277('0x34')](_0x46fda3[_0xc277('0x30')],qs[_0xc277('0x36')](_0x519f14[_0xc277('0x32')][_0xc277('0x36')]));_0x4a26e3[_0xc277('0x35')]=_0x4a26e3[_0xc277('0x35')][_0xc277('0x37')]?_0x4a26e3[_0xc277('0x35')]:_0x46fda3['model'];if(_0x519f14[_0xc277('0x32')][_0xc277('0x41')]){_0x4a26e3[_0xc277('0x42')]=[{'all':!![]}];}_0x4a26e3=_[_0xc277('0x3e')]({},_0x4a26e3,_0x519f14['options']);return db[_0xc277('0x45')]['find'](_0x4a26e3)[_0xc277('0x23')](handleEntityNotFound(_0x25723a,null))[_0xc277('0x23')](respondWithResult(_0x25723a,null))[_0xc277('0x46')](handleError(_0x25723a,null));};exports[_0xc277('0x47')]=function(_0x4129bc,_0x57c759){return db[_0xc277('0x45')][_0xc277('0x47')](_0x4129bc[_0xc277('0x48')],{})[_0xc277('0x23')](respondWithResult(_0x57c759,0xc9))['catch'](handleError(_0x57c759,null));};exports[_0xc277('0x22')]=function(_0x9c910a,_0x150876){if(_0x9c910a['body']['id']){delete _0x9c910a[_0xc277('0x48')]['id'];}return db['Cdr'][_0xc277('0x49')]({'where':{'id':_0x9c910a[_0xc277('0x44')]['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x150876,null))[_0xc277('0x23')](saveUpdates(_0x9c910a[_0xc277('0x48')],null))[_0xc277('0x23')](respondWithResult(_0x150876,null))[_0xc277('0x46')](handleError(_0x150876,null));};exports[_0xc277('0x24')]=function(_0x8752f2,_0x25f5e1){return db[_0xc277('0x45')][_0xc277('0x49')]({'where':{'id':_0x8752f2['params']['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x25f5e1,null))['then'](removeEntity(_0x25f5e1,null))[_0xc277('0x46')](handleError(_0x25f5e1,null));};exports[_0xc277('0x4a')]=function(_0x1900ca,_0x33b032){return db[_0xc277('0x45')]['describe']()[_0xc277('0x23')](respondWithResult(_0x33b032,null))[_0xc277('0x46')](handleError(_0x33b032,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 61bfba6..cd40fb8 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(_0x36237a,_0x18df4a){var _0x40fb5c=function(_0x2dc153){while(--_0x2dc153){_0x36237a['push'](_0x36237a['shift']());}};_0x40fb5c(++_0x18df4a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x3978fa,_0x552b50){var _0x4386ff=function(_0x339007){while(--_0x339007){_0x3978fa['push'](_0x3978fa['shift']());}};_0x4386ff(++_0x552b50);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 00e7dbd..7b9cace 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 _0x9842=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x9842,0x163));var _0x2984=function(_0x3eeaea,_0x5079d5){_0x3eeaea=_0x3eeaea-0x0;var _0x537079=_0x9842[_0x3eeaea];return _0x537079;};'use strict';var _=require(_0x2984('0x0'));var util=require(_0x2984('0x1'));var moment=require(_0x2984('0x2'));var BPromise=require(_0x2984('0x3'));var rs=require(_0x2984('0x4'));var fs=require('fs');var Redis=require(_0x2984('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2984('0x6'));var logger=require(_0x2984('0x7'))(_0x2984('0x8'));var config=require('../../config/environment');var jayson=require(_0x2984('0x9'));var client=jayson[_0x2984('0xa')][_0x2984('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5850bf,_0x33cae7,_0x6fe7a6){return new BPromise(function(_0x148d40,_0x4b9dc0){return client['request'](_0x5850bf,_0x6fe7a6)['then'](function(_0x5e428f){logger['info'](_0x2984('0xc'),_0x33cae7,'request\x20sent');logger[_0x2984('0xd')](_0x2984('0xe'),_0x33cae7,_0x2984('0xf'),JSON[_0x2984('0x10')](_0x5e428f));if(_0x5e428f[_0x2984('0x11')]){if(_0x5e428f[_0x2984('0x11')]['code']===0x1f4){logger[_0x2984('0x11')]('Cdr,\x20%s,\x20%s',_0x33cae7,_0x5e428f[_0x2984('0x11')][_0x2984('0x12')]);return _0x4b9dc0(_0x5e428f[_0x2984('0x11')]['message']);}logger['error'](_0x2984('0xc'),_0x33cae7,_0x5e428f[_0x2984('0x11')]['message']);return _0x148d40(_0x5e428f[_0x2984('0x11')][_0x2984('0x12')]);}else{logger[_0x2984('0x13')](_0x2984('0xc'),_0x33cae7,'request\x20sent');_0x148d40(_0x5e428f[_0x2984('0x14')][_0x2984('0x12')]);}})[_0x2984('0x15')](function(_0x4c8c3b){logger[_0x2984('0x11')]('Cdr,\x20%s,\x20%s',_0x33cae7,_0x4c8c3b);_0x4b9dc0(_0x4c8c3b);});});}
\ No newline at end of file
+var _0xd22b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1c95e6,_0x12e0b7){var _0x1aa60b=function(_0x2be010){while(--_0x2be010){_0x1c95e6['push'](_0x1c95e6['shift']());}};_0x1aa60b(++_0x12e0b7);}(_0xd22b,0x18a));var _0xbd22=function(_0x285169,_0x8517d7){_0x285169=_0x285169-0x0;var _0x329194=_0xd22b[_0x285169];return _0x329194;};'use strict';var _=require(_0xbd22('0x0'));var util=require(_0xbd22('0x1'));var moment=require(_0xbd22('0x2'));var BPromise=require(_0xbd22('0x3'));var rs=require(_0xbd22('0x4'));var fs=require('fs');var Redis=require(_0xbd22('0x5'));var db=require(_0xbd22('0x6'))['db'];var utils=require(_0xbd22('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbd22('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d5e4f,_0x6c1fdb,_0x364773){return new BPromise(function(_0x3fe104,_0x23eb3e){return client[_0xbd22('0xa')](_0x3d5e4f,_0x364773)['then'](function(_0x1a2eda){logger[_0xbd22('0xb')](_0xbd22('0xc'),_0x6c1fdb,_0xbd22('0xd'));logger[_0xbd22('0xe')](_0xbd22('0xf'),_0x6c1fdb,_0xbd22('0xd'),JSON[_0xbd22('0x10')](_0x1a2eda));if(_0x1a2eda['error']){if(_0x1a2eda[_0xbd22('0x11')][_0xbd22('0x12')]===0x1f4){logger[_0xbd22('0x11')](_0xbd22('0xc'),_0x6c1fdb,_0x1a2eda[_0xbd22('0x11')][_0xbd22('0x13')]);return _0x23eb3e(_0x1a2eda[_0xbd22('0x11')][_0xbd22('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x6c1fdb,_0x1a2eda[_0xbd22('0x11')]['message']);return _0x3fe104(_0x1a2eda[_0xbd22('0x11')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x6c1fdb,_0xbd22('0xd'));_0x3fe104(_0x1a2eda[_0xbd22('0x14')][_0xbd22('0x13')]);}})[_0xbd22('0x15')](function(_0x34305c){logger[_0xbd22('0x11')](_0xbd22('0xc'),_0x6c1fdb,_0x34305c);_0x23eb3e(_0x34305c);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 964ce53..ee3ec23 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3766f4,_0x580673){var _0x183f88=function(_0x4be9ac){while(--_0x4be9ac){_0x3766f4['push'](_0x3766f4['shift']());}};_0x183f88(++_0x580673);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x11a3bb,_0x5c5466){var _0x3c3e36=function(_0x59f16f){while(--_0x59f16f){_0x11a3bb['push'](_0x11a3bb['shift']());}};_0x3c3e36(++_0x5c5466);}(_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 3789b1b..0fda69a 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 _0x06e3=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x37ad7e,_0x325e74){var _0x928086=function(_0x4e54da){while(--_0x4e54da){_0x37ad7e['push'](_0x37ad7e['shift']());}};_0x928086(++_0x325e74);}(_0x06e3,0x1b3));var _0x306e=function(_0x47732c,_0x5955e3){_0x47732c=_0x47732c-0x0;var _0x55b2d2=_0x06e3[_0x47732c];return _0x55b2d2;};'use strict';var Sequelize=require('sequelize');module[_0x306e('0x0')]={'priority':{'type':Sequelize[_0x306e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x306e('0x2')],'allowNull':![],'defaultValue':_0x306e('0x3')},'appdata':{'type':Sequelize[_0x306e('0x4')]()},'description':{'type':Sequelize[_0x306e('0x2')]},'interval':{'type':Sequelize[_0x306e('0x2')],'defaultValue':_0x306e('0x5')}};
\ No newline at end of file
+var _0xe0bf=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0xe0bf,0x75));var _0xfe0b=function(_0x2afeb3,_0x43d94d){_0x2afeb3=_0x2afeb3-0x0;var _0x52216f=_0xe0bf[_0x2afeb3];return _0x52216f;};'use strict';var Sequelize=require(_0xfe0b('0x0'));module[_0xfe0b('0x1')]={'priority':{'type':Sequelize[_0xfe0b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfe0b('0x3')],'allowNull':![],'defaultValue':_0xfe0b('0x4')},'appdata':{'type':Sequelize[_0xfe0b('0x5')]()},'description':{'type':Sequelize[_0xfe0b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index a453080..31c782a 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 _0x8721=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','ChatApplication','catch','body','find','params','eml-format','rimraf','zip-dir','moment','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8721,0xd9));var _0x1872=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x8721[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0x1872('0x0'));var rimraf=require(_0x1872('0x1'));var zipdir=require(_0x1872('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1872('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1872('0x4'));var sox=require(_0x1872('0x5'));var csv=require(_0x1872('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1872('0x7'));var squel=require(_0x1872('0x8'));var crypto=require(_0x1872('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1872('0xa'));var toCsv=require(_0x1872('0x6'));var querystring=require(_0x1872('0xb'));var Papa=require(_0x1872('0xc'));var Redis=require(_0x1872('0xd'));var authService=require(_0x1872('0xe'));var qs=require(_0x1872('0xf'));var as=require(_0x1872('0x10'));var hardwareService=require(_0x1872('0x11'));var logger=require(_0x1872('0x12'))(_0x1872('0x13'));var utils=require('../../config/utils');var config=require(_0x1872('0x14'));var licenseUtil=require(_0x1872('0x15'));var db=require(_0x1872('0x16'))['db'];function respondWithStatusCode(_0x4345d0,_0x5122df){_0x5122df=_0x5122df||0xcc;return function(_0x412663){if(_0x412663){return _0x4345d0[_0x1872('0x17')](_0x5122df);}return _0x4345d0[_0x1872('0x18')](_0x5122df)[_0x1872('0x19')]();};}function respondWithResult(_0x4d943c,_0x4df475){_0x4df475=_0x4df475||0xc8;return function(_0xe47f69){if(_0xe47f69){return _0x4d943c[_0x1872('0x18')](_0x4df475)[_0x1872('0x1a')](_0xe47f69);}};}function respondWithFilteredResult(_0x40ee43,_0x1ffc89){return function(_0x5662e6){if(_0x5662e6){var _0x4be58a=typeof _0x1ffc89['offset']===_0x1872('0x1b')&&typeof _0x1ffc89[_0x1872('0x1c')]===_0x1872('0x1b');var _0x47f15f=_0x5662e6[_0x1872('0x1d')];var _0x487791=_0x4be58a?0x0:_0x1ffc89[_0x1872('0x1e')];var _0x34899d=_0x4be58a?_0x5662e6[_0x1872('0x1d')]:_0x1ffc89['offset']+_0x1ffc89[_0x1872('0x1c')];var _0x5a0483;if(_0x34899d>=_0x47f15f){_0x34899d=_0x47f15f;_0x5a0483=0xc8;}else{_0x5a0483=0xce;}_0x40ee43[_0x1872('0x18')](_0x5a0483);return _0x40ee43[_0x1872('0x1f')](_0x1872('0x20'),_0x487791+'-'+_0x34899d+'/'+_0x47f15f)[_0x1872('0x1a')](_0x5662e6);}return null;};}function patchUpdates(_0x15dbbc){return function(_0x506a44){try{jsonpatch[_0x1872('0x21')](_0x506a44,_0x15dbbc,!![]);}catch(_0x18ff91){return BPromise[_0x1872('0x22')](_0x18ff91);}return _0x506a44[_0x1872('0x23')]();};}function saveUpdates(_0xcc4221,_0x3142f8){return function(_0x1fc33f){if(_0x1fc33f){return _0x1fc33f[_0x1872('0x24')](_0xcc4221)[_0x1872('0x25')](function(_0x4908bf){return _0x4908bf;});}return null;};}function removeEntity(_0x54e059,_0x5f29f5){return function(_0x42e0e4){if(_0x42e0e4){return _0x42e0e4[_0x1872('0x26')]()[_0x1872('0x25')](function(){_0x54e059[_0x1872('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x323592,_0x2ac6b8){return function(_0x126ab4){if(!_0x126ab4){_0x323592['sendStatus'](0x194);}return _0x126ab4;};}function handleError(_0x42baba,_0x576efa){_0x576efa=_0x576efa||0x1f4;return function(_0x43e178){logger[_0x1872('0x27')](_0x43e178[_0x1872('0x28')]);if(_0x43e178['name']){delete _0x43e178[_0x1872('0x29')];}_0x42baba[_0x1872('0x18')](_0x576efa)['send'](_0x43e178);};}exports['show']=function(_0x33448e,_0x5bab21){var _0x5469e7={'raw':!![],'where':{'id':_0x33448e['params']['id']}},_0x333961={};_0x333961[_0x1872('0x2a')]=_[_0x1872('0x2b')](db['ChatApplication'][_0x1872('0x2c')]);_0x333961[_0x1872('0x2d')]=_[_0x1872('0x2b')](_0x33448e['query']);_0x333961[_0x1872('0x2e')]=_[_0x1872('0x2f')](_0x333961[_0x1872('0x2a')],_0x333961[_0x1872('0x2d')]);_0x5469e7[_0x1872('0x30')]=_['intersection'](_0x333961[_0x1872('0x2a')],qs[_0x1872('0x31')](_0x33448e[_0x1872('0x2d')][_0x1872('0x31')]));_0x5469e7[_0x1872('0x30')]=_0x5469e7[_0x1872('0x30')]['length']?_0x5469e7[_0x1872('0x30')]:_0x333961[_0x1872('0x2a')];if(_0x33448e[_0x1872('0x2d')][_0x1872('0x32')]){_0x5469e7[_0x1872('0x33')]=[{'all':!![]}];}_0x5469e7=_[_0x1872('0x34')]({},_0x5469e7,_0x33448e[_0x1872('0x35')]);return db[_0x1872('0x36')]['find'](_0x5469e7)['then'](handleEntityNotFound(_0x5bab21,null))[_0x1872('0x25')](respondWithResult(_0x5bab21,null))[_0x1872('0x37')](handleError(_0x5bab21,null));};exports[_0x1872('0x24')]=function(_0x13e46f,_0x12cb14){if(_0x13e46f[_0x1872('0x38')]['id']){delete _0x13e46f['body']['id'];}return db[_0x1872('0x36')][_0x1872('0x39')]({'where':{'id':_0x13e46f['params']['id']}})['then'](handleEntityNotFound(_0x12cb14,null))['then'](saveUpdates(_0x13e46f[_0x1872('0x38')],null))[_0x1872('0x25')](respondWithResult(_0x12cb14,null))[_0x1872('0x37')](handleError(_0x12cb14,null));};exports['destroy']=function(_0x27e5df,_0x111f47){return db[_0x1872('0x36')][_0x1872('0x39')]({'where':{'id':_0x27e5df[_0x1872('0x3a')]['id']}})[_0x1872('0x25')](handleEntityNotFound(_0x111f47,null))['then'](removeEntity(_0x111f47,null))[_0x1872('0x37')](handleError(_0x111f47,null));};
\ No newline at end of file
+var _0xe3d4=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','destroy','error','name','show','params','ChatApplication','rawAttributes','query','filters','attributes','model','fields','length','includeAll','merge','options','find','then','catch','update','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x20ef84,_0x737ae0){var _0x1811f3=function(_0x4739f4){while(--_0x4739f4){_0x20ef84['push'](_0x20ef84['shift']());}};_0x1811f3(++_0x737ae0);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0xe3d4[_0x1558ab];return _0x53b64a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e3d('0x0'));var zipdir=require(_0x4e3d('0x1'));var jsonpatch=require(_0x4e3d('0x2'));var rp=require('request-promise');var moment=require(_0x4e3d('0x3'));var BPromise=require(_0x4e3d('0x4'));var Mustache=require('mustache');var util=require(_0x4e3d('0x5'));var path=require('path');var sox=require(_0x4e3d('0x6'));var csv=require(_0x4e3d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e3d('0x8'));var _=require(_0x4e3d('0x9'));var squel=require('squel');var crypto=require(_0x4e3d('0xa'));var jsforce=require(_0x4e3d('0xb'));var deskjs=require(_0x4e3d('0xc'));var toCsv=require(_0x4e3d('0x7'));var querystring=require(_0x4e3d('0xd'));var Papa=require(_0x4e3d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e3d('0xf'));var as=require(_0x4e3d('0x10'));var hardwareService=require(_0x4e3d('0x11'));var logger=require(_0x4e3d('0x12'))(_0x4e3d('0x13'));var utils=require(_0x4e3d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4e3d('0x15'));var db=require(_0x4e3d('0x16'))['db'];function respondWithStatusCode(_0x2fc5f6,_0x30b359){_0x30b359=_0x30b359||0xcc;return function(_0x3556ec){if(_0x3556ec){return _0x2fc5f6[_0x4e3d('0x17')](_0x30b359);}return _0x2fc5f6[_0x4e3d('0x18')](_0x30b359)[_0x4e3d('0x19')]();};}function respondWithResult(_0x54debc,_0x44022b){_0x44022b=_0x44022b||0xc8;return function(_0x4325b4){if(_0x4325b4){return _0x54debc[_0x4e3d('0x18')](_0x44022b)['json'](_0x4325b4);}};}function respondWithFilteredResult(_0x3708be,_0x438973){return function(_0x46bf2b){if(_0x46bf2b){var _0xc20768=typeof _0x438973[_0x4e3d('0x1a')]===_0x4e3d('0x1b')&&typeof _0x438973[_0x4e3d('0x1c')]===_0x4e3d('0x1b');var _0x554ba6=_0x46bf2b[_0x4e3d('0x1d')];var _0x5129d5=_0xc20768?0x0:_0x438973['offset'];var _0x19010b=_0xc20768?_0x46bf2b['count']:_0x438973['offset']+_0x438973[_0x4e3d('0x1c')];var _0x2e37ad;if(_0x19010b>=_0x554ba6){_0x19010b=_0x554ba6;_0x2e37ad=0xc8;}else{_0x2e37ad=0xce;}_0x3708be[_0x4e3d('0x18')](_0x2e37ad);return _0x3708be[_0x4e3d('0x1e')]('Content-Range',_0x5129d5+'-'+_0x19010b+'/'+_0x554ba6)[_0x4e3d('0x1f')](_0x46bf2b);}return null;};}function patchUpdates(_0x552ca7){return function(_0x20c533){try{jsonpatch['apply'](_0x20c533,_0x552ca7,!![]);}catch(_0x170f88){return BPromise[_0x4e3d('0x20')](_0x170f88);}return _0x20c533[_0x4e3d('0x21')]();};}function saveUpdates(_0x534185,_0x224c05){return function(_0x2c8186){if(_0x2c8186){return _0x2c8186['update'](_0x534185)['then'](function(_0x18271a){return _0x18271a;});}return null;};}function removeEntity(_0x7a0b3c,_0x35a31b){return function(_0x49301f){if(_0x49301f){return _0x49301f[_0x4e3d('0x22')]()['then'](function(){_0x7a0b3c[_0x4e3d('0x18')](0xcc)[_0x4e3d('0x19')]();});}};}function handleEntityNotFound(_0x43bc1b,_0x50d9db){return function(_0x2434ea){if(!_0x2434ea){_0x43bc1b[_0x4e3d('0x17')](0x194);}return _0x2434ea;};}function handleError(_0x5b1a18,_0x192cb4){_0x192cb4=_0x192cb4||0x1f4;return function(_0x21d7e4){logger[_0x4e3d('0x23')](_0x21d7e4['stack']);if(_0x21d7e4[_0x4e3d('0x24')]){delete _0x21d7e4['name'];}_0x5b1a18[_0x4e3d('0x18')](_0x192cb4)['send'](_0x21d7e4);};}exports[_0x4e3d('0x25')]=function(_0x2d1991,_0x17c0f4){var _0x4dfc6b={'raw':!![],'where':{'id':_0x2d1991[_0x4e3d('0x26')]['id']}},_0x2c5935={};_0x2c5935['model']=_['keys'](db[_0x4e3d('0x27')][_0x4e3d('0x28')]);_0x2c5935[_0x4e3d('0x29')]=_['keys'](_0x2d1991[_0x4e3d('0x29')]);_0x2c5935[_0x4e3d('0x2a')]=_['intersection'](_0x2c5935['model'],_0x2c5935[_0x4e3d('0x29')]);_0x4dfc6b[_0x4e3d('0x2b')]=_['intersection'](_0x2c5935[_0x4e3d('0x2c')],qs['fields'](_0x2d1991[_0x4e3d('0x29')][_0x4e3d('0x2d')]));_0x4dfc6b['attributes']=_0x4dfc6b[_0x4e3d('0x2b')][_0x4e3d('0x2e')]?_0x4dfc6b[_0x4e3d('0x2b')]:_0x2c5935['model'];if(_0x2d1991[_0x4e3d('0x29')][_0x4e3d('0x2f')]){_0x4dfc6b['include']=[{'all':!![]}];}_0x4dfc6b=_[_0x4e3d('0x30')]({},_0x4dfc6b,_0x2d1991[_0x4e3d('0x31')]);return db['ChatApplication'][_0x4e3d('0x32')](_0x4dfc6b)[_0x4e3d('0x33')](handleEntityNotFound(_0x17c0f4,null))[_0x4e3d('0x33')](respondWithResult(_0x17c0f4,null))[_0x4e3d('0x34')](handleError(_0x17c0f4,null));};exports[_0x4e3d('0x35')]=function(_0x24830d,_0x131c1d){if(_0x24830d[_0x4e3d('0x36')]['id']){delete _0x24830d[_0x4e3d('0x36')]['id'];}return db[_0x4e3d('0x27')][_0x4e3d('0x32')]({'where':{'id':_0x24830d['params']['id']}})[_0x4e3d('0x33')](handleEntityNotFound(_0x131c1d,null))[_0x4e3d('0x33')](saveUpdates(_0x24830d[_0x4e3d('0x36')],null))[_0x4e3d('0x33')](respondWithResult(_0x131c1d,null))[_0x4e3d('0x34')](handleError(_0x131c1d,null));};exports[_0x4e3d('0x22')]=function(_0x4dc1f4,_0x24232c){return db[_0x4e3d('0x27')][_0x4e3d('0x32')]({'where':{'id':_0x4dc1f4[_0x4e3d('0x26')]['id']}})[_0x4e3d('0x33')](handleEntityNotFound(_0x24232c,null))[_0x4e3d('0x33')](removeEntity(_0x24232c,null))[_0x4e3d('0x34')](handleError(_0x24232c,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index bd8572c..6301905 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 _0x4d22=['lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x451b84,_0x8d39f8){var _0x1d3a9d=function(_0x32cfd5){while(--_0x32cfd5){_0x451b84['push'](_0x451b84['shift']());}};_0x1d3a9d(++_0x8d39f8);}(_0x4d22,0x1ef));var _0x24d2=function(_0x49c54c,_0x54a647){_0x49c54c=_0x49c54c-0x0;var _0x446225=_0x4d22[_0x49c54c];return _0x446225;};'use strict';var _=require(_0x24d2('0x0'));var util=require('util');var logger=require(_0x24d2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x24d2('0x2'));var rp=require(_0x24d2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24d2('0x4'));var config=require(_0x24d2('0x5'));var attributes=require(_0x24d2('0x6'));module[_0x24d2('0x7')]=function(_0x5892f6,_0x483801){return _0x5892f6['define'](_0x24d2('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24d2('0x9'),'collate':_0x24d2('0xa')});};
\ No newline at end of file
+var _0xf50a=['util','api','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x2dd2e1,_0x1cc9cc){var _0xdfa1f4=function(_0x348df1){while(--_0x348df1){_0x2dd2e1['push'](_0x2dd2e1['shift']());}};_0xdfa1f4(++_0x1cc9cc);}(_0xf50a,0x1b8));var _0xaf50=function(_0x4dd71c,_0x23a24e){_0x4dd71c=_0x4dd71c-0x0;var _0x8e4e36=_0xf50a[_0x4dd71c];return _0x8e4e36;};'use strict';var _=require('lodash');var util=require(_0xaf50('0x0'));var logger=require('../../config/logger')(_0xaf50('0x1'));var moment=require('moment');var BPromise=require(_0xaf50('0x2'));var rp=require(_0xaf50('0x3'));var fs=require('fs');var path=require(_0xaf50('0x4'));var rimraf=require('rimraf');var config=require(_0xaf50('0x5'));var attributes=require(_0xaf50('0x6'));module['exports']=function(_0x6b142f,_0x55abcd){return _0x6b142f[_0xaf50('0x7')](_0xaf50('0x8'),attributes,{'tableName':_0xaf50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf50('0xa'),'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 3a5100f..4e8329d 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 _0xe4d6=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4d76f0,_0x47160f){var _0x3ed573=function(_0x5d3a5f){while(--_0x5d3a5f){_0x4d76f0['push'](_0x4d76f0['shift']());}};_0x3ed573(++_0x47160f);}(_0xe4d6,0xec));var _0x6e4d=function(_0x5378fd,_0x2500d3){_0x5378fd=_0x5378fd-0x0;var _0x3c3a3b=_0xe4d6[_0x5378fd];return _0x3c3a3b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e4d('0x0'));var BPromise=require('bluebird');var rs=require(_0x6e4d('0x1'));var fs=require('fs');var Redis=require(_0x6e4d('0x2'));var db=require(_0x6e4d('0x3'))['db'];var utils=require(_0x6e4d('0x4'));var logger=require(_0x6e4d('0x5'))(_0x6e4d('0x6'));var config=require(_0x6e4d('0x7'));var jayson=require(_0x6e4d('0x8'));var client=jayson[_0x6e4d('0x9')][_0x6e4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3774c4,_0xe4fb38,_0x3b41aa){return new BPromise(function(_0x4af36d,_0x158f9c){return client[_0x6e4d('0xb')](_0x3774c4,_0x3b41aa)[_0x6e4d('0xc')](function(_0x154ca1){logger[_0x6e4d('0xd')](_0x6e4d('0xe'),_0xe4fb38,_0x6e4d('0xf'));logger['debug'](_0x6e4d('0x10'),_0xe4fb38,'request\x20sent',JSON['stringify'](_0x154ca1));if(_0x154ca1[_0x6e4d('0x11')]){if(_0x154ca1[_0x6e4d('0x11')][_0x6e4d('0x12')]===0x1f4){logger[_0x6e4d('0x11')](_0x6e4d('0xe'),_0xe4fb38,_0x154ca1[_0x6e4d('0x11')][_0x6e4d('0x13')]);return _0x158f9c(_0x154ca1[_0x6e4d('0x11')]['message']);}logger[_0x6e4d('0x11')]('ChatApplication,\x20%s,\x20%s',_0xe4fb38,_0x154ca1[_0x6e4d('0x11')]['message']);return _0x4af36d(_0x154ca1['error'][_0x6e4d('0x13')]);}else{logger[_0x6e4d('0xd')](_0x6e4d('0xe'),_0xe4fb38,_0x6e4d('0xf'));_0x4af36d(_0x154ca1[_0x6e4d('0x14')]['message']);}})[_0x6e4d('0x15')](function(_0x3ae304){logger[_0x6e4d('0x11')](_0x6e4d('0xe'),_0xe4fb38,_0x3ae304);_0x158f9c(_0x3ae304);});});}
\ No newline at end of file
+var _0x3c52=['ChatApplication,\x20%s,\x20%s','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0xe0a009,_0x1a43e9){var _0x246686=function(_0x30ed94){while(--_0x30ed94){_0xe0a009['push'](_0xe0a009['shift']());}};_0x246686(++_0x1a43e9);}(_0x3c52,0xeb));var _0x23c5=function(_0x298f74,_0x4ece46){_0x298f74=_0x298f74-0x0;var _0x22301b=_0x3c52[_0x298f74];return _0x22301b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x23c5('0x0'));var BPromise=require('bluebird');var rs=require(_0x23c5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23c5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c5('0x3'))(_0x23c5('0x4'));var config=require(_0x23c5('0x5'));var jayson=require(_0x23c5('0x6'));var client=jayson[_0x23c5('0x7')][_0x23c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b784e,_0x428e7b,_0x2cf541){return new BPromise(function(_0x307395,_0x1f120c){return client[_0x23c5('0x9')](_0x4b784e,_0x2cf541)[_0x23c5('0xa')](function(_0x3196e8){logger['info']('ChatApplication,\x20%s,\x20%s',_0x428e7b,'request\x20sent');logger[_0x23c5('0xb')](_0x23c5('0xc'),_0x428e7b,_0x23c5('0xd'),JSON[_0x23c5('0xe')](_0x3196e8));if(_0x3196e8[_0x23c5('0xf')]){if(_0x3196e8[_0x23c5('0xf')]['code']===0x1f4){logger[_0x23c5('0xf')]('ChatApplication,\x20%s,\x20%s',_0x428e7b,_0x3196e8[_0x23c5('0xf')][_0x23c5('0x10')]);return _0x1f120c(_0x3196e8[_0x23c5('0xf')][_0x23c5('0x10')]);}logger[_0x23c5('0xf')](_0x23c5('0x11'),_0x428e7b,_0x3196e8[_0x23c5('0xf')]['message']);return _0x307395(_0x3196e8[_0x23c5('0xf')][_0x23c5('0x10')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x428e7b,_0x23c5('0xd'));_0x307395(_0x3196e8['result'][_0x23c5('0x10')]);}})['catch'](function(_0x3e573a){logger[_0x23c5('0xf')]('ChatApplication,\x20%s,\x20%s',_0x428e7b,_0x3e573a);_0x1f120c(_0x3e573a);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 9d4803f..aad5e65 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 _0x1763=['destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','put'];(function(_0x5360bf,_0x4be2f9){var _0x359907=function(_0x5a2847){while(--_0x5a2847){_0x5360bf['push'](_0x5360bf['shift']());}};_0x359907(++_0x4be2f9);}(_0x1763,0x116));var _0x3176=function(_0x24dfb7,_0x2bf1bf){_0x24dfb7=_0x24dfb7-0x0;var _0x525851=_0x1763[_0x24dfb7];return _0x525851;};'use strict';var multer=require(_0x3176('0x0'));var util=require('util');var path=require(_0x3176('0x1'));var timeout=require('connect-timeout');var express=require(_0x3176('0x2'));var router=express[_0x3176('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3176('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3176('0x5'));var controller=require('./chatApplication.controller');router[_0x3176('0x6')](_0x3176('0x7'),auth[_0x3176('0x8')](),controller['show']);router[_0x3176('0x9')]('/:id',auth[_0x3176('0x8')](),controller['update']);router['delete'](_0x3176('0x7'),auth[_0x3176('0x8')](),controller[_0x3176('0xa')]);module[_0x3176('0xb')]=router;
\ No newline at end of file
+var _0x0964=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','put','/:id','update'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x0964,0xf1));var _0x4096=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x0964[_0x44946b];return _0x249bc4;};'use strict';var multer=require(_0x4096('0x0'));var util=require(_0x4096('0x1'));var path=require(_0x4096('0x2'));var timeout=require(_0x4096('0x3'));var express=require(_0x4096('0x4'));var router=express[_0x4096('0x5')]();var fs_extra=require(_0x4096('0x6'));var auth=require(_0x4096('0x7'));var interaction=require(_0x4096('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x4096('0x9')]('/:id',auth[_0x4096('0xa')](),controller['show']);router[_0x4096('0xb')](_0x4096('0xc'),auth[_0x4096('0xa')](),controller[_0x4096('0xd')]);router[_0x4096('0xe')]('/:id',auth[_0x4096('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index e3fbc2e..1385d18 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 _0x9169=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9169,0xdd));var _0x9916=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x9169[_0x34232c];return _0x4d4f4e;};'use strict';var Sequelize=require(_0x9916('0x0'));module[_0x9916('0x1')]={'name':{'type':Sequelize[_0x9916('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9916('0x2')]},'write':{'type':Sequelize[_0x9916('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x647c=['exports','STRING','BOOLEAN'];(function(_0x2b5ec3,_0x528ef0){var _0x10b927=function(_0x133435){while(--_0x133435){_0x2b5ec3['push'](_0x2b5ec3['shift']());}};_0x10b927(++_0x528ef0);}(_0x647c,0x105));var _0xc647=function(_0x541a10,_0x53f603){_0x541a10=_0x541a10-0x0;var _0x45a4a6=_0x647c[_0x541a10];return _0x45a4a6;};'use strict';var Sequelize=require('sequelize');module[_0xc647('0x0')]={'name':{'type':Sequelize[_0xc647('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc647('0x1')]},'write':{'type':Sequelize[_0xc647('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 b38932b..bdd198f 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 _0x6b23=['findAll','rows','params','rawAttributes','includeAll','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','order','sort','pick','removeMembers','addMessage','ChatGroupId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','undefined','limit','offset','count','set','json','apply','save','update','then','error','name','send','index','ChatGroup','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','merge','VIRTUAL','filter','options','include'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x6b23,0x195));var _0x36b2=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x6b23[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require(_0x36b2('0x0'));var rimraf=require(_0x36b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36b2('0x2'));var rp=require('request-promise');var moment=require(_0x36b2('0x3'));var BPromise=require(_0x36b2('0x4'));var Mustache=require(_0x36b2('0x5'));var util=require(_0x36b2('0x6'));var path=require(_0x36b2('0x7'));var sox=require(_0x36b2('0x8'));var csv=require(_0x36b2('0x9'));var ejs=require(_0x36b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36b2('0xb'));var squel=require(_0x36b2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x36b2('0xd'));var toCsv=require(_0x36b2('0x9'));var querystring=require('querystring');var Papa=require(_0x36b2('0xe'));var Redis=require(_0x36b2('0xf'));var authService=require(_0x36b2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x36b2('0x11'));var hardwareService=require(_0x36b2('0x12'));var logger=require(_0x36b2('0x13'))(_0x36b2('0x14'));var utils=require('../../config/utils');var config=require(_0x36b2('0x15'));var licenseUtil=require(_0x36b2('0x16'));var db=require(_0x36b2('0x17'))['db'];config[_0x36b2('0x18')]=_[_0x36b2('0x19')](config[_0x36b2('0x18')],{'host':_0x36b2('0x1a'),'port':0x18eb});var socket=require(_0x36b2('0x1b'))(new Redis(config[_0x36b2('0x18')]));require(_0x36b2('0x1c'))['register'](socket);function respondWithStatusCode(_0x1bd6cf,_0x1c204e){_0x1c204e=_0x1c204e||0xcc;return function(_0x21785c){if(_0x21785c){return _0x1bd6cf[_0x36b2('0x1d')](_0x1c204e);}return _0x1bd6cf[_0x36b2('0x1e')](_0x1c204e)[_0x36b2('0x1f')]();};}function respondWithResult(_0x234087,_0xccd87b){_0xccd87b=_0xccd87b||0xc8;return function(_0xb162b3){if(_0xb162b3){return _0x234087[_0x36b2('0x1e')](_0xccd87b)['json'](_0xb162b3);}};}function respondWithFilteredResult(_0x2105e7,_0x476545){return function(_0x1e8580){if(_0x1e8580){var _0x83f591=typeof _0x476545['offset']===_0x36b2('0x20')&&typeof _0x476545[_0x36b2('0x21')]==='undefined';var _0x2292b6=_0x1e8580['count'];var _0x31924a=_0x83f591?0x0:_0x476545[_0x36b2('0x22')];var _0x497c99=_0x83f591?_0x1e8580[_0x36b2('0x23')]:_0x476545['offset']+_0x476545[_0x36b2('0x21')];var _0x1cab46;if(_0x497c99>=_0x2292b6){_0x497c99=_0x2292b6;_0x1cab46=0xc8;}else{_0x1cab46=0xce;}_0x2105e7[_0x36b2('0x1e')](_0x1cab46);return _0x2105e7[_0x36b2('0x24')]('Content-Range',_0x31924a+'-'+_0x497c99+'/'+_0x2292b6)[_0x36b2('0x25')](_0x1e8580);}return null;};}function patchUpdates(_0x55f49d){return function(_0x260e56){try{jsonpatch[_0x36b2('0x26')](_0x260e56,_0x55f49d,!![]);}catch(_0x3afe2e){return BPromise['reject'](_0x3afe2e);}return _0x260e56[_0x36b2('0x27')]();};}function saveUpdates(_0x261018,_0x35ad09){return function(_0x2af333){if(_0x2af333){return _0x2af333[_0x36b2('0x28')](_0x261018)['then'](function(_0x4b1491){return _0x4b1491;});}return null;};}function removeEntity(_0x5f004c,_0x4a6511){return function(_0xdd34bb){if(_0xdd34bb){return _0xdd34bb['destroy']()[_0x36b2('0x29')](function(){_0x5f004c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13d9c5,_0x12cc58){return function(_0x3ff94d){if(!_0x3ff94d){_0x13d9c5[_0x36b2('0x1d')](0x194);}return _0x3ff94d;};}function handleError(_0x2156bb,_0xb19040){_0xb19040=_0xb19040||0x1f4;return function(_0x322348){logger[_0x36b2('0x2a')](_0x322348['stack']);if(_0x322348[_0x36b2('0x2b')]){delete _0x322348[_0x36b2('0x2b')];}_0x2156bb[_0x36b2('0x1e')](_0xb19040)[_0x36b2('0x2c')](_0x322348);};}exports[_0x36b2('0x2d')]=function(_0x2ffb81,_0x520e21){var _0x24be26={},_0x24b27d={},_0x1405d6={'count':0x0,'rows':[]};var _0x159e58=_['map'](db[_0x36b2('0x2e')]['rawAttributes'],function(_0x3de383){return{'name':_0x3de383['fieldName'],'type':_0x3de383[_0x36b2('0x2f')]['key']};});_0x24b27d[_0x36b2('0x30')]=_[_0x36b2('0x31')](_0x159e58,_0x36b2('0x2b'));_0x24b27d['query']=_[_0x36b2('0x32')](_0x2ffb81[_0x36b2('0x33')]);_0x24b27d[_0x36b2('0x34')]=_[_0x36b2('0x35')](_0x24b27d[_0x36b2('0x30')],_0x24b27d[_0x36b2('0x33')]);_0x24be26[_0x36b2('0x36')]=_[_0x36b2('0x35')](_0x24b27d[_0x36b2('0x30')],qs[_0x36b2('0x37')](_0x2ffb81[_0x36b2('0x33')][_0x36b2('0x37')]));_0x24be26['attributes']=_0x24be26[_0x36b2('0x36')][_0x36b2('0x38')]?_0x24be26[_0x36b2('0x36')]:_0x24b27d[_0x36b2('0x30')];if(!_0x2ffb81[_0x36b2('0x33')][_0x36b2('0x39')](_0x36b2('0x3a'))){_0x24be26['limit']=qs['limit'](_0x2ffb81[_0x36b2('0x33')][_0x36b2('0x21')]);_0x24be26['offset']=qs[_0x36b2('0x22')](_0x2ffb81[_0x36b2('0x33')]['offset']);}_0x24be26['order']=qs['sort'](_0x2ffb81[_0x36b2('0x33')]['sort']);_0x24be26['where']=qs['filters'](_['pick'](_0x2ffb81[_0x36b2('0x33')],_0x24b27d[_0x36b2('0x34')]),_0x159e58);if(_0x2ffb81['query']['filter']){_0x24be26[_0x36b2('0x3b')]=_[_0x36b2('0x3c')](_0x24be26[_0x36b2('0x3b')],{'$or':_[_0x36b2('0x31')](_0x159e58,function(_0x431ba8){if(_0x431ba8[_0x36b2('0x2f')]!==_0x36b2('0x3d')){var _0x2f8841={};_0x2f8841[_0x431ba8['name']]={'$like':'%'+_0x2ffb81[_0x36b2('0x33')][_0x36b2('0x3e')]+'%'};return _0x2f8841;}})});}_0x24be26=_[_0x36b2('0x3c')]({},_0x24be26,_0x2ffb81[_0x36b2('0x3f')]);var _0x370376={'where':_0x24be26[_0x36b2('0x3b')]};return db[_0x36b2('0x2e')][_0x36b2('0x23')](_0x370376)[_0x36b2('0x29')](function(_0x49eeb0){_0x1405d6['count']=_0x49eeb0;if(_0x2ffb81[_0x36b2('0x33')]['includeAll']){_0x24be26[_0x36b2('0x40')]=[{'all':!![]}];}return db['ChatGroup'][_0x36b2('0x41')](_0x24be26);})[_0x36b2('0x29')](function(_0x227914){_0x1405d6[_0x36b2('0x42')]=_0x227914;return _0x1405d6;})[_0x36b2('0x29')](respondWithFilteredResult(_0x520e21,_0x24be26))['catch'](handleError(_0x520e21,null));};exports['show']=function(_0x29b7bd,_0x3ca730){var _0x2883dd={'raw':!![],'where':{'id':_0x29b7bd[_0x36b2('0x43')]['id']}},_0x1da3b1={};_0x1da3b1[_0x36b2('0x30')]=_[_0x36b2('0x32')](db[_0x36b2('0x2e')][_0x36b2('0x44')]);_0x1da3b1[_0x36b2('0x33')]=_['keys'](_0x29b7bd[_0x36b2('0x33')]);_0x1da3b1['filters']=_['intersection'](_0x1da3b1[_0x36b2('0x30')],_0x1da3b1[_0x36b2('0x33')]);_0x2883dd[_0x36b2('0x36')]=_[_0x36b2('0x35')](_0x1da3b1[_0x36b2('0x30')],qs['fields'](_0x29b7bd[_0x36b2('0x33')][_0x36b2('0x37')]));_0x2883dd[_0x36b2('0x36')]=_0x2883dd[_0x36b2('0x36')]['length']?_0x2883dd[_0x36b2('0x36')]:_0x1da3b1['model'];if(_0x29b7bd[_0x36b2('0x33')][_0x36b2('0x45')]){_0x2883dd[_0x36b2('0x40')]=[{'all':!![]}];}_0x2883dd=_[_0x36b2('0x3c')]({},_0x2883dd,_0x29b7bd[_0x36b2('0x3f')]);return db[_0x36b2('0x2e')][_0x36b2('0x46')](_0x2883dd)['then'](handleEntityNotFound(_0x3ca730,null))[_0x36b2('0x29')](respondWithResult(_0x3ca730,null))[_0x36b2('0x47')](handleError(_0x3ca730,null));};exports[_0x36b2('0x48')]=function(_0x947227,_0x40ac92){return db['ChatGroup'][_0x36b2('0x48')](_0x947227['body'],{})['then'](respondWithResult(_0x40ac92,0xc9))[_0x36b2('0x47')](handleError(_0x40ac92,null));};exports[_0x36b2('0x28')]=function(_0x1d973c,_0x9d8c33){if(_0x1d973c[_0x36b2('0x49')]['id']){delete _0x1d973c[_0x36b2('0x49')]['id'];}return db[_0x36b2('0x2e')]['find']({'where':{'id':_0x1d973c['params']['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x9d8c33,null))['then'](saveUpdates(_0x1d973c[_0x36b2('0x49')],null))[_0x36b2('0x29')](respondWithResult(_0x9d8c33,null))['catch'](handleError(_0x9d8c33,null));};exports['destroy']=function(_0x231aa9,_0x5c8dc1){return db[_0x36b2('0x2e')][_0x36b2('0x46')]({'where':{'id':_0x231aa9[_0x36b2('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c8dc1,null))[_0x36b2('0x29')](removeEntity(_0x5c8dc1,null))[_0x36b2('0x47')](handleError(_0x5c8dc1,null));};exports[_0x36b2('0x4a')]=function(_0x12619f,_0x185fe9){return db[_0x36b2('0x2e')][_0x36b2('0x4a')]()[_0x36b2('0x29')](respondWithResult(_0x185fe9,null))[_0x36b2('0x47')](handleError(_0x185fe9,null));};exports[_0x36b2('0x4b')]=function(_0x41493d,_0x18bed9,_0x3c07b2){return db[_0x36b2('0x4c')][_0x36b2('0x23')]({'where':{'ChatGroupId':_0x41493d[_0x36b2('0x43')]['id'],'ToId':_0x41493d[_0x36b2('0x4d')]['id'],'read':![]}})['then'](function(_0x4d4365){return{'id':_['toInteger'](_0x41493d['params']['id']),'count':_0x4d4365};})[_0x36b2('0x29')](respondWithResult(_0x18bed9,null))['catch'](handleError(_0x18bed9,null));};exports[_0x36b2('0x4e')]=function(_0x681067,_0x509b55,_0x32adde){return db[_0x36b2('0x2e')]['find']({'where':{'id':_0x681067[_0x36b2('0x43')]['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x509b55,null))[_0x36b2('0x29')](function(_0xed42d6){if(_0xed42d6){return _0xed42d6[_0x36b2('0x4e')](_0x681067['body'][_0x36b2('0x4f')],_[_0x36b2('0x50')](_0x681067[_0x36b2('0x49')],[_0x36b2('0x4f'),'id'])||{});}})[_0x36b2('0x29')](respondWithResult(_0x509b55,null))[_0x36b2('0x47')](handleError(_0x509b55,null));};exports[_0x36b2('0x51')]=function(_0x1d8cb8,_0x564551,_0x55984d){var _0x27fa3e={};var _0x1f76ff={};var _0x360e8a;var _0x91b1ab;return db[_0x36b2('0x2e')][_0x36b2('0x52')]({'where':{'id':_0x1d8cb8['params']['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x564551,null))[_0x36b2('0x29')](function(_0x540dc4){if(_0x540dc4){_0x360e8a=_0x540dc4;_0x1f76ff['model']=_['keys'](db[_0x36b2('0x53')][_0x36b2('0x44')]);_0x1f76ff['query']=_[_0x36b2('0x32')](_0x1d8cb8[_0x36b2('0x33')]);_0x1f76ff[_0x36b2('0x34')]=_[_0x36b2('0x35')](_0x1f76ff['model'],_0x1f76ff[_0x36b2('0x33')]);_0x27fa3e[_0x36b2('0x36')]=_[_0x36b2('0x35')](_0x1f76ff[_0x36b2('0x30')],qs['fields'](_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x37')]));_0x27fa3e[_0x36b2('0x36')]=_0x27fa3e['attributes'][_0x36b2('0x38')]?_0x27fa3e[_0x36b2('0x36')]:_0x1f76ff['model'];_0x27fa3e[_0x36b2('0x54')]=qs[_0x36b2('0x55')](_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x55')]);_0x27fa3e['where']=qs[_0x36b2('0x34')](_[_0x36b2('0x56')](_0x1d8cb8[_0x36b2('0x33')],_0x1f76ff[_0x36b2('0x34')]));if(_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x3e')]){_0x27fa3e[_0x36b2('0x3b')]=_['merge'](_0x27fa3e[_0x36b2('0x3b')],{'$or':_[_0x36b2('0x31')](_0x27fa3e[_0x36b2('0x36')],function(_0xa6a2f3){var _0x5c9d50={};_0x5c9d50[_0xa6a2f3]={'$like':'%'+_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x3e')]+'%'};return _0x5c9d50;})});}_0x27fa3e=_['merge']({},_0x27fa3e,_0x1d8cb8['options']);return _0x360e8a[_0x36b2('0x51')](_0x27fa3e);}})['then'](function(_0x2dd15f){if(_0x2dd15f){_0x91b1ab=_0x2dd15f[_0x36b2('0x38')];if(!_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x39')](_0x36b2('0x3a'))){_0x27fa3e[_0x36b2('0x21')]=qs[_0x36b2('0x21')](_0x1d8cb8['query'][_0x36b2('0x21')]);_0x27fa3e[_0x36b2('0x22')]=qs[_0x36b2('0x22')](_0x1d8cb8[_0x36b2('0x33')][_0x36b2('0x22')]);}return _0x360e8a[_0x36b2('0x51')](_0x27fa3e);}})[_0x36b2('0x29')](function(_0x1b6b39){if(_0x1b6b39){return _0x1b6b39?{'count':_0x91b1ab,'rows':_0x1b6b39}:null;}})['then'](respondWithResult(_0x564551,null))['catch'](handleError(_0x564551,null));};exports[_0x36b2('0x57')]=function(_0x2ee5bf,_0x17166a,_0x5b78a){return db['ChatGroup'][_0x36b2('0x46')]({'where':{'id':_0x2ee5bf[_0x36b2('0x43')]['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x17166a,null))[_0x36b2('0x29')](function(_0x422ebc){if(_0x422ebc){return _0x422ebc['removeMembers'](_0x2ee5bf[_0x36b2('0x33')][_0x36b2('0x4f')]);}})[_0x36b2('0x29')](respondWithStatusCode(_0x17166a,null))[_0x36b2('0x47')](handleError(_0x17166a,null));};exports[_0x36b2('0x58')]=function(_0x4acedc,_0x240d37,_0x4eacd3){if(_0x4acedc[_0x36b2('0x49')]['id']){delete _0x4acedc[_0x36b2('0x49')]['id'];}return db[_0x36b2('0x2e')][_0x36b2('0x46')]({'where':{'id':_0x4acedc[_0x36b2('0x43')]['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x240d37,null))['then'](function(_0x2939bd){if(_0x2939bd){_0x4acedc[_0x36b2('0x49')][_0x36b2('0x59')]=_0x2939bd['id'];return db[_0x36b2('0x4c')][_0x36b2('0x48')](_0x4acedc[_0x36b2('0x49')]);}})[_0x36b2('0x29')](respondWithResult(_0x240d37,null))[_0x36b2('0x47')](handleError(_0x240d37,null));};exports['getMessages']=function(_0x384bf,_0x66539a,_0x1be255){var _0x14a1f7={};var _0x7c48a={};var _0x237743;var _0x5e2eac;return db[_0x36b2('0x2e')]['findOne']({'where':{'id':_0x384bf[_0x36b2('0x43')]['id']}})[_0x36b2('0x29')](handleEntityNotFound(_0x66539a,null))[_0x36b2('0x29')](function(_0x4a37fd){if(_0x4a37fd){_0x237743=_0x4a37fd;_0x7c48a[_0x36b2('0x30')]=_[_0x36b2('0x32')](db[_0x36b2('0x4c')][_0x36b2('0x44')]);_0x7c48a[_0x36b2('0x33')]=_['keys'](_0x384bf[_0x36b2('0x33')]);_0x7c48a[_0x36b2('0x34')]=_[_0x36b2('0x35')](_0x7c48a['model'],_0x7c48a[_0x36b2('0x33')]);_0x14a1f7[_0x36b2('0x36')]=_[_0x36b2('0x35')](_0x7c48a['model'],qs[_0x36b2('0x37')](_0x384bf['query'][_0x36b2('0x37')]));_0x14a1f7['attributes']=_0x14a1f7[_0x36b2('0x36')]['length']?_0x14a1f7[_0x36b2('0x36')]:_0x7c48a[_0x36b2('0x30')];_0x14a1f7['order']=qs[_0x36b2('0x55')](_0x384bf['query'][_0x36b2('0x55')]);_0x14a1f7[_0x36b2('0x3b')]=qs[_0x36b2('0x34')](_[_0x36b2('0x56')](_0x384bf[_0x36b2('0x33')],_0x7c48a[_0x36b2('0x34')]));if(_0x384bf[_0x36b2('0x33')][_0x36b2('0x3e')]){_0x14a1f7[_0x36b2('0x3b')]=_['merge'](_0x14a1f7[_0x36b2('0x3b')],{'$or':_[_0x36b2('0x31')](_0x14a1f7[_0x36b2('0x36')],function(_0x38a95a){var _0x5a635f={};_0x5a635f[_0x38a95a]={'$like':'%'+_0x384bf[_0x36b2('0x33')]['filter']+'%'};return _0x5a635f;})});}if(_0x384bf['query'][_0x36b2('0x5a')]){var _0x328ab9=_0x384bf[_0x36b2('0x33')][_0x36b2('0x5a')][_0x36b2('0x5b')](',');var _0x3274d1={};_0x3274d1[_0x328ab9[0x0]]={'$gte':moment(_0x328ab9[0x1])['format'](_0x36b2('0x5c'))};_0x14a1f7['where']=_[_0x36b2('0x3c')](_0x14a1f7[_0x36b2('0x3b')],_0x3274d1);}_0x14a1f7=_[_0x36b2('0x3c')]({},_0x14a1f7,_0x384bf['options']);return _0x237743[_0x36b2('0x5d')](_0x14a1f7);}})['then'](function(_0x131ed5){if(_0x131ed5){_0x5e2eac=_0x131ed5[_0x36b2('0x38')];if(!_0x384bf[_0x36b2('0x33')][_0x36b2('0x39')]('nolimit')){_0x14a1f7['limit']=qs[_0x36b2('0x21')](_0x384bf[_0x36b2('0x33')][_0x36b2('0x21')]);_0x14a1f7[_0x36b2('0x22')]=qs[_0x36b2('0x22')](_0x384bf[_0x36b2('0x33')][_0x36b2('0x22')]);}return _0x237743[_0x36b2('0x5d')](_0x14a1f7);}})[_0x36b2('0x29')](function(_0x840470){if(_0x840470){return _0x840470?{'count':_0x5e2eac,'rows':_0x840470}:null;}})[_0x36b2('0x29')](respondWithResult(_0x66539a,null))[_0x36b2('0x47')](handleError(_0x66539a,null));};
\ No newline at end of file
+var _0xfa7f=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','ChatGroup','include','rows','show','params','rawAttributes','includeAll','find','create','body','describe','catch','getUnread','ChatInternalMessage','addMembers','ids','getMembers','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','model'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xfa7f,0xef));var _0xffa7=function(_0x3cec41,_0x2ef3c6){_0x3cec41=_0x3cec41-0x0;var _0x2bf49d=_0xfa7f[_0x3cec41];return _0x2bf49d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffa7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffa7('0x1'));var rp=require(_0xffa7('0x2'));var moment=require('moment');var BPromise=require(_0xffa7('0x3'));var Mustache=require(_0xffa7('0x4'));var util=require(_0xffa7('0x5'));var path=require(_0xffa7('0x6'));var sox=require('sox');var csv=require(_0xffa7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffa7('0x8'));var _=require(_0xffa7('0x9'));var squel=require(_0xffa7('0xa'));var crypto=require(_0xffa7('0xb'));var jsforce=require(_0xffa7('0xc'));var deskjs=require(_0xffa7('0xd'));var toCsv=require(_0xffa7('0x7'));var querystring=require(_0xffa7('0xe'));var Papa=require('papaparse');var Redis=require(_0xffa7('0xf'));var authService=require(_0xffa7('0x10'));var qs=require(_0xffa7('0x11'));var as=require(_0xffa7('0x12'));var hardwareService=require(_0xffa7('0x13'));var logger=require(_0xffa7('0x14'))(_0xffa7('0x15'));var utils=require(_0xffa7('0x16'));var config=require(_0xffa7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xffa7('0x18'))['db'];config[_0xffa7('0x19')]=_[_0xffa7('0x1a')](config[_0xffa7('0x19')],{'host':_0xffa7('0x1b'),'port':0x18eb});var socket=require(_0xffa7('0x1c'))(new Redis(config[_0xffa7('0x19')]));require(_0xffa7('0x1d'))[_0xffa7('0x1e')](socket);function respondWithStatusCode(_0x45b312,_0x2bf1de){_0x2bf1de=_0x2bf1de||0xcc;return function(_0x5e2aa4){if(_0x5e2aa4){return _0x45b312['sendStatus'](_0x2bf1de);}return _0x45b312[_0xffa7('0x1f')](_0x2bf1de)[_0xffa7('0x20')]();};}function respondWithResult(_0x2bda7a,_0x4323e6){_0x4323e6=_0x4323e6||0xc8;return function(_0x13586d){if(_0x13586d){return _0x2bda7a[_0xffa7('0x1f')](_0x4323e6)['json'](_0x13586d);}};}function respondWithFilteredResult(_0x4a48f6,_0x2cdfb7){return function(_0x54fccc){if(_0x54fccc){var _0x39550d=typeof _0x2cdfb7[_0xffa7('0x21')]===_0xffa7('0x22')&&typeof _0x2cdfb7['limit']==='undefined';var _0xba1209=_0x54fccc[_0xffa7('0x23')];var _0x584d17=_0x39550d?0x0:_0x2cdfb7[_0xffa7('0x21')];var _0x1a28a0=_0x39550d?_0x54fccc[_0xffa7('0x23')]:_0x2cdfb7[_0xffa7('0x21')]+_0x2cdfb7[_0xffa7('0x24')];var _0x551a5f;if(_0x1a28a0>=_0xba1209){_0x1a28a0=_0xba1209;_0x551a5f=0xc8;}else{_0x551a5f=0xce;}_0x4a48f6[_0xffa7('0x1f')](_0x551a5f);return _0x4a48f6[_0xffa7('0x25')](_0xffa7('0x26'),_0x584d17+'-'+_0x1a28a0+'/'+_0xba1209)[_0xffa7('0x27')](_0x54fccc);}return null;};}function patchUpdates(_0x161be4){return function(_0x33f5c1){try{jsonpatch[_0xffa7('0x28')](_0x33f5c1,_0x161be4,!![]);}catch(_0x3ab06b){return BPromise[_0xffa7('0x29')](_0x3ab06b);}return _0x33f5c1[_0xffa7('0x2a')]();};}function saveUpdates(_0x4e8ac5,_0x1cbd4a){return function(_0x464bfb){if(_0x464bfb){return _0x464bfb[_0xffa7('0x2b')](_0x4e8ac5)[_0xffa7('0x2c')](function(_0x4d0758){return _0x4d0758;});}return null;};}function removeEntity(_0x6f890c,_0x3ff39e){return function(_0x535356){if(_0x535356){return _0x535356[_0xffa7('0x2d')]()[_0xffa7('0x2c')](function(){_0x6f890c['status'](0xcc)[_0xffa7('0x20')]();});}};}function handleEntityNotFound(_0x534eba,_0x4f943a){return function(_0xdb1175){if(!_0xdb1175){_0x534eba[_0xffa7('0x2e')](0x194);}return _0xdb1175;};}function handleError(_0x34dab3,_0x189e6c){_0x189e6c=_0x189e6c||0x1f4;return function(_0x4383a8){logger[_0xffa7('0x2f')](_0x4383a8[_0xffa7('0x30')]);if(_0x4383a8[_0xffa7('0x31')]){delete _0x4383a8[_0xffa7('0x31')];}_0x34dab3[_0xffa7('0x1f')](_0x189e6c)[_0xffa7('0x32')](_0x4383a8);};}exports['index']=function(_0x2d733a,_0x522866){var _0x429169={},_0x2b7831={},_0x15ee6d={'count':0x0,'rows':[]};var _0x5c0f88=_[_0xffa7('0x33')](db['ChatGroup']['rawAttributes'],function(_0x1592ba){return{'name':_0x1592ba[_0xffa7('0x34')],'type':_0x1592ba[_0xffa7('0x35')]['key']};});_0x2b7831[_0xffa7('0x36')]=_[_0xffa7('0x33')](_0x5c0f88,'name');_0x2b7831[_0xffa7('0x37')]=_[_0xffa7('0x38')](_0x2d733a[_0xffa7('0x37')]);_0x2b7831[_0xffa7('0x39')]=_[_0xffa7('0x3a')](_0x2b7831[_0xffa7('0x36')],_0x2b7831['query']);_0x429169[_0xffa7('0x3b')]=_[_0xffa7('0x3a')](_0x2b7831[_0xffa7('0x36')],qs[_0xffa7('0x3c')](_0x2d733a[_0xffa7('0x37')][_0xffa7('0x3c')]));_0x429169[_0xffa7('0x3b')]=_0x429169[_0xffa7('0x3b')][_0xffa7('0x3d')]?_0x429169[_0xffa7('0x3b')]:_0x2b7831[_0xffa7('0x36')];if(!_0x2d733a[_0xffa7('0x37')]['hasOwnProperty'](_0xffa7('0x3e'))){_0x429169['limit']=qs[_0xffa7('0x24')](_0x2d733a[_0xffa7('0x37')][_0xffa7('0x24')]);_0x429169[_0xffa7('0x21')]=qs[_0xffa7('0x21')](_0x2d733a[_0xffa7('0x37')][_0xffa7('0x21')]);}_0x429169[_0xffa7('0x3f')]=qs[_0xffa7('0x40')](_0x2d733a[_0xffa7('0x37')][_0xffa7('0x40')]);_0x429169[_0xffa7('0x41')]=qs['filters'](_[_0xffa7('0x42')](_0x2d733a['query'],_0x2b7831[_0xffa7('0x39')]),_0x5c0f88);if(_0x2d733a[_0xffa7('0x37')][_0xffa7('0x43')]){_0x429169['where']=_[_0xffa7('0x44')](_0x429169['where'],{'$or':_[_0xffa7('0x33')](_0x5c0f88,function(_0x20c215){if(_0x20c215[_0xffa7('0x35')]!=='VIRTUAL'){var _0x45759e={};_0x45759e[_0x20c215[_0xffa7('0x31')]]={'$like':'%'+_0x2d733a[_0xffa7('0x37')]['filter']+'%'};return _0x45759e;}})});}_0x429169=_[_0xffa7('0x44')]({},_0x429169,_0x2d733a[_0xffa7('0x45')]);var _0x36f915={'where':_0x429169[_0xffa7('0x41')]};return db[_0xffa7('0x46')][_0xffa7('0x23')](_0x36f915)[_0xffa7('0x2c')](function(_0x31b2d5){_0x15ee6d[_0xffa7('0x23')]=_0x31b2d5;if(_0x2d733a[_0xffa7('0x37')]['includeAll']){_0x429169[_0xffa7('0x47')]=[{'all':!![]}];}return db[_0xffa7('0x46')]['findAll'](_0x429169);})['then'](function(_0x555293){_0x15ee6d[_0xffa7('0x48')]=_0x555293;return _0x15ee6d;})[_0xffa7('0x2c')](respondWithFilteredResult(_0x522866,_0x429169))['catch'](handleError(_0x522866,null));};exports[_0xffa7('0x49')]=function(_0x31bd89,_0x3f268e){var _0x514ec3={'raw':!![],'where':{'id':_0x31bd89[_0xffa7('0x4a')]['id']}},_0x215eac={};_0x215eac[_0xffa7('0x36')]=_[_0xffa7('0x38')](db['ChatGroup'][_0xffa7('0x4b')]);_0x215eac[_0xffa7('0x37')]=_[_0xffa7('0x38')](_0x31bd89[_0xffa7('0x37')]);_0x215eac['filters']=_[_0xffa7('0x3a')](_0x215eac['model'],_0x215eac[_0xffa7('0x37')]);_0x514ec3[_0xffa7('0x3b')]=_[_0xffa7('0x3a')](_0x215eac[_0xffa7('0x36')],qs['fields'](_0x31bd89[_0xffa7('0x37')]['fields']));_0x514ec3[_0xffa7('0x3b')]=_0x514ec3[_0xffa7('0x3b')][_0xffa7('0x3d')]?_0x514ec3[_0xffa7('0x3b')]:_0x215eac[_0xffa7('0x36')];if(_0x31bd89[_0xffa7('0x37')][_0xffa7('0x4c')]){_0x514ec3[_0xffa7('0x47')]=[{'all':!![]}];}_0x514ec3=_[_0xffa7('0x44')]({},_0x514ec3,_0x31bd89[_0xffa7('0x45')]);return db[_0xffa7('0x46')][_0xffa7('0x4d')](_0x514ec3)[_0xffa7('0x2c')](handleEntityNotFound(_0x3f268e,null))[_0xffa7('0x2c')](respondWithResult(_0x3f268e,null))['catch'](handleError(_0x3f268e,null));};exports['create']=function(_0x28e3fe,_0xe0a2d){return db[_0xffa7('0x46')][_0xffa7('0x4e')](_0x28e3fe['body'],{})['then'](respondWithResult(_0xe0a2d,0xc9))['catch'](handleError(_0xe0a2d,null));};exports['update']=function(_0x3c3c3d,_0x27d344){if(_0x3c3c3d[_0xffa7('0x4f')]['id']){delete _0x3c3c3d['body']['id'];}return db[_0xffa7('0x46')][_0xffa7('0x4d')]({'where':{'id':_0x3c3c3d[_0xffa7('0x4a')]['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x27d344,null))[_0xffa7('0x2c')](saveUpdates(_0x3c3c3d[_0xffa7('0x4f')],null))[_0xffa7('0x2c')](respondWithResult(_0x27d344,null))['catch'](handleError(_0x27d344,null));};exports['destroy']=function(_0x5c627b,_0x1011a9){return db[_0xffa7('0x46')]['find']({'where':{'id':_0x5c627b[_0xffa7('0x4a')]['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x1011a9,null))[_0xffa7('0x2c')](removeEntity(_0x1011a9,null))['catch'](handleError(_0x1011a9,null));};exports[_0xffa7('0x50')]=function(_0x418852,_0x23ad56){return db[_0xffa7('0x46')][_0xffa7('0x50')]()[_0xffa7('0x2c')](respondWithResult(_0x23ad56,null))[_0xffa7('0x51')](handleError(_0x23ad56,null));};exports[_0xffa7('0x52')]=function(_0x3c591a,_0x4b6d22,_0x19223b){return db[_0xffa7('0x53')][_0xffa7('0x23')]({'where':{'ChatGroupId':_0x3c591a[_0xffa7('0x4a')]['id'],'ToId':_0x3c591a['user']['id'],'read':![]}})['then'](function(_0x28addb){return{'id':_['toInteger'](_0x3c591a[_0xffa7('0x4a')]['id']),'count':_0x28addb};})['then'](respondWithResult(_0x4b6d22,null))['catch'](handleError(_0x4b6d22,null));};exports[_0xffa7('0x54')]=function(_0x14a021,_0x429fd2,_0x5a77be){return db['ChatGroup'][_0xffa7('0x4d')]({'where':{'id':_0x14a021['params']['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x429fd2,null))[_0xffa7('0x2c')](function(_0x419d72){if(_0x419d72){return _0x419d72['addMembers'](_0x14a021[_0xffa7('0x4f')][_0xffa7('0x55')],_['omit'](_0x14a021[_0xffa7('0x4f')],[_0xffa7('0x55'),'id'])||{});}})[_0xffa7('0x2c')](respondWithResult(_0x429fd2,null))[_0xffa7('0x51')](handleError(_0x429fd2,null));};exports[_0xffa7('0x56')]=function(_0x22c532,_0x4dcc17,_0x4d2f78){var _0x5708fd={};var _0x170c64={};var _0x5d66bd;var _0x2737f7;return db['ChatGroup']['findOne']({'where':{'id':_0x22c532[_0xffa7('0x4a')]['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x4dcc17,null))[_0xffa7('0x2c')](function(_0x6e352){if(_0x6e352){_0x5d66bd=_0x6e352;_0x170c64[_0xffa7('0x36')]=_[_0xffa7('0x38')](db[_0xffa7('0x57')][_0xffa7('0x4b')]);_0x170c64[_0xffa7('0x37')]=_[_0xffa7('0x38')](_0x22c532[_0xffa7('0x37')]);_0x170c64[_0xffa7('0x39')]=_[_0xffa7('0x3a')](_0x170c64[_0xffa7('0x36')],_0x170c64[_0xffa7('0x37')]);_0x5708fd[_0xffa7('0x3b')]=_[_0xffa7('0x3a')](_0x170c64[_0xffa7('0x36')],qs['fields'](_0x22c532[_0xffa7('0x37')][_0xffa7('0x3c')]));_0x5708fd['attributes']=_0x5708fd[_0xffa7('0x3b')][_0xffa7('0x3d')]?_0x5708fd['attributes']:_0x170c64[_0xffa7('0x36')];_0x5708fd[_0xffa7('0x3f')]=qs[_0xffa7('0x40')](_0x22c532[_0xffa7('0x37')]['sort']);_0x5708fd[_0xffa7('0x41')]=qs['filters'](_[_0xffa7('0x42')](_0x22c532['query'],_0x170c64[_0xffa7('0x39')]));if(_0x22c532[_0xffa7('0x37')][_0xffa7('0x43')]){_0x5708fd[_0xffa7('0x41')]=_[_0xffa7('0x44')](_0x5708fd[_0xffa7('0x41')],{'$or':_[_0xffa7('0x33')](_0x5708fd[_0xffa7('0x3b')],function(_0x14e779){var _0x2277e8={};_0x2277e8[_0x14e779]={'$like':'%'+_0x22c532[_0xffa7('0x37')][_0xffa7('0x43')]+'%'};return _0x2277e8;})});}_0x5708fd=_[_0xffa7('0x44')]({},_0x5708fd,_0x22c532[_0xffa7('0x45')]);return _0x5d66bd['getMembers'](_0x5708fd);}})[_0xffa7('0x2c')](function(_0x19e6fe){if(_0x19e6fe){_0x2737f7=_0x19e6fe['length'];if(!_0x22c532[_0xffa7('0x37')][_0xffa7('0x58')]('nolimit')){_0x5708fd[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x22c532[_0xffa7('0x37')][_0xffa7('0x24')]);_0x5708fd['offset']=qs['offset'](_0x22c532[_0xffa7('0x37')][_0xffa7('0x21')]);}return _0x5d66bd['getMembers'](_0x5708fd);}})[_0xffa7('0x2c')](function(_0x5f268d){if(_0x5f268d){return _0x5f268d?{'count':_0x2737f7,'rows':_0x5f268d}:null;}})[_0xffa7('0x2c')](respondWithResult(_0x4dcc17,null))[_0xffa7('0x51')](handleError(_0x4dcc17,null));};exports[_0xffa7('0x59')]=function(_0x22615a,_0x14fd25,_0x18314e){return db[_0xffa7('0x46')]['find']({'where':{'id':_0x22615a[_0xffa7('0x4a')]['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x14fd25,null))['then'](function(_0x1f83d4){if(_0x1f83d4){return _0x1f83d4[_0xffa7('0x59')](_0x22615a[_0xffa7('0x37')]['ids']);}})[_0xffa7('0x2c')](respondWithStatusCode(_0x14fd25,null))[_0xffa7('0x51')](handleError(_0x14fd25,null));};exports[_0xffa7('0x5a')]=function(_0x314dcf,_0x2e5be5,_0x410b29){if(_0x314dcf['body']['id']){delete _0x314dcf[_0xffa7('0x4f')]['id'];}return db['ChatGroup'][_0xffa7('0x4d')]({'where':{'id':_0x314dcf['params']['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x2e5be5,null))[_0xffa7('0x2c')](function(_0x290a16){if(_0x290a16){_0x314dcf['body'][_0xffa7('0x5b')]=_0x290a16['id'];return db[_0xffa7('0x53')][_0xffa7('0x4e')](_0x314dcf[_0xffa7('0x4f')]);}})[_0xffa7('0x2c')](respondWithResult(_0x2e5be5,null))[_0xffa7('0x51')](handleError(_0x2e5be5,null));};exports[_0xffa7('0x5c')]=function(_0x196753,_0x5d1751,_0x5fc38d){var _0x3fc535={};var _0x579f51={};var _0x42a07a;var _0x22c4ad;return db[_0xffa7('0x46')][_0xffa7('0x5d')]({'where':{'id':_0x196753['params']['id']}})[_0xffa7('0x2c')](handleEntityNotFound(_0x5d1751,null))[_0xffa7('0x2c')](function(_0x151b4e){if(_0x151b4e){_0x42a07a=_0x151b4e;_0x579f51[_0xffa7('0x36')]=_[_0xffa7('0x38')](db[_0xffa7('0x53')][_0xffa7('0x4b')]);_0x579f51['query']=_[_0xffa7('0x38')](_0x196753[_0xffa7('0x37')]);_0x579f51[_0xffa7('0x39')]=_['intersection'](_0x579f51['model'],_0x579f51[_0xffa7('0x37')]);_0x3fc535['attributes']=_[_0xffa7('0x3a')](_0x579f51['model'],qs['fields'](_0x196753[_0xffa7('0x37')]['fields']));_0x3fc535[_0xffa7('0x3b')]=_0x3fc535[_0xffa7('0x3b')][_0xffa7('0x3d')]?_0x3fc535[_0xffa7('0x3b')]:_0x579f51['model'];_0x3fc535['order']=qs['sort'](_0x196753[_0xffa7('0x37')][_0xffa7('0x40')]);_0x3fc535['where']=qs[_0xffa7('0x39')](_['pick'](_0x196753[_0xffa7('0x37')],_0x579f51[_0xffa7('0x39')]));if(_0x196753['query'][_0xffa7('0x43')]){_0x3fc535[_0xffa7('0x41')]=_[_0xffa7('0x44')](_0x3fc535[_0xffa7('0x41')],{'$or':_[_0xffa7('0x33')](_0x3fc535[_0xffa7('0x3b')],function(_0x178042){var _0xf8d725={};_0xf8d725[_0x178042]={'$like':'%'+_0x196753[_0xffa7('0x37')][_0xffa7('0x43')]+'%'};return _0xf8d725;})});}if(_0x196753['query'][_0xffa7('0x5e')]){var _0x1f5e8f=_0x196753['query'][_0xffa7('0x5e')][_0xffa7('0x5f')](',');var _0x318904={};_0x318904[_0x1f5e8f[0x0]]={'$gte':moment(_0x1f5e8f[0x1])[_0xffa7('0x60')](_0xffa7('0x61'))};_0x3fc535[_0xffa7('0x41')]=_[_0xffa7('0x44')](_0x3fc535[_0xffa7('0x41')],_0x318904);}_0x3fc535=_[_0xffa7('0x44')]({},_0x3fc535,_0x196753[_0xffa7('0x45')]);return _0x42a07a[_0xffa7('0x5c')](_0x3fc535);}})[_0xffa7('0x2c')](function(_0x2155cf){if(_0x2155cf){_0x22c4ad=_0x2155cf[_0xffa7('0x3d')];if(!_0x196753[_0xffa7('0x37')][_0xffa7('0x58')](_0xffa7('0x3e'))){_0x3fc535['limit']=qs[_0xffa7('0x24')](_0x196753[_0xffa7('0x37')][_0xffa7('0x24')]);_0x3fc535[_0xffa7('0x21')]=qs[_0xffa7('0x21')](_0x196753['query']['offset']);}return _0x42a07a['getMessages'](_0x3fc535);}})[_0xffa7('0x2c')](function(_0x3ff5a8){if(_0x3ff5a8){return _0x3ff5a8?{'count':_0x22c4ad,'rows':_0x3ff5a8}:null;}})[_0xffa7('0x2c')](respondWithResult(_0x5d1751,null))[_0xffa7('0x51')](handleError(_0x5d1751,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 436a074..8836c5d 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 _0xfd1b=['exports','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5f2624,_0xb969ca){var _0x5be3e5=function(_0x14dfce){while(--_0x14dfce){_0x5f2624['push'](_0x5f2624['shift']());}};_0x5be3e5(++_0xb969ca);}(_0xfd1b,0x1b1));var _0xbfd1=function(_0x1392d7,_0x520a68){_0x1392d7=_0x1392d7-0x0;var _0xefc815=_0xfd1b[_0x1392d7];return _0xefc815;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0xbfd1('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbfd1('0x1')](0x0);var events={'afterCreate':_0xbfd1('0x2'),'afterUpdate':_0xbfd1('0x3'),'afterDestroy':_0xbfd1('0x4')};function emitEvent(_0x5cc4e8){return function(_0x2adfea,_0x40f31b,_0x2236c4){ChatGroupEvents['emit'](_0x5cc4e8+':'+_0x2adfea['id'],_0x2adfea);ChatGroupEvents[_0xbfd1('0x5')](_0x5cc4e8,_0x2adfea);_0x2236c4(null);};}for(var e in events){if(events[_0xbfd1('0x6')](e)){var event=events[e];ChatGroup[_0xbfd1('0x7')](e,emitEvent(event));}}module[_0xbfd1('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x3411=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x477d04,_0x2ff6ce){var _0x219e68=function(_0x9250ee){while(--_0x9250ee){_0x477d04['push'](_0x477d04['shift']());}};_0x219e68(++_0x2ff6ce);}(_0x3411,0x105));var _0x1341=function(_0x1b2299,_0x4809d3){_0x1b2299=_0x1b2299-0x0;var _0x5c2f59=_0x3411[_0x1b2299];return _0x5c2f59;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x1341('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1341('0x1')](0x0);var events={'afterCreate':_0x1341('0x2'),'afterUpdate':_0x1341('0x3'),'afterDestroy':_0x1341('0x4')};function emitEvent(_0x2d327f){return function(_0xef6224,_0x538672,_0x23b08a){ChatGroupEvents['emit'](_0x2d327f+':'+_0xef6224['id'],_0xef6224);ChatGroupEvents[_0x1341('0x5')](_0x2d327f,_0xef6224);_0x23b08a(null);};}for(var e in events){if(events[_0x1341('0x6')](e)){var event=events[e];ChatGroup[_0x1341('0x7')](e,emitEvent(event));}}module[_0x1341('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index d09a93a..a8b0859 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 _0x6a8d=['moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x3b0e60,_0x3e3056){var _0x20c751=function(_0x46bcb3){while(--_0x46bcb3){_0x3b0e60['push'](_0x3b0e60['shift']());}};_0x20c751(++_0x3e3056);}(_0x6a8d,0x1cd));var _0xd6a8=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x6a8d[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xd6a8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd6a8('0x1'));var BPromise=require(_0xd6a8('0x2'));var rp=require(_0xd6a8('0x3'));var fs=require('fs');var path=require(_0xd6a8('0x4'));var rimraf=require('rimraf');var config=require(_0xd6a8('0x5'));var attributes=require(_0xd6a8('0x6'));module[_0xd6a8('0x7')]=function(_0x548d80,_0x5c4b04){return _0x548d80[_0xd6a8('0x8')](_0xd6a8('0x9'),attributes,{'tableName':_0xd6a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14a9=['moment','request-promise','path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x7bf42f,_0x291528){var _0x3ecfe4=function(_0xabaf19){while(--_0xabaf19){_0x7bf42f['push'](_0x7bf42f['shift']());}};_0x3ecfe4(++_0x291528);}(_0x14a9,0xef));var _0x914a=function(_0x25be49,_0x47c0f6){_0x25be49=_0x25be49-0x0;var _0x5bf8ac=_0x14a9[_0x25be49];return _0x5bf8ac;};'use strict';var _=require(_0x914a('0x0'));var util=require(_0x914a('0x1'));var logger=require(_0x914a('0x2'))('api');var moment=require(_0x914a('0x3'));var BPromise=require('bluebird');var rp=require(_0x914a('0x4'));var fs=require('fs');var path=require(_0x914a('0x5'));var rimraf=require(_0x914a('0x6'));var config=require('../../config/environment');var attributes=require(_0x914a('0x7'));module['exports']=function(_0x2ea3bb,_0x24400f){return _0x2ea3bb[_0x914a('0x8')](_0x914a('0x9'),attributes,{'tableName':_0x914a('0xa'),'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 9304699..d116954 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 _0x867f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment'];(function(_0x4f1919,_0x31c629){var _0x34f1b2=function(_0x2ce324){while(--_0x2ce324){_0x4f1919['push'](_0x4f1919['shift']());}};_0x34f1b2(++_0x31c629);}(_0x867f,0x7f));var _0xf867=function(_0x577077,_0x52f056){_0x577077=_0x577077-0x0;var _0x370769=_0x867f[_0x577077];return _0x370769;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf867('0x7'));var jayson=require(_0xf867('0x8'));var client=jayson[_0xf867('0x9')][_0xf867('0xa')]({'port':0x232a});config['redis']=_[_0xf867('0xb')](config[_0xf867('0xc')],{'host':_0xf867('0xd'),'port':0x18eb});var socket=require(_0xf867('0xe'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xf867('0xf')](socket);function respondWithRpcPromise(_0x2e25bf,_0x46d754,_0x4d9c51){return new BPromise(function(_0x25699a,_0x4b4e3b){return client[_0xf867('0x10')](_0x2e25bf,_0x4d9c51)[_0xf867('0x11')](function(_0x57cb41){logger['info'](_0xf867('0x12'),_0x46d754,_0xf867('0x13'));logger[_0xf867('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x46d754,_0xf867('0x13'),JSON[_0xf867('0x15')](_0x57cb41));if(_0x57cb41[_0xf867('0x16')]){if(_0x57cb41[_0xf867('0x16')][_0xf867('0x17')]===0x1f4){logger[_0xf867('0x16')](_0xf867('0x12'),_0x46d754,_0x57cb41[_0xf867('0x16')]['message']);return _0x4b4e3b(_0x57cb41[_0xf867('0x16')]['message']);}logger[_0xf867('0x16')](_0xf867('0x12'),_0x46d754,_0x57cb41[_0xf867('0x16')][_0xf867('0x18')]);return _0x25699a(_0x57cb41['error'][_0xf867('0x18')]);}else{logger['info'](_0xf867('0x12'),_0x46d754,'request\x20sent');_0x25699a(_0x57cb41[_0xf867('0x19')][_0xf867('0x18')]);}})['catch'](function(_0x91a392){logger[_0xf867('0x16')](_0xf867('0x12'),_0x46d754,_0x91a392);_0x4b4e3b(_0x91a392);});});}
\ No newline at end of file
+var _0xec46=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','catch','lodash','util','moment','bluebird'];(function(_0x4b9978,_0x58eb71){var _0x42f0e5=function(_0x4ff5dc){while(--_0x4ff5dc){_0x4b9978['push'](_0x4b9978['shift']());}};_0x42f0e5(++_0x58eb71);}(_0xec46,0x19c));var _0x6ec4=function(_0x473d1e,_0x4df799){_0x473d1e=_0x473d1e-0x0;var _0x503be9=_0xec46[_0x473d1e];return _0x503be9;};'use strict';var _=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var moment=require(_0x6ec4('0x2'));var BPromise=require(_0x6ec4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ec4('0x4'))['db'];var utils=require(_0x6ec4('0x5'));var logger=require(_0x6ec4('0x6'))('rpc');var config=require(_0x6ec4('0x7'));var jayson=require(_0x6ec4('0x8'));var client=jayson['client'][_0x6ec4('0x9')]({'port':0x232a});config['redis']=_[_0x6ec4('0xa')](config[_0x6ec4('0xb')],{'host':_0x6ec4('0xc'),'port':0x18eb});var socket=require(_0x6ec4('0xd'))(new Redis(config[_0x6ec4('0xb')]));require(_0x6ec4('0xe'))[_0x6ec4('0xf')](socket);function respondWithRpcPromise(_0x164b81,_0x5e8746,_0x259d07){return new BPromise(function(_0xe51f56,_0x47bfaa){return client['request'](_0x164b81,_0x259d07)[_0x6ec4('0x10')](function(_0x45f738){logger[_0x6ec4('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x6ec4('0x12'));logger['debug'](_0x6ec4('0x13'),_0x5e8746,'request\x20sent',JSON[_0x6ec4('0x14')](_0x45f738));if(_0x45f738[_0x6ec4('0x15')]){if(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x16')]===0x1f4){logger[_0x6ec4('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);return _0x47bfaa(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);}logger[_0x6ec4('0x15')](_0x6ec4('0x18'),_0x5e8746,_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);return _0xe51f56(_0x45f738[_0x6ec4('0x15')][_0x6ec4('0x17')]);}else{logger[_0x6ec4('0x11')]('ChatGroup,\x20%s,\x20%s',_0x5e8746,_0x6ec4('0x12'));_0xe51f56(_0x45f738['result']['message']);}})[_0x6ec4('0x19')](function(_0x49594b){logger[_0x6ec4('0x15')](_0x6ec4('0x18'),_0x5e8746,_0x49594b);_0x47bfaa(_0x49594b);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e9585fb..0924715 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 _0x969c=['register','length','chatGroup:','save','remove','update','emit','removeListener'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x969c,0x123));var _0xc969=function(_0x2477c9,_0x156618){_0x2477c9=_0x2477c9-0x0;var _0x2b2791=_0x969c[_0x2477c9];return _0x2b2791;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xc969('0x0'),_0xc969('0x1'),_0xc969('0x2')];function createListener(_0x367463,_0x4b135d){return function(_0x652060){_0x4b135d[_0xc969('0x3')](_0x367463,_0x652060);};}function removeListener(_0x4c4d10,_0x3aaeda){return function(){ChatGroupEvents[_0xc969('0x4')](_0x4c4d10,_0x3aaeda);};}exports[_0xc969('0x5')]=function(_0x2fcc46){for(var _0x5b3632=0x0,_0x23ed1a=events[_0xc969('0x6')];_0x5b3632<_0x23ed1a;_0x5b3632++){var _0x2c5e0b=events[_0x5b3632];var _0x3b3313=createListener(_0xc969('0x7')+_0x2c5e0b,_0x2fcc46);ChatGroupEvents['on'](_0x2c5e0b,_0x3b3313);}};
\ No newline at end of file
+var _0x9314=['length','chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register'];(function(_0x36ee93,_0x502135){var _0x2a936c=function(_0xb6659c){while(--_0xb6659c){_0x36ee93['push'](_0x36ee93['shift']());}};_0x2a936c(++_0x502135);}(_0x9314,0xb2));var _0x4931=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9314[_0x13b02f];return _0x12e9a6;};'use strict';var ChatGroupEvents=require(_0x4931('0x0'));var events=['save',_0x4931('0x1'),_0x4931('0x2')];function createListener(_0x10ba23,_0x3d71b2){return function(_0x2312b5){_0x3d71b2[_0x4931('0x3')](_0x10ba23,_0x2312b5);};}function removeListener(_0xa382d7,_0x3f057f){return function(){ChatGroupEvents[_0x4931('0x4')](_0xa382d7,_0x3f057f);};}exports[_0x4931('0x5')]=function(_0x5766f9){for(var _0x3710d0=0x0,_0x22feb5=events[_0x4931('0x6')];_0x3710d0<_0x22feb5;_0x3710d0++){var _0x44df73=events[_0x3710d0];var _0x2ca31f=createListener(_0x4931('0x7')+_0x44df73,_0x5766f9);ChatGroupEvents['on'](_0x44df73,_0x2ca31f);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index b5d5686..a6fa7b1 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 _0x3de2=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3de2,0x137));var _0x23de=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3de2[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x23de('0x0'));var util=require(_0x23de('0x1'));var path=require(_0x23de('0x2'));var timeout=require(_0x23de('0x3'));var express=require(_0x23de('0x4'));var router=express[_0x23de('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x23de('0x6'));var interaction=require(_0x23de('0x7'));var config=require(_0x23de('0x8'));var controller=require('./chatGroup.controller');router[_0x23de('0x9')]('/',auth[_0x23de('0xa')](),controller[_0x23de('0xb')]);router[_0x23de('0x9')]('/describe',auth[_0x23de('0xa')](),controller[_0x23de('0xc')]);router[_0x23de('0x9')](_0x23de('0xd'),auth[_0x23de('0xa')](),controller[_0x23de('0xe')]);router[_0x23de('0x9')](_0x23de('0xf'),auth[_0x23de('0xa')](),controller[_0x23de('0x10')]);router['get'](_0x23de('0x11'),auth['isAuthenticated'](),controller[_0x23de('0x12')]);router[_0x23de('0x9')](_0x23de('0x13'),auth['isAuthenticated'](),controller[_0x23de('0x14')]);router[_0x23de('0x15')]('/',auth['isAuthenticated'](),controller[_0x23de('0x16')]);router[_0x23de('0x15')](_0x23de('0x11'),auth[_0x23de('0xa')](),controller[_0x23de('0x17')]);router['post'](_0x23de('0x13'),auth[_0x23de('0xa')](),controller['addMessage']);router[_0x23de('0x18')](_0x23de('0xd'),auth[_0x23de('0xa')](),controller[_0x23de('0x19')]);router[_0x23de('0x1a')](_0x23de('0xd'),auth[_0x23de('0xa')](),controller[_0x23de('0x1b')]);router['delete'](_0x23de('0x11'),auth[_0x23de('0xa')](),controller['removeMembers']);module[_0x23de('0x1c')]=router;
\ No newline at end of file
+var _0x5e50=['destroy','delete','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','getMessages','post','create','/:id/messages','addMessage','put','update'];(function(_0x4afa93,_0x2dccc9){var _0x365be7=function(_0x360c06){while(--_0x360c06){_0x4afa93['push'](_0x4afa93['shift']());}};_0x365be7(++_0x2dccc9);}(_0x5e50,0xb8));var _0x05e5=function(_0x11c3cb,_0x555982){_0x11c3cb=_0x11c3cb-0x0;var _0x14428f=_0x5e50[_0x11c3cb];return _0x14428f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x05e5('0x0'));var express=require(_0x05e5('0x1'));var router=express[_0x05e5('0x2')]();var fs_extra=require(_0x05e5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x05e5('0x4'));var config=require(_0x05e5('0x5'));var controller=require(_0x05e5('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x05e5('0x7')]);router[_0x05e5('0x8')](_0x05e5('0x9'),auth[_0x05e5('0xa')](),controller[_0x05e5('0xb')]);router['get'](_0x05e5('0xc'),auth['isAuthenticated'](),controller[_0x05e5('0xd')]);router[_0x05e5('0x8')](_0x05e5('0xe'),auth[_0x05e5('0xa')](),controller['getUnread']);router[_0x05e5('0x8')](_0x05e5('0xf'),auth[_0x05e5('0xa')](),controller[_0x05e5('0x10')]);router['get']('/:id/messages',auth[_0x05e5('0xa')](),controller[_0x05e5('0x11')]);router[_0x05e5('0x12')]('/',auth[_0x05e5('0xa')](),controller[_0x05e5('0x13')]);router[_0x05e5('0x12')]('/:id/members',auth[_0x05e5('0xa')](),controller['addMembers']);router[_0x05e5('0x12')](_0x05e5('0x14'),auth[_0x05e5('0xa')](),controller[_0x05e5('0x15')]);router[_0x05e5('0x16')](_0x05e5('0xc'),auth[_0x05e5('0xa')](),controller[_0x05e5('0x17')]);router['delete'](_0x05e5('0xc'),auth[_0x05e5('0xa')](),controller[_0x05e5('0x18')]);router[_0x05e5('0x19')]('/:id/members',auth[_0x05e5('0xa')](),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 29bef91..83a152f 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 _0x4b0f=['INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out','exports','BOOLEAN'];(function(_0x2421e1,_0x44afaa){var _0x44f3f0=function(_0x4f9990){while(--_0x4f9990){_0x2421e1['push'](_0x2421e1['shift']());}};_0x44f3f0(++_0x44afaa);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x18db4d,_0x381bb1){_0x18db4d=_0x18db4d-0x0;var _0x132535=_0x4b0f[_0x18db4d];return _0x132535;};'use strict';var Sequelize=require('sequelize');module[_0xf4b0('0x0')]={'closed':{'type':Sequelize[_0xf4b0('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf4b0('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xf4b0('0x3'),_0xf4b0('0x4')),'defaultValue':_0xf4b0('0x3')},'ratingMessage':{'type':Sequelize[_0xf4b0('0x5')]},'pathTranscript':{'type':Sequelize[_0xf4b0('0x5')]},'mailTranscript':{'type':Sequelize[_0xf4b0('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf4b0('0x7')]},'disposition':{'type':Sequelize[_0xf4b0('0x6')]},'secondDisposition':{'type':Sequelize[_0xf4b0('0x6')]},'thirdDisposition':{'type':Sequelize[_0xf4b0('0x6')]},'note':{'type':Sequelize[_0xf4b0('0x6')]},'browserName':{'type':Sequelize[_0xf4b0('0x6')]},'browserVersion':{'type':Sequelize[_0xf4b0('0x6')]},'osName':{'type':Sequelize[_0xf4b0('0x6')]},'osVersion':{'type':Sequelize[_0xf4b0('0x6')]},'deviceModel':{'type':Sequelize[_0xf4b0('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xf4b0('0x6')]},'referer':{'type':Sequelize[_0xf4b0('0x5')]},'customerIp':{'type':Sequelize[_0xf4b0('0x6')]},'formData':{'type':Sequelize[_0xf4b0('0x5')](_0xf4b0('0x8'))},'read1stAt':{'type':Sequelize[_0xf4b0('0x7')]},'lastMsgAt':{'type':Sequelize[_0xf4b0('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xf4b0('0x9')]('in',_0xf4b0('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf4b0('0x6')]},'customerPort':{'type':Sequelize[_0xf4b0('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xf4b0('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xf4b0('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9ffd=['TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb'];(function(_0x3f8781,_0x28822f){var _0x55fc61=function(_0x187796){while(--_0x187796){_0x3f8781['push'](_0x3f8781['shift']());}};_0x55fc61(++_0x28822f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x56ba7b,_0x967c00){_0x56ba7b=_0x56ba7b-0x0;var _0x4ac606=_0x9ffd[_0x56ba7b];return _0x4ac606;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'closed':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xd9ff('0x3')](_0xd9ff('0x4'),_0xd9ff('0x5')),'defaultValue':_0xd9ff('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd9ff('0x6')]},'mailTranscript':{'type':Sequelize[_0xd9ff('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd9ff('0x7')]},'secondDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'thirdDisposition':{'type':Sequelize[_0xd9ff('0x7')]},'note':{'type':Sequelize[_0xd9ff('0x7')]},'browserName':{'type':Sequelize[_0xd9ff('0x7')]},'browserVersion':{'type':Sequelize[_0xd9ff('0x7')]},'osName':{'type':Sequelize[_0xd9ff('0x7')]},'osVersion':{'type':Sequelize[_0xd9ff('0x7')]},'deviceModel':{'type':Sequelize[_0xd9ff('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd9ff('0x6')](_0xd9ff('0x8'))},'read1stAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgAt':{'type':Sequelize[_0xd9ff('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xd9ff('0x3')]('in',_0xd9ff('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd9ff('0x7')]},'customerPort':{'type':Sequelize[_0xd9ff('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 0c50ab1..750151c 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 _0x3237=['server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','direction','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','render','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','user','show','params','model','keys','query','filters','attributes','intersection','fields','length','includeAll','include','merge','catch','create','body','find','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','ContactId','System','customer','%s%d','agentAlias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','nolimit','includeAgent','addTags','setTags','Tag','color','emit','removeTags'];(function(_0x542ab0,_0x4f10d5){var _0x165baa=function(_0x1dfe33){while(--_0x1dfe33){_0x542ab0['push'](_0x542ab0['shift']());}};_0x165baa(++_0x4f10d5);}(_0x3237,0x1d5));var _0x7323=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3237[_0x4cf98e];return _0x1623ac;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x7323('0x0'));var rp=require(_0x7323('0x1'));var moment=require(_0x7323('0x2'));var BPromise=require(_0x7323('0x3'));var Mustache=require(_0x7323('0x4'));var util=require(_0x7323('0x5'));var path=require(_0x7323('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7323('0x7'));var Redis=require('ioredis');var interaction=require(_0x7323('0x8'));var qs=require(_0x7323('0x9'));var pdf=require(_0x7323('0xa'));var logger=require(_0x7323('0xb'))(_0x7323('0xc'));var config=require(_0x7323('0xd'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7323('0xe')](config[_0x7323('0xf')],{'host':_0x7323('0x10'),'port':0x18eb});var socket=require(_0x7323('0x11'))(new Redis(config['redis']));require(_0x7323('0x12'))[_0x7323('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7323('0x14')][_0x7323('0x15')]({'port':0x232b});var client9004=jayson[_0x7323('0x14')]['http']({'port':0x232c});function respondWithRpcPromise(_0x21c10d,_0x385f86,_0x4529a3,_0x471771){return new BPromise(function(_0x46d48d,_0xc9c921){var _0x8dec00=_0x471771||client;return _0x8dec00['request'](_0x21c10d,_0x4529a3)['then'](function(_0x24d799){logger[_0x7323('0x16')](_0x7323('0x17'),_0x385f86,_0x7323('0x18'));logger[_0x7323('0x19')](_0x7323('0x1a'),_0x385f86,'request\x20sent',JSON['stringify'](_0x24d799));if(_0x24d799['error']){if(_0x24d799[_0x7323('0x1b')][_0x7323('0x1c')]===0x1f4){logger[_0x7323('0x1b')](_0x7323('0x17'),_0x385f86,_0x24d799[_0x7323('0x1b')]['message']);return _0xc9c921(_0x24d799[_0x7323('0x1b')][_0x7323('0x1d')]);}logger[_0x7323('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x385f86,_0x24d799['error'][_0x7323('0x1d')]);return _0x46d48d(_0x24d799[_0x7323('0x1b')][_0x7323('0x1d')]);}else{logger[_0x7323('0x16')](_0x7323('0x17'),_0x385f86,_0x7323('0x18'));_0x46d48d(_0x24d799[_0x7323('0x1e')][_0x7323('0x1d')]);}})['catch'](function(_0x5e9acc){logger[_0x7323('0x1b')](_0x7323('0x17'),_0x385f86,_0x5e9acc);_0xc9c921(_0x5e9acc);});});}function respondWithStatusCode(_0x3f77e9,_0x2170a6){_0x2170a6=_0x2170a6||0xcc;return function(_0x492161){if(_0x492161){return _0x3f77e9['sendStatus'](_0x2170a6);}return _0x3f77e9['status'](_0x2170a6)[_0x7323('0x1f')]();};}function respondWithResult(_0x590038,_0x3671b4){_0x3671b4=_0x3671b4||0xc8;return function(_0x4bb2e2){if(_0x4bb2e2){return _0x590038[_0x7323('0x20')](_0x3671b4)[_0x7323('0x21')](_0x4bb2e2);}};}function respondWithFilteredResult(_0x444a78,_0x1f3156){return function(_0x4d55a5){if(_0x4d55a5){var _0x230358=typeof _0x1f3156[_0x7323('0x22')]===_0x7323('0x23')&&typeof _0x1f3156[_0x7323('0x24')]===_0x7323('0x23');var _0x236d3d=_0x4d55a5[_0x7323('0x25')];var _0x48a93a=_0x230358?0x0:_0x1f3156[_0x7323('0x22')];var _0x323d20=_0x230358?_0x4d55a5['count']:_0x1f3156[_0x7323('0x22')]+_0x1f3156[_0x7323('0x24')];var _0x42ad8d;if(_0x323d20>=_0x236d3d){_0x323d20=_0x236d3d;_0x42ad8d=0xc8;}else{_0x42ad8d=0xce;}_0x444a78[_0x7323('0x20')](_0x42ad8d);return _0x444a78[_0x7323('0x26')](_0x7323('0x27'),_0x48a93a+'-'+_0x323d20+'/'+_0x236d3d)[_0x7323('0x21')](_0x4d55a5);}return null;};}function saveUpdates(_0x533d83){return function(_0xf70958){if(_0xf70958){return _0xf70958[_0x7323('0x28')](_0x533d83)[_0x7323('0x29')](function(_0x20645b){return _0x20645b;});}return null;};}function removeEntity(_0x5832bf){return function(_0x1f0c36){if(_0x1f0c36){return _0x1f0c36[_0x7323('0x2a')]()[_0x7323('0x29')](function(){_0x5832bf[_0x7323('0x20')](0xcc)[_0x7323('0x1f')]();});}};}function handleEntityNotFound(_0x1be7c0){return function(_0x184446){if(!_0x184446){_0x1be7c0[_0x7323('0x2b')](0x194);}return _0x184446;};}function handleError(_0xd5377a,_0x32a72f){_0x32a72f=_0x32a72f||0x1f4;return function(_0x24b07d){logger[_0x7323('0x1b')](_0x24b07d[_0x7323('0x2c')]);if(_0x24b07d['name']){delete _0x24b07d[_0x7323('0x2d')];}_0xd5377a[_0x7323('0x20')](_0x32a72f)[_0x7323('0x2e')](_0x24b07d);};}function getMustacheRender(_0x350e3b,_0x2c43bf){return Mustache[_0x7323('0x2f')](_0x350e3b,_['merge'](_0x2c43bf['body'],{'contact':_0x2c43bf['contact'],'message':_0x2c43bf[_0x7323('0x1d')],'agent':_0x2c43bf[_0x7323('0x30')],'interaction':_0x2c43bf['interaction'],'account':_0x2c43bf[_0x7323('0x31')]}))||'';}exports[_0x7323('0x32')]=function(_0x3d60e1,_0x3b33ed){var _0x5e2f11={};var _0x3be911=_[_0x7323('0x33')](db[_0x7323('0x34')][_0x7323('0x35')],function(_0x4a1a9b){return{'name':_0x4a1a9b[_0x7323('0x36')],'type':_0x4a1a9b[_0x7323('0x37')][_0x7323('0x38')]};});_0x5e2f11=qs[_0x7323('0x39')](_0x3be911,_0x3d60e1);return interaction[_0x7323('0x3a')](_0x7323('0x3b'),_0x3d60e1['query'],_0x3d60e1[_0x7323('0x3c')],_0x5e2f11,_0x3be911)[_0x7323('0x29')](respondWithFilteredResult(_0x3b33ed,_0x5e2f11))['catch'](handleError(_0x3b33ed,null));};exports[_0x7323('0x3d')]=function(_0x5b66b3,_0x4fe9ee){var _0x1ead7a={'raw':![],'where':{'id':_0x5b66b3[_0x7323('0x3e')]['id']}},_0x2dda0d={};_0x2dda0d[_0x7323('0x3f')]=_['keys'](db['ChatInteraction'][_0x7323('0x35')]);_0x2dda0d['query']=_[_0x7323('0x40')](_0x5b66b3[_0x7323('0x41')]);_0x2dda0d[_0x7323('0x42')]=_['intersection'](_0x2dda0d[_0x7323('0x3f')],_0x2dda0d[_0x7323('0x41')]);_0x1ead7a[_0x7323('0x43')]=_[_0x7323('0x44')](_0x2dda0d[_0x7323('0x3f')],qs[_0x7323('0x45')](_0x5b66b3['query'][_0x7323('0x45')]));_0x1ead7a[_0x7323('0x43')]=_0x1ead7a[_0x7323('0x43')][_0x7323('0x46')]?_0x1ead7a[_0x7323('0x43')]:_0x2dda0d['model'];if(_0x5b66b3['query'][_0x7323('0x47')]){_0x1ead7a[_0x7323('0x48')]=[{'all':!![]}];}_0x1ead7a=_[_0x7323('0x49')]({},_0x1ead7a,_0x5b66b3['options']);return db[_0x7323('0x34')]['find'](_0x1ead7a)['then'](handleEntityNotFound(_0x4fe9ee,null))['then'](respondWithResult(_0x4fe9ee,null))[_0x7323('0x4a')](handleError(_0x4fe9ee,null));};exports[_0x7323('0x4b')]=function(_0x1e0484,_0x324d66){return db[_0x7323('0x34')][_0x7323('0x4b')](_0x1e0484[_0x7323('0x4c')],{})['then'](respondWithResult(_0x324d66,0xc9))[_0x7323('0x4a')](handleError(_0x324d66,null));};exports['update']=function(_0x457755,_0x9ef049){if(_0x457755[_0x7323('0x4c')]['id']){delete _0x457755[_0x7323('0x4c')]['id'];}return db[_0x7323('0x34')]['find']({'where':{'id':_0x457755[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](handleEntityNotFound(_0x9ef049,null))['then'](saveUpdates(_0x457755[_0x7323('0x4c')],null))[_0x7323('0x29')](respondWithResult(_0x9ef049,null))[_0x7323('0x4a')](handleError(_0x9ef049,null));};exports[_0x7323('0x2a')]=function(_0x51b5d9,_0xba8325){return db['ChatInteraction'][_0x7323('0x4d')]({'where':{'id':_0x51b5d9['params']['id']}})[_0x7323('0x29')](handleEntityNotFound(_0xba8325,null))[_0x7323('0x29')](removeEntity(_0xba8325,null))[_0x7323('0x4a')](handleError(_0xba8325,null));};exports[_0x7323('0x4e')]=function(_0x275282,_0x110f2f){return db[_0x7323('0x34')][_0x7323('0x4e')]()[_0x7323('0x29')](respondWithResult(_0x110f2f,null))[_0x7323('0x4a')](handleError(_0x110f2f,null));};exports[_0x7323('0x4f')]=function(_0x5e8733,_0x2c35a8){var _0x37cd10=_0x5e8733[_0x7323('0x3e')]['id'];var _0x4296b1;var _0x30cb49;var _0x201a15;return db[_0x7323('0x34')]['findOne']({'where':{'id':_0x37cd10}})[_0x7323('0x29')](function(_0x5c5cc7){_0x4296b1=_0x5c5cc7;return db[_0x7323('0x50')][_0x7323('0x51')]({'where':{'id':_0x5c5cc7[_0x7323('0x52')]},'attributes':['id',_0x7323('0x53'),_0x7323('0x54'),_0x7323('0x55'),_0x7323('0x56'),_0x7323('0x57')],'raw':!![]});})[_0x7323('0x29')](function(_0x3874f5){if(_0x3874f5&&_0x3874f5[_0x7323('0x53')]&&_0x3874f5[_0x7323('0x54')]){_0x30cb49=_0x3874f5;var _0x6ee38c={'interaction':{'id':_0x37cd10},'agent':{'id':_0x5e8733[_0x7323('0x3c')]['id'],'name':_0x5e8733[_0x7323('0x3c')]['name'],'fullname':_0x5e8733['user'][_0x7323('0x58')],'email':_0x5e8733[_0x7323('0x3c')][_0x7323('0x59')]},'contact':_0x5e8733[_0x7323('0x4c')][_0x7323('0x5a')],'account':_0x5e8733[_0x7323('0x4c')][_0x7323('0x31')]};var _0x4822ca={'rejectUnauthorized':![],'method':_0x7323('0x5b'),'url':_0x7323('0x5c'),'headers':{'X-APIKEY':_0x3874f5[_0x7323('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e8733[_0x7323('0x3c')][_0x7323('0x59')]],'buttons':null,'topic':_0x30cb49[_0x7323('0x55')],'note':_[_0x7323('0x5d')](_0x30cb49[_0x7323('0x56')])?null:getMustacheRender(_0x30cb49['vidaooNote'],_0x6ee38c),'metadata':null},'redirect':_0x7323('0x5e'),'json':!![]};try{if(!_['isNull'](_0x30cb49[_0x7323('0x57')])){var _0x52e10e=getMustacheRender(_0x30cb49['vidaooMetadata'],_0x6ee38c);var _0x973268=JSON[_0x7323('0x5f')](_0x52e10e);_0x4822ca[_0x7323('0x4c')][_0x7323('0x60')]=_0x973268;}}catch(_0x4daf96){throw new db['Sequelize']['ValidationError'](_0x7323('0x61'));}return rp(_0x4822ca);}else{throw new db[(_0x7323('0x62'))][(_0x7323('0x63'))](_0x7323('0x64'));}})[_0x7323('0x29')](function(_0x14f45c){_0x201a15=_0x14f45c;if(_0x201a15['id']){var _0x3bb397={'body':_0x201a15['join_url'],'ChatWebsiteId':_0x30cb49['id'],'ChatInteractionId':_0x4296b1['id'],'direction':_0x7323('0x65'),'UserId':_0x5e8733['user']['id']};return db['ChatMessage'][_0x7323('0x4b')](_0x3bb397,{});}else{throw new db['Sequelize']['ValidationError'](_0x7323('0x66'));}})[_0x7323('0x29')](function(){return _0x4296b1['updateAttributes']({'vidaooSessionId':_0x201a15['id']});})[_0x7323('0x29')](respondWithResult(_0x2c35a8,null))[_0x7323('0x4a')](handleError(_0x2c35a8,null));};exports[_0x7323('0x67')]=function(_0x2f90bd,_0x9ce7f7){if(_0x2f90bd[_0x7323('0x4c')]['id']){delete _0x2f90bd[_0x7323('0x4c')]['id'];}return db['ChatInteraction'][_0x7323('0x4d')]({'where':{'id':_0x2f90bd[_0x7323('0x3e')]['id']},'include':[{'model':db[_0x7323('0x68')],'as':_0x7323('0x69')}]})[_0x7323('0x29')](handleEntityNotFound(_0x9ce7f7,null))[_0x7323('0x29')](saveUpdates(_0x2f90bd[_0x7323('0x4c')],null))[_0x7323('0x29')](respondWithResult(_0x9ce7f7,null))[_0x7323('0x4a')](handleError(_0x9ce7f7,null));};exports[_0x7323('0x6a')]=function(_0x3558f7,_0x4f64a3){if(_0x3558f7['body']['id']){delete _0x3558f7[_0x7323('0x4c')]['id'];}return db['ChatInteraction'][_0x7323('0x4d')]({'where':{'id':_0x3558f7[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](function(_0x556bda){if(!_0x556bda){logger[_0x7323('0x1b')](_0x7323('0x6b'),_0x7323('0x6a'),0x194,_0x7323('0x6c'));_0x4f64a3[_0x7323('0x2b')](0x194);}else{if(_0x556bda[_0x7323('0x6d')]){throw new db[(_0x7323('0x62'))][(_0x7323('0x63'))](_0x7323('0x6e'));}}return _0x556bda;})['then'](function(_0x566ac5){if(_0x566ac5){return _0x566ac5['update']({'closed':_0x3558f7[_0x7323('0x4c')][_0x7323('0x6f')],'disposition':_0x3558f7[_0x7323('0x4c')][_0x7323('0x70')]})['then'](function(_0x17f9d1){return _0x17f9d1;});}})[_0x7323('0x29')](function(){return respondWithRpcPromise(_0x7323('0x71'),_0x7323('0x6a'),_0x3558f7[_0x7323('0x4c')],client9004);})['then'](respondWithResult(_0x4f64a3,null))['catch'](handleError(_0x4f64a3,null));};exports[_0x7323('0x72')]=function(_0x41e7eb,_0x2546e8){_0x41e7eb[_0x7323('0x4c')]['name']=_0x41e7eb[_0x7323('0x73')][_0x7323('0x74')];_0x41e7eb[_0x7323('0x4c')]['basename']=_0x41e7eb['file'][_0x7323('0x75')];_0x41e7eb[_0x7323('0x4c')]['type']=_0x41e7eb[_0x7323('0x73')][_0x7323('0x76')];return db[_0x7323('0x77')]['create'](_0x41e7eb[_0x7323('0x4c')])['then'](respondWithResult(_0x2546e8,0xc9))['catch'](handleError(_0x2546e8,null));};exports[_0x7323('0x78')]=function(_0x5b0d27,_0x43c913){return db[_0x7323('0x34')][_0x7323('0x51')]({'where':{'id':_0x5b0d27[_0x7323('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43c913,null))[_0x7323('0x29')](function(_0x49f03d){if(_0x49f03d){if(_0x49f03d[_0x7323('0x6f')]){return _0x43c913[_0x7323('0x20')](0x193)[_0x7323('0x21')]({'status':0x193,'message':'Unauthorized'});}return db[_0x7323('0x77')]['findOne']({'where':{'id':_0x5b0d27[_0x7323('0x41')]['attachId']},'raw':!![]})[_0x7323('0x29')](handleEntityNotFound(_0x43c913,null));}})['then'](function(_0x1f7050){if(_0x1f7050){var _0x164e79=_0x1f7050['ChatOfflineMessageId']!==null;var _0x36a1f6=path[_0x7323('0x79')](config[_0x7323('0x7a')],_0x7323('0x7b'));if(_0x164e79){_0x36a1f6=path[_0x7323('0x79')](_0x36a1f6,_0x7323('0x7c'));}var _0x2d8530=path[_0x7323('0x79')](_0x36a1f6,_0x1f7050[_0x7323('0x7d')]);return _0x43c913[_0x7323('0x7e')](_0x2d8530);}})[_0x7323('0x4a')](handleError(_0x43c913,null));};exports[_0x7323('0x7f')]=function(_0x1a1a81,_0x2c5141){var _0x5dfad6=null;var _0xee2372=null;var _0x2d7e04=null;if(_0x1a1a81[_0x7323('0x4c')]['id']){delete _0x1a1a81[_0x7323('0x4c')]['id'];}if(_0x1a1a81[_0x7323('0x4c')][_0x7323('0x80')]){_0x2d7e04=path[_0x7323('0x79')](config[_0x7323('0x7a')],_0x7323('0x81'),util[_0x7323('0x82')](_0x7323('0x83'),Date[_0x7323('0x84')]()));_0x1a1a81['body'][_0x7323('0x85')]=_0x2d7e04;}return db[_0x7323('0x34')][_0x7323('0x4d')]({'where':{'id':_0x1a1a81[_0x7323('0x3e')]['id']},'include':[{'model':db[_0x7323('0x86')],'as':_0x7323('0x87'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x7323('0x29')](handleEntityNotFound(_0x2c5141,null))[_0x7323('0x29')](saveUpdates(_0x1a1a81['body'],null))[_0x7323('0x29')](function(_0x36de3b){if(_0x36de3b){_0x5dfad6=_0x36de3b;return db[_0x7323('0x50')][_0x7323('0x4d')]({'where':{'id':_0x5dfad6['ChatWebsiteId']}});}})['then'](function(_0x34e6fc){if(_0x34e6fc){_0xee2372=_0x34e6fc;return db[_0x7323('0x68')][_0x7323('0x4d')]({'where':{'id':_0x5dfad6[_0x7323('0x88')]}});}})[_0x7323('0x29')](function(_0xd8da4d){if(_0xd8da4d){if(_0x2d7e04){var _0x5ad78c=null;for(var _0x32903c=0x1;_0x32903c<_0x5dfad6[_0x7323('0x87')]['length'];++_0x32903c){_0x5ad78c=_0x5dfad6[_0x7323('0x87')][_0x32903c];var _0x4161bc=_0x5ad78c['UserId']?util['format']('%s%d',_0xee2372['agentAlias'],_0x5ad78c[_0x7323('0x6d')]):_0x7323('0x89');var _0x19bb05=_0x1a1a81['body'][_0x7323('0x8a')]||util['format'](_0x7323('0x8b'),'Visitor',_0x5ad78c[_0x7323('0x88')]);switch(_0xee2372['agentIdentifier']){case'website_alias':_0x4161bc=_0x5ad78c[_0x7323('0x6d')]?util['format'](_0x7323('0x8b'),_0xee2372[_0x7323('0x8c')],_0x5ad78c['UserId']):_0x7323('0x89');break;case _0x7323('0x8d'):_0x4161bc=_0x5ad78c[_0x7323('0x6d')]?_0x5ad78c[_0x7323('0x8e')][_0x7323('0x8f')]||_0x5ad78c['User'][_0x7323('0x58')]:_0x7323('0x89');break;case _0x7323('0x90'):_0x4161bc=_0x5ad78c['UserId']?_0x5ad78c[_0x7323('0x8e')][_0x7323('0x58')]:_0x7323('0x89');break;default:_0x4161bc=_0x5ad78c[_0x7323('0x6d')]?util['format'](_0x7323('0x8b'),_0xee2372[_0x7323('0x8c')],_0x5ad78c[_0x7323('0x6d')]):_0x7323('0x89');}var _0x1fbe64=util[_0x7323('0x82')](_0x7323('0x91'),moment(_0x5ad78c[_0x7323('0x92')])[_0x7323('0x82')](_0x7323('0x93')),_0x5ad78c['direction']==='in'?_0x19bb05:_0x4161bc,_0x5ad78c[_0x7323('0x4c')]);if(!_0x5ad78c[_0x7323('0x94')]){fs[_0x7323('0x95')](_0x2d7e04,_0x1fbe64);}}return db[_0x7323('0x96')][_0x7323('0x51')]({'where':{'service':!![]},'include':[{'model':db[_0x7323('0x97')],'as':_0x7323('0x98'),'raw':!![],'include':[{'model':db[_0x7323('0x99')],'as':_0x7323('0x99'),'raw':!![]}]}]});}}})['then'](function(_0xb563ee){if(!_0xb563ee||!_0xb563ee[_0x7323('0x98')]||!_0x1a1a81[_0x7323('0x4c')])return _0x5dfad6;var _0x1bcf2c=_0xb563ee[_0x7323('0x9a')]();return respondWithRpcPromise(_0x7323('0x9b'),'sendMail',{'account':_0x1bcf2c,'message':{'from':util[_0x7323('0x82')](_0x7323('0x9c'),_0xb563ee[_0x7323('0x2d')],_0xb563ee[_0x7323('0x59')]||_0xb563ee[_0x7323('0x98')][_0x7323('0x3c')]),'to':_0x1a1a81['body'][_0x7323('0x80')],'subject':_0x7323('0x9d'),'text':util[_0x7323('0x82')](_0x7323('0x9e'),_0x1a1a81['body'][_0x7323('0x80')]),'attachments':[{'path':_0x2d7e04}]}})[_0x7323('0x29')](function(){return _0x5dfad6;})[_0x7323('0x4a')](function(_0x42fc3d){logger[_0x7323('0x1b')](_0x42fc3d);});})[_0x7323('0x29')](respondWithStatusCode(_0x2c5141,0xc8))[_0x7323('0x4a')](handleError(_0x2c5141,null));};exports['addMessage']=function(_0x1a008f,_0x196c99){return db[_0x7323('0x86')][_0x7323('0x4d')]({'where':{'id':_0x1a008f['params']['id']}})['then'](handleEntityNotFound(_0x196c99,null))[_0x7323('0x29')](function(_0x37eb38){if(_0x37eb38){return _0x37eb38[_0x7323('0x9f')](_0x1a008f[_0x7323('0x4c')][_0x7323('0xa0')],_[_0x7323('0xa1')](_0x1a008f[_0x7323('0x4c')],[_0x7323('0xa0'),'id'])||{});}})[_0x7323('0x29')](respondWithResult(_0x196c99,null))[_0x7323('0x4a')](handleError(_0x196c99,null));};exports['getMessages']=function(_0x1482c7,_0x151c0a){var _0x1b04a2={'raw':![],'where':{}};var _0x92616d={};var _0x4e6d16={'count':0x0,'rows':[]};return db[_0x7323('0x34')][_0x7323('0x51')]({'where':{'id':_0x1482c7[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](handleEntityNotFound(_0x151c0a,null))[_0x7323('0x29')](function(_0x2d7ff7){if(_0x2d7ff7){_0x92616d['model']=_[_0x7323('0x40')](db['ChatMessage']['rawAttributes']);_0x92616d[_0x7323('0x41')]=_[_0x7323('0x40')](_0x1482c7[_0x7323('0x41')]);_0x92616d[_0x7323('0x42')]=_['intersection'](_0x92616d[_0x7323('0x3f')],_0x92616d[_0x7323('0x41')]);_0x1b04a2['attributes']=_[_0x7323('0x44')](_0x92616d[_0x7323('0x3f')],qs['fields'](_0x1482c7[_0x7323('0x41')]['fields']));_0x1b04a2[_0x7323('0x43')]=_0x1b04a2[_0x7323('0x43')][_0x7323('0x46')]?_0x1b04a2[_0x7323('0x43')]:_0x92616d[_0x7323('0x3f')];if(!_0x1482c7[_0x7323('0x41')][_0x7323('0xa2')]('nolimit')){_0x1b04a2['limit']=qs[_0x7323('0x24')](_0x1482c7[_0x7323('0x41')][_0x7323('0x24')]);_0x1b04a2[_0x7323('0x22')]=qs[_0x7323('0x22')](_0x1482c7['query'][_0x7323('0x22')]);}_0x1b04a2[_0x7323('0xa3')]=qs[_0x7323('0xa4')](_0x1482c7['query']['sort']);_0x1b04a2[_0x7323('0xa5')]=qs[_0x7323('0x42')](_[_0x7323('0xa6')](_0x1482c7[_0x7323('0x41')],_0x92616d[_0x7323('0x42')]));_0x1b04a2[_0x7323('0xa5')][_0x7323('0xa7')]=_0x2d7ff7['id'];if(_0x1482c7[_0x7323('0x41')]['filter']){_0x1b04a2[_0x7323('0xa5')]=_[_0x7323('0x49')](_0x1b04a2['where'],{'$or':_['map'](_0x1b04a2[_0x7323('0x43')],function(_0x37dd3b){var _0x400989={};_0x400989[_0x37dd3b]={'$like':'%'+_0x1482c7['query'][_0x7323('0xa8')]+'%'};return _0x400989;})});}if(_0x1482c7[_0x7323('0x41')][_0x7323('0xa9')]){var _0x22fe2b=_0x1482c7[_0x7323('0x41')][_0x7323('0xa9')]['split'](',');var _0x386b48={};_0x386b48[_0x22fe2b[0x0]]={'$gte':moment(_0x22fe2b[0x1])[_0x7323('0x82')](_0x7323('0xaa'))};_0x1b04a2[_0x7323('0xa5')]=_[_0x7323('0x49')](_0x1b04a2[_0x7323('0xa5')],_0x386b48);}_0x1b04a2=_['merge']({},_0x1b04a2,_0x1482c7[_0x7323('0xab')]);return db[_0x7323('0x86')][_0x7323('0x25')]({'where':_0x1b04a2[_0x7323('0xa5')]})['then'](function(_0x489f2e){_0x4e6d16[_0x7323('0x25')]=_0x489f2e;if(_0x1482c7[_0x7323('0x41')]['includeAll']){_0x1b04a2[_0x7323('0x48')]=[{'all':!![]}];}return db[_0x7323('0x86')][_0x7323('0x3a')](_0x1b04a2);})[_0x7323('0x29')](function(_0x2ddd1d){_0x4e6d16[_0x7323('0xac')]=_0x2ddd1d;return _0x4e6d16;});}})[_0x7323('0x29')](respondWithFilteredResult(_0x151c0a,_0x1b04a2))[_0x7323('0x4a')](handleError(_0x151c0a,null));};exports[_0x7323('0xad')]=function(_0x252404,_0x349e38){var _0x433c16={'where':{}},_0xb3aae7={},_0x1ba542={'count':0x0,'rows':[]};return db[_0x7323('0x34')][_0x7323('0x51')]({'where':{'id':_0x252404[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](handleEntityNotFound(_0x349e38,null))['then'](function(_0x13df43){if(_0x13df43){_0xb3aae7['model']=_[_0x7323('0x40')](db['ChatMessage']['rawAttributes']);_0xb3aae7[_0x7323('0x41')]=_['keys'](_0x252404[_0x7323('0x41')]);_0xb3aae7['filters']=_['intersection'](_0xb3aae7[_0x7323('0x3f')],_0xb3aae7['query']);_0x433c16['attributes']=_[_0x7323('0x44')](_0xb3aae7['model'],qs[_0x7323('0x45')](_0x252404[_0x7323('0x41')]['fields']));_0x433c16[_0x7323('0x43')]=_0x433c16[_0x7323('0x43')][_0x7323('0x46')]?_0x433c16[_0x7323('0x43')]:_0xb3aae7['model'];if(!_0x252404[_0x7323('0x41')][_0x7323('0xa2')](_0x7323('0xae'))){_0x433c16[_0x7323('0x24')]=qs['limit'](_0x252404[_0x7323('0x41')][_0x7323('0x24')]);_0x433c16[_0x7323('0x22')]=qs[_0x7323('0x22')](_0x252404[_0x7323('0x41')][_0x7323('0x22')]);}_0x433c16[_0x7323('0xa3')]=qs[_0x7323('0xa4')](_0x252404[_0x7323('0x41')][_0x7323('0xa4')]);_0x433c16[_0x7323('0xa5')]=qs[_0x7323('0x42')](_['pick'](_0x252404[_0x7323('0x41')],_0xb3aae7[_0x7323('0x42')]));_0x433c16[_0x7323('0xa5')][_0x7323('0xa7')]=_0x13df43['id'];if(_0x252404[_0x7323('0x41')]['filter']){_0x433c16['where']=_[_0x7323('0x49')](_0x433c16[_0x7323('0xa5')],{'$or':_[_0x7323('0x33')](_0x433c16[_0x7323('0x43')],function(_0x3c3c27){var _0x40a7d8={};_0x40a7d8[_0x3c3c27]={'$like':'%'+_0x252404[_0x7323('0x41')][_0x7323('0xa8')]+'%'};return _0x40a7d8;})});}_0x433c16[_0x7323('0xa5')][_0x7323('0x94')]=![];if(_0x252404[_0x7323('0x41')]['id']){_0x433c16[_0x7323('0xa5')]['id']={'$gt':_0x252404[_0x7323('0x41')]['id']};}_0x433c16=_[_0x7323('0x49')]({},_0x433c16,_0x252404[_0x7323('0xab')]);return db[_0x7323('0x86')]['count']({'where':_0x433c16['where']})['then'](function(_0x5aef75){_0x1ba542[_0x7323('0x25')]=_0x5aef75;_0x433c16[_0x7323('0x48')]=[];if(_0x252404[_0x7323('0x41')][_0x7323('0xaf')]){_0x433c16[_0x7323('0x48')]['push']({'model':db[_0x7323('0x8e')],'as':'User','attributes':['id',_0x7323('0x58'),_0x7323('0x8f')]});}if(_0x252404[_0x7323('0x41')][_0x7323('0x47')]){_0x433c16[_0x7323('0x48')]=[{'all':!![]}];}return db['ChatMessage'][_0x7323('0x3a')](_0x433c16);})['then'](function(_0x2bdda6){_0x1ba542[_0x7323('0xac')]=_0x2bdda6;return _0x1ba542;});}})[_0x7323('0x29')](respondWithFilteredResult(_0x349e38,_0x433c16))[_0x7323('0x4a')](handleError(_0x349e38,null));};exports[_0x7323('0xb0')]=function(_0x5608e3,_0x27063f){return db['ChatInteraction']['find']({'where':{'id':_0x5608e3[_0x7323('0x3e')]['id']}})[_0x7323('0x29')](handleEntityNotFound(_0x27063f,null))[_0x7323('0x29')](function(_0x4b21f1){if(_0x4b21f1){return _0x4b21f1[_0x7323('0xb1')](_0x5608e3[_0x7323('0x4c')][_0x7323('0xa0')],_[_0x7323('0xa1')](_0x5608e3[_0x7323('0x4c')],[_0x7323('0xa0'),'id'])||{})['spread'](function(){return db[_0x7323('0xb2')][_0x7323('0x3a')]({'attributes':['id',_0x7323('0x2d'),_0x7323('0xb3')],'where':{'id':_0x5608e3[_0x7323('0x4c')][_0x7323('0xa0')]}});})[_0x7323('0x29')](function(_0xfa854f){socket[_0x7323('0xb4')]('chatInteractionTags:save',{'id':Number(_0x5608e3[_0x7323('0x3e')]['id']),'tags':_0xfa854f||[]});return{'id':Number(_0x5608e3[_0x7323('0x3e')]['id']),'tags':_0xfa854f||[]};});}})[_0x7323('0x29')](respondWithResult(_0x27063f,null))[_0x7323('0x4a')](handleError(_0x27063f,null));};exports[_0x7323('0xb5')]=function(_0x472d1f,_0x377327){return db['ChatInteraction']['find']({'where':{'id':_0x472d1f[_0x7323('0x3e')]['id']}})['then'](handleEntityNotFound(_0x377327,null))[_0x7323('0x29')](function(_0x1eb425){if(_0x1eb425){return _0x1eb425['removeTags'](_0x472d1f[_0x7323('0x41')][_0x7323('0xa0')]);}})['then'](respondWithStatusCode(_0x377327,null))[_0x7323('0x4a')](handleError(_0x377327,null));};exports[_0x7323('0x7e')]=function(_0x3dd7ef,_0x3832fe){var _0x2baf41=moment()['unix']()['toString']();var _0xc4810c=path['join'](config[_0x7323('0x7a')],_0x7323('0xb6'),_0x7323('0xb7'),_0x7323('0xb8'));var _0x1b5fdd=path['join'](config[_0x7323('0x7a')],'server',_0x7323('0xb7'),_0x7323('0xb9'));var _0x4423d0=path[_0x7323('0x79')](_0xc4810c,_0x2baf41);var _0x271811=util[_0x7323('0x82')](_0x7323('0xba'),_0x3dd7ef['params']['id'],_0x2baf41);var _0x391ef0=path['join'](_0xc4810c,_0x271811);var _0x32764c=[];_0x32764c[_0x7323('0xbb')]({'model':db['User'],'as':'User','attributes':['id',_0x7323('0x58')],'raw':!![]});_0x32764c['push']({'model':db[_0x7323('0x68')],'as':_0x7323('0x69'),'attributes':['id',_0x7323('0xbc'),_0x7323('0xbd')],'raw':!![]});if(_0x3dd7ef[_0x7323('0x41')]['attachments']){_0x32764c[_0x7323('0xbb')]({'model':db[_0x7323('0x77')],'as':_0x7323('0x77'),'raw':!![]});}var _0x8bcbcb=[{'model':db[_0x7323('0x86')],'as':_0x7323('0x87'),'attributes':['id',_0x7323('0x4c'),_0x7323('0x92'),'direction',_0x7323('0x94'),_0x7323('0xbe')],'include':_0x32764c}];_0x8bcbcb[_0x7323('0xbb')]({'model':db[_0x7323('0x50')],'as':_0x7323('0xbf'),'attributes':['id',_0x7323('0x2d')]});_0x8bcbcb[_0x7323('0xbb')]({'model':db[_0x7323('0x8e')],'as':_0x7323('0xc0'),'attributes':['id',_0x7323('0x58')]});return db['ChatInteraction']['find']({'where':{'id':_0x3dd7ef['params']['id']},'include':_0x8bcbcb})[_0x7323('0x29')](handleEntityNotFound(_0x3832fe,null))['then'](function(_0x11fe27){if(_0x11fe27){var _0x2083ce=_0x11fe27[_0x7323('0xc1')]({'plain':!![]});fs[_0x7323('0xc2')](_0x4423d0);var _0x153067={'channel':_0x7323('0xc3'),'account':_0x2083ce[_0x7323('0xbf')][_0x7323('0x2d')],'agent':_0x2083ce[_0x7323('0xc0')]?_0x2083ce[_0x7323('0xc0')][_0x7323('0x58')]:_0x7323('0xc4'),'createdAt':moment(_0x2083ce[_0x7323('0x92')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2083ce[_0x7323('0x6f')]?moment(_0x2083ce['closedAt'])[_0x7323('0x82')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7323('0xc5')]():'','disposition':_0x2083ce[_0x7323('0x70')],'chatInfo':{'browser':_0x2083ce[_0x7323('0xc6')],'os':_0x2083ce[_0x7323('0xc7')],'referer':_0x2083ce[_0x7323('0xc8')],'customerIp':_0x2083ce[_0x7323('0xc9')],'customerPort':_0x2083ce[_0x7323('0xca')]?_0x2083ce[_0x7323('0xca')]:_0x7323('0xc4')},'messages':_(_0x2083ce[_0x7323('0x87')])[_0x7323('0xcb')]()[_0x7323('0xa8')]({'secret':![]})[_0x7323('0x33')](function(_0x15197e){if(_0x15197e[_0x7323('0x77')]){var _0x4bca=path[_0x7323('0x79')](_0x1b5fdd,_0x15197e[_0x7323('0x77')][_0x7323('0x7d')]);if(fs[_0x7323('0xcc')](_0x4bca)){fs[_0x7323('0xcd')](_0x4bca)['pipe'](fs[_0x7323('0xce')](path[_0x7323('0x79')](_0x4423d0,_0x15197e[_0x7323('0x77')][_0x7323('0x7d')])));}}return{'date':moment(_0x15197e[_0x7323('0x92')])['format'](_0x7323('0xaa'))[_0x7323('0xc5')](),'sender':_0x15197e[_0x7323('0xcf')]===_0x7323('0x65')?_0x15197e[_0x7323('0x8e')]?_0x15197e[_0x7323('0x8e')][_0x7323('0x58')]:_0x7323('0x89'):_0x15197e['Contact'][_0x7323('0xbc')]+(_0x15197e[_0x7323('0x69')][_0x7323('0xbd')]?'\x20'+_0x15197e[_0x7323('0x69')]['lastName']:''),'body':_0x15197e[_0x7323('0x77')]?_0x15197e[_0x7323('0x77')][_0x7323('0x7d')]:_0x15197e[_0x7323('0x4c')],'direction':_0x15197e[_0x7323('0xcf')]===_0x7323('0x65')?'A':'C','secret':_0x15197e[_0x7323('0x94')],'read':_0x15197e['read'],'attachment':_0x15197e['Attachment']};})[_0x7323('0xd0')]()};return ejs[_0x7323('0xd1')](path[_0x7323('0x79')](config[_0x7323('0x7a')],_0x7323('0xb6'),_0x7323('0xd2'),_0x7323('0xd3')),{'interaction':_0x153067})[_0x7323('0x29')](function(_0x322552){var _0x5f2056=path[_0x7323('0x79')](_0x4423d0,_0x7323('0xd4')+_0x2083ce['id']+'-'+_0x2baf41+_0x7323('0xd5'));var _0x3621c7={'path':_0x5f2056,'channel':_0x7323('0xc3'),'interactionId':_0x2083ce['id']};return pdf[_0x7323('0xd6')](_0x322552,_0x3621c7);})[_0x7323('0x29')](function(){return new Promise(function(_0xf2e9ec,_0x452cb5){zipdir(_0x4423d0,{'saveTo':_0x391ef0},function(_0xd71d6c,_0x39450b){if(_0xd71d6c)return _0x452cb5(_0xd71d6c);return _0xf2e9ec(_0x39450b);});})[_0x7323('0x29')](function(){return new BPromise(function(_0x58643a,_0x510541){rimraf(_0x4423d0,function(_0x569daa){if(_0x569daa)_0x510541(_0x569daa);return _0x58643a();});});})[_0x7323('0x29')](function(){return _0x3832fe['download'](_0x391ef0,_0x271811,function(_0x41780e){if(_0x41780e){logger[_0x7323('0x1b')](_0x7323('0xd7'),_0x41780e);}else{fs[_0x7323('0xd8')](_0x391ef0);}});});});}else{return _0x3832fe['sendStatus'](0xc8);}})[_0x7323('0x4a')](handleError(_0x3832fe,null));};
\ No newline at end of file
+var _0xb1df=['ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','pick','includeAgent','addTags','setTags','omit','spread','emit','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','createdAt','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','disposition','osName','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','views','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','name','send','merge','contact','interaction','index','map','ChatInteraction','type','key','getOptions','findAll','query','user','show','model','rawAttributes','keys','filters','attributes','fields','length','includeAll','include','options','create','body','find','params','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','account','POST','isNull','follow','vidaooMetadata','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','download','root','server/files/chat/upload/','now','pathTranscript','Messages','User','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','getMessages','intersection','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3ee24c,_0x5de268){var _0x5ab48c=function(_0x642e89){while(--_0x642e89){_0x3ee24c['push'](_0x3ee24c['shift']());}};_0x5ab48c(++_0x5de268);}(_0xb1df,0x1c7));var _0xfb1d=function(_0x4ba75c,_0x2290d8){_0x4ba75c=_0x4ba75c-0x0;var _0x569f04=_0xb1df[_0x4ba75c];return _0x569f04;};'use strict';var rimraf=require(_0xfb1d('0x0'));var zipdir=require(_0xfb1d('0x1'));var rp=require(_0xfb1d('0x2'));var moment=require('moment');var BPromise=require(_0xfb1d('0x3'));var Mustache=require(_0xfb1d('0x4'));var util=require(_0xfb1d('0x5'));var path=require(_0xfb1d('0x6'));var ejs=require(_0xfb1d('0x7'));var fs=require('fs');var _=require(_0xfb1d('0x8'));var Redis=require(_0xfb1d('0x9'));var interaction=require(_0xfb1d('0xa'));var qs=require(_0xfb1d('0xb'));var pdf=require(_0xfb1d('0xc'));var logger=require(_0xfb1d('0xd'))(_0xfb1d('0xe'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xfb1d('0xf')]=_['defaults'](config['redis'],{'host':_0xfb1d('0x10'),'port':0x18eb});var socket=require(_0xfb1d('0x11'))(new Redis(config[_0xfb1d('0xf')]));require('./chatInteraction.socket')[_0xfb1d('0x12')](socket);var jayson=require(_0xfb1d('0x13'));var client=jayson[_0xfb1d('0x14')]['http']({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x212d14,_0x246de5,_0x301bb6,_0x17fe3f){return new BPromise(function(_0x1c2161,_0x8666ad){var _0x5f5ab5=_0x17fe3f||client;return _0x5f5ab5[_0xfb1d('0x15')](_0x212d14,_0x301bb6)['then'](function(_0x57a7dd){logger[_0xfb1d('0x16')](_0xfb1d('0x17'),_0x246de5,_0xfb1d('0x18'));logger['debug'](_0xfb1d('0x19'),_0x246de5,_0xfb1d('0x18'),JSON['stringify'](_0x57a7dd));if(_0x57a7dd[_0xfb1d('0x1a')]){if(_0x57a7dd[_0xfb1d('0x1a')]['code']===0x1f4){logger[_0xfb1d('0x1a')](_0xfb1d('0x17'),_0x246de5,_0x57a7dd[_0xfb1d('0x1a')][_0xfb1d('0x1b')]);return _0x8666ad(_0x57a7dd['error']['message']);}logger[_0xfb1d('0x1a')](_0xfb1d('0x17'),_0x246de5,_0x57a7dd[_0xfb1d('0x1a')][_0xfb1d('0x1b')]);return _0x1c2161(_0x57a7dd[_0xfb1d('0x1a')][_0xfb1d('0x1b')]);}else{logger['info'](_0xfb1d('0x17'),_0x246de5,_0xfb1d('0x18'));_0x1c2161(_0x57a7dd[_0xfb1d('0x1c')]['message']);}})[_0xfb1d('0x1d')](function(_0x2e0421){logger[_0xfb1d('0x1a')](_0xfb1d('0x17'),_0x246de5,_0x2e0421);_0x8666ad(_0x2e0421);});});}function respondWithStatusCode(_0x5b1ab8,_0x5198b6){_0x5198b6=_0x5198b6||0xcc;return function(_0x52f26f){if(_0x52f26f){return _0x5b1ab8[_0xfb1d('0x1e')](_0x5198b6);}return _0x5b1ab8[_0xfb1d('0x1f')](_0x5198b6)[_0xfb1d('0x20')]();};}function respondWithResult(_0x3b394c,_0x25c0d4){_0x25c0d4=_0x25c0d4||0xc8;return function(_0x36e4be){if(_0x36e4be){return _0x3b394c[_0xfb1d('0x1f')](_0x25c0d4)[_0xfb1d('0x21')](_0x36e4be);}};}function respondWithFilteredResult(_0x418c89,_0x2cfc06){return function(_0x230990){if(_0x230990){var _0x43fcbf=typeof _0x2cfc06[_0xfb1d('0x22')]===_0xfb1d('0x23')&&typeof _0x2cfc06[_0xfb1d('0x24')]===_0xfb1d('0x23');var _0x346913=_0x230990[_0xfb1d('0x25')];var _0x3c2d8b=_0x43fcbf?0x0:_0x2cfc06['offset'];var _0x16ebfb=_0x43fcbf?_0x230990[_0xfb1d('0x25')]:_0x2cfc06[_0xfb1d('0x22')]+_0x2cfc06[_0xfb1d('0x24')];var _0x1316ad;if(_0x16ebfb>=_0x346913){_0x16ebfb=_0x346913;_0x1316ad=0xc8;}else{_0x1316ad=0xce;}_0x418c89[_0xfb1d('0x1f')](_0x1316ad);return _0x418c89[_0xfb1d('0x26')](_0xfb1d('0x27'),_0x3c2d8b+'-'+_0x16ebfb+'/'+_0x346913)['json'](_0x230990);}return null;};}function saveUpdates(_0x4596cc){return function(_0x367906){if(_0x367906){return _0x367906[_0xfb1d('0x28')](_0x4596cc)['then'](function(_0x4ad22b){return _0x4ad22b;});}return null;};}function removeEntity(_0x409c3d){return function(_0x3f7e5b){if(_0x3f7e5b){return _0x3f7e5b['destroy']()[_0xfb1d('0x29')](function(){_0x409c3d['status'](0xcc)[_0xfb1d('0x20')]();});}};}function handleEntityNotFound(_0x1fd165){return function(_0x1ac6db){if(!_0x1ac6db){_0x1fd165[_0xfb1d('0x1e')](0x194);}return _0x1ac6db;};}function handleError(_0x3a92b8,_0x2f6d0e){_0x2f6d0e=_0x2f6d0e||0x1f4;return function(_0x36625d){logger['error'](_0x36625d['stack']);if(_0x36625d[_0xfb1d('0x2a')]){delete _0x36625d[_0xfb1d('0x2a')];}_0x3a92b8[_0xfb1d('0x1f')](_0x2f6d0e)[_0xfb1d('0x2b')](_0x36625d);};}function getMustacheRender(_0x72dc36,_0x27f635){return Mustache['render'](_0x72dc36,_[_0xfb1d('0x2c')](_0x27f635['body'],{'contact':_0x27f635[_0xfb1d('0x2d')],'message':_0x27f635[_0xfb1d('0x1b')],'agent':_0x27f635['agent'],'interaction':_0x27f635[_0xfb1d('0x2e')],'account':_0x27f635['account']}))||'';}exports[_0xfb1d('0x2f')]=function(_0x2b1dc9,_0x778144){var _0x34d01e={};var _0x4231f6=_[_0xfb1d('0x30')](db[_0xfb1d('0x31')]['rawAttributes'],function(_0x53200e){return{'name':_0x53200e['fieldName'],'type':_0x53200e[_0xfb1d('0x32')][_0xfb1d('0x33')]};});_0x34d01e=qs[_0xfb1d('0x34')](_0x4231f6,_0x2b1dc9);return interaction[_0xfb1d('0x35')]('chat',_0x2b1dc9[_0xfb1d('0x36')],_0x2b1dc9[_0xfb1d('0x37')],_0x34d01e,_0x4231f6)['then'](respondWithFilteredResult(_0x778144,_0x34d01e))['catch'](handleError(_0x778144,null));};exports[_0xfb1d('0x38')]=function(_0x59716b,_0x22b69e){var _0x44d0b3={'raw':![],'where':{'id':_0x59716b['params']['id']}},_0x10c021={};_0x10c021[_0xfb1d('0x39')]=_['keys'](db[_0xfb1d('0x31')][_0xfb1d('0x3a')]);_0x10c021[_0xfb1d('0x36')]=_[_0xfb1d('0x3b')](_0x59716b['query']);_0x10c021[_0xfb1d('0x3c')]=_['intersection'](_0x10c021[_0xfb1d('0x39')],_0x10c021['query']);_0x44d0b3[_0xfb1d('0x3d')]=_['intersection'](_0x10c021[_0xfb1d('0x39')],qs[_0xfb1d('0x3e')](_0x59716b[_0xfb1d('0x36')][_0xfb1d('0x3e')]));_0x44d0b3[_0xfb1d('0x3d')]=_0x44d0b3[_0xfb1d('0x3d')][_0xfb1d('0x3f')]?_0x44d0b3['attributes']:_0x10c021[_0xfb1d('0x39')];if(_0x59716b[_0xfb1d('0x36')][_0xfb1d('0x40')]){_0x44d0b3[_0xfb1d('0x41')]=[{'all':!![]}];}_0x44d0b3=_[_0xfb1d('0x2c')]({},_0x44d0b3,_0x59716b[_0xfb1d('0x42')]);return db[_0xfb1d('0x31')]['find'](_0x44d0b3)['then'](handleEntityNotFound(_0x22b69e,null))['then'](respondWithResult(_0x22b69e,null))[_0xfb1d('0x1d')](handleError(_0x22b69e,null));};exports[_0xfb1d('0x43')]=function(_0x27a11e,_0x2f3a72){return db[_0xfb1d('0x31')][_0xfb1d('0x43')](_0x27a11e[_0xfb1d('0x44')],{})[_0xfb1d('0x29')](respondWithResult(_0x2f3a72,0xc9))[_0xfb1d('0x1d')](handleError(_0x2f3a72,null));};exports[_0xfb1d('0x28')]=function(_0x290b9a,_0xd5e91c){if(_0x290b9a[_0xfb1d('0x44')]['id']){delete _0x290b9a[_0xfb1d('0x44')]['id'];}return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x290b9a[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0xd5e91c,null))[_0xfb1d('0x29')](saveUpdates(_0x290b9a[_0xfb1d('0x44')],null))[_0xfb1d('0x29')](respondWithResult(_0xd5e91c,null))[_0xfb1d('0x1d')](handleError(_0xd5e91c,null));};exports['destroy']=function(_0x23f714,_0x158ed3){return db['ChatInteraction']['find']({'where':{'id':_0x23f714[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x158ed3,null))[_0xfb1d('0x29')](removeEntity(_0x158ed3,null))['catch'](handleError(_0x158ed3,null));};exports[_0xfb1d('0x47')]=function(_0x58903f,_0x451e40){return db[_0xfb1d('0x31')]['describe']()[_0xfb1d('0x29')](respondWithResult(_0x451e40,null))[_0xfb1d('0x1d')](handleError(_0x451e40,null));};exports['createVidaooSession']=function(_0x37c46b,_0x412b3e){var _0x2c3e7e=_0x37c46b[_0xfb1d('0x46')]['id'];var _0x55b410;var _0x50f6b0;var _0x15dde2;return db[_0xfb1d('0x31')][_0xfb1d('0x48')]({'where':{'id':_0x2c3e7e}})[_0xfb1d('0x29')](function(_0x4613cd){_0x55b410=_0x4613cd;return db[_0xfb1d('0x49')][_0xfb1d('0x48')]({'where':{'id':_0x4613cd[_0xfb1d('0x4a')]},'attributes':['id',_0xfb1d('0x4b'),_0xfb1d('0x4c'),_0xfb1d('0x4d'),_0xfb1d('0x4e'),'vidaooMetadata'],'raw':!![]});})[_0xfb1d('0x29')](function(_0x2780a9){if(_0x2780a9&&_0x2780a9[_0xfb1d('0x4b')]&&_0x2780a9[_0xfb1d('0x4c')]){_0x50f6b0=_0x2780a9;var _0x329a5c={'interaction':{'id':_0x2c3e7e},'agent':{'id':_0x37c46b[_0xfb1d('0x37')]['id'],'name':_0x37c46b[_0xfb1d('0x37')][_0xfb1d('0x2a')],'fullname':_0x37c46b[_0xfb1d('0x37')][_0xfb1d('0x4f')],'email':_0x37c46b[_0xfb1d('0x37')][_0xfb1d('0x50')]},'contact':_0x37c46b[_0xfb1d('0x44')][_0xfb1d('0x2d')],'account':_0x37c46b[_0xfb1d('0x44')][_0xfb1d('0x51')]};var _0x55da56={'rejectUnauthorized':![],'method':_0xfb1d('0x52'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2780a9[_0xfb1d('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x37c46b[_0xfb1d('0x37')][_0xfb1d('0x50')]],'buttons':null,'topic':_0x50f6b0[_0xfb1d('0x4d')],'note':_[_0xfb1d('0x53')](_0x50f6b0[_0xfb1d('0x4e')])?null:getMustacheRender(_0x50f6b0['vidaooNote'],_0x329a5c),'metadata':null},'redirect':_0xfb1d('0x54'),'json':!![]};try{if(!_['isNull'](_0x50f6b0[_0xfb1d('0x55')])){var _0x681717=getMustacheRender(_0x50f6b0['vidaooMetadata'],_0x329a5c);var _0x4b6a1d=JSON[_0xfb1d('0x56')](_0x681717);_0x55da56['body']['metadata']=_0x4b6a1d;}}catch(_0x1cddb5){throw new db['Sequelize'][(_0xfb1d('0x57'))](_0xfb1d('0x58'));}return rp(_0x55da56);}else{throw new db[(_0xfb1d('0x59'))][(_0xfb1d('0x57'))](_0xfb1d('0x5a'));}})[_0xfb1d('0x29')](function(_0x3ddbd4){_0x15dde2=_0x3ddbd4;if(_0x15dde2['id']){var _0x58f9dd={'body':_0x15dde2[_0xfb1d('0x5b')],'ChatWebsiteId':_0x50f6b0['id'],'ChatInteractionId':_0x55b410['id'],'direction':_0xfb1d('0x5c'),'UserId':_0x37c46b[_0xfb1d('0x37')]['id']};return db[_0xfb1d('0x5d')][_0xfb1d('0x43')](_0x58f9dd,{});}else{throw new db[(_0xfb1d('0x59'))][(_0xfb1d('0x57'))](_0xfb1d('0x5e'));}})[_0xfb1d('0x29')](function(){return _0x55b410['updateAttributes']({'vidaooSessionId':_0x15dde2['id']});})[_0xfb1d('0x29')](respondWithResult(_0x412b3e,null))[_0xfb1d('0x1d')](handleError(_0x412b3e,null));};exports[_0xfb1d('0x5f')]=function(_0x52967a,_0x16da21){if(_0x52967a[_0xfb1d('0x44')]['id']){delete _0x52967a['body']['id'];}return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x52967a[_0xfb1d('0x46')]['id']},'include':[{'model':db[_0xfb1d('0x60')],'as':_0xfb1d('0x61')}]})[_0xfb1d('0x29')](handleEntityNotFound(_0x16da21,null))[_0xfb1d('0x29')](saveUpdates(_0x52967a['body'],null))['then'](respondWithResult(_0x16da21,null))[_0xfb1d('0x1d')](handleError(_0x16da21,null));};exports[_0xfb1d('0x62')]=function(_0x392ccf,_0x22c2d3){if(_0x392ccf['body']['id']){delete _0x392ccf[_0xfb1d('0x44')]['id'];}return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x392ccf[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](function(_0x1b2ba4){if(!_0x1b2ba4){logger[_0xfb1d('0x1a')](_0xfb1d('0x63'),_0xfb1d('0x62'),0x194,_0xfb1d('0x64'));_0x22c2d3[_0xfb1d('0x1e')](0x194);}else{if(_0x1b2ba4[_0xfb1d('0x65')]){throw new db[(_0xfb1d('0x59'))][(_0xfb1d('0x57'))](_0xfb1d('0x66'));}}return _0x1b2ba4;})[_0xfb1d('0x29')](function(_0x1ef426){if(_0x1ef426){return _0x1ef426[_0xfb1d('0x28')]({'closed':_0x392ccf[_0xfb1d('0x44')][_0xfb1d('0x67')],'disposition':_0x392ccf[_0xfb1d('0x44')]['disposition']})[_0xfb1d('0x29')](function(_0x8f755e){return _0x8f755e;});}})['then'](function(){return respondWithRpcPromise(_0xfb1d('0x68'),_0xfb1d('0x62'),_0x392ccf[_0xfb1d('0x44')],client9004);})[_0xfb1d('0x29')](respondWithResult(_0x22c2d3,null))['catch'](handleError(_0x22c2d3,null));};exports[_0xfb1d('0x69')]=function(_0x14e160,_0x13e099){_0x14e160['body'][_0xfb1d('0x2a')]=_0x14e160[_0xfb1d('0x6a')][_0xfb1d('0x6b')];_0x14e160[_0xfb1d('0x44')][_0xfb1d('0x6c')]=_0x14e160[_0xfb1d('0x6a')][_0xfb1d('0x6d')];_0x14e160[_0xfb1d('0x44')][_0xfb1d('0x32')]=_0x14e160[_0xfb1d('0x6a')][_0xfb1d('0x6e')];return db[_0xfb1d('0x6f')]['create'](_0x14e160[_0xfb1d('0x44')])['then'](respondWithResult(_0x13e099,0xc9))[_0xfb1d('0x1d')](handleError(_0x13e099,null));};exports[_0xfb1d('0x70')]=function(_0x1fd93e,_0x21e7ee){return db[_0xfb1d('0x31')]['findOne']({'where':{'id':_0x1fd93e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x21e7ee,null))['then'](function(_0xbede25){if(_0xbede25){if(_0xbede25[_0xfb1d('0x67')]){return _0x21e7ee[_0xfb1d('0x1f')](0x193)[_0xfb1d('0x21')]({'status':0x193,'message':_0xfb1d('0x71')});}return db[_0xfb1d('0x6f')]['findOne']({'where':{'id':_0x1fd93e['query'][_0xfb1d('0x72')]},'raw':!![]})['then'](handleEntityNotFound(_0x21e7ee,null));}})[_0xfb1d('0x29')](function(_0x5002e8){if(_0x5002e8){var _0xa769fb=_0x5002e8[_0xfb1d('0x73')]!==null;var _0x4785f1=path[_0xfb1d('0x74')](config['root'],'server/files/attachments/');if(_0xa769fb){_0x4785f1=path[_0xfb1d('0x74')](_0x4785f1,_0xfb1d('0x75'));}var _0x2e3db0=path[_0xfb1d('0x74')](_0x4785f1,_0x5002e8[_0xfb1d('0x6c')]);return _0x21e7ee[_0xfb1d('0x76')](_0x2e3db0);}})[_0xfb1d('0x1d')](handleError(_0x21e7ee,null));};exports['close']=function(_0x3db04a,_0x184e2b){var _0x31fa42=null;var _0x2c3aec=null;var _0x48a63f=null;if(_0x3db04a[_0xfb1d('0x44')]['id']){delete _0x3db04a['body']['id'];}if(_0x3db04a['body']['mailTranscript']){_0x48a63f=path['join'](config[_0xfb1d('0x77')],_0xfb1d('0x78'),util['format']('transcript-%s.txt',Date[_0xfb1d('0x79')]()));_0x3db04a['body'][_0xfb1d('0x7a')]=_0x48a63f;}return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x3db04a[_0xfb1d('0x46')]['id']},'include':[{'model':db[_0xfb1d('0x5d')],'as':_0xfb1d('0x7b'),'include':[{'model':db['User'],'as':_0xfb1d('0x7c')}]}]})[_0xfb1d('0x29')](handleEntityNotFound(_0x184e2b,null))[_0xfb1d('0x29')](saveUpdates(_0x3db04a['body'],null))[_0xfb1d('0x29')](function(_0x219450){if(_0x219450){_0x31fa42=_0x219450;return db[_0xfb1d('0x49')][_0xfb1d('0x45')]({'where':{'id':_0x31fa42[_0xfb1d('0x4a')]}});}})[_0xfb1d('0x29')](function(_0x4b2a61){if(_0x4b2a61){_0x2c3aec=_0x4b2a61;return db['CmContact'][_0xfb1d('0x45')]({'where':{'id':_0x31fa42[_0xfb1d('0x7d')]}});}})['then'](function(_0x34867e){if(_0x34867e){if(_0x48a63f){var _0x25b1cd=null;for(var _0x5929bf=0x1;_0x5929bf<_0x31fa42[_0xfb1d('0x7b')][_0xfb1d('0x3f')];++_0x5929bf){_0x25b1cd=_0x31fa42[_0xfb1d('0x7b')][_0x5929bf];var _0x52cb8f=_0x25b1cd[_0xfb1d('0x65')]?util[_0xfb1d('0x7e')]('%s%d',_0x2c3aec[_0xfb1d('0x7f')],_0x25b1cd[_0xfb1d('0x65')]):_0xfb1d('0x80');var _0x5ab33f=_0x3db04a[_0xfb1d('0x44')][_0xfb1d('0x81')]||util[_0xfb1d('0x7e')](_0xfb1d('0x82'),_0xfb1d('0x83'),_0x25b1cd[_0xfb1d('0x7d')]);switch(_0x2c3aec[_0xfb1d('0x84')]){case _0xfb1d('0x85'):_0x52cb8f=_0x25b1cd[_0xfb1d('0x65')]?util[_0xfb1d('0x7e')]('%s%d',_0x2c3aec[_0xfb1d('0x7f')],_0x25b1cd[_0xfb1d('0x65')]):_0xfb1d('0x80');break;case _0xfb1d('0x86'):_0x52cb8f=_0x25b1cd['UserId']?_0x25b1cd['User']['alias']||_0x25b1cd[_0xfb1d('0x7c')][_0xfb1d('0x4f')]:_0xfb1d('0x80');break;case _0xfb1d('0x87'):_0x52cb8f=_0x25b1cd[_0xfb1d('0x65')]?_0x25b1cd[_0xfb1d('0x7c')][_0xfb1d('0x4f')]:_0xfb1d('0x80');break;default:_0x52cb8f=_0x25b1cd[_0xfb1d('0x65')]?util[_0xfb1d('0x7e')]('%s%d',_0x2c3aec[_0xfb1d('0x7f')],_0x25b1cd[_0xfb1d('0x65')]):'System';}var _0x936c1e=util[_0xfb1d('0x7e')](_0xfb1d('0x88'),moment(_0x25b1cd['createdAt'])['format'](_0xfb1d('0x89')),_0x25b1cd[_0xfb1d('0x8a')]==='in'?_0x5ab33f:_0x52cb8f,_0x25b1cd[_0xfb1d('0x44')]);if(!_0x25b1cd[_0xfb1d('0x8b')]){fs[_0xfb1d('0x8c')](_0x48a63f,_0x936c1e);}}return db[_0xfb1d('0x8d')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfb1d('0x8e')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xfb1d('0x8f')],'as':_0xfb1d('0x8f'),'raw':!![]}]}]});}}})['then'](function(_0x3d6e9f){if(!_0x3d6e9f||!_0x3d6e9f[_0xfb1d('0x90')]||!_0x3db04a[_0xfb1d('0x44')])return _0x31fa42;var _0x1437ff=_0x3d6e9f[_0xfb1d('0x91')]();return respondWithRpcPromise(_0xfb1d('0x92'),_0xfb1d('0x93'),{'account':_0x1437ff,'message':{'from':util[_0xfb1d('0x7e')]('\x22%s\x22\x20<%s>',_0x3d6e9f[_0xfb1d('0x2a')],_0x3d6e9f[_0xfb1d('0x50')]||_0x3d6e9f['Smtp'][_0xfb1d('0x37')]),'to':_0x3db04a[_0xfb1d('0x44')]['mailTranscript'],'subject':_0xfb1d('0x94'),'text':util[_0xfb1d('0x7e')](_0xfb1d('0x95'),_0x3db04a[_0xfb1d('0x44')][_0xfb1d('0x96')]),'attachments':[{'path':_0x48a63f}]}})['then'](function(){return _0x31fa42;})[_0xfb1d('0x1d')](function(_0x2734ad){logger[_0xfb1d('0x1a')](_0x2734ad);});})[_0xfb1d('0x29')](respondWithStatusCode(_0x184e2b,0xc8))[_0xfb1d('0x1d')](handleError(_0x184e2b,null));};exports['addMessage']=function(_0x17a580,_0x28876a){return db[_0xfb1d('0x5d')]['find']({'where':{'id':_0x17a580[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x28876a,null))[_0xfb1d('0x29')](function(_0x453376){if(_0x453376){return _0x453376[_0xfb1d('0x97')](_0x17a580['body']['ids'],_['omit'](_0x17a580['body'],[_0xfb1d('0x98'),'id'])||{});}})[_0xfb1d('0x29')](respondWithResult(_0x28876a,null))[_0xfb1d('0x1d')](handleError(_0x28876a,null));};exports[_0xfb1d('0x99')]=function(_0x3f9eb2,_0x4a4439){var _0x163713={'raw':![],'where':{}};var _0x55cebf={};var _0x100d65={'count':0x0,'rows':[]};return db[_0xfb1d('0x31')][_0xfb1d('0x48')]({'where':{'id':_0x3f9eb2[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x4a4439,null))[_0xfb1d('0x29')](function(_0x1d8b73){if(_0x1d8b73){_0x55cebf[_0xfb1d('0x39')]=_[_0xfb1d('0x3b')](db[_0xfb1d('0x5d')][_0xfb1d('0x3a')]);_0x55cebf[_0xfb1d('0x36')]=_[_0xfb1d('0x3b')](_0x3f9eb2['query']);_0x55cebf[_0xfb1d('0x3c')]=_[_0xfb1d('0x9a')](_0x55cebf[_0xfb1d('0x39')],_0x55cebf[_0xfb1d('0x36')]);_0x163713[_0xfb1d('0x3d')]=_['intersection'](_0x55cebf['model'],qs[_0xfb1d('0x3e')](_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x3e')]));_0x163713['attributes']=_0x163713['attributes']['length']?_0x163713[_0xfb1d('0x3d')]:_0x55cebf[_0xfb1d('0x39')];if(!_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x9b')](_0xfb1d('0x9c'))){_0x163713[_0xfb1d('0x24')]=qs[_0xfb1d('0x24')](_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x24')]);_0x163713['offset']=qs[_0xfb1d('0x22')](_0x3f9eb2['query'][_0xfb1d('0x22')]);}_0x163713[_0xfb1d('0x9d')]=qs[_0xfb1d('0x9e')](_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x9e')]);_0x163713['where']=qs[_0xfb1d('0x3c')](_['pick'](_0x3f9eb2[_0xfb1d('0x36')],_0x55cebf['filters']));_0x163713[_0xfb1d('0x9f')][_0xfb1d('0xa0')]=_0x1d8b73['id'];if(_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0xa1')]){_0x163713[_0xfb1d('0x9f')]=_[_0xfb1d('0x2c')](_0x163713['where'],{'$or':_[_0xfb1d('0x30')](_0x163713['attributes'],function(_0x26ec67){var _0x4a1067={};_0x4a1067[_0x26ec67]={'$like':'%'+_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0xa1')]+'%'};return _0x4a1067;})});}if(_0x3f9eb2['query'][_0xfb1d('0xa2')]){var _0x411b0d=_0x3f9eb2[_0xfb1d('0x36')]['$gte']['split'](',');var _0xafa48d={};_0xafa48d[_0x411b0d[0x0]]={'$gte':moment(_0x411b0d[0x1])[_0xfb1d('0x7e')](_0xfb1d('0xa3'))};_0x163713[_0xfb1d('0x9f')]=_[_0xfb1d('0x2c')](_0x163713['where'],_0xafa48d);}_0x163713=_[_0xfb1d('0x2c')]({},_0x163713,_0x3f9eb2[_0xfb1d('0x42')]);return db[_0xfb1d('0x5d')][_0xfb1d('0x25')]({'where':_0x163713[_0xfb1d('0x9f')]})[_0xfb1d('0x29')](function(_0x374e02){_0x100d65[_0xfb1d('0x25')]=_0x374e02;if(_0x3f9eb2[_0xfb1d('0x36')][_0xfb1d('0x40')]){_0x163713[_0xfb1d('0x41')]=[{'all':!![]}];}return db[_0xfb1d('0x5d')][_0xfb1d('0x35')](_0x163713);})[_0xfb1d('0x29')](function(_0x3d30de){_0x100d65[_0xfb1d('0xa4')]=_0x3d30de;return _0x100d65;});}})[_0xfb1d('0x29')](respondWithFilteredResult(_0x4a4439,_0x163713))[_0xfb1d('0x1d')](handleError(_0x4a4439,null));};exports['getMyMessages']=function(_0xde3f08,_0x475524){var _0xb3deae={'where':{}},_0xd8a9f3={},_0x1c83e0={'count':0x0,'rows':[]};return db[_0xfb1d('0x31')][_0xfb1d('0x48')]({'where':{'id':_0xde3f08[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x475524,null))[_0xfb1d('0x29')](function(_0x1e9f50){if(_0x1e9f50){_0xd8a9f3[_0xfb1d('0x39')]=_[_0xfb1d('0x3b')](db[_0xfb1d('0x5d')][_0xfb1d('0x3a')]);_0xd8a9f3[_0xfb1d('0x36')]=_[_0xfb1d('0x3b')](_0xde3f08[_0xfb1d('0x36')]);_0xd8a9f3[_0xfb1d('0x3c')]=_[_0xfb1d('0x9a')](_0xd8a9f3[_0xfb1d('0x39')],_0xd8a9f3[_0xfb1d('0x36')]);_0xb3deae[_0xfb1d('0x3d')]=_[_0xfb1d('0x9a')](_0xd8a9f3[_0xfb1d('0x39')],qs[_0xfb1d('0x3e')](_0xde3f08[_0xfb1d('0x36')]['fields']));_0xb3deae[_0xfb1d('0x3d')]=_0xb3deae[_0xfb1d('0x3d')][_0xfb1d('0x3f')]?_0xb3deae['attributes']:_0xd8a9f3[_0xfb1d('0x39')];if(!_0xde3f08[_0xfb1d('0x36')]['hasOwnProperty'](_0xfb1d('0x9c'))){_0xb3deae[_0xfb1d('0x24')]=qs['limit'](_0xde3f08['query'][_0xfb1d('0x24')]);_0xb3deae[_0xfb1d('0x22')]=qs['offset'](_0xde3f08[_0xfb1d('0x36')][_0xfb1d('0x22')]);}_0xb3deae[_0xfb1d('0x9d')]=qs[_0xfb1d('0x9e')](_0xde3f08[_0xfb1d('0x36')]['sort']);_0xb3deae[_0xfb1d('0x9f')]=qs[_0xfb1d('0x3c')](_[_0xfb1d('0xa5')](_0xde3f08[_0xfb1d('0x36')],_0xd8a9f3[_0xfb1d('0x3c')]));_0xb3deae['where'][_0xfb1d('0xa0')]=_0x1e9f50['id'];if(_0xde3f08[_0xfb1d('0x36')][_0xfb1d('0xa1')]){_0xb3deae['where']=_[_0xfb1d('0x2c')](_0xb3deae[_0xfb1d('0x9f')],{'$or':_[_0xfb1d('0x30')](_0xb3deae[_0xfb1d('0x3d')],function(_0x356999){var _0x457195={};_0x457195[_0x356999]={'$like':'%'+_0xde3f08['query'][_0xfb1d('0xa1')]+'%'};return _0x457195;})});}_0xb3deae[_0xfb1d('0x9f')][_0xfb1d('0x8b')]=![];if(_0xde3f08['query']['id']){_0xb3deae[_0xfb1d('0x9f')]['id']={'$gt':_0xde3f08[_0xfb1d('0x36')]['id']};}_0xb3deae=_[_0xfb1d('0x2c')]({},_0xb3deae,_0xde3f08[_0xfb1d('0x42')]);return db[_0xfb1d('0x5d')][_0xfb1d('0x25')]({'where':_0xb3deae[_0xfb1d('0x9f')]})[_0xfb1d('0x29')](function(_0x3fbbf3){_0x1c83e0[_0xfb1d('0x25')]=_0x3fbbf3;_0xb3deae['include']=[];if(_0xde3f08[_0xfb1d('0x36')][_0xfb1d('0xa6')]){_0xb3deae['include']['push']({'model':db[_0xfb1d('0x7c')],'as':_0xfb1d('0x7c'),'attributes':['id',_0xfb1d('0x4f'),'alias']});}if(_0xde3f08[_0xfb1d('0x36')][_0xfb1d('0x40')]){_0xb3deae['include']=[{'all':!![]}];}return db['ChatMessage'][_0xfb1d('0x35')](_0xb3deae);})[_0xfb1d('0x29')](function(_0x393448){_0x1c83e0[_0xfb1d('0xa4')]=_0x393448;return _0x1c83e0;});}})[_0xfb1d('0x29')](respondWithFilteredResult(_0x475524,_0xb3deae))[_0xfb1d('0x1d')](handleError(_0x475524,null));};exports[_0xfb1d('0xa7')]=function(_0x55b504,_0x384cc9){return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x55b504[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x384cc9,null))[_0xfb1d('0x29')](function(_0x3448c4){if(_0x3448c4){return _0x3448c4[_0xfb1d('0xa8')](_0x55b504['body'][_0xfb1d('0x98')],_[_0xfb1d('0xa9')](_0x55b504['body'],[_0xfb1d('0x98'),'id'])||{})[_0xfb1d('0xaa')](function(){return db['Tag'][_0xfb1d('0x35')]({'attributes':['id',_0xfb1d('0x2a'),'color'],'where':{'id':_0x55b504['body'][_0xfb1d('0x98')]}});})[_0xfb1d('0x29')](function(_0x1394ea){socket[_0xfb1d('0xab')]('chatInteractionTags:save',{'id':Number(_0x55b504[_0xfb1d('0x46')]['id']),'tags':_0x1394ea||[]});return{'id':Number(_0x55b504['params']['id']),'tags':_0x1394ea||[]};});}})[_0xfb1d('0x29')](respondWithResult(_0x384cc9,null))['catch'](handleError(_0x384cc9,null));};exports[_0xfb1d('0xac')]=function(_0x1c025d,_0x34712a){return db[_0xfb1d('0x31')][_0xfb1d('0x45')]({'where':{'id':_0x1c025d[_0xfb1d('0x46')]['id']}})[_0xfb1d('0x29')](handleEntityNotFound(_0x34712a,null))[_0xfb1d('0x29')](function(_0x5efaad){if(_0x5efaad){return _0x5efaad['removeTags'](_0x1c025d[_0xfb1d('0x36')][_0xfb1d('0x98')]);}})[_0xfb1d('0x29')](respondWithStatusCode(_0x34712a,null))[_0xfb1d('0x1d')](handleError(_0x34712a,null));};exports['download']=function(_0x58c65f,_0x3e1609){var _0x424731=moment()[_0xfb1d('0xad')]()[_0xfb1d('0xae')]();var _0x15805e=path[_0xfb1d('0x74')](config[_0xfb1d('0x77')],_0xfb1d('0xaf'),_0xfb1d('0xb0'),_0xfb1d('0xb1'));var _0x30b0fe=path[_0xfb1d('0x74')](config[_0xfb1d('0x77')],_0xfb1d('0xaf'),_0xfb1d('0xb0'),_0xfb1d('0xb2'));var _0xa41291=path[_0xfb1d('0x74')](_0x15805e,_0x424731);var _0xa7c953=util[_0xfb1d('0x7e')](_0xfb1d('0xb3'),_0x58c65f['params']['id'],_0x424731);var _0x25ec22=path[_0xfb1d('0x74')](_0x15805e,_0xa7c953);var _0x32c4db=[];_0x32c4db[_0xfb1d('0xb4')]({'model':db[_0xfb1d('0x7c')],'as':'User','attributes':['id',_0xfb1d('0x4f')],'raw':!![]});_0x32c4db[_0xfb1d('0xb4')]({'model':db[_0xfb1d('0x60')],'as':_0xfb1d('0x61'),'attributes':['id',_0xfb1d('0xb5'),_0xfb1d('0xb6')],'raw':!![]});if(_0x58c65f[_0xfb1d('0x36')]['attachments']){_0x32c4db[_0xfb1d('0xb4')]({'model':db['Attachment'],'as':_0xfb1d('0x6f'),'raw':!![]});}var _0x52b92b=[{'model':db[_0xfb1d('0x5d')],'as':'Messages','attributes':['id','body',_0xfb1d('0xb7'),_0xfb1d('0x8a'),'secret',_0xfb1d('0xb8')],'include':_0x32c4db}];_0x52b92b['push']({'model':db['ChatWebsite'],'as':_0xfb1d('0xb9'),'attributes':['id',_0xfb1d('0x2a')]});_0x52b92b['push']({'model':db[_0xfb1d('0x7c')],'as':'Owner','attributes':['id',_0xfb1d('0x4f')]});return db['ChatInteraction'][_0xfb1d('0x45')]({'where':{'id':_0x58c65f[_0xfb1d('0x46')]['id']},'include':_0x52b92b})[_0xfb1d('0x29')](handleEntityNotFound(_0x3e1609,null))[_0xfb1d('0x29')](function(_0x40294a){if(_0x40294a){var _0x147758=_0x40294a[_0xfb1d('0xba')]({'plain':!![]});fs[_0xfb1d('0xbb')](_0xa41291);var _0x764546={'channel':_0xfb1d('0xbc'),'account':_0x147758['Account'][_0xfb1d('0x2a')],'agent':_0x147758[_0xfb1d('0xbd')]?_0x147758['Owner'][_0xfb1d('0x4f')]:_0xfb1d('0xbe'),'createdAt':moment(_0x147758[_0xfb1d('0xb7')])[_0xfb1d('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfb1d('0xae')](),'closedAt':_0x147758[_0xfb1d('0x67')]?moment(_0x147758[_0xfb1d('0xbf')])[_0xfb1d('0x7e')](_0xfb1d('0xa3'))[_0xfb1d('0xae')]():'','disposition':_0x147758[_0xfb1d('0xc0')],'chatInfo':{'browser':_0x147758['browserName'],'os':_0x147758[_0xfb1d('0xc1')],'referer':_0x147758['referer'],'customerIp':_0x147758['customerIp'],'customerPort':_0x147758[_0xfb1d('0xc2')]?_0x147758[_0xfb1d('0xc2')]:_0xfb1d('0xbe')},'messages':_(_0x147758['Messages'])[_0xfb1d('0xc3')]()[_0xfb1d('0xa1')]({'secret':![]})[_0xfb1d('0x30')](function(_0x396b6f){if(_0x396b6f[_0xfb1d('0x6f')]){var _0x3dad32=path[_0xfb1d('0x74')](_0x30b0fe,_0x396b6f[_0xfb1d('0x6f')][_0xfb1d('0x6c')]);if(fs['existsSync'](_0x3dad32)){fs[_0xfb1d('0xc4')](_0x3dad32)[_0xfb1d('0xc5')](fs[_0xfb1d('0xc6')](path[_0xfb1d('0x74')](_0xa41291,_0x396b6f[_0xfb1d('0x6f')][_0xfb1d('0x6c')])));}}return{'date':moment(_0x396b6f['createdAt'])['format'](_0xfb1d('0xa3'))['toString'](),'sender':_0x396b6f[_0xfb1d('0x8a')]===_0xfb1d('0x5c')?_0x396b6f['User']?_0x396b6f[_0xfb1d('0x7c')]['fullname']:'System':_0x396b6f[_0xfb1d('0x61')]['firstName']+(_0x396b6f[_0xfb1d('0x61')][_0xfb1d('0xb6')]?'\x20'+_0x396b6f['Contact'][_0xfb1d('0xb6')]:''),'body':_0x396b6f['Attachment']?_0x396b6f[_0xfb1d('0x6f')][_0xfb1d('0x6c')]:_0x396b6f[_0xfb1d('0x44')],'direction':_0x396b6f[_0xfb1d('0x8a')]===_0xfb1d('0x5c')?'A':'C','secret':_0x396b6f[_0xfb1d('0x8b')],'read':_0x396b6f[_0xfb1d('0xb8')],'attachment':_0x396b6f[_0xfb1d('0x6f')]};})['value']()};return ejs[_0xfb1d('0xc7')](path[_0xfb1d('0x74')](config[_0xfb1d('0x77')],_0xfb1d('0xaf'),_0xfb1d('0xc8'),'downloadInteraction.ejs'),{'interaction':_0x764546})[_0xfb1d('0x29')](function(_0xb52222){var _0x1f4eae=path[_0xfb1d('0x74')](_0xa41291,_0xfb1d('0xc9')+_0x147758['id']+'-'+_0x424731+_0xfb1d('0xca'));var _0x4aa5aa={'path':_0x1f4eae,'channel':_0xfb1d('0xbc'),'interactionId':_0x147758['id']};return pdf['createPdfFromHTML'](_0xb52222,_0x4aa5aa);})[_0xfb1d('0x29')](function(){return new Promise(function(_0x53360b,_0x134e28){zipdir(_0xa41291,{'saveTo':_0x25ec22},function(_0x47355d,_0x274f0f){if(_0x47355d)return _0x134e28(_0x47355d);return _0x53360b(_0x274f0f);});})['then'](function(){return new BPromise(function(_0xe2997b,_0x45e959){rimraf(_0xa41291,function(_0x4c4fb5){if(_0x4c4fb5)_0x45e959(_0x4c4fb5);return _0xe2997b();});});})['then'](function(){return _0x3e1609[_0xfb1d('0x76')](_0x25ec22,_0xa7c953,function(_0x3f5832){if(_0x3f5832){logger[_0xfb1d('0x1a')](_0xfb1d('0xcb'),_0x3f5832);}else{fs[_0xfb1d('0xcc')](_0x25ec22);}});});});}else{return _0x3e1609['sendStatus'](0xc8);}})[_0xfb1d('0x1d')](handleError(_0x3e1609,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 7336c8f..f9abc3a 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 _0x389a=['ChatMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction'];(function(_0x5c4321,_0x5f572c){var _0x251f1f=function(_0x5bed18){while(--_0x5bed18){_0x5c4321['push'](_0x5c4321['shift']());}};_0x251f1f(++_0x5f572c);}(_0x389a,0x10c));var _0xa389=function(_0x49a81c,_0x367dcb){_0x49a81c=_0x49a81c-0x0;var _0x326403=_0x389a[_0x49a81c];return _0x326403;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xa389('0x0'))['db'][_0xa389('0x1')];var ChatMessage=require(_0xa389('0x0'))['db'][_0xa389('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa389('0x3')](0x0);var events={'afterCreate':_0xa389('0x4'),'afterUpdate':'update','afterDestroy':_0xa389('0x5')};function emitEvent(_0x43814e){return function(_0x293f15,_0x3aceb7,_0x2711d1){_0x293f15[_0xa389('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x330c43){_0x293f15[_0xa389('0x7')](_0xa389('0x8'),_0x330c43['map'](function(_0x2b10df){return{'id':_0x2b10df['id']};}));return ChatMessage[_0xa389('0x9')]({'where':{'ChatInteractionId':_0x293f15['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa389('0xa')](function(_0x4bfbea){_0x293f15[_0xa389('0x7')](_0xa389('0xb'),_0x4bfbea[_0xa389('0xc')]);ChatInteractionEvents[_0xa389('0xd')](_0x43814e+':'+_0x293f15['id'],_0x293f15);ChatInteractionEvents[_0xa389('0xd')](_0x43814e,_0x293f15);_0x2711d1(null);})[_0xa389('0xe')](_0x2711d1(null));};}for(var e in events){if(events[_0xa389('0xf')](e)){var event=events[e];ChatInteraction[_0xa389('0x10')](e,emitEvent(event));}}module[_0xa389('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xef60=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit'];(function(_0x1d3046,_0x8b14e1){var _0x3b9b62=function(_0xb69d69){while(--_0xb69d69){_0x1d3046['push'](_0x1d3046['shift']());}};_0x3b9b62(++_0x8b14e1);}(_0xef60,0x9c));var _0x0ef6=function(_0x77cde4,_0x2d8038){_0x77cde4=_0x77cde4-0x0;var _0x1e42c2=_0xef60[_0x77cde4];return _0x1e42c2;};'use strict';var EventEmitter=require(_0x0ef6('0x0'));var ChatInteraction=require(_0x0ef6('0x1'))['db'][_0x0ef6('0x2')];var ChatMessage=require(_0x0ef6('0x1'))['db'][_0x0ef6('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0ef6('0x4')](0x0);var events={'afterCreate':_0x0ef6('0x5'),'afterUpdate':_0x0ef6('0x6'),'afterDestroy':_0x0ef6('0x7')};function emitEvent(_0x51436a){return function(_0x4d7cc8,_0x1dc68e,_0x51ac71){_0x4d7cc8[_0x0ef6('0x8')]({'attributes':['id'],'raw':!![]})[_0x0ef6('0x9')](function(_0x357bf6){_0x4d7cc8[_0x0ef6('0xa')]('Users',_0x357bf6[_0x0ef6('0xb')](function(_0x1ad04f){return{'id':_0x1ad04f['id']};}));return ChatMessage[_0x0ef6('0xc')]({'where':{'ChatInteractionId':_0x4d7cc8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ef6('0x9')](function(_0x4e8e69){_0x4d7cc8['setDataValue'](_0x0ef6('0xd'),_0x4e8e69['length']);ChatInteractionEvents['emit'](_0x51436a+':'+_0x4d7cc8['id'],_0x4d7cc8);ChatInteractionEvents[_0x0ef6('0xe')](_0x51436a,_0x4d7cc8);_0x51ac71(null);})[_0x0ef6('0xf')](_0x51ac71(null));};}for(var e in events){if(events[_0x0ef6('0x10')](e)){var event=events[e];ChatInteraction[_0x0ef6('0x11')](e,emitEvent(event));}}module[_0x0ef6('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 8c0406c..747fd58 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 _0x235c=['lodash','api','moment','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3f8a3b,_0x33932a){var _0x1419f1=function(_0x18ebb9){while(--_0x18ebb9){_0x3f8a3b['push'](_0x3f8a3b['shift']());}};_0x1419f1(++_0x33932a);}(_0x235c,0x17a));var _0xc235=function(_0x5024b6,_0x360f4e){_0x5024b6=_0x5024b6-0x0;var _0x7a8ea7=_0x235c[_0x5024b6];return _0x7a8ea7;};'use strict';var _=require(_0xc235('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc235('0x1'));var moment=require(_0xc235('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc235('0x3'));var rimraf=require(_0xc235('0x4'));var config=require('../../config/environment');var attributes=require(_0xc235('0x5'));module[_0xc235('0x6')]=function(_0x154b77,_0x446196){return _0x154b77[_0xc235('0x7')](_0xc235('0x8'),attributes,{'tableName':_0xc235('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35c52a,_0x42967f,_0x1bd7e0){if(_0x35c52a[_0xc235('0xa')]('closed')){_0x35c52a['closedAt']=moment()['format'](_0xc235('0xb'));}_0x1bd7e0(null,_0x35c52a);}},'charset':_0xc235('0xc'),'collate':_0xc235('0xd')});};
\ No newline at end of file
+var _0x09d8=['define','chat_interactions','changed','closed','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports'];(function(_0x5a2162,_0x5a90a3){var _0x4561a7=function(_0x11849e){while(--_0x11849e){_0x5a2162['push'](_0x5a2162['shift']());}};_0x4561a7(++_0x5a90a3);}(_0x09d8,0x117));var _0x809d=function(_0x3b00d5,_0x952eec){_0x3b00d5=_0x3b00d5-0x0;var _0x42cd8d=_0x09d8[_0x3b00d5];return _0x42cd8d;};'use strict';var _=require(_0x809d('0x0'));var util=require('util');var logger=require(_0x809d('0x1'))(_0x809d('0x2'));var moment=require(_0x809d('0x3'));var BPromise=require(_0x809d('0x4'));var rp=require(_0x809d('0x5'));var fs=require('fs');var path=require(_0x809d('0x6'));var rimraf=require(_0x809d('0x7'));var config=require('../../config/environment');var attributes=require(_0x809d('0x8'));module[_0x809d('0x9')]=function(_0x58a347,_0x5973af){return _0x58a347[_0x809d('0xa')]('ChatInteraction',attributes,{'tableName':_0x809d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46e709,_0x1e7161,_0x517aa7){if(_0x46e709[_0x809d('0xc')](_0x809d('0xd'))){_0x46e709['closedAt']=moment()[_0x809d('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x517aa7(null,_0x46e709);}},'charset':_0x809d('0xf'),'collate':_0x809d('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 742b017..a2df3c7 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 _0x3b8e=['ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','stringify','AddTagsToChatInteraction','addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','then','info'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3b8e,0x1e4));var _0xe3b8=function(_0x17a8b0,_0x20ac87){_0x17a8b0=_0x17a8b0-0x0;var _0x589069=_0x3b8e[_0x17a8b0];return _0x589069;};'use strict';var _=require(_0xe3b8('0x0'));var util=require(_0xe3b8('0x1'));var moment=require(_0xe3b8('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3b8('0x3'));var fs=require('fs');var Redis=require(_0xe3b8('0x4'));var db=require(_0xe3b8('0x5'))['db'];var utils=require(_0xe3b8('0x6'));var logger=require(_0xe3b8('0x7'))(_0xe3b8('0x8'));var config=require(_0xe3b8('0x9'));var jayson=require(_0xe3b8('0xa'));var client=jayson[_0xe3b8('0xb')][_0xe3b8('0xc')]({'port':0x232a});config[_0xe3b8('0xd')]=_[_0xe3b8('0xe')](config['redis'],{'host':_0xe3b8('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3b8('0xd')]));require(_0xe3b8('0x10'))[_0xe3b8('0x11')](socket);function respondWithRpcPromise(_0x5bf964,_0x44fec3,_0x5c6cce){return new BPromise(function(_0x10e327,_0x1655c0){return client['request'](_0x5bf964,_0x5c6cce)[_0xe3b8('0x12')](function(_0x292564){logger[_0xe3b8('0x13')](_0xe3b8('0x14'),_0x44fec3,'request\x20sent');logger[_0xe3b8('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x44fec3,_0xe3b8('0x16'),JSON['stringify'](_0x292564));if(_0x292564[_0xe3b8('0x17')]){if(_0x292564[_0xe3b8('0x17')][_0xe3b8('0x18')]===0x1f4){logger['error'](_0xe3b8('0x14'),_0x44fec3,_0x292564[_0xe3b8('0x17')][_0xe3b8('0x19')]);return _0x1655c0(_0x292564[_0xe3b8('0x17')][_0xe3b8('0x19')]);}logger[_0xe3b8('0x17')](_0xe3b8('0x14'),_0x44fec3,_0x292564[_0xe3b8('0x17')][_0xe3b8('0x19')]);return _0x10e327(_0x292564['error'][_0xe3b8('0x19')]);}else{logger[_0xe3b8('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x44fec3,_0xe3b8('0x16'));_0x10e327(_0x292564[_0xe3b8('0x1a')]['message']);}})[_0xe3b8('0x1b')](function(_0x37a69f){logger[_0xe3b8('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x44fec3,_0x37a69f);_0x1655c0(_0x37a69f);});});}exports[_0xe3b8('0x1c')]=function(_0x1d6326){var _0x45d568=this;return new Promise(function(_0x2b26a2,_0x12497b){return db[_0xe3b8('0x1d')][_0xe3b8('0x1e')](_0x1d6326[_0xe3b8('0x1f')],{'raw':_0x1d6326[_0xe3b8('0x20')]?_0x1d6326[_0xe3b8('0x20')][_0xe3b8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d6326['options']?_0x1d6326['options'][_0xe3b8('0x22')]||null:null,'attributes':_0x1d6326['options']?_0x1d6326['options'][_0xe3b8('0x23')]||null:null,'limit':_0x1d6326['options']?_0x1d6326[_0xe3b8('0x20')]['limit']||null:null})[_0xe3b8('0x12')](function(_0xf31957){logger['info'](_0xe3b8('0x1c'),_0x1d6326);logger[_0xe3b8('0x15')](_0xe3b8('0x1c'),_0x1d6326,JSON[_0xe3b8('0x24')](_0xf31957));_0x2b26a2(_0xf31957);})['catch'](function(_0x1f4f9b){logger['error'](_0xe3b8('0x1c'),_0x1f4f9b[_0xe3b8('0x19')],_0x1d6326);_0x12497b(_0x45d568[_0xe3b8('0x17')](0x1f4,_0x1f4f9b[_0xe3b8('0x19')]));});});};exports[_0xe3b8('0x25')]=function(_0x1e0994){return new Promise(function(_0x5ac3ca,_0x3405d7){return db[_0xe3b8('0x1d')]['find']({'where':_0x1e0994[_0xe3b8('0x20')]?_0x1e0994[_0xe3b8('0x20')][_0xe3b8('0x22')]||null:null})[_0xe3b8('0x12')](function(_0x453999){if(_0x453999){return _0x453999[_0xe3b8('0x26')](_0x1e0994[_0xe3b8('0x1f')][_0xe3b8('0x27')],_['omit'](_0x1e0994[_0xe3b8('0x1f')],[_0xe3b8('0x27'),'id'])||{});}})[_0xe3b8('0x28')](function(_0x545c8f){logger[_0xe3b8('0x13')](_0xe3b8('0x29'),_0x1e0994);logger[_0xe3b8('0x15')](_0xe3b8('0x29'),_0x1e0994,JSON[_0xe3b8('0x24')](_0x545c8f));_0x5ac3ca(_0x545c8f);})['catch'](function(_0x5a2761){logger['error'](_0xe3b8('0x29'),_0x5a2761[_0xe3b8('0x19')],_0x1e0994);_0x3405d7(_this[_0xe3b8('0x17')](0x1f4,_0x5a2761['message']));});});};
\ No newline at end of file
+var _0x2937=['redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','raw','where','options','attributes','limit','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x23330f,_0x4ce4d0){var _0x2b962f=function(_0x12c122){while(--_0x12c122){_0x23330f['push'](_0x23330f['shift']());}};_0x2b962f(++_0x4ce4d0);}(_0x2937,0x1ad));var _0x7293=function(_0x5116e3,_0x497c07){_0x5116e3=_0x5116e3-0x0;var _0x3b9852=_0x2937[_0x5116e3];return _0x3b9852;};'use strict';var _=require(_0x7293('0x0'));var util=require(_0x7293('0x1'));var moment=require(_0x7293('0x2'));var BPromise=require(_0x7293('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7293('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7293('0x5'));var logger=require(_0x7293('0x6'))('rpc');var config=require(_0x7293('0x7'));var jayson=require(_0x7293('0x8'));var client=jayson[_0x7293('0x9')][_0x7293('0xa')]({'port':0x232a});config[_0x7293('0xb')]=_[_0x7293('0xc')](config[_0x7293('0xb')],{'host':_0x7293('0xd'),'port':0x18eb});var socket=require(_0x7293('0xe'))(new Redis(config[_0x7293('0xb')]));require(_0x7293('0xf'))[_0x7293('0x10')](socket);function respondWithRpcPromise(_0x52b064,_0x2a12e5,_0x1f8341){return new BPromise(function(_0x50d370,_0x491178){return client['request'](_0x52b064,_0x1f8341)[_0x7293('0x11')](function(_0x4a7b74){logger[_0x7293('0x12')](_0x7293('0x13'),_0x2a12e5,_0x7293('0x14'));logger[_0x7293('0x15')](_0x7293('0x16'),_0x2a12e5,'request\x20sent',JSON[_0x7293('0x17')](_0x4a7b74));if(_0x4a7b74[_0x7293('0x18')]){if(_0x4a7b74[_0x7293('0x18')][_0x7293('0x19')]===0x1f4){logger[_0x7293('0x18')](_0x7293('0x13'),_0x2a12e5,_0x4a7b74[_0x7293('0x18')][_0x7293('0x1a')]);return _0x491178(_0x4a7b74[_0x7293('0x18')][_0x7293('0x1a')]);}logger[_0x7293('0x18')](_0x7293('0x13'),_0x2a12e5,_0x4a7b74[_0x7293('0x18')][_0x7293('0x1a')]);return _0x50d370(_0x4a7b74['error'][_0x7293('0x1a')]);}else{logger[_0x7293('0x12')](_0x7293('0x13'),_0x2a12e5,'request\x20sent');_0x50d370(_0x4a7b74[_0x7293('0x1b')][_0x7293('0x1a')]);}})[_0x7293('0x1c')](function(_0x2ac2d6){logger[_0x7293('0x18')](_0x7293('0x13'),_0x2a12e5,_0x2ac2d6);_0x491178(_0x2ac2d6);});});}exports[_0x7293('0x1d')]=function(_0x2d5fff){var _0x396be0=this;return new Promise(function(_0x52c9fe,_0x765c23){return db[_0x7293('0x1e')]['update'](_0x2d5fff['body'],{'raw':_0x2d5fff['options']?_0x2d5fff['options'][_0x7293('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5fff['options']?_0x2d5fff['options'][_0x7293('0x20')]||null:null,'attributes':_0x2d5fff[_0x7293('0x21')]?_0x2d5fff[_0x7293('0x21')][_0x7293('0x22')]||null:null,'limit':_0x2d5fff[_0x7293('0x21')]?_0x2d5fff['options'][_0x7293('0x23')]||null:null})[_0x7293('0x11')](function(_0x4ca1df){logger[_0x7293('0x12')](_0x7293('0x1d'),_0x2d5fff);logger['debug'](_0x7293('0x1d'),_0x2d5fff,JSON[_0x7293('0x17')](_0x4ca1df));_0x52c9fe(_0x4ca1df);})[_0x7293('0x1c')](function(_0x479f3a){logger[_0x7293('0x18')](_0x7293('0x1d'),_0x479f3a[_0x7293('0x1a')],_0x2d5fff);_0x765c23(_0x396be0[_0x7293('0x18')](0x1f4,_0x479f3a[_0x7293('0x1a')]));});});};exports[_0x7293('0x24')]=function(_0x32dbd8){return new Promise(function(_0x571a78,_0x28ba35){return db[_0x7293('0x1e')][_0x7293('0x25')]({'where':_0x32dbd8[_0x7293('0x21')]?_0x32dbd8[_0x7293('0x21')]['where']||null:null})[_0x7293('0x11')](function(_0x907c79){if(_0x907c79){return _0x907c79[_0x7293('0x26')](_0x32dbd8[_0x7293('0x27')][_0x7293('0x28')],_[_0x7293('0x29')](_0x32dbd8[_0x7293('0x27')],[_0x7293('0x28'),'id'])||{});}})[_0x7293('0x2a')](function(_0x1d10bc){logger[_0x7293('0x12')](_0x7293('0x2b'),_0x32dbd8);logger[_0x7293('0x15')](_0x7293('0x2b'),_0x32dbd8,JSON[_0x7293('0x17')](_0x1d10bc));_0x571a78(_0x1d10bc);})['catch'](function(_0x2e0218){logger[_0x7293('0x18')](_0x7293('0x2b'),_0x2e0218[_0x7293('0x1a')],_0x32dbd8);_0x28ba35(_this[_0x7293('0x18')](0x1f4,_0x2e0218[_0x7293('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0e2254f..574db24 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 _0xd658=['chatInteraction:','./chatInteraction.events','remove','emit','register','length'];(function(_0x5d49c5,_0x589a0f){var _0x622430=function(_0x22a176){while(--_0x22a176){_0x5d49c5['push'](_0x5d49c5['shift']());}};_0x622430(++_0x589a0f);}(_0xd658,0x151));var _0x8d65=function(_0xc84e8c,_0x3388f0){_0xc84e8c=_0xc84e8c-0x0;var _0xc92ebf=_0xd658[_0xc84e8c];return _0xc92ebf;};'use strict';var ChatInteractionEvents=require(_0x8d65('0x0'));var events=['save',_0x8d65('0x1'),'update'];function createListener(_0x3f4978,_0x311ccb){return function(_0x2b8b32){_0x311ccb[_0x8d65('0x2')](_0x3f4978,_0x2b8b32);};}function removeListener(_0x2ac9e0,_0x52040b){return function(){ChatInteractionEvents['removeListener'](_0x2ac9e0,_0x52040b);};}exports[_0x8d65('0x3')]=function(_0x40480f){for(var _0xd4c678=0x0,_0x4427ce=events[_0x8d65('0x4')];_0xd4c678<_0x4427ce;_0xd4c678++){var _0x422e68=events[_0xd4c678];var _0x6666a0=createListener(_0x8d65('0x5')+_0x422e68,_0x40480f);ChatInteractionEvents['on'](_0x422e68,_0x6666a0);}};
\ No newline at end of file
+var _0xc7e1=['remove','removeListener','register','length','./chatInteraction.events','save'];(function(_0x110065,_0x2ae661){var _0x219dc5=function(_0x511f69){while(--_0x511f69){_0x110065['push'](_0x110065['shift']());}};_0x219dc5(++_0x2ae661);}(_0xc7e1,0x11e));var _0x1c7e=function(_0x22cc91,_0x154bd0){_0x22cc91=_0x22cc91-0x0;var _0x1bdfda=_0xc7e1[_0x22cc91];return _0x1bdfda;};'use strict';var ChatInteractionEvents=require(_0x1c7e('0x0'));var events=[_0x1c7e('0x1'),_0x1c7e('0x2'),'update'];function createListener(_0x5b23e8,_0x161164){return function(_0x5cd0ee){_0x161164['emit'](_0x5b23e8,_0x5cd0ee);};}function removeListener(_0x3bd04c,_0x120014){return function(){ChatInteractionEvents[_0x1c7e('0x3')](_0x3bd04c,_0x120014);};}exports[_0x1c7e('0x4')]=function(_0x54ea0e){for(var _0x75d274=0x0,_0x275546=events[_0x1c7e('0x5')];_0x75d274<_0x275546;_0x75d274++){var _0x552d89=events[_0x75d274];var _0xd3791d=createListener('chatInteraction:'+_0x552d89,_0x54ea0e);ChatInteractionEvents['on'](_0x552d89,_0xd3791d);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3dfbe53..d69bc16 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 _0x5840=['/:id','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x5840,0x111));var _0x0584=function(_0x31d99f,_0x1c55df){_0x31d99f=_0x31d99f-0x0;var _0x5bcd81=_0x5840[_0x31d99f];return _0x5bcd81;};'use strict';var multer=require(_0x0584('0x0'));var util=require('util');var path=require(_0x0584('0x1'));var timeout=require('connect-timeout');var express=require(_0x0584('0x2'));var router=express['Router']();var fs_extra=require(_0x0584('0x3'));var auth=require(_0x0584('0x4'));var interaction=require(_0x0584('0x5'));var config=require(_0x0584('0x6'));var controller=require('./chatInteraction.controller');router[_0x0584('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0584('0x7')](_0x0584('0x8'),auth[_0x0584('0x9')](),controller[_0x0584('0xa')]);router[_0x0584('0x7')]('/:id',auth[_0x0584('0xb')](),controller[_0x0584('0xc')]);router[_0x0584('0x7')](_0x0584('0xd'),auth[_0x0584('0xb')](),controller[_0x0584('0xe')]);router['get'](_0x0584('0xf'),auth[_0x0584('0x9')](),controller['getMessages']);router[_0x0584('0x7')](_0x0584('0x10'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0x0584('0x11'),auth[_0x0584('0x9')](),controller['download']);router['post']('/',auth[_0x0584('0x9')](),controller['create']);router[_0x0584('0x12')](_0x0584('0x13'),auth[_0x0584('0x9')](),controller[_0x0584('0x14')]);var upload=multer({'storage':multer[_0x0584('0x15')]({'destination':function(_0x4b7e13,_0x5e43cd,_0x56dd50){_0x56dd50(null,path[_0x0584('0x16')](config[_0x0584('0x17')],_0x0584('0x18')));},'filename':function(_0x3f3abd,_0x3fb953,_0x1dac1e){_0x1dac1e(null,util[_0x0584('0x19')](_0x0584('0x1a'),Date[_0x0584('0x1b')](),_0x3fb953[_0x0584('0x1c')][_0x0584('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x0584('0x1e'),upload['single'](_0x0584('0x1f')),controller[_0x0584('0x20')]);router['post']('/:id/messages',auth[_0x0584('0xb')](),controller[_0x0584('0x21')]);router[_0x0584('0x12')](_0x0584('0x22'),auth[_0x0584('0x9')](),interaction[_0x0584('0x23')]('chat',_0x0584('0x24')),controller[_0x0584('0x25')]);router[_0x0584('0x26')](_0x0584('0x27'),auth[_0x0584('0x9')](),interaction['tracked'](_0x0584('0x28'),_0x0584('0x29')),controller[_0x0584('0x2a')]);router[_0x0584('0x26')](_0x0584('0x2b'),controller[_0x0584('0x2c')]);router['put'](_0x0584('0x2d'),auth[_0x0584('0xb')](),controller[_0x0584('0x2e')]);router[_0x0584('0x26')]('/:id/close',controller['close']);router['delete'](_0x0584('0x27'),auth[_0x0584('0x9')](),interaction['tracked'](_0x0584('0x28'),_0x0584('0x2f')),controller[_0x0584('0x30')]);router[_0x0584('0x31')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0584('0x32')]);module[_0x0584('0x33')]=router;
\ No newline at end of file
+var _0x345b=['/:id/close','close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon'];(function(_0x94f760,_0x4f1b70){var _0x3aec01=function(_0x15c485){while(--_0x15c485){_0x94f760['push'](_0x94f760['shift']());}};_0x3aec01(++_0x4f1b70);}(_0x345b,0x74));var _0xb345=function(_0x41bc6b,_0x5ecf42){_0x41bc6b=_0x41bc6b-0x0;var _0x3c3f76=_0x345b[_0x41bc6b];return _0x3c3f76;};'use strict';var multer=require('multer');var util=require(_0xb345('0x0'));var path=require(_0xb345('0x1'));var timeout=require(_0xb345('0x2'));var express=require('express');var router=express[_0xb345('0x3')]();var fs_extra=require(_0xb345('0x4'));var auth=require(_0xb345('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb345('0x6'));var controller=require(_0xb345('0x7'));router[_0xb345('0x8')]('/',auth[_0xb345('0x9')](),controller[_0xb345('0xa')]);router['get'](_0xb345('0xb'),auth['isAuthenticated'](),controller[_0xb345('0xc')]);router[_0xb345('0x8')](_0xb345('0xd'),auth[_0xb345('0xe')](),controller['show']);router['get'](_0xb345('0xf'),auth[_0xb345('0xe')](),controller[_0xb345('0x10')]);router[_0xb345('0x8')](_0xb345('0x11'),auth['isAuthenticated'](),controller[_0xb345('0x12')]);router['get'](_0xb345('0x13'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xb345('0x8')](_0xb345('0x14'),auth[_0xb345('0x9')](),controller[_0xb345('0x15')]);router[_0xb345('0x16')]('/',auth['isAuthenticated'](),controller[_0xb345('0x17')]);router[_0xb345('0x16')](_0xb345('0x18'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xb345('0x19')]({'destination':function(_0x4b468f,_0x449bca,_0x211c35){_0x211c35(null,path[_0xb345('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x14f849,_0x1a74c8,_0x160061){_0x160061(null,util[_0xb345('0x1b')](_0xb345('0x1c'),Date['now'](),_0x1a74c8[_0xb345('0x1d')][_0xb345('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xb345('0x1f'),upload[_0xb345('0x20')](_0xb345('0x21')),controller[_0xb345('0x22')]);router[_0xb345('0x16')](_0xb345('0x11'),auth[_0xb345('0xe')](),controller['addMessage']);router[_0xb345('0x16')]('/:id/tags',auth[_0xb345('0x9')](),interaction[_0xb345('0x23')](_0xb345('0x24'),_0xb345('0x25')),controller[_0xb345('0x26')]);router[_0xb345('0x27')](_0xb345('0xd'),auth[_0xb345('0x9')](),interaction[_0xb345('0x23')](_0xb345('0x24'),_0xb345('0x28')),controller[_0xb345('0x29')]);router[_0xb345('0x27')](_0xb345('0x2a'),controller[_0xb345('0x2b')]);router[_0xb345('0x27')](_0xb345('0x2c'),auth[_0xb345('0xe')](),controller[_0xb345('0x2d')]);router['put'](_0xb345('0x2e'),controller[_0xb345('0x2f')]);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked']('chat',_0xb345('0x30')),controller[_0xb345('0x31')]);router[_0xb345('0x32')](_0xb345('0x33'),auth[_0xb345('0x9')](),controller[_0xb345('0x34')]);module[_0xb345('0x35')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 27a3127..7c36cf9 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 _0xfeb8=['INTEGER','exports','medium','BOOLEAN'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfeb8,0x155));var _0x8feb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfeb8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x8feb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x8feb('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x8feb('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8feb('0x3')]}};
\ No newline at end of file
+var _0x3f9d=['INTEGER','sequelize','exports','TEXT'];(function(_0x1df443,_0x2860fe){var _0x3ee434=function(_0x4a61b6){while(--_0x4a61b6){_0x1df443['push'](_0x1df443['shift']());}};_0x3ee434(++_0x2860fe);}(_0x3f9d,0x109));var _0xd3f9=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x3f9d[_0x3ba924];return _0x4cc1df;};'use strict';var Sequelize=require(_0xd3f9('0x0'));module[_0xd3f9('0x1')]={'body':{'type':Sequelize[_0xd3f9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd3f9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 7529c6c..fbca5a2 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 _0xb887=['ToId','read','all','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','undefined','count','offset','limit','status','set','Content-Range','json','apply','reject','save','destroy','name','send','index','map','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','then','rows','catch','params','rawAttributes','filters','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','fullname','role','userpic','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId'];(function(_0x319cf9,_0x42c345){var _0x179cec=function(_0x318d2e){while(--_0x318d2e){_0x319cf9['push'](_0x319cf9['shift']());}};_0x179cec(++_0x42c345);}(_0xb887,0x14d));var _0x7b88=function(_0x5d9806,_0x45ef88){_0x5d9806=_0x5d9806-0x0;var _0x335764=_0xb887[_0x5d9806];return _0x335764;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b88('0x0'));var zipdir=require(_0x7b88('0x1'));var jsonpatch=require(_0x7b88('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7b88('0x3'));var Mustache=require(_0x7b88('0x4'));var util=require(_0x7b88('0x5'));var path=require(_0x7b88('0x6'));var sox=require(_0x7b88('0x7'));var csv=require('to-csv');var ejs=require(_0x7b88('0x8'));var fs=require('fs');var fs_extra=require(_0x7b88('0x9'));var _=require(_0x7b88('0xa'));var squel=require(_0x7b88('0xb'));var crypto=require('crypto');var jsforce=require(_0x7b88('0xc'));var deskjs=require(_0x7b88('0xd'));var toCsv=require(_0x7b88('0xe'));var querystring=require(_0x7b88('0xf'));var Papa=require(_0x7b88('0x10'));var Redis=require(_0x7b88('0x11'));var authService=require(_0x7b88('0x12'));var qs=require(_0x7b88('0x13'));var as=require(_0x7b88('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b88('0x15'))('api');var utils=require(_0x7b88('0x16'));var config=require(_0x7b88('0x17'));var licenseUtil=require(_0x7b88('0x18'));var db=require(_0x7b88('0x19'))['db'];config[_0x7b88('0x1a')]=_['defaults'](config[_0x7b88('0x1a')],{'host':_0x7b88('0x1b'),'port':0x18eb});var socket=require(_0x7b88('0x1c'))(new Redis(config[_0x7b88('0x1a')]));require(_0x7b88('0x1d'))[_0x7b88('0x1e')](socket);function respondWithStatusCode(_0x144607,_0xd2c9ee){_0xd2c9ee=_0xd2c9ee||0xcc;return function(_0x57b193){if(_0x57b193){return _0x144607[_0x7b88('0x1f')](_0xd2c9ee);}return _0x144607['status'](_0xd2c9ee)[_0x7b88('0x20')]();};}function respondWithResult(_0x4010ab,_0x571941){_0x571941=_0x571941||0xc8;return function(_0x513f2a){if(_0x513f2a){return _0x4010ab['status'](_0x571941)['json'](_0x513f2a);}};}function respondWithFilteredResult(_0xb1193,_0x3e9d7b){return function(_0x32d68e){if(_0x32d68e){var _0x476a19=typeof _0x3e9d7b['offset']==='undefined'&&typeof _0x3e9d7b['limit']===_0x7b88('0x21');var _0x1ae55b=_0x32d68e[_0x7b88('0x22')];var _0xe09cb3=_0x476a19?0x0:_0x3e9d7b['offset'];var _0x44d53f=_0x476a19?_0x32d68e['count']:_0x3e9d7b[_0x7b88('0x23')]+_0x3e9d7b[_0x7b88('0x24')];var _0x1b181a;if(_0x44d53f>=_0x1ae55b){_0x44d53f=_0x1ae55b;_0x1b181a=0xc8;}else{_0x1b181a=0xce;}_0xb1193[_0x7b88('0x25')](_0x1b181a);return _0xb1193[_0x7b88('0x26')](_0x7b88('0x27'),_0xe09cb3+'-'+_0x44d53f+'/'+_0x1ae55b)[_0x7b88('0x28')](_0x32d68e);}return null;};}function patchUpdates(_0x367ba4){return function(_0xd8bfc2){try{jsonpatch[_0x7b88('0x29')](_0xd8bfc2,_0x367ba4,!![]);}catch(_0x5b5ee0){return BPromise[_0x7b88('0x2a')](_0x5b5ee0);}return _0xd8bfc2[_0x7b88('0x2b')]();};}function saveUpdates(_0x12f91f,_0x41f17f){return function(_0x5f3e07){if(_0x5f3e07){return _0x5f3e07['update'](_0x12f91f)['then'](function(_0x16a042){return _0x16a042;});}return null;};}function removeEntity(_0x1c3057,_0x5c8e9f){return function(_0x37349c){if(_0x37349c){return _0x37349c[_0x7b88('0x2c')]()['then'](function(){_0x1c3057[_0x7b88('0x25')](0xcc)[_0x7b88('0x20')]();});}};}function handleEntityNotFound(_0x85bebc,_0xf381){return function(_0x949f03){if(!_0x949f03){_0x85bebc[_0x7b88('0x1f')](0x194);}return _0x949f03;};}function handleError(_0x532358,_0x527f4d){_0x527f4d=_0x527f4d||0x1f4;return function(_0x460a0c){logger['error'](_0x460a0c['stack']);if(_0x460a0c[_0x7b88('0x2d')]){delete _0x460a0c[_0x7b88('0x2d')];}_0x532358[_0x7b88('0x25')](_0x527f4d)[_0x7b88('0x2e')](_0x460a0c);};}exports[_0x7b88('0x2f')]=function(_0x288914,_0x1a6f1a){var _0x5bae3b={},_0x53a5a5={},_0x52e0c7={'count':0x0,'rows':[]};var _0x2e045a=_[_0x7b88('0x30')](db['ChatInternalMessage']['rawAttributes'],function(_0x5e4754){return{'name':_0x5e4754['fieldName'],'type':_0x5e4754['type']['key']};});_0x53a5a5[_0x7b88('0x31')]=_[_0x7b88('0x30')](_0x2e045a,_0x7b88('0x2d'));_0x53a5a5[_0x7b88('0x32')]=_[_0x7b88('0x33')](_0x288914[_0x7b88('0x32')]);_0x53a5a5['filters']=_[_0x7b88('0x34')](_0x53a5a5[_0x7b88('0x31')],_0x53a5a5[_0x7b88('0x32')]);_0x5bae3b[_0x7b88('0x35')]=_[_0x7b88('0x34')](_0x53a5a5[_0x7b88('0x31')],qs[_0x7b88('0x36')](_0x288914[_0x7b88('0x32')][_0x7b88('0x36')]));_0x5bae3b[_0x7b88('0x35')]=_0x5bae3b['attributes'][_0x7b88('0x37')]?_0x5bae3b[_0x7b88('0x35')]:_0x53a5a5[_0x7b88('0x31')];if(!_0x288914['query'][_0x7b88('0x38')](_0x7b88('0x39'))){_0x5bae3b['limit']=qs['limit'](_0x288914['query']['limit']);_0x5bae3b['offset']=qs[_0x7b88('0x23')](_0x288914[_0x7b88('0x32')][_0x7b88('0x23')]);}_0x5bae3b[_0x7b88('0x3a')]=qs[_0x7b88('0x3b')](_0x288914[_0x7b88('0x32')]['sort']);_0x5bae3b[_0x7b88('0x3c')]=qs['filters'](_[_0x7b88('0x3d')](_0x288914[_0x7b88('0x32')],_0x53a5a5['filters']),_0x2e045a);if(_0x288914[_0x7b88('0x32')][_0x7b88('0x3e')]){_0x5bae3b['where']=_[_0x7b88('0x3f')](_0x5bae3b['where'],{'$or':_['map'](_0x2e045a,function(_0x541b3a){if(_0x541b3a[_0x7b88('0x40')]!==_0x7b88('0x41')){var _0x3d3f7f={};_0x3d3f7f[_0x541b3a[_0x7b88('0x2d')]]={'$like':'%'+_0x288914[_0x7b88('0x32')][_0x7b88('0x3e')]+'%'};return _0x3d3f7f;}})});}_0x5bae3b=_[_0x7b88('0x3f')]({},_0x5bae3b,_0x288914[_0x7b88('0x42')]);var _0xa3f8f3={'where':_0x5bae3b[_0x7b88('0x3c')]};return db[_0x7b88('0x43')][_0x7b88('0x22')](_0xa3f8f3)['then'](function(_0xafd838){_0x52e0c7[_0x7b88('0x22')]=_0xafd838;if(_0x288914['query'][_0x7b88('0x44')]){_0x5bae3b[_0x7b88('0x45')]=[{'all':!![]}];}return db[_0x7b88('0x43')][_0x7b88('0x46')](_0x5bae3b);})[_0x7b88('0x47')](function(_0x105982){_0x52e0c7[_0x7b88('0x48')]=_0x105982;return _0x52e0c7;})[_0x7b88('0x47')](respondWithFilteredResult(_0x1a6f1a,_0x5bae3b))[_0x7b88('0x49')](handleError(_0x1a6f1a,null));};exports['show']=function(_0x32d584,_0x3356ff){var _0x4882dd={'raw':!![],'where':{'id':_0x32d584[_0x7b88('0x4a')]['id']}},_0x2ce00f={};_0x2ce00f[_0x7b88('0x31')]=_['keys'](db[_0x7b88('0x43')][_0x7b88('0x4b')]);_0x2ce00f[_0x7b88('0x32')]=_[_0x7b88('0x33')](_0x32d584[_0x7b88('0x32')]);_0x2ce00f[_0x7b88('0x4c')]=_[_0x7b88('0x34')](_0x2ce00f[_0x7b88('0x31')],_0x2ce00f[_0x7b88('0x32')]);_0x4882dd['attributes']=_[_0x7b88('0x34')](_0x2ce00f[_0x7b88('0x31')],qs['fields'](_0x32d584[_0x7b88('0x32')][_0x7b88('0x36')]));_0x4882dd[_0x7b88('0x35')]=_0x4882dd[_0x7b88('0x35')][_0x7b88('0x37')]?_0x4882dd[_0x7b88('0x35')]:_0x2ce00f['model'];if(_0x32d584['query'][_0x7b88('0x44')]){_0x4882dd['include']=[{'all':!![]}];}_0x4882dd=_[_0x7b88('0x3f')]({},_0x4882dd,_0x32d584[_0x7b88('0x42')]);return db[_0x7b88('0x43')][_0x7b88('0x4d')](_0x4882dd)[_0x7b88('0x47')](handleEntityNotFound(_0x3356ff,null))[_0x7b88('0x47')](respondWithResult(_0x3356ff,null))['catch'](handleError(_0x3356ff,null));};exports[_0x7b88('0x4e')]=function(_0x5a534d,_0x415ecc){return db['ChatInternalMessage'][_0x7b88('0x4e')](_0x5a534d['body'],{})[_0x7b88('0x47')](respondWithResult(_0x415ecc,0xc9))[_0x7b88('0x49')](handleError(_0x415ecc,null));};exports['update']=function(_0x1fb632,_0x4e59b7){if(_0x1fb632[_0x7b88('0x4f')]['id']){delete _0x1fb632[_0x7b88('0x4f')]['id'];}return db[_0x7b88('0x43')][_0x7b88('0x4d')]({'where':{'id':_0x1fb632['params']['id']}})[_0x7b88('0x47')](handleEntityNotFound(_0x4e59b7,null))['then'](saveUpdates(_0x1fb632[_0x7b88('0x4f')],null))[_0x7b88('0x47')](respondWithResult(_0x4e59b7,null))[_0x7b88('0x49')](handleError(_0x4e59b7,null));};exports[_0x7b88('0x2c')]=function(_0x119264,_0x15151e){return db[_0x7b88('0x43')][_0x7b88('0x4d')]({'where':{'id':_0x119264[_0x7b88('0x4a')]['id']}})[_0x7b88('0x47')](handleEntityNotFound(_0x15151e,null))[_0x7b88('0x47')](removeEntity(_0x15151e,null))['catch'](handleError(_0x15151e,null));};exports[_0x7b88('0x50')]=function(_0xe9051f,_0x138bbd){return db[_0x7b88('0x43')][_0x7b88('0x50')]()[_0x7b88('0x47')](respondWithResult(_0x138bbd,null))[_0x7b88('0x49')](handleError(_0x138bbd,null));};function wrapUser(_0x543a7b){return function(_0x1d5d13){var _0x10343c=_0x543a7b[_0x7b88('0x51')]({'plain':!![]});_0x10343c['messages']=[];if(_0x1d5d13){_0x10343c[_0x7b88('0x52')]=_0x1d5d13[_0x7b88('0x53')];_0x10343c[_0x7b88('0x54')]=_0x1d5d13;}else{_0x10343c['lastMessageAt']=moment(0x0)[_0x7b88('0x55')](_0x7b88('0x56'));_0x10343c[_0x7b88('0x54')]={};}return _0x10343c;};}exports['getUsers']=function(_0x1d9617,_0x5c6a0a,_0x250673){var _0x2205f4=[];return db[_0x7b88('0x57')]['findAll']({'where':{'role':[_0x7b88('0x58'),_0x7b88('0x59'),'user']},'attributes':['id',_0x7b88('0x5a'),_0x7b88('0x2d'),_0x7b88('0x5b'),_0x7b88('0x5c'),'internal','online',_0x7b88('0x5d'),'allowmessenger',_0x7b88('0x5e')],'order':qs[_0x7b88('0x3b')]('-online'),'include':[{'model':db[_0x7b88('0x5f')],'as':_0x7b88('0x60'),'attributes':['id',_0x7b88('0x2d'),_0x7b88('0x40')],'through':{'attributes':[]}}]})[_0x7b88('0x47')](function(_0x14cb2a){if(_0x14cb2a){var _0xa859af=_0x1d9617[_0x7b88('0x61')][_0x7b88('0x51')]({'plain':!![]});if(!_0xa859af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa859af[_0x7b88('0x5b')]===_0x7b88('0x61')){return db['UserProfileSection']['find']({'where':{'name':_0x7b88('0x62'),'userProfileId':_0xa859af[_0x7b88('0x63')]},'raw':!![]})['then'](function(_0x54cc97){if(_0x54cc97){if(_0x54cc97[_0x7b88('0x64')]===0x0){return db[_0x7b88('0x65')][_0x7b88('0x46')]({'where':{'sectionId':_0x54cc97['id']},'raw':!![]})['then'](function(_0x569e00){var _0x5bd9fa=[];if(_[_0x7b88('0x66')](_0x569e00)){_0x5bd9fa=_[_0x7b88('0x3e')](_0x14cb2a,function(_0x3dc39a){if(_0x3dc39a[_0x7b88('0x5b')]!==_0x7b88('0x58')){return _0x3dc39a;}});return _0x5bd9fa;}else{for(var _0x86d4f=0x0;_0x86d4f<_0x14cb2a['length'];_0x86d4f++){var _0x289faa=_0x14cb2a[_0x86d4f];if(_0x289faa[_0x7b88('0x5b')]==='agent'){var _0x4ad63a=_[_0x7b88('0x4d')](_0x569e00,function(_0x446a91){return _0x446a91[_0x7b88('0x67')]===_0x289faa['id'];});if(_0x4ad63a)_0x5bd9fa[_0x7b88('0x68')](_0x289faa);}else{_0x5bd9fa['push'](_0x289faa);}}return _0x5bd9fa;}});}else{return _0x14cb2a;}}else{var _0x2fca62=_[_0x7b88('0x3e')](_0x14cb2a,function(_0x45e3fd){if(_0x45e3fd[_0x7b88('0x5b')]!==_0x7b88('0x58')){return _0x45e3fd;}});return _0x2fca62;}});}else{return _0x14cb2a;}}})['then'](function(_0x3740be){var _0x2a27fd=[];if(_0x3740be){_0x2205f4=_0x3740be;for(var _0x224394=0x0;_0x224394<_0x3740be[_0x7b88('0x37')];_0x224394+=0x1){_0x2205f4[_0x224394][_0x7b88('0x69')]=[];_0x2a27fd[_0x7b88('0x68')](db[_0x7b88('0x43')][_0x7b88('0x4d')]({'where':{'FromId':[_0x1d9617[_0x7b88('0x61')]['id'],_0x3740be[_0x224394]['id']],'ToId':[_0x1d9617[_0x7b88('0x61')]['id'],_0x3740be[_0x224394]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x7b88('0x6a'),_0x7b88('0x6b'),_0x7b88('0x6c'),'body'],'order':qs[_0x7b88('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7b88('0x47')](wrapUser(_0x3740be[_0x224394])));}return BPromise[_0x7b88('0x6d')](_0x2a27fd);}return[];})[_0x7b88('0x47')](function(_0x430591){return{'rows':_0x430591,'count':_0x430591[_0x7b88('0x37')]};})['then'](respondWithResult(_0x5c6a0a,null))[_0x7b88('0x49')](handleError(_0x5c6a0a,null));};
\ No newline at end of file
+var _0x7877=['lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','catch','show','filters','fields','include','find','create','body','params','describe'];(function(_0x566c8e,_0x149011){var _0x589258=function(_0x67e117){while(--_0x67e117){_0x566c8e['push'](_0x566c8e['shift']());}};_0x589258(++_0x149011);}(_0x7877,0x1e0));var _0x7787=function(_0x4c16c4,_0x1f4fb2){_0x4c16c4=_0x4c16c4-0x0;var _0x2d2ddf=_0x7877[_0x4c16c4];return _0x2d2ddf;};'use strict';var emlformat=require(_0x7787('0x0'));var rimraf=require(_0x7787('0x1'));var zipdir=require(_0x7787('0x2'));var jsonpatch=require(_0x7787('0x3'));var rp=require(_0x7787('0x4'));var moment=require(_0x7787('0x5'));var BPromise=require(_0x7787('0x6'));var Mustache=require(_0x7787('0x7'));var util=require(_0x7787('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7787('0x9'));var ejs=require(_0x7787('0xa'));var fs=require('fs');var fs_extra=require(_0x7787('0xb'));var _=require(_0x7787('0xc'));var squel=require(_0x7787('0xd'));var crypto=require(_0x7787('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7787('0x9'));var querystring=require('querystring');var Papa=require(_0x7787('0xf'));var Redis=require(_0x7787('0x10'));var authService=require(_0x7787('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7787('0x12'));var hardwareService=require(_0x7787('0x13'));var logger=require(_0x7787('0x14'))(_0x7787('0x15'));var utils=require(_0x7787('0x16'));var config=require(_0x7787('0x17'));var licenseUtil=require(_0x7787('0x18'));var db=require(_0x7787('0x19'))['db'];config[_0x7787('0x1a')]=_[_0x7787('0x1b')](config[_0x7787('0x1a')],{'host':_0x7787('0x1c'),'port':0x18eb});var socket=require(_0x7787('0x1d'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x3882f6,_0x48929f){_0x48929f=_0x48929f||0xcc;return function(_0x4dd3b6){if(_0x4dd3b6){return _0x3882f6[_0x7787('0x1e')](_0x48929f);}return _0x3882f6[_0x7787('0x1f')](_0x48929f)[_0x7787('0x20')]();};}function respondWithResult(_0x2ae6f6,_0x1eea75){_0x1eea75=_0x1eea75||0xc8;return function(_0x28d773){if(_0x28d773){return _0x2ae6f6[_0x7787('0x1f')](_0x1eea75)[_0x7787('0x21')](_0x28d773);}};}function respondWithFilteredResult(_0x393c5f,_0xddf4b5){return function(_0x43f8a5){if(_0x43f8a5){var _0x22a2d3=typeof _0xddf4b5[_0x7787('0x22')]===_0x7787('0x23')&&typeof _0xddf4b5[_0x7787('0x24')]==='undefined';var _0x325e41=_0x43f8a5[_0x7787('0x25')];var _0x50c583=_0x22a2d3?0x0:_0xddf4b5['offset'];var _0x576992=_0x22a2d3?_0x43f8a5[_0x7787('0x25')]:_0xddf4b5[_0x7787('0x22')]+_0xddf4b5[_0x7787('0x24')];var _0x43c6e0;if(_0x576992>=_0x325e41){_0x576992=_0x325e41;_0x43c6e0=0xc8;}else{_0x43c6e0=0xce;}_0x393c5f[_0x7787('0x1f')](_0x43c6e0);return _0x393c5f['set'](_0x7787('0x26'),_0x50c583+'-'+_0x576992+'/'+_0x325e41)[_0x7787('0x21')](_0x43f8a5);}return null;};}function patchUpdates(_0x42afdb){return function(_0x111c84){try{jsonpatch[_0x7787('0x27')](_0x111c84,_0x42afdb,!![]);}catch(_0x3a3465){return BPromise[_0x7787('0x28')](_0x3a3465);}return _0x111c84[_0x7787('0x29')]();};}function saveUpdates(_0x443624,_0x2f33d1){return function(_0x4b1b84){if(_0x4b1b84){return _0x4b1b84[_0x7787('0x2a')](_0x443624)[_0x7787('0x2b')](function(_0x3e4ed6){return _0x3e4ed6;});}return null;};}function removeEntity(_0x38a998,_0x40821d){return function(_0x194367){if(_0x194367){return _0x194367[_0x7787('0x2c')]()[_0x7787('0x2b')](function(){_0x38a998['status'](0xcc)[_0x7787('0x20')]();});}};}function handleEntityNotFound(_0x4bc24f,_0x444d2a){return function(_0x33e0e7){if(!_0x33e0e7){_0x4bc24f['sendStatus'](0x194);}return _0x33e0e7;};}function handleError(_0x14403d,_0x17cded){_0x17cded=_0x17cded||0x1f4;return function(_0x2ae6cf){logger['error'](_0x2ae6cf[_0x7787('0x2d')]);if(_0x2ae6cf[_0x7787('0x2e')]){delete _0x2ae6cf[_0x7787('0x2e')];}_0x14403d[_0x7787('0x1f')](_0x17cded)[_0x7787('0x2f')](_0x2ae6cf);};}exports[_0x7787('0x30')]=function(_0x19d5ad,_0x595b49){var _0xe4c499={},_0x324bea={},_0x59a55d={'count':0x0,'rows':[]};var _0x8a5120=_[_0x7787('0x31')](db[_0x7787('0x32')][_0x7787('0x33')],function(_0x528eaf){return{'name':_0x528eaf[_0x7787('0x34')],'type':_0x528eaf[_0x7787('0x35')][_0x7787('0x36')]};});_0x324bea[_0x7787('0x37')]=_[_0x7787('0x31')](_0x8a5120,_0x7787('0x2e'));_0x324bea[_0x7787('0x38')]=_[_0x7787('0x39')](_0x19d5ad[_0x7787('0x38')]);_0x324bea['filters']=_['intersection'](_0x324bea[_0x7787('0x37')],_0x324bea[_0x7787('0x38')]);_0xe4c499['attributes']=_[_0x7787('0x3a')](_0x324bea[_0x7787('0x37')],qs['fields'](_0x19d5ad[_0x7787('0x38')]['fields']));_0xe4c499[_0x7787('0x3b')]=_0xe4c499[_0x7787('0x3b')][_0x7787('0x3c')]?_0xe4c499[_0x7787('0x3b')]:_0x324bea['model'];if(!_0x19d5ad[_0x7787('0x38')][_0x7787('0x3d')](_0x7787('0x3e'))){_0xe4c499[_0x7787('0x24')]=qs['limit'](_0x19d5ad[_0x7787('0x38')][_0x7787('0x24')]);_0xe4c499['offset']=qs[_0x7787('0x22')](_0x19d5ad[_0x7787('0x38')]['offset']);}_0xe4c499['order']=qs[_0x7787('0x3f')](_0x19d5ad['query'][_0x7787('0x3f')]);_0xe4c499['where']=qs['filters'](_['pick'](_0x19d5ad[_0x7787('0x38')],_0x324bea['filters']),_0x8a5120);if(_0x19d5ad[_0x7787('0x38')][_0x7787('0x40')]){_0xe4c499[_0x7787('0x41')]=_['merge'](_0xe4c499[_0x7787('0x41')],{'$or':_[_0x7787('0x31')](_0x8a5120,function(_0x9a5663){if(_0x9a5663['type']!==_0x7787('0x42')){var _0x5f19fb={};_0x5f19fb[_0x9a5663[_0x7787('0x2e')]]={'$like':'%'+_0x19d5ad[_0x7787('0x38')][_0x7787('0x40')]+'%'};return _0x5f19fb;}})});}_0xe4c499=_[_0x7787('0x43')]({},_0xe4c499,_0x19d5ad[_0x7787('0x44')]);var _0x5e9b7f={'where':_0xe4c499[_0x7787('0x41')]};return db[_0x7787('0x32')][_0x7787('0x25')](_0x5e9b7f)[_0x7787('0x2b')](function(_0x2aec45){_0x59a55d[_0x7787('0x25')]=_0x2aec45;if(_0x19d5ad[_0x7787('0x38')][_0x7787('0x45')]){_0xe4c499['include']=[{'all':!![]}];}return db[_0x7787('0x32')]['findAll'](_0xe4c499);})['then'](function(_0x1a9650){_0x59a55d['rows']=_0x1a9650;return _0x59a55d;})[_0x7787('0x2b')](respondWithFilteredResult(_0x595b49,_0xe4c499))[_0x7787('0x46')](handleError(_0x595b49,null));};exports[_0x7787('0x47')]=function(_0x460fa1,_0x32274c){var _0x23932d={'raw':!![],'where':{'id':_0x460fa1['params']['id']}},_0x96b9c2={};_0x96b9c2[_0x7787('0x37')]=_[_0x7787('0x39')](db['ChatInternalMessage']['rawAttributes']);_0x96b9c2[_0x7787('0x38')]=_[_0x7787('0x39')](_0x460fa1[_0x7787('0x38')]);_0x96b9c2[_0x7787('0x48')]=_['intersection'](_0x96b9c2[_0x7787('0x37')],_0x96b9c2[_0x7787('0x38')]);_0x23932d['attributes']=_[_0x7787('0x3a')](_0x96b9c2[_0x7787('0x37')],qs['fields'](_0x460fa1[_0x7787('0x38')][_0x7787('0x49')]));_0x23932d['attributes']=_0x23932d[_0x7787('0x3b')][_0x7787('0x3c')]?_0x23932d[_0x7787('0x3b')]:_0x96b9c2['model'];if(_0x460fa1[_0x7787('0x38')][_0x7787('0x45')]){_0x23932d[_0x7787('0x4a')]=[{'all':!![]}];}_0x23932d=_['merge']({},_0x23932d,_0x460fa1['options']);return db['ChatInternalMessage'][_0x7787('0x4b')](_0x23932d)[_0x7787('0x2b')](handleEntityNotFound(_0x32274c,null))[_0x7787('0x2b')](respondWithResult(_0x32274c,null))[_0x7787('0x46')](handleError(_0x32274c,null));};exports[_0x7787('0x4c')]=function(_0x42ee6e,_0x1c904a){return db[_0x7787('0x32')]['create'](_0x42ee6e['body'],{})['then'](respondWithResult(_0x1c904a,0xc9))[_0x7787('0x46')](handleError(_0x1c904a,null));};exports[_0x7787('0x2a')]=function(_0x14d1fe,_0x461807){if(_0x14d1fe[_0x7787('0x4d')]['id']){delete _0x14d1fe['body']['id'];}return db[_0x7787('0x32')][_0x7787('0x4b')]({'where':{'id':_0x14d1fe[_0x7787('0x4e')]['id']}})[_0x7787('0x2b')](handleEntityNotFound(_0x461807,null))[_0x7787('0x2b')](saveUpdates(_0x14d1fe[_0x7787('0x4d')],null))['then'](respondWithResult(_0x461807,null))[_0x7787('0x46')](handleError(_0x461807,null));};exports['destroy']=function(_0xe6d878,_0x3accdd){return db['ChatInternalMessage'][_0x7787('0x4b')]({'where':{'id':_0xe6d878['params']['id']}})['then'](handleEntityNotFound(_0x3accdd,null))[_0x7787('0x2b')](removeEntity(_0x3accdd,null))[_0x7787('0x46')](handleError(_0x3accdd,null));};exports[_0x7787('0x4f')]=function(_0x2b0e46,_0x5e4983){return db[_0x7787('0x32')]['describe']()[_0x7787('0x2b')](respondWithResult(_0x5e4983,null))['catch'](handleError(_0x5e4983,null));};function wrapUser(_0x2717fd){return function(_0x5eb413){var _0x1b5b1e=_0x2717fd['get']({'plain':!![]});_0x1b5b1e['messages']=[];if(_0x5eb413){_0x1b5b1e[_0x7787('0x50')]=_0x5eb413[_0x7787('0x51')];_0x1b5b1e[_0x7787('0x52')]=_0x5eb413;}else{_0x1b5b1e[_0x7787('0x50')]=moment(0x0)['format'](_0x7787('0x53'));_0x1b5b1e[_0x7787('0x52')]={};}return _0x1b5b1e;};}exports[_0x7787('0x54')]=function(_0x49f98e,_0x12a978,_0x4cec69){var _0x36ea5a=[];return db[_0x7787('0x55')][_0x7787('0x56')]({'where':{'role':[_0x7787('0x57'),_0x7787('0x58'),_0x7787('0x59')]},'attributes':['id','fullname',_0x7787('0x2e'),'role','userpic',_0x7787('0x5a'),_0x7787('0x5b'),_0x7787('0x5c'),_0x7787('0x5d'),_0x7787('0x5e')],'order':qs['sort'](_0x7787('0x5f')),'include':[{'model':db[_0x7787('0x60')],'as':_0x7787('0x61'),'attributes':['id',_0x7787('0x2e'),_0x7787('0x35')],'through':{'attributes':[]}}]})[_0x7787('0x2b')](function(_0x4da1a4){if(_0x4da1a4){var _0x492767=_0x49f98e[_0x7787('0x59')][_0x7787('0x62')]({'plain':!![]});if(!_0x492767)throw new Error(_0x7787('0x63'));if(_0x492767[_0x7787('0x64')]===_0x7787('0x59')){return db[_0x7787('0x65')][_0x7787('0x4b')]({'where':{'name':_0x7787('0x66'),'userProfileId':_0x492767[_0x7787('0x67')]},'raw':!![]})[_0x7787('0x2b')](function(_0x437862){if(_0x437862){if(_0x437862['autoAssociation']===0x0){return db[_0x7787('0x68')][_0x7787('0x56')]({'where':{'sectionId':_0x437862['id']},'raw':!![]})[_0x7787('0x2b')](function(_0xa406ea){var _0x580cc8=[];if(_[_0x7787('0x69')](_0xa406ea)){_0x580cc8=_[_0x7787('0x40')](_0x4da1a4,function(_0x13b685){if(_0x13b685[_0x7787('0x64')]!==_0x7787('0x57')){return _0x13b685;}});return _0x580cc8;}else{for(var _0x4e08d1=0x0;_0x4e08d1<_0x4da1a4['length'];_0x4e08d1++){var _0x3b181a=_0x4da1a4[_0x4e08d1];if(_0x3b181a[_0x7787('0x64')]===_0x7787('0x57')){var _0x1850ba=_['find'](_0xa406ea,function(_0x2a972a){return _0x2a972a[_0x7787('0x6a')]===_0x3b181a['id'];});if(_0x1850ba)_0x580cc8[_0x7787('0x6b')](_0x3b181a);}else{_0x580cc8[_0x7787('0x6b')](_0x3b181a);}}return _0x580cc8;}});}else{return _0x4da1a4;}}else{var _0x14017f=_[_0x7787('0x40')](_0x4da1a4,function(_0x1828cb){if(_0x1828cb[_0x7787('0x64')]!=='agent'){return _0x1828cb;}});return _0x14017f;}});}else{return _0x4da1a4;}}})[_0x7787('0x2b')](function(_0x1cc6a3){var _0x1e8396=[];if(_0x1cc6a3){_0x36ea5a=_0x1cc6a3;for(var _0x23394b=0x0;_0x23394b<_0x1cc6a3[_0x7787('0x3c')];_0x23394b+=0x1){_0x36ea5a[_0x23394b]['messages']=[];_0x1e8396[_0x7787('0x6b')](db[_0x7787('0x32')][_0x7787('0x4b')]({'where':{'FromId':[_0x49f98e[_0x7787('0x59')]['id'],_0x1cc6a3[_0x23394b]['id']],'ToId':[_0x49f98e[_0x7787('0x59')]['id'],_0x1cc6a3[_0x23394b]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x7787('0x6c'),_0x7787('0x6d'),'body'],'order':qs[_0x7787('0x3f')](_0x7787('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7787('0x2b')](wrapUser(_0x1cc6a3[_0x23394b])));}return BPromise[_0x7787('0x6f')](_0x1e8396);}return[];})['then'](function(_0x58a9dd){return{'rows':_0x58a9dd,'count':_0x58a9dd[_0x7787('0x3c')]};})[_0x7787('0x2b')](respondWithResult(_0x12a978,null))['catch'](handleError(_0x12a978,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 5e23ee1..8e663cf 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 _0xc14c=['ChatInternalMessage','setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x5ecb3b,_0x187a51){var _0x33b125=function(_0x2f99dd){while(--_0x2f99dd){_0x5ecb3b['push'](_0x5ecb3b['shift']());}};_0x33b125(++_0x187a51);}(_0xc14c,0x1c6));var _0xcc14=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc14c[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xcc14('0x0'));var ChatInternalMessage=require(_0xcc14('0x1'))['db'][_0xcc14('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcc14('0x3')](0x0);var events={'afterCreate':_0xcc14('0x4'),'afterUpdate':_0xcc14('0x5'),'afterDestroy':'remove'};function emitEvent(_0x193ac4){return function(_0x2e0ef2,_0x212414,_0x54469f){ChatInternalMessageEvents[_0xcc14('0x6')](_0x193ac4+':'+_0x2e0ef2['id'],_0x2e0ef2);ChatInternalMessageEvents[_0xcc14('0x6')](_0x193ac4,_0x2e0ef2);_0x54469f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xcc14('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5d0e=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x5d0e,0x1d2));var _0xe5d0=function(_0xad00c6,_0x300093){_0xad00c6=_0xad00c6-0x0;var _0x567159=_0x5d0e[_0xad00c6];return _0x567159;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe5d0('0x0'))['db'][_0xe5d0('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe5d0('0x2')](0x0);var events={'afterCreate':_0xe5d0('0x3'),'afterUpdate':'update','afterDestroy':_0xe5d0('0x4')};function emitEvent(_0x5887e9){return function(_0x27fdd2,_0x1e7c13,_0x49d8de){ChatInternalMessageEvents['emit'](_0x5887e9+':'+_0x27fdd2['id'],_0x27fdd2);ChatInternalMessageEvents[_0xe5d0('0x5')](_0x5887e9,_0x27fdd2);_0x49d8de(null);};}for(var e in events){if(events[_0xe5d0('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe5d0('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index b7c5a79..8cd39c4 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 _0xa99f=['exports','define','ChatInternalMessage','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x59f896,_0x35c890){var _0x50da4a=function(_0x1d398c){while(--_0x1d398c){_0x59f896['push'](_0x59f896['shift']());}};_0x50da4a(++_0x35c890);}(_0xa99f,0xab));var _0xfa99=function(_0x1e563f,_0x1ad013){_0x1e563f=_0x1e563f-0x0;var _0x10615a=_0xa99f[_0x1e563f];return _0x10615a;};'use strict';var _=require(_0xfa99('0x0'));var util=require(_0xfa99('0x1'));var logger=require(_0xfa99('0x2'))(_0xfa99('0x3'));var moment=require(_0xfa99('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa99('0x5'));var rimraf=require(_0xfa99('0x6'));var config=require(_0xfa99('0x7'));var attributes=require(_0xfa99('0x8'));module[_0xfa99('0x9')]=function(_0x584e36,_0x15982e){return _0x584e36[_0xfa99('0xa')](_0xfa99('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xccd4=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x27e8f4,_0x577fc7){var _0xbeb7ef=function(_0x310a10){while(--_0x310a10){_0x27e8f4['push'](_0x27e8f4['shift']());}};_0xbeb7ef(++_0x577fc7);}(_0xccd4,0x16d));var _0x4ccd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xccd4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4ccd('0x0'));var util=require(_0x4ccd('0x1'));var logger=require('../../config/logger')(_0x4ccd('0x2'));var moment=require(_0x4ccd('0x3'));var BPromise=require(_0x4ccd('0x4'));var rp=require(_0x4ccd('0x5'));var fs=require('fs');var path=require(_0x4ccd('0x6'));var rimraf=require(_0x4ccd('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x4ccd('0x8')]=function(_0x3c222a,_0x46ced8){return _0x3c222a[_0x4ccd('0x9')](_0x4ccd('0xa'),attributes,{'tableName':_0x4ccd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ccd('0xc'),'collate':_0x4ccd('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 161d5b1..9058f11 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 _0x94f8=['./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x262f11,_0x5316e8){var _0x258a32=function(_0x183f2f){while(--_0x183f2f){_0x262f11['push'](_0x262f11['shift']());}};_0x258a32(++_0x5316e8);}(_0x94f8,0x19e));var _0x894f=function(_0x2d58e6,_0x55cb14){_0x2d58e6=_0x2d58e6-0x0;var _0x5bcd81=_0x94f8[_0x2d58e6];return _0x5bcd81;};'use strict';var _=require('lodash');var util=require(_0x894f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x894f('0x1'))['db'];var utils=require(_0x894f('0x2'));var logger=require(_0x894f('0x3'))('rpc');var config=require(_0x894f('0x4'));var jayson=require(_0x894f('0x5'));var client=jayson[_0x894f('0x6')][_0x894f('0x7')]({'port':0x232a});config[_0x894f('0x8')]=_[_0x894f('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x894f('0xa'))(new Redis(config['redis']));require(_0x894f('0xb'))[_0x894f('0xc')](socket);function respondWithRpcPromise(_0x6586c8,_0x3f0a2b,_0x705ee8){return new BPromise(function(_0x6e4a99,_0x5ce4a5){return client[_0x894f('0xd')](_0x6586c8,_0x705ee8)[_0x894f('0xe')](function(_0x215850){logger[_0x894f('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x3f0a2b,_0x894f('0x10'));logger[_0x894f('0x11')](_0x894f('0x12'),_0x3f0a2b,_0x894f('0x10'),JSON[_0x894f('0x13')](_0x215850));if(_0x215850[_0x894f('0x14')]){if(_0x215850[_0x894f('0x14')]['code']===0x1f4){logger[_0x894f('0x14')](_0x894f('0x15'),_0x3f0a2b,_0x215850[_0x894f('0x14')][_0x894f('0x16')]);return _0x5ce4a5(_0x215850['error'][_0x894f('0x16')]);}logger[_0x894f('0x14')](_0x894f('0x15'),_0x3f0a2b,_0x215850[_0x894f('0x14')]['message']);return _0x6e4a99(_0x215850[_0x894f('0x14')]['message']);}else{logger[_0x894f('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x3f0a2b,_0x894f('0x10'));_0x6e4a99(_0x215850[_0x894f('0x17')][_0x894f('0x16')]);}})[_0x894f('0x18')](function(_0x13e75b){logger[_0x894f('0x14')](_0x894f('0x15'),_0x3f0a2b,_0x13e75b);_0x5ce4a5(_0x13e75b);});});}
\ No newline at end of file
+var _0xf5c4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util'];(function(_0x14e4d7,_0x21ca39){var _0x2a9b06=function(_0x2cd8d3){while(--_0x2cd8d3){_0x14e4d7['push'](_0x14e4d7['shift']());}};_0x2a9b06(++_0x21ca39);}(_0xf5c4,0x1a7));var _0x4f5c=function(_0xd6d2b9,_0x48c95a){_0xd6d2b9=_0xd6d2b9-0x0;var _0x2a51c5=_0xf5c4[_0xd6d2b9];return _0x2a51c5;};'use strict';var _=require(_0x4f5c('0x0'));var util=require(_0x4f5c('0x1'));var moment=require(_0x4f5c('0x2'));var BPromise=require(_0x4f5c('0x3'));var rs=require(_0x4f5c('0x4'));var fs=require('fs');var Redis=require(_0x4f5c('0x5'));var db=require(_0x4f5c('0x6'))['db'];var utils=require(_0x4f5c('0x7'));var logger=require(_0x4f5c('0x8'))(_0x4f5c('0x9'));var config=require(_0x4f5c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4f5c('0xb')]['http']({'port':0x232a});config['redis']=_[_0x4f5c('0xc')](config[_0x4f5c('0xd')],{'host':_0x4f5c('0xe'),'port':0x18eb});var socket=require(_0x4f5c('0xf'))(new Redis(config[_0x4f5c('0xd')]));require('./chatInternalMessage.socket')[_0x4f5c('0x10')](socket);function respondWithRpcPromise(_0x4f97af,_0x415996,_0x237a70){return new BPromise(function(_0x1aebc6,_0x40cf2d){return client['request'](_0x4f97af,_0x237a70)[_0x4f5c('0x11')](function(_0x2c0f9c){logger[_0x4f5c('0x12')](_0x4f5c('0x13'),_0x415996,'request\x20sent');logger['debug'](_0x4f5c('0x14'),_0x415996,_0x4f5c('0x15'),JSON['stringify'](_0x2c0f9c));if(_0x2c0f9c[_0x4f5c('0x16')]){if(_0x2c0f9c['error']['code']===0x1f4){logger[_0x4f5c('0x16')](_0x4f5c('0x13'),_0x415996,_0x2c0f9c[_0x4f5c('0x16')][_0x4f5c('0x17')]);return _0x40cf2d(_0x2c0f9c['error'][_0x4f5c('0x17')]);}logger['error'](_0x4f5c('0x13'),_0x415996,_0x2c0f9c[_0x4f5c('0x16')][_0x4f5c('0x17')]);return _0x1aebc6(_0x2c0f9c[_0x4f5c('0x16')][_0x4f5c('0x17')]);}else{logger[_0x4f5c('0x12')](_0x4f5c('0x13'),_0x415996,_0x4f5c('0x15'));_0x1aebc6(_0x2c0f9c['result'][_0x4f5c('0x17')]);}})[_0x4f5c('0x18')](function(_0x3ece35){logger[_0x4f5c('0x16')](_0x4f5c('0x13'),_0x415996,_0x3ece35);_0x40cf2d(_0x3ece35);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 5ce08e7..1c5c9a9 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 _0xc07a=['update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0xf0377e,_0x54473f){var _0x18f6ee=function(_0x207f0d){while(--_0x207f0d){_0xf0377e['push'](_0xf0377e['shift']());}};_0x18f6ee(++_0x54473f);}(_0xc07a,0x1b6));var _0xac07=function(_0x3a9b11,_0xb6c98){_0x3a9b11=_0x3a9b11-0x0;var _0x5e6324=_0xc07a[_0x3a9b11];return _0x5e6324;};'use strict';var ChatInternalMessageEvents=require(_0xac07('0x0'));var events=[_0xac07('0x1'),'remove',_0xac07('0x2')];function createListener(_0x22616c,_0x545554){return function(_0x3794da){_0x545554[_0xac07('0x3')](_0x22616c,_0x3794da);};}function removeListener(_0x308a78,_0x2b67ac){return function(){ChatInternalMessageEvents[_0xac07('0x4')](_0x308a78,_0x2b67ac);};}exports[_0xac07('0x5')]=function(_0x1c3e5e){for(var _0x4ac23e=0x0,_0x418fce=events[_0xac07('0x6')];_0x4ac23e<_0x418fce;_0x4ac23e++){var _0x20e3d6=events[_0x4ac23e];var _0x4da314=createListener(_0xac07('0x7')+_0x20e3d6,_0x1c3e5e);ChatInternalMessageEvents['on'](_0x20e3d6,_0x4da314);}};
\ No newline at end of file
+var _0xc2a7=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x17e600,_0x1fdf60){var _0x317515=function(_0x5a4607){while(--_0x5a4607){_0x17e600['push'](_0x17e600['shift']());}};_0x317515(++_0x1fdf60);}(_0xc2a7,0x112));var _0x7c2a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc2a7[_0x40a045];return _0x1a687c;};'use strict';var ChatInternalMessageEvents=require(_0x7c2a('0x0'));var events=[_0x7c2a('0x1'),_0x7c2a('0x2'),_0x7c2a('0x3')];function createListener(_0x485258,_0x18eabd){return function(_0x57e811){_0x18eabd[_0x7c2a('0x4')](_0x485258,_0x57e811);};}function removeListener(_0x3cc18e,_0x3ed5d3){return function(){ChatInternalMessageEvents[_0x7c2a('0x5')](_0x3cc18e,_0x3ed5d3);};}exports[_0x7c2a('0x6')]=function(_0x15e9fa){for(var _0x1e3d1f=0x0,_0xf1582b=events[_0x7c2a('0x7')];_0x1e3d1f<_0xf1582b;_0x1e3d1f++){var _0x5bc270=events[_0x1e3d1f];var _0x30ec96=createListener(_0x7c2a('0x8')+_0x5bc270,_0x15e9fa);ChatInternalMessageEvents['on'](_0x5bc270,_0x30ec96);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index a960626..3fb1ce4 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 _0xe3d4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users','getUsers','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x4a901d,_0x5b966b){var _0x810dad=function(_0x2ff2c7){while(--_0x2ff2c7){_0x4a901d['push'](_0x4a901d['shift']());}};_0x810dad(++_0x5b966b);}(_0xe3d4,0x112));var _0x4e3d=function(_0x47e3f8,_0x517bcd){_0x47e3f8=_0x47e3f8-0x0;var _0x4742d5=_0xe3d4[_0x47e3f8];return _0x4742d5;};'use strict';var multer=require(_0x4e3d('0x0'));var util=require(_0x4e3d('0x1'));var path=require(_0x4e3d('0x2'));var timeout=require(_0x4e3d('0x3'));var express=require(_0x4e3d('0x4'));var router=express[_0x4e3d('0x5')]();var fs_extra=require(_0x4e3d('0x6'));var auth=require(_0x4e3d('0x7'));var interaction=require(_0x4e3d('0x8'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x4e3d('0x9')]('/',auth['isAuthenticated'](),controller[_0x4e3d('0xa')]);router['get'](_0x4e3d('0xb'),auth[_0x4e3d('0xc')](),controller[_0x4e3d('0xd')]);router[_0x4e3d('0x9')](_0x4e3d('0xe'),auth[_0x4e3d('0xc')](),controller[_0x4e3d('0xf')]);router[_0x4e3d('0x9')]('/:id',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x10')]);router[_0x4e3d('0x11')]('/',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x12')]);router[_0x4e3d('0x13')]('/:id',controller[_0x4e3d('0x14')]);router[_0x4e3d('0x15')]('/:id',auth[_0x4e3d('0xc')](),controller[_0x4e3d('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xbdfa=['show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0xbdfa,0x1c0));var _0xabdf=function(_0x42ce5a,_0xd71696){_0x42ce5a=_0x42ce5a-0x0;var _0x3f0661=_0xbdfa[_0x42ce5a];return _0x3f0661;};'use strict';var multer=require(_0xabdf('0x0'));var util=require('util');var path=require(_0xabdf('0x1'));var timeout=require(_0xabdf('0x2'));var express=require(_0xabdf('0x3'));var router=express['Router']();var fs_extra=require(_0xabdf('0x4'));var auth=require(_0xabdf('0x5'));var interaction=require(_0xabdf('0x6'));var config=require(_0xabdf('0x7'));var controller=require(_0xabdf('0x8'));router[_0xabdf('0x9')]('/',auth[_0xabdf('0xa')](),controller['index']);router[_0xabdf('0x9')](_0xabdf('0xb'),auth['isAuthenticated'](),controller[_0xabdf('0xc')]);router[_0xabdf('0x9')]('/users',auth[_0xabdf('0xa')](),controller[_0xabdf('0xd')]);router[_0xabdf('0x9')]('/:id',auth[_0xabdf('0xa')](),controller[_0xabdf('0xe')]);router[_0xabdf('0xf')]('/',auth[_0xabdf('0xa')](),controller[_0xabdf('0x10')]);router[_0xabdf('0x11')](_0xabdf('0x12'),controller[_0xabdf('0x13')]);router[_0xabdf('0x14')](_0xabdf('0x12'),auth[_0xabdf('0xa')](),controller['destroy']);module[_0xabdf('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 9c658c9..cfc9562 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 _0x174b=['medium','BOOLEAN','ENUM','out','TEXT','sequelize'];(function(_0x28b9ea,_0x5b50f2){var _0x4af8f4=function(_0x302d3a){while(--_0x302d3a){_0x28b9ea['push'](_0x28b9ea['shift']());}};_0x4af8f4(++_0x5b50f2);}(_0x174b,0x19d));var _0xb174=function(_0x13d8c4,_0x52b03e){_0x13d8c4=_0x13d8c4-0x0;var _0x3c06c5=_0x174b[_0x13d8c4];return _0x3c06c5;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb174('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb174('0x3')]('in',_0xb174('0x4')),'defaultValue':_0xb174('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb174('0x5')]}};
\ No newline at end of file
+var _0x6d0c=['sequelize','exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x3aa965,_0x173e2c){_0x3aa965=_0x3aa965-0x0;var _0xef4dae=_0x6d0c[_0x3aa965];return _0xef4dae;};'use strict';var Sequelize=require(_0xc6d0('0x0'));module[_0xc6d0('0x1')]={'body':{'type':Sequelize[_0xc6d0('0x2')](_0xc6d0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc6d0('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc6d0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc6d0('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc6d0('0x6')]},'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 4f6df4b..6c2d33e 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 _0x5b18=['VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','info','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat','RejectMessage','SELECT','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','ChatMessage','rawAttributes','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x25241e,_0x5dfa0e){var _0x5d9df1=function(_0x4443ce){while(--_0x4443ce){_0x25241e['push'](_0x25241e['shift']());}};_0x5d9df1(++_0x5dfa0e);}(_0x5b18,0xb4));var _0x85b1=function(_0x25fef3,_0x2238b0){_0x25fef3=_0x25fef3-0x0;var _0x5d9ea1=_0x5b18[_0x25fef3];return _0x5d9ea1;};'use strict';var emlformat=require(_0x85b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85b1('0x2'));var moment=require(_0x85b1('0x3'));var BPromise=require(_0x85b1('0x4'));var Mustache=require('mustache');var util=require(_0x85b1('0x5'));var path=require(_0x85b1('0x6'));var sox=require(_0x85b1('0x7'));var csv=require(_0x85b1('0x8'));var ejs=require(_0x85b1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85b1('0xa'));var squel=require(_0x85b1('0xb'));var crypto=require(_0x85b1('0xc'));var jsforce=require(_0x85b1('0xd'));var deskjs=require(_0x85b1('0xe'));var toCsv=require(_0x85b1('0x8'));var querystring=require(_0x85b1('0xf'));var Papa=require(_0x85b1('0x10'));var Redis=require(_0x85b1('0x11'));var authService=require(_0x85b1('0x12'));var qs=require(_0x85b1('0x13'));var as=require(_0x85b1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x85b1('0x15'))('api');var utils=require(_0x85b1('0x16'));var config=require(_0x85b1('0x17'));var licenseUtil=require(_0x85b1('0x18'));var db=require(_0x85b1('0x19'))['db'];config[_0x85b1('0x1a')]=_[_0x85b1('0x1b')](config['redis'],{'host':_0x85b1('0x1c'),'port':0x18eb});var socket=require(_0x85b1('0x1d'))(new Redis(config[_0x85b1('0x1a')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x85b1('0x1e'));var client=jayson['client'][_0x85b1('0x1f')]({'port':0x232c});var client9002=jayson[_0x85b1('0x20')][_0x85b1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3cdfa8,_0xb0e13a,_0x54b160,_0x395918){return new BPromise(function(_0x362ee4,_0x251516){var _0x5a146c=_0x395918||client;return _0x5a146c[_0x85b1('0x21')](_0x3cdfa8,_0x54b160)[_0x85b1('0x22')](function(_0x252b7c){logger['info'](_0x85b1('0x23'),_0xb0e13a,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xb0e13a,_0x85b1('0x24'),JSON[_0x85b1('0x25')](_0x252b7c));if(_0x252b7c[_0x85b1('0x26')]){if(_0x252b7c[_0x85b1('0x26')][_0x85b1('0x27')]===0x1f4){logger[_0x85b1('0x26')](_0x85b1('0x23'),_0xb0e13a,_0x252b7c[_0x85b1('0x26')]['message']);return _0x251516(_0x252b7c['error'][_0x85b1('0x28')]);}logger['error'](_0x85b1('0x23'),_0xb0e13a,_0x252b7c['error'][_0x85b1('0x28')]);return _0x362ee4(_0x252b7c['error'][_0x85b1('0x28')]);}else{logger['info'](_0x85b1('0x23'),_0xb0e13a,_0x85b1('0x24'));_0x362ee4(_0x252b7c[_0x85b1('0x29')]['message']);}})['catch'](function(_0x77b511){logger[_0x85b1('0x26')](_0x85b1('0x23'),_0xb0e13a,_0x77b511);_0x251516(_0x77b511);});});}function respondWithStatusCode(_0x47143b,_0x4e8f35){_0x4e8f35=_0x4e8f35||0xcc;return function(_0x56af9e){if(_0x56af9e){return _0x47143b[_0x85b1('0x2a')](_0x4e8f35);}return _0x47143b['status'](_0x4e8f35)[_0x85b1('0x2b')]();};}function respondWithResult(_0x2c6637,_0x2b62bf){_0x2b62bf=_0x2b62bf||0xc8;return function(_0xfb3f9b){if(_0xfb3f9b){return _0x2c6637[_0x85b1('0x2c')](_0x2b62bf)[_0x85b1('0x2d')](_0xfb3f9b);}};}function respondWithFilteredResult(_0xa2cfdc,_0x383fba){return function(_0x4d7085){if(_0x4d7085){var _0x1ea309=typeof _0x383fba[_0x85b1('0x2e')]===_0x85b1('0x2f')&&typeof _0x383fba[_0x85b1('0x30')]===_0x85b1('0x2f');var _0x32fa34=_0x4d7085[_0x85b1('0x31')];var _0x1217fb=_0x1ea309?0x0:_0x383fba[_0x85b1('0x2e')];var _0xed0db7=_0x1ea309?_0x4d7085[_0x85b1('0x31')]:_0x383fba['offset']+_0x383fba['limit'];var _0x418fbb;if(_0xed0db7>=_0x32fa34){_0xed0db7=_0x32fa34;_0x418fbb=0xc8;}else{_0x418fbb=0xce;}_0xa2cfdc['status'](_0x418fbb);return _0xa2cfdc[_0x85b1('0x32')](_0x85b1('0x33'),_0x1217fb+'-'+_0xed0db7+'/'+_0x32fa34)[_0x85b1('0x2d')](_0x4d7085);}return null;};}function patchUpdates(_0x55b10d){return function(_0x39d71a){try{jsonpatch[_0x85b1('0x34')](_0x39d71a,_0x55b10d,!![]);}catch(_0x3c4dc3){return BPromise[_0x85b1('0x35')](_0x3c4dc3);}return _0x39d71a[_0x85b1('0x36')]();};}function saveUpdates(_0x178a58,_0x5a50d5){return function(_0xb63e29){if(_0xb63e29){return _0xb63e29[_0x85b1('0x37')](_0x178a58)[_0x85b1('0x22')](function(_0x4fff84){return _0x4fff84;});}return null;};}function removeEntity(_0x604c85,_0x8ba78b){return function(_0x2d5aaf){if(_0x2d5aaf){return _0x2d5aaf[_0x85b1('0x38')]()[_0x85b1('0x22')](function(){_0x604c85[_0x85b1('0x2c')](0xcc)[_0x85b1('0x2b')]();});}};}function handleEntityNotFound(_0x50f14a,_0x35f56e){return function(_0x130cd5){if(!_0x130cd5){_0x50f14a[_0x85b1('0x2a')](0x194);}return _0x130cd5;};}function handleError(_0x229c4a,_0x51c3eb){_0x51c3eb=_0x51c3eb||0x1f4;return function(_0x3592bf){logger[_0x85b1('0x26')](_0x3592bf[_0x85b1('0x39')]);if(_0x3592bf[_0x85b1('0x3a')]){delete _0x3592bf[_0x85b1('0x3a')];}_0x229c4a[_0x85b1('0x2c')](_0x51c3eb)['send'](_0x3592bf);};}exports['index']=function(_0x40f7fb,_0x572c00){var _0x47e0fc={},_0x5e3bec={},_0x10cde3={'count':0x0,'rows':[]};var _0xafeb39=_['map'](db[_0x85b1('0x3b')][_0x85b1('0x3c')],function(_0x387901){return{'name':_0x387901['fieldName'],'type':_0x387901['type'][_0x85b1('0x3d')]};});_0x5e3bec['model']=_[_0x85b1('0x3e')](_0xafeb39,_0x85b1('0x3a'));_0x5e3bec['query']=_[_0x85b1('0x3f')](_0x40f7fb[_0x85b1('0x40')]);_0x5e3bec[_0x85b1('0x41')]=_[_0x85b1('0x42')](_0x5e3bec[_0x85b1('0x43')],_0x5e3bec[_0x85b1('0x40')]);_0x47e0fc[_0x85b1('0x44')]=_[_0x85b1('0x42')](_0x5e3bec['model'],qs[_0x85b1('0x45')](_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x45')]));_0x47e0fc[_0x85b1('0x44')]=_0x47e0fc[_0x85b1('0x44')][_0x85b1('0x46')]?_0x47e0fc['attributes']:_0x5e3bec[_0x85b1('0x43')];if(!_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x47')](_0x85b1('0x48'))){_0x47e0fc[_0x85b1('0x30')]=qs['limit'](_0x40f7fb[_0x85b1('0x40')]['limit']);_0x47e0fc['offset']=qs[_0x85b1('0x2e')](_0x40f7fb[_0x85b1('0x40')]['offset']);}_0x47e0fc[_0x85b1('0x49')]=qs[_0x85b1('0x4a')](_0x40f7fb[_0x85b1('0x40')]['sort']);_0x47e0fc[_0x85b1('0x4b')]=qs[_0x85b1('0x41')](_[_0x85b1('0x4c')](_0x40f7fb[_0x85b1('0x40')],_0x5e3bec[_0x85b1('0x41')]),_0xafeb39);if(_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x4d')]){_0x47e0fc['where']=_[_0x85b1('0x4e')](_0x47e0fc[_0x85b1('0x4b')],{'$or':_[_0x85b1('0x3e')](_0xafeb39,function(_0x2f4903){if(_0x2f4903[_0x85b1('0x4f')]!==_0x85b1('0x50')){var _0x336117={};_0x336117[_0x2f4903[_0x85b1('0x3a')]]={'$like':'%'+_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x4d')]+'%'};return _0x336117;}})});}_0x47e0fc=_[_0x85b1('0x4e')]({},_0x47e0fc,_0x40f7fb[_0x85b1('0x51')]);var _0x1838d3={'where':_0x47e0fc[_0x85b1('0x4b')]};return db['ChatMessage'][_0x85b1('0x31')](_0x1838d3)['then'](function(_0x5e8520){_0x10cde3[_0x85b1('0x31')]=_0x5e8520;if(_0x40f7fb[_0x85b1('0x40')][_0x85b1('0x52')]){_0x47e0fc['include']=[{'all':!![]}];}return db[_0x85b1('0x3b')][_0x85b1('0x53')](_0x47e0fc);})[_0x85b1('0x22')](function(_0x20c0f8){_0x10cde3[_0x85b1('0x54')]=_0x20c0f8;return _0x10cde3;})[_0x85b1('0x22')](respondWithFilteredResult(_0x572c00,_0x47e0fc))[_0x85b1('0x55')](handleError(_0x572c00,null));};exports['show']=function(_0x9565f7,_0xeb33ed){var _0xbded8f={'raw':!![],'where':{'id':_0x9565f7[_0x85b1('0x56')]['id']}},_0x57bd9d={};_0x57bd9d['model']=_[_0x85b1('0x3f')](db[_0x85b1('0x3b')][_0x85b1('0x3c')]);_0x57bd9d[_0x85b1('0x40')]=_['keys'](_0x9565f7['query']);_0x57bd9d[_0x85b1('0x41')]=_['intersection'](_0x57bd9d['model'],_0x57bd9d[_0x85b1('0x40')]);_0xbded8f[_0x85b1('0x44')]=_['intersection'](_0x57bd9d[_0x85b1('0x43')],qs[_0x85b1('0x45')](_0x9565f7['query'][_0x85b1('0x45')]));_0xbded8f[_0x85b1('0x44')]=_0xbded8f[_0x85b1('0x44')]['length']?_0xbded8f[_0x85b1('0x44')]:_0x57bd9d[_0x85b1('0x43')];if(_0x9565f7['query'][_0x85b1('0x52')]){_0xbded8f['include']=[{'all':!![]}];}_0xbded8f=_[_0x85b1('0x4e')]({},_0xbded8f,_0x9565f7[_0x85b1('0x51')]);return db[_0x85b1('0x3b')][_0x85b1('0x57')](_0xbded8f)[_0x85b1('0x22')](handleEntityNotFound(_0xeb33ed,null))[_0x85b1('0x22')](respondWithResult(_0xeb33ed,null))['catch'](handleError(_0xeb33ed,null));};exports['create']=function(_0x1b778e,_0x542601){return db[_0x85b1('0x3b')][_0x85b1('0x58')](_0x1b778e[_0x85b1('0x59')],{})[_0x85b1('0x22')](respondWithResult(_0x542601,0xc9))[_0x85b1('0x55')](handleError(_0x542601,null));};exports[_0x85b1('0x37')]=function(_0x28e4f6,_0x2fe1e8){if(_0x28e4f6[_0x85b1('0x59')]['id']){delete _0x28e4f6['body']['id'];}return db[_0x85b1('0x3b')][_0x85b1('0x57')]({'where':{'id':_0x28e4f6[_0x85b1('0x56')]['id']}})['then'](handleEntityNotFound(_0x2fe1e8,null))[_0x85b1('0x22')](saveUpdates(_0x28e4f6[_0x85b1('0x59')],null))[_0x85b1('0x22')](respondWithResult(_0x2fe1e8,null))[_0x85b1('0x55')](handleError(_0x2fe1e8,null));};exports[_0x85b1('0x38')]=function(_0xd93476,_0x6d6415){return db[_0x85b1('0x3b')][_0x85b1('0x57')]({'where':{'id':_0xd93476[_0x85b1('0x56')]['id']}})[_0x85b1('0x22')](handleEntityNotFound(_0x6d6415,null))[_0x85b1('0x22')](removeEntity(_0x6d6415,null))[_0x85b1('0x55')](handleError(_0x6d6415,null));};exports[_0x85b1('0x5a')]=function(_0x5f5dfe,_0x50d9c3){return db[_0x85b1('0x3b')][_0x85b1('0x5a')]()['then'](respondWithResult(_0x50d9c3,null))[_0x85b1('0x55')](handleError(_0x50d9c3,null));};var interaction_log=require(_0x85b1('0x15'))(_0x85b1('0x5b'));exports[_0x85b1('0x5c')]=function(_0x4c40c6,_0x2c3b88,_0x2c2114){var _0x3033d7={'agent':{},'channel':'chat'};if(_0x4c40c6[_0x85b1('0x59')]['id']){delete _0x4c40c6[_0x85b1('0x59')]['id'];}_0x4c40c6['body']['read']=!![];_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x5d')]=moment()[_0x85b1('0x5e')](_0x85b1('0x5f'));_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x60')]=_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x60')]||_0x4c40c6[_0x85b1('0x61')]['id'];_0x3033d7[_0x85b1('0x62')]['id']=_0x4c40c6[_0x85b1('0x59')]['UserId'];return db[_0x85b1('0x3b')][_0x85b1('0x57')]({'where':{'id':_0x4c40c6[_0x85b1('0x56')]['id'],'UserId':null}})[_0x85b1('0x22')](handleEntityNotFound(_0x2c3b88,null))[_0x85b1('0x22')](saveUpdates(_0x4c40c6[_0x85b1('0x59')],null))[_0x85b1('0x22')](function(_0x35b24f){if(_0x35b24f){_0x3033d7[_0x85b1('0x28')]=_0x35b24f[_0x85b1('0x63')]({'plain':!![]});return db[_0x85b1('0x64')]['find']({'where':{'id':_0x35b24f[_0x85b1('0x65')]}});}return null;})[_0x85b1('0x22')](handleEntityNotFound(_0x2c3b88,null))[_0x85b1('0x22')](function(_0x311ae6){if(_0x311ae6){return _0x311ae6['update']({'UserId':_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x60')],'read1stAt':_[_0x85b1('0x66')](_0x311ae6['read1stAt'])?moment()[_0x85b1('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x85b1('0x22')](function(_0x12892e){if(_0x12892e){_0x3033d7[_0x85b1('0x67')]=_0x12892e['get']({'plain':!![]});interaction_log[_0x85b1('0x68')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c40c6[_0x85b1('0x61')]['id'],_0x4c40c6[_0x85b1('0x61')][_0x85b1('0x3a')],_0x4c40c6['user'][_0x85b1('0x69')],_0x3033d7[_0x85b1('0x67')]['id'],_0x4c40c6[_0x85b1('0x59')]?JSON['stringify'](_0x4c40c6[_0x85b1('0x59')]):_0x85b1('0x6a'));return respondWithRpcPromise(_0x85b1('0x6b'),'acceptMessage',_0x3033d7);}return null;})[_0x85b1('0x22')](function(_0x26d748){var _0x89ad94=_0x85b1('0x6c')+_0x26d748[_0x85b1('0x28')][_0x85b1('0x6d')];return db[_0x85b1('0x6e')]['query'](_0x89ad94,{'type':db['Sequelize'][_0x85b1('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x540078){return _0x540078;});})[_0x85b1('0x22')](function(_0x23cb9d){if(_0x23cb9d){_0x3033d7['message'][_0x85b1('0x70')]=_0x23cb9d[0x0];if(!_0x4c40c6[_0x85b1('0x59')][_0x85b1('0x60')])return;return db[_0x85b1('0x71')][_0x85b1('0x57')]({'where':{'id':_0x4c40c6[_0x85b1('0x59')]['UserId'],'role':_0x85b1('0x62')},'attributes':['id',_0x85b1('0x3a'),_0x85b1('0x72'),_0x85b1('0x73'),_0x85b1('0x74')],'raw':!![]});}return null;})['then'](function(_0x46ad41){if(!_0x46ad41)return null;_0x3033d7['message'][_0x85b1('0x62')]=_0x46ad41;return _0x3033d7;})[_0x85b1('0x22')](function(_0x3aad67){if(_0x3aad67){if(_0x4c40c6[_0x85b1('0x59')]['manual']){_0x3033d7['message'][_0x85b1('0x75')]=util[_0x85b1('0x5e')](_0x85b1('0x76'),_0x4c40c6[_0x85b1('0x61')][_0x85b1('0x3a')]);_0x3033d7[_0x85b1('0x28')][_0x85b1('0x77')]=_0x3033d7['channel'];_0x3033d7[_0x85b1('0x28')][_0x85b1('0x78')]=_0x3033d7[_0x85b1('0x77')];_0x3033d7[_0x85b1('0x28')][_0x85b1('0x79')]=_0x85b1('0x5c');return respondWithRpcPromise(_0x85b1('0x7a'),_0x85b1('0x7a'),{'event':_0x85b1('0x7b'),'message':_[_0x85b1('0x4e')](_0x3033d7['message'],JSON[_0x85b1('0x7c')](_0x3033d7['interaction'][_0x85b1('0x7d')]))},client9002)['then'](function(){return _0x3033d7;});}return _0x3033d7;}return null;})[_0x85b1('0x22')](respondWithResult(_0x2c3b88,null))[_0x85b1('0x55')](handleError(_0x2c3b88,null));};var interaction_log=require('../../config/logger')(_0x85b1('0x5b'));exports[_0x85b1('0x35')]=function(_0x104df1,_0x52ff98,_0x52a6c7){var _0x41a772={'agent':{},'channel':_0x85b1('0x7e')};if(_0x104df1[_0x85b1('0x59')]['id']){delete _0x104df1[_0x85b1('0x59')]['id'];}_0x104df1[_0x85b1('0x59')]['UserId']=_0x104df1[_0x85b1('0x59')]['UserId']||_0x104df1[_0x85b1('0x61')]['id'];_0x41a772['agent']['id']=_0x104df1[_0x85b1('0x59')][_0x85b1('0x60')];return db['ChatMessage'][_0x85b1('0x57')]({'where':{'id':_0x104df1[_0x85b1('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52ff98,null))[_0x85b1('0x22')](function(_0x327bc7){if(_0x327bc7){_0x41a772[_0x85b1('0x28')]=_0x327bc7[_0x85b1('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x85b1('0x57')]({'where':{'id':_0x327bc7[_0x85b1('0x65')]}});}return null;})[_0x85b1('0x22')](handleEntityNotFound(_0x52ff98,null))[_0x85b1('0x22')](function(_0x51b182){if(_0x51b182){_0x41a772[_0x85b1('0x67')]=_0x51b182[_0x85b1('0x63')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x104df1[_0x85b1('0x61')]['id'],_0x104df1[_0x85b1('0x61')]['name'],_0x104df1[_0x85b1('0x61')]['role'],_0x41a772[_0x85b1('0x67')]['id'],_0x104df1[_0x85b1('0x59')]?JSON[_0x85b1('0x25')](_0x104df1[_0x85b1('0x59')]):'null');return respondWithRpcPromise(_0x85b1('0x7f'),'rejectMessage',_0x41a772);}return null;})[_0x85b1('0x22')](function(_0x3aa10a){var _0x4118ee=_0x85b1('0x6c')+_0x3aa10a[_0x85b1('0x28')][_0x85b1('0x6d')];return db[_0x85b1('0x6e')][_0x85b1('0x40')](_0x4118ee,{'type':db['Sequelize']['QueryTypes'][_0x85b1('0x80')],'raw':!![]})['then'](function(_0x45872b){return _0x45872b;});})[_0x85b1('0x22')](function(_0x4b1ae2){if(_0x4b1ae2){_0x41a772[_0x85b1('0x28')][_0x85b1('0x70')]=_0x4b1ae2[0x0];if(!_0x104df1['body']['UserId'])return;return db[_0x85b1('0x71')][_0x85b1('0x57')]({'where':{'id':_0x104df1['body'][_0x85b1('0x60')],'role':_0x85b1('0x62')},'attributes':['id',_0x85b1('0x3a'),_0x85b1('0x72'),_0x85b1('0x73'),_0x85b1('0x74')],'raw':!![]});}return null;})[_0x85b1('0x22')](function(_0x4d48d9){if(!_0x4d48d9)return null;_0x41a772[_0x85b1('0x28')][_0x85b1('0x62')]=_0x4d48d9;return _0x41a772;})[_0x85b1('0x22')](function(_0x2dd9a3){if(_0x2dd9a3){_0x2dd9a3['message']['interface']=util[_0x85b1('0x5e')](_0x85b1('0x76'),_0x104df1['user'][_0x85b1('0x3a')]);_0x2dd9a3[_0x85b1('0x28')][_0x85b1('0x77')]=_0x41a772['channel'];_0x2dd9a3['message']['motionChannel']=_0x41a772[_0x85b1('0x77')];_0x2dd9a3[_0x85b1('0x28')][_0x85b1('0x79')]='reject';respondWithRpcPromise(_0x85b1('0x7a'),'EventManager',{'event':_0x85b1('0x81'),'message':_[_0x85b1('0x4e')](_0x41a772['message'],JSON[_0x85b1('0x7c')](_0x41a772['interaction'][_0x85b1('0x7d')]))},client9002);return _0x41a772;}return null;})[_0x85b1('0x22')](respondWithResult(_0x52ff98,null))[_0x85b1('0x55')](handleError(_0x52ff98,null));};
\ No newline at end of file
+var _0x9894=['error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','rows','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','sequelize','contact','internal','rejectmessage','formData','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1b7801,_0x3ecdb8){var _0x278754=function(_0x120c6b){while(--_0x120c6b){_0x1b7801['push'](_0x1b7801['shift']());}};_0x278754(++_0x3ecdb8);}(_0x9894,0xe6));var _0x4989=function(_0x5af1e1,_0x29f6b3){_0x5af1e1=_0x5af1e1-0x0;var _0xb10c12=_0x9894[_0x5af1e1];return _0xb10c12;};'use strict';var emlformat=require(_0x4989('0x0'));var rimraf=require(_0x4989('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4989('0x2'));var moment=require('moment');var BPromise=require(_0x4989('0x3'));var Mustache=require('mustache');var util=require(_0x4989('0x4'));var path=require('path');var sox=require(_0x4989('0x5'));var csv=require(_0x4989('0x6'));var ejs=require(_0x4989('0x7'));var fs=require('fs');var fs_extra=require(_0x4989('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4989('0x9'));var jsforce=require(_0x4989('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4989('0x6'));var querystring=require(_0x4989('0xb'));var Papa=require(_0x4989('0xc'));var Redis=require(_0x4989('0xd'));var authService=require(_0x4989('0xe'));var qs=require(_0x4989('0xf'));var as=require(_0x4989('0x10'));var hardwareService=require(_0x4989('0x11'));var logger=require(_0x4989('0x12'))(_0x4989('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4989('0x14'));var db=require(_0x4989('0x15'))['db'];config[_0x4989('0x16')]=_[_0x4989('0x17')](config[_0x4989('0x16')],{'host':_0x4989('0x18'),'port':0x18eb});var socket=require(_0x4989('0x19'))(new Redis(config[_0x4989('0x16')]));require(_0x4989('0x1a'))['register'](socket);var jayson=require(_0x4989('0x1b'));var client=jayson[_0x4989('0x1c')][_0x4989('0x1d')]({'port':0x232c});var client9002=jayson[_0x4989('0x1c')][_0x4989('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x415788,_0x191c67,_0x2ba8a5,_0x5ea124){return new BPromise(function(_0x3c33df,_0x203ae3){var _0x4d1f8c=_0x5ea124||client;return _0x4d1f8c['request'](_0x415788,_0x2ba8a5)[_0x4989('0x1e')](function(_0x34e55a){logger['info'](_0x4989('0x1f'),_0x191c67,_0x4989('0x20'));logger[_0x4989('0x21')](_0x4989('0x22'),_0x191c67,_0x4989('0x20'),JSON[_0x4989('0x23')](_0x34e55a));if(_0x34e55a['error']){if(_0x34e55a[_0x4989('0x24')][_0x4989('0x25')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x191c67,_0x34e55a[_0x4989('0x24')][_0x4989('0x26')]);return _0x203ae3(_0x34e55a[_0x4989('0x24')][_0x4989('0x26')]);}logger[_0x4989('0x24')](_0x4989('0x1f'),_0x191c67,_0x34e55a[_0x4989('0x24')]['message']);return _0x3c33df(_0x34e55a[_0x4989('0x24')][_0x4989('0x26')]);}else{logger[_0x4989('0x27')](_0x4989('0x1f'),_0x191c67,_0x4989('0x20'));_0x3c33df(_0x34e55a[_0x4989('0x28')]['message']);}})[_0x4989('0x29')](function(_0xef4e32){logger[_0x4989('0x24')](_0x4989('0x1f'),_0x191c67,_0xef4e32);_0x203ae3(_0xef4e32);});});}function respondWithStatusCode(_0xedb202,_0x5901ac){_0x5901ac=_0x5901ac||0xcc;return function(_0xf2bf8){if(_0xf2bf8){return _0xedb202[_0x4989('0x2a')](_0x5901ac);}return _0xedb202[_0x4989('0x2b')](_0x5901ac)['end']();};}function respondWithResult(_0x4d1176,_0x2eac37){_0x2eac37=_0x2eac37||0xc8;return function(_0x156819){if(_0x156819){return _0x4d1176['status'](_0x2eac37)[_0x4989('0x2c')](_0x156819);}};}function respondWithFilteredResult(_0x6e321b,_0x325a03){return function(_0xf1ae47){if(_0xf1ae47){var _0x50b8cb=typeof _0x325a03[_0x4989('0x2d')]===_0x4989('0x2e')&&typeof _0x325a03[_0x4989('0x2f')]===_0x4989('0x2e');var _0x2c64cd=_0xf1ae47[_0x4989('0x30')];var _0x104d65=_0x50b8cb?0x0:_0x325a03[_0x4989('0x2d')];var _0x1d2ba2=_0x50b8cb?_0xf1ae47[_0x4989('0x30')]:_0x325a03[_0x4989('0x2d')]+_0x325a03[_0x4989('0x2f')];var _0x183404;if(_0x1d2ba2>=_0x2c64cd){_0x1d2ba2=_0x2c64cd;_0x183404=0xc8;}else{_0x183404=0xce;}_0x6e321b[_0x4989('0x2b')](_0x183404);return _0x6e321b[_0x4989('0x31')](_0x4989('0x32'),_0x104d65+'-'+_0x1d2ba2+'/'+_0x2c64cd)[_0x4989('0x2c')](_0xf1ae47);}return null;};}function patchUpdates(_0x249439){return function(_0x6879db){try{jsonpatch['apply'](_0x6879db,_0x249439,!![]);}catch(_0x5d5675){return BPromise['reject'](_0x5d5675);}return _0x6879db[_0x4989('0x33')]();};}function saveUpdates(_0x52ef22,_0x5e04ce){return function(_0x5f132e){if(_0x5f132e){return _0x5f132e[_0x4989('0x34')](_0x52ef22)['then'](function(_0x18b9de){return _0x18b9de;});}return null;};}function removeEntity(_0x279c06,_0x302330){return function(_0x5023f0){if(_0x5023f0){return _0x5023f0[_0x4989('0x35')]()['then'](function(){_0x279c06[_0x4989('0x2b')](0xcc)[_0x4989('0x36')]();});}};}function handleEntityNotFound(_0x24aa0f,_0x531754){return function(_0x40a8dc){if(!_0x40a8dc){_0x24aa0f[_0x4989('0x2a')](0x194);}return _0x40a8dc;};}function handleError(_0x1836e8,_0xcabcf6){_0xcabcf6=_0xcabcf6||0x1f4;return function(_0x5d0b17){logger[_0x4989('0x24')](_0x5d0b17[_0x4989('0x37')]);if(_0x5d0b17[_0x4989('0x38')]){delete _0x5d0b17['name'];}_0x1836e8[_0x4989('0x2b')](_0xcabcf6)[_0x4989('0x39')](_0x5d0b17);};}exports['index']=function(_0x292849,_0x4b5075){var _0x4a216d={},_0xe24f77={},_0x3c684b={'count':0x0,'rows':[]};var _0x4eafd3=_[_0x4989('0x3a')](db['ChatMessage'][_0x4989('0x3b')],function(_0x545111){return{'name':_0x545111[_0x4989('0x3c')],'type':_0x545111[_0x4989('0x3d')][_0x4989('0x3e')]};});_0xe24f77['model']=_[_0x4989('0x3a')](_0x4eafd3,'name');_0xe24f77[_0x4989('0x3f')]=_[_0x4989('0x40')](_0x292849['query']);_0xe24f77[_0x4989('0x41')]=_[_0x4989('0x42')](_0xe24f77['model'],_0xe24f77[_0x4989('0x3f')]);_0x4a216d[_0x4989('0x43')]=_[_0x4989('0x42')](_0xe24f77[_0x4989('0x44')],qs[_0x4989('0x45')](_0x292849[_0x4989('0x3f')][_0x4989('0x45')]));_0x4a216d[_0x4989('0x43')]=_0x4a216d[_0x4989('0x43')][_0x4989('0x46')]?_0x4a216d[_0x4989('0x43')]:_0xe24f77[_0x4989('0x44')];if(!_0x292849[_0x4989('0x3f')][_0x4989('0x47')](_0x4989('0x48'))){_0x4a216d[_0x4989('0x2f')]=qs[_0x4989('0x2f')](_0x292849['query'][_0x4989('0x2f')]);_0x4a216d[_0x4989('0x2d')]=qs['offset'](_0x292849[_0x4989('0x3f')]['offset']);}_0x4a216d[_0x4989('0x49')]=qs['sort'](_0x292849[_0x4989('0x3f')][_0x4989('0x4a')]);_0x4a216d[_0x4989('0x4b')]=qs['filters'](_['pick'](_0x292849[_0x4989('0x3f')],_0xe24f77[_0x4989('0x41')]),_0x4eafd3);if(_0x292849[_0x4989('0x3f')][_0x4989('0x4c')]){_0x4a216d[_0x4989('0x4b')]=_[_0x4989('0x4d')](_0x4a216d[_0x4989('0x4b')],{'$or':_[_0x4989('0x3a')](_0x4eafd3,function(_0x5f27d2){if(_0x5f27d2['type']!==_0x4989('0x4e')){var _0x773dad={};_0x773dad[_0x5f27d2['name']]={'$like':'%'+_0x292849[_0x4989('0x3f')][_0x4989('0x4c')]+'%'};return _0x773dad;}})});}_0x4a216d=_[_0x4989('0x4d')]({},_0x4a216d,_0x292849[_0x4989('0x4f')]);var _0x2f6b38={'where':_0x4a216d[_0x4989('0x4b')]};return db[_0x4989('0x50')][_0x4989('0x30')](_0x2f6b38)['then'](function(_0x4db44){_0x3c684b[_0x4989('0x30')]=_0x4db44;if(_0x292849[_0x4989('0x3f')][_0x4989('0x51')]){_0x4a216d[_0x4989('0x52')]=[{'all':!![]}];}return db[_0x4989('0x50')]['findAll'](_0x4a216d);})[_0x4989('0x1e')](function(_0x34dd7c){_0x3c684b[_0x4989('0x53')]=_0x34dd7c;return _0x3c684b;})[_0x4989('0x1e')](respondWithFilteredResult(_0x4b5075,_0x4a216d))[_0x4989('0x29')](handleError(_0x4b5075,null));};exports['show']=function(_0x136154,_0x3e72fa){var _0x464e36={'raw':!![],'where':{'id':_0x136154[_0x4989('0x54')]['id']}},_0x37fdd6={};_0x37fdd6[_0x4989('0x44')]=_[_0x4989('0x40')](db[_0x4989('0x50')][_0x4989('0x3b')]);_0x37fdd6[_0x4989('0x3f')]=_[_0x4989('0x40')](_0x136154[_0x4989('0x3f')]);_0x37fdd6[_0x4989('0x41')]=_[_0x4989('0x42')](_0x37fdd6[_0x4989('0x44')],_0x37fdd6['query']);_0x464e36[_0x4989('0x43')]=_[_0x4989('0x42')](_0x37fdd6['model'],qs[_0x4989('0x45')](_0x136154['query'][_0x4989('0x45')]));_0x464e36[_0x4989('0x43')]=_0x464e36['attributes'][_0x4989('0x46')]?_0x464e36[_0x4989('0x43')]:_0x37fdd6[_0x4989('0x44')];if(_0x136154[_0x4989('0x3f')][_0x4989('0x51')]){_0x464e36[_0x4989('0x52')]=[{'all':!![]}];}_0x464e36=_['merge']({},_0x464e36,_0x136154['options']);return db[_0x4989('0x50')][_0x4989('0x55')](_0x464e36)[_0x4989('0x1e')](handleEntityNotFound(_0x3e72fa,null))[_0x4989('0x1e')](respondWithResult(_0x3e72fa,null))[_0x4989('0x29')](handleError(_0x3e72fa,null));};exports['create']=function(_0x20bb96,_0x38ad03){return db[_0x4989('0x50')][_0x4989('0x56')](_0x20bb96['body'],{})[_0x4989('0x1e')](respondWithResult(_0x38ad03,0xc9))[_0x4989('0x29')](handleError(_0x38ad03,null));};exports[_0x4989('0x34')]=function(_0x4c5e98,_0x763cc4){if(_0x4c5e98['body']['id']){delete _0x4c5e98['body']['id'];}return db[_0x4989('0x50')][_0x4989('0x55')]({'where':{'id':_0x4c5e98[_0x4989('0x54')]['id']}})[_0x4989('0x1e')](handleEntityNotFound(_0x763cc4,null))[_0x4989('0x1e')](saveUpdates(_0x4c5e98[_0x4989('0x57')],null))[_0x4989('0x1e')](respondWithResult(_0x763cc4,null))[_0x4989('0x29')](handleError(_0x763cc4,null));};exports['destroy']=function(_0x587fc0,_0x77011){return db[_0x4989('0x50')][_0x4989('0x55')]({'where':{'id':_0x587fc0[_0x4989('0x54')]['id']}})[_0x4989('0x1e')](handleEntityNotFound(_0x77011,null))[_0x4989('0x1e')](removeEntity(_0x77011,null))[_0x4989('0x29')](handleError(_0x77011,null));};exports[_0x4989('0x58')]=function(_0x5a9535,_0x1d0baf){return db[_0x4989('0x50')][_0x4989('0x58')]()[_0x4989('0x1e')](respondWithResult(_0x1d0baf,null))['catch'](handleError(_0x1d0baf,null));};var interaction_log=require('../../config/logger')(_0x4989('0x59'));exports[_0x4989('0x5a')]=function(_0x267f8f,_0x34663c,_0x5e9e5b){var _0x13e0b0={'agent':{},'channel':_0x4989('0x5b')};if(_0x267f8f[_0x4989('0x57')]['id']){delete _0x267f8f[_0x4989('0x57')]['id'];}_0x267f8f[_0x4989('0x57')][_0x4989('0x5c')]=!![];_0x267f8f[_0x4989('0x57')][_0x4989('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x267f8f['body']['UserId']=_0x267f8f['body'][_0x4989('0x5e')]||_0x267f8f[_0x4989('0x5f')]['id'];_0x13e0b0[_0x4989('0x60')]['id']=_0x267f8f[_0x4989('0x57')][_0x4989('0x5e')];return db[_0x4989('0x50')][_0x4989('0x55')]({'where':{'id':_0x267f8f[_0x4989('0x54')]['id'],'UserId':null}})[_0x4989('0x1e')](handleEntityNotFound(_0x34663c,null))[_0x4989('0x1e')](saveUpdates(_0x267f8f[_0x4989('0x57')],null))[_0x4989('0x1e')](function(_0x4585fe){if(_0x4585fe){_0x13e0b0[_0x4989('0x26')]=_0x4585fe[_0x4989('0x61')]({'plain':!![]});return db[_0x4989('0x62')][_0x4989('0x55')]({'where':{'id':_0x4585fe[_0x4989('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x34663c,null))[_0x4989('0x1e')](function(_0x3612f9){if(_0x3612f9){return _0x3612f9[_0x4989('0x34')]({'UserId':_0x267f8f[_0x4989('0x57')][_0x4989('0x5e')],'read1stAt':_[_0x4989('0x64')](_0x3612f9[_0x4989('0x65')])?moment()[_0x4989('0x66')](_0x4989('0x67')):undefined});}return null;})[_0x4989('0x1e')](function(_0x190204){if(_0x190204){_0x13e0b0[_0x4989('0x68')]=_0x190204['get']({'plain':!![]});interaction_log[_0x4989('0x27')](_0x4989('0x69'),_0x267f8f['user']['id'],_0x267f8f[_0x4989('0x5f')][_0x4989('0x38')],_0x267f8f['user']['role'],_0x13e0b0['interaction']['id'],_0x267f8f[_0x4989('0x57')]?JSON['stringify'](_0x267f8f[_0x4989('0x57')]):'null');return respondWithRpcPromise(_0x4989('0x6a'),'acceptMessage',_0x13e0b0);}return null;})[_0x4989('0x1e')](function(_0xc5a734){var _0x5a313f=_0x4989('0x6b')+_0xc5a734[_0x4989('0x26')][_0x4989('0x6c')];return db['sequelize'][_0x4989('0x3f')](_0x5a313f,{'type':db[_0x4989('0x6d')][_0x4989('0x6e')][_0x4989('0x6f')],'raw':!![]})['then'](function(_0x52f259){return _0x52f259;});})[_0x4989('0x1e')](function(_0x149110){if(_0x149110){_0x13e0b0[_0x4989('0x26')]['contact']=_0x149110[0x0];if(!_0x267f8f[_0x4989('0x57')]['UserId'])return;return db['User'][_0x4989('0x55')]({'where':{'id':_0x267f8f[_0x4989('0x57')][_0x4989('0x5e')],'role':'agent'},'attributes':['id','name',_0x4989('0x70'),_0x4989('0x71'),'internal'],'raw':!![]});}return null;})[_0x4989('0x1e')](function(_0x4a5187){if(!_0x4a5187)return null;_0x13e0b0[_0x4989('0x26')][_0x4989('0x60')]=_0x4a5187;return _0x13e0b0;})[_0x4989('0x1e')](function(_0x27688e){if(_0x27688e){if(_0x267f8f[_0x4989('0x57')][_0x4989('0x72')]){_0x13e0b0[_0x4989('0x26')][_0x4989('0x73')]=util[_0x4989('0x66')]('SIP/%s',_0x267f8f[_0x4989('0x5f')][_0x4989('0x38')]);_0x13e0b0[_0x4989('0x26')][_0x4989('0x74')]=_0x13e0b0[_0x4989('0x74')];_0x13e0b0[_0x4989('0x26')][_0x4989('0x75')]=_0x13e0b0[_0x4989('0x74')];_0x13e0b0[_0x4989('0x26')][_0x4989('0x76')]=_0x4989('0x5a');return respondWithRpcPromise(_0x4989('0x77'),_0x4989('0x77'),{'event':_0x4989('0x78'),'message':_[_0x4989('0x4d')](_0x13e0b0[_0x4989('0x26')],JSON[_0x4989('0x79')](_0x13e0b0[_0x4989('0x68')]['formData']))},client9002)[_0x4989('0x1e')](function(){return _0x13e0b0;});}return _0x13e0b0;}return null;})['then'](respondWithResult(_0x34663c,null))[_0x4989('0x29')](handleError(_0x34663c,null));};var interaction_log=require('../../config/logger')(_0x4989('0x59'));exports[_0x4989('0x7a')]=function(_0x3aa6b2,_0x52f970,_0x49304c){var _0x339d6e={'agent':{},'channel':_0x4989('0x5b')};if(_0x3aa6b2['body']['id']){delete _0x3aa6b2['body']['id'];}_0x3aa6b2[_0x4989('0x57')]['UserId']=_0x3aa6b2[_0x4989('0x57')]['UserId']||_0x3aa6b2[_0x4989('0x5f')]['id'];_0x339d6e[_0x4989('0x60')]['id']=_0x3aa6b2[_0x4989('0x57')][_0x4989('0x5e')];return db[_0x4989('0x50')][_0x4989('0x55')]({'where':{'id':_0x3aa6b2['params']['id'],'UserId':null}})[_0x4989('0x1e')](handleEntityNotFound(_0x52f970,null))[_0x4989('0x1e')](function(_0x273226){if(_0x273226){_0x339d6e[_0x4989('0x26')]=_0x273226[_0x4989('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x4989('0x55')]({'where':{'id':_0x273226[_0x4989('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x52f970,null))['then'](function(_0x1c2af9){if(_0x1c2af9){_0x339d6e[_0x4989('0x68')]=_0x1c2af9[_0x4989('0x61')]({'plain':!![]});interaction_log['info'](_0x4989('0x7b'),_0x3aa6b2[_0x4989('0x5f')]['id'],_0x3aa6b2['user']['name'],_0x3aa6b2[_0x4989('0x5f')][_0x4989('0x7c')],_0x339d6e[_0x4989('0x68')]['id'],_0x3aa6b2[_0x4989('0x57')]?JSON['stringify'](_0x3aa6b2[_0x4989('0x57')]):_0x4989('0x7d'));return respondWithRpcPromise(_0x4989('0x7e'),_0x4989('0x7f'),_0x339d6e);}return null;})[_0x4989('0x1e')](function(_0x2afd13){var _0x1cc3db=_0x4989('0x6b')+_0x2afd13[_0x4989('0x26')][_0x4989('0x6c')];return db[_0x4989('0x80')]['query'](_0x1cc3db,{'type':db[_0x4989('0x6d')][_0x4989('0x6e')]['SELECT'],'raw':!![]})[_0x4989('0x1e')](function(_0x3f4139){return _0x3f4139;});})['then'](function(_0x75a505){if(_0x75a505){_0x339d6e[_0x4989('0x26')][_0x4989('0x81')]=_0x75a505[0x0];if(!_0x3aa6b2['body']['UserId'])return;return db['User'][_0x4989('0x55')]({'where':{'id':_0x3aa6b2['body']['UserId'],'role':'agent'},'attributes':['id','name','fullname','email',_0x4989('0x82')],'raw':!![]});}return null;})[_0x4989('0x1e')](function(_0x11ffdb){if(!_0x11ffdb)return null;_0x339d6e[_0x4989('0x26')][_0x4989('0x60')]=_0x11ffdb;return _0x339d6e;})[_0x4989('0x1e')](function(_0x4863a7){if(_0x4863a7){_0x4863a7['message'][_0x4989('0x73')]=util[_0x4989('0x66')]('SIP/%s',_0x3aa6b2[_0x4989('0x5f')][_0x4989('0x38')]);_0x4863a7[_0x4989('0x26')][_0x4989('0x74')]=_0x339d6e[_0x4989('0x74')];_0x4863a7[_0x4989('0x26')][_0x4989('0x75')]=_0x339d6e[_0x4989('0x74')];_0x4863a7[_0x4989('0x26')][_0x4989('0x76')]=_0x4989('0x7a');respondWithRpcPromise('EventManager',_0x4989('0x77'),{'event':_0x4989('0x83'),'message':_[_0x4989('0x4d')](_0x339d6e[_0x4989('0x26')],JSON[_0x4989('0x79')](_0x339d6e[_0x4989('0x68')][_0x4989('0x84')]))},client9002);return _0x339d6e;}return null;})[_0x4989('0x1e')](respondWithResult(_0x52f970,null))[_0x4989('0x29')](handleError(_0x52f970,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c574652..91c830b 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 _0x976f=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x2910b3,_0x4d44c9){var _0x46fba1=function(_0x3d66f4){while(--_0x3d66f4){_0x2910b3['push'](_0x2910b3['shift']());}};_0x46fba1(++_0x4d44c9);}(_0x976f,0x112));var _0xf976=function(_0x2eb086,_0x6d8dde){_0x2eb086=_0x2eb086-0x0;var _0x3854a6=_0x976f[_0x2eb086];return _0x3854a6;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xf976('0x0'))['db'][_0xf976('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf976('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf976('0x3'),'afterDestroy':_0xf976('0x4')};function emitEvent(_0x36f240){return function(_0x4b280d,_0x2b3fe5,_0x160050){ChatMessageEvents[_0xf976('0x5')](_0x36f240+':'+_0x4b280d['id'],_0x4b280d);ChatMessageEvents[_0xf976('0x5')](_0x36f240,_0x4b280d);_0x160050(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xf976('0x6')](e,emitEvent(event));}}module[_0xf976('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x9b26=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0x9b26,0x13f));var _0x69b2=function(_0x207a83,_0x453824){_0x207a83=_0x207a83-0x0;var _0x3186e4=_0x9b26[_0x207a83];return _0x3186e4;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x69b2('0x0'))['db'][_0x69b2('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x69b2('0x2')](0x0);var events={'afterCreate':_0x69b2('0x3'),'afterUpdate':_0x69b2('0x4'),'afterDestroy':_0x69b2('0x5')};function emitEvent(_0x20ba1){return function(_0x3559e4,_0x260436,_0xe4a4e7){ChatMessageEvents[_0x69b2('0x6')](_0x20ba1+':'+_0x3559e4['id'],_0x3559e4);ChatMessageEvents['emit'](_0x20ba1,_0x3559e4);_0xe4a4e7(null);};}for(var e in events){if(events[_0x69b2('0x7')](e)){var event=events[e];ChatMessage['hook'](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 7f5c424..3e2e9ee 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 _0xe64e=['ChatMessage','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define'];(function(_0x297833,_0x2c5611){var _0x36bf74=function(_0x5c2b63){while(--_0x5c2b63){_0x297833['push'](_0x297833['shift']());}};_0x36bf74(++_0x2c5611);}(_0xe64e,0xe4));var _0xee64=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe64e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xee64('0x0'));var util=require(_0xee64('0x1'));var logger=require(_0xee64('0x2'))(_0xee64('0x3'));var moment=require(_0xee64('0x4'));var BPromise=require(_0xee64('0x5'));var rp=require(_0xee64('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee64('0x7'));var config=require(_0xee64('0x8'));var attributes=require(_0xee64('0x9'));module[_0xee64('0xa')]=function(_0x1b9521,_0x85be40){return _0x1b9521[_0xee64('0xb')](_0xee64('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xee64('0xd')],'type':_0xee64('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f6827,_0x393ade,_0x262c90){var _0x340a62=_0x1b9521[_0xee64('0xf')];var _0x4b59d7=_0x1f6827[_0xee64('0x10')]({'plain':!![]});if(_0x4b59d7['direction']['toLowerCase']()==='in'||_0x4b59d7['direction'][_0xee64('0x11')]()===_0xee64('0x12')&&!_0x4b59d7[_0xee64('0x13')]&&!_[_0xee64('0x14')](_0x4b59d7[_0xee64('0x15')])){_0x340a62[_0xee64('0x16')][_0xee64('0x17')]({'where':{'id':_0x4b59d7[_0xee64('0x18')]}})['then'](function(_0x1ce902){if(_0x1ce902){_0x1ce902[_0xee64('0x19')]({'lastMsgAt':_0x4b59d7[_0xee64('0x1a')],'lastMsgDirection':_0x4b59d7['direction'][_0xee64('0x11')]()});}})['catch'](function(_0x2b9b5a){console[_0xee64('0x1b')](_0x2b9b5a);});}_0x262c90();}},'charset':_0xee64('0x1c'),'collate':_0xee64('0x1d')});};
\ No newline at end of file
+var _0x0c2f=['request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','update','error','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x3e8674,_0x5c4322){var _0xa692cd=function(_0x22560f){while(--_0x22560f){_0x3e8674['push'](_0x3e8674['shift']());}};_0xa692cd(++_0x5c4322);}(_0x0c2f,0x1b6));var _0xf0c2=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x0c2f[_0x1abb09];return _0xea1c07;};'use strict';var _=require('lodash');var util=require(_0xf0c2('0x0'));var logger=require(_0xf0c2('0x1'))(_0xf0c2('0x2'));var moment=require('moment');var BPromise=require(_0xf0c2('0x3'));var rp=require(_0xf0c2('0x4'));var fs=require('fs');var path=require(_0xf0c2('0x5'));var rimraf=require(_0xf0c2('0x6'));var config=require(_0xf0c2('0x7'));var attributes=require(_0xf0c2('0x8'));module[_0xf0c2('0x9')]=function(_0x388b26,_0x523119){return _0x388b26[_0xf0c2('0xa')]('ChatMessage',attributes,{'tableName':_0xf0c2('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xf0c2('0xc')],'type':_0xf0c2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e8dae,_0x644fc,_0xf98a87){var _0x386f58=_0x388b26[_0xf0c2('0xe')];var _0x933e7=_0x5e8dae[_0xf0c2('0xf')]({'plain':!![]});if(_0x933e7[_0xf0c2('0x10')][_0xf0c2('0x11')]()==='in'||_0x933e7['direction']['toLowerCase']()==='out'&&!_0x933e7[_0xf0c2('0x12')]&&!_[_0xf0c2('0x13')](_0x933e7[_0xf0c2('0x14')])){_0x386f58['ChatInteraction'][_0xf0c2('0x15')]({'where':{'id':_0x933e7['ChatInteractionId']}})[_0xf0c2('0x16')](function(_0x63235){if(_0x63235){_0x63235[_0xf0c2('0x17')]({'lastMsgAt':_0x933e7['createdAt'],'lastMsgDirection':_0x933e7['direction'][_0xf0c2('0x11')]()});}})['catch'](function(_0x580c92){console[_0xf0c2('0x18')](_0x580c92);});}_0xf98a87();}},'charset':'utf8mb4','collate':_0xf0c2('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index c7aaa3d..84243d0 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 _0x2319=['../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','ChatMessage','create','body','options','CreateChatMessage','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xa9d44f,_0x293dcc){var _0x755908=function(_0x40f872){while(--_0x40f872){_0xa9d44f['push'](_0xa9d44f['shift']());}};_0x755908(++_0x293dcc);}(_0x2319,0x144));var _0x9231=function(_0x46b80b,_0x5b357f){_0x46b80b=_0x46b80b-0x0;var _0x55dc64=_0x2319[_0x46b80b];return _0x55dc64;};'use strict';var _=require(_0x9231('0x0'));var util=require(_0x9231('0x1'));var moment=require(_0x9231('0x2'));var BPromise=require('bluebird');var rs=require(_0x9231('0x3'));var fs=require('fs');var Redis=require(_0x9231('0x4'));var db=require(_0x9231('0x5'))['db'];var utils=require(_0x9231('0x6'));var logger=require('../../config/logger')(_0x9231('0x7'));var config=require('../../config/environment');var jayson=require(_0x9231('0x8'));var client=jayson[_0x9231('0x9')][_0x9231('0xa')]({'port':0x232a});config[_0x9231('0xb')]=_[_0x9231('0xc')](config[_0x9231('0xb')],{'host':_0x9231('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9231('0xb')]));require('./chatMessage.socket')[_0x9231('0xe')](socket);function respondWithRpcPromise(_0x31f7fe,_0x154cec,_0x26dabc){return new BPromise(function(_0x1af492,_0x589d53){return client[_0x9231('0xf')](_0x31f7fe,_0x26dabc)[_0x9231('0x10')](function(_0x2507a3){logger[_0x9231('0x11')]('ChatMessage,\x20%s,\x20%s',_0x154cec,_0x9231('0x12'));logger[_0x9231('0x13')](_0x9231('0x14'),_0x154cec,_0x9231('0x12'),JSON[_0x9231('0x15')](_0x2507a3));if(_0x2507a3[_0x9231('0x16')]){if(_0x2507a3[_0x9231('0x16')][_0x9231('0x17')]===0x1f4){logger[_0x9231('0x16')](_0x9231('0x18'),_0x154cec,_0x2507a3[_0x9231('0x16')][_0x9231('0x19')]);return _0x589d53(_0x2507a3[_0x9231('0x16')]['message']);}logger[_0x9231('0x16')](_0x9231('0x18'),_0x154cec,_0x2507a3['error']['message']);return _0x1af492(_0x2507a3[_0x9231('0x16')][_0x9231('0x19')]);}else{logger[_0x9231('0x11')](_0x9231('0x18'),_0x154cec,'request\x20sent');_0x1af492(_0x2507a3[_0x9231('0x1a')][_0x9231('0x19')]);}})['catch'](function(_0x330109){logger[_0x9231('0x16')]('ChatMessage,\x20%s,\x20%s',_0x154cec,_0x330109);_0x589d53(_0x330109);});});}exports['CreateChatMessage']=function(_0x5b6c0f){var _0x47a11f=this;return new Promise(function(_0x2c7716,_0x2e4e45){return db[_0x9231('0x1b')][_0x9231('0x1c')](_0x5b6c0f[_0x9231('0x1d')],{'raw':_0x5b6c0f['options']?_0x5b6c0f[_0x9231('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x9231('0x10')](function(_0x159665){logger['info'](_0x9231('0x1f'),_0x5b6c0f);logger[_0x9231('0x13')]('CreateChatMessage',_0x5b6c0f,JSON[_0x9231('0x15')](_0x159665));_0x2c7716(_0x159665);})[_0x9231('0x20')](function(_0x3fd69a){logger[_0x9231('0x16')]('CreateChatMessage',_0x3fd69a[_0x9231('0x19')],_0x5b6c0f);_0x2e4e45(_0x47a11f[_0x9231('0x16')](0x1f4,_0x3fd69a['message']));});});};
\ No newline at end of file
+var _0xb815=['defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x30e83e,_0x3bfae5){var _0x4da585=function(_0x2f2b71){while(--_0x2f2b71){_0x30e83e['push'](_0x30e83e['shift']());}};_0x4da585(++_0x3bfae5);}(_0xb815,0x160));var _0x5b81=function(_0x434adb,_0x58959b){_0x434adb=_0x434adb-0x0;var _0x4b7483=_0xb815[_0x434adb];return _0x4b7483;};'use strict';var _=require(_0x5b81('0x0'));var util=require(_0x5b81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b81('0x3'))['db'];var utils=require(_0x5b81('0x4'));var logger=require(_0x5b81('0x5'))(_0x5b81('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b81('0x7'));var client=jayson[_0x5b81('0x8')][_0x5b81('0x9')]({'port':0x232a});config[_0x5b81('0xa')]=_[_0x5b81('0xb')](config[_0x5b81('0xa')],{'host':_0x5b81('0xc'),'port':0x18eb});var socket=require(_0x5b81('0xd'))(new Redis(config[_0x5b81('0xa')]));require(_0x5b81('0xe'))[_0x5b81('0xf')](socket);function respondWithRpcPromise(_0x1bd508,_0x3b480c,_0x5345f8){return new BPromise(function(_0x4153f0,_0x21bb6d){return client['request'](_0x1bd508,_0x5345f8)[_0x5b81('0x10')](function(_0x3d2296){logger[_0x5b81('0x11')]('ChatMessage,\x20%s,\x20%s',_0x3b480c,_0x5b81('0x12'));logger[_0x5b81('0x13')](_0x5b81('0x14'),_0x3b480c,_0x5b81('0x12'),JSON[_0x5b81('0x15')](_0x3d2296));if(_0x3d2296[_0x5b81('0x16')]){if(_0x3d2296[_0x5b81('0x16')]['code']===0x1f4){logger[_0x5b81('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3b480c,_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);return _0x21bb6d(_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);}logger[_0x5b81('0x16')](_0x5b81('0x18'),_0x3b480c,_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);return _0x4153f0(_0x3d2296[_0x5b81('0x16')][_0x5b81('0x17')]);}else{logger[_0x5b81('0x11')]('ChatMessage,\x20%s,\x20%s',_0x3b480c,_0x5b81('0x12'));_0x4153f0(_0x3d2296[_0x5b81('0x19')][_0x5b81('0x17')]);}})['catch'](function(_0xfa7f55){logger['error'](_0x5b81('0x18'),_0x3b480c,_0xfa7f55);_0x21bb6d(_0xfa7f55);});});}exports[_0x5b81('0x1a')]=function(_0x163357){var _0x97934d=this;return new Promise(function(_0x384504,_0x392cf8){return db[_0x5b81('0x1b')][_0x5b81('0x1c')](_0x163357[_0x5b81('0x1d')],{'raw':_0x163357[_0x5b81('0x1e')]?_0x163357[_0x5b81('0x1e')][_0x5b81('0x1f')]===undefined?!![]:![]:!![]})[_0x5b81('0x10')](function(_0xcde4a5){logger[_0x5b81('0x11')](_0x5b81('0x1a'),_0x163357);logger['debug']('CreateChatMessage',_0x163357,JSON[_0x5b81('0x15')](_0xcde4a5));_0x384504(_0xcde4a5);})[_0x5b81('0x20')](function(_0x2cb087){logger[_0x5b81('0x16')](_0x5b81('0x1a'),_0x2cb087[_0x5b81('0x17')],_0x163357);_0x392cf8(_0x97934d[_0x5b81('0x16')](0x1f4,_0x2cb087[_0x5b81('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index bdb91ab..9056bff 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 _0x423b=['update','removeListener','length','chatMessage:','save'];(function(_0x33d21a,_0xfa1f62){var _0x35b44a=function(_0xa32c5d){while(--_0xa32c5d){_0x33d21a['push'](_0x33d21a['shift']());}};_0x35b44a(++_0xfa1f62);}(_0x423b,0x12b));var _0xb423=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x423b[_0x4b73a2];return _0x383c66;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xb423('0x0'),'remove',_0xb423('0x1')];function createListener(_0x54e396,_0x3dbb0c){return function(_0x4b4acf){_0x3dbb0c['emit'](_0x54e396,_0x4b4acf);};}function removeListener(_0x50f31a,_0x2fa5da){return function(){ChatMessageEvents[_0xb423('0x2')](_0x50f31a,_0x2fa5da);};}exports['register']=function(_0x1be92e){for(var _0x3e6b18=0x0,_0x49eabb=events[_0xb423('0x3')];_0x3e6b18<_0x49eabb;_0x3e6b18++){var _0x573e95=events[_0x3e6b18];var _0x4119d7=createListener(_0xb423('0x4')+_0x573e95,_0x1be92e);ChatMessageEvents['on'](_0x573e95,_0x4119d7);}};
\ No newline at end of file
+var _0x6596=['update','emit','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x3f2c8e,_0x3e1ae5){var _0x3087e3=function(_0x4faaca){while(--_0x4faaca){_0x3f2c8e['push'](_0x3f2c8e['shift']());}};_0x3087e3(++_0x3e1ae5);}(_0x6596,0x1d3));var _0x6659=function(_0x405fcc,_0x109079){_0x405fcc=_0x405fcc-0x0;var _0x48e0db=_0x6596[_0x405fcc];return _0x48e0db;};'use strict';var ChatMessageEvents=require(_0x6659('0x0'));var events=[_0x6659('0x1'),'remove',_0x6659('0x2')];function createListener(_0x114579,_0x3b1b74){return function(_0x2c58e1){_0x3b1b74[_0x6659('0x3')](_0x114579,_0x2c58e1);};}function removeListener(_0x67ac1d,_0x4bfd3c){return function(){ChatMessageEvents['removeListener'](_0x67ac1d,_0x4bfd3c);};}exports[_0x6659('0x4')]=function(_0x3091f1){for(var _0xd6bf59=0x0,_0x1ed458=events[_0x6659('0x5')];_0xd6bf59<_0x1ed458;_0xd6bf59++){var _0x4a900d=events[_0xd6bf59];var _0x485ea0=createListener(_0x6659('0x6')+_0x4a900d,_0x3091f1);ChatMessageEvents['on'](_0x4a900d,_0x485ea0);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 755b126..d6ab224 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 _0xd660=['isAuthenticated','index','get','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x4a5a76,_0x3031c9){var _0x4f32b9=function(_0x30dd33){while(--_0x30dd33){_0x4a5a76['push'](_0x4a5a76['shift']());}};_0x4f32b9(++_0x3031c9);}(_0xd660,0x10c));var _0x0d66=function(_0x1633b3,_0x2d84af){_0x1633b3=_0x1633b3-0x0;var _0x149a74=_0xd660[_0x1633b3];return _0x149a74;};'use strict';var multer=require(_0x0d66('0x0'));var util=require(_0x0d66('0x1'));var path=require(_0x0d66('0x2'));var timeout=require(_0x0d66('0x3'));var express=require('express');var router=express[_0x0d66('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0d66('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0d66('0x6'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x0d66('0x7')](),controller[_0x0d66('0x8')]);router[_0x0d66('0x9')]('/describe',auth[_0x0d66('0x7')](),controller[_0x0d66('0xa')]);router[_0x0d66('0x9')](_0x0d66('0xb'),auth[_0x0d66('0x7')](),controller[_0x0d66('0xc')]);router[_0x0d66('0xd')]('/',auth[_0x0d66('0x7')](),interaction[_0x0d66('0xe')](_0x0d66('0xf'),_0x0d66('0x10')),controller[_0x0d66('0x11')]);router[_0x0d66('0x12')](_0x0d66('0xb'),controller[_0x0d66('0x13')]);router[_0x0d66('0x12')]('/:id/accept',auth[_0x0d66('0x7')](),controller[_0x0d66('0x14')]);router[_0x0d66('0x12')](_0x0d66('0x15'),auth['isAuthenticated'](),controller[_0x0d66('0x16')]);router['delete'](_0x0d66('0xb'),auth['isAuthenticated'](),controller[_0x0d66('0x17')]);module[_0x0d66('0x18')]=router;
\ No newline at end of file
+var _0x852e=['/:id/accept','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','create','put','update'];(function(_0x3332dd,_0xf4f34c){var _0x27825d=function(_0x137af7){while(--_0x137af7){_0x3332dd['push'](_0x3332dd['shift']());}};_0x27825d(++_0xf4f34c);}(_0x852e,0x1b9));var _0xe852=function(_0x11f3ab,_0x76530e){_0x11f3ab=_0x11f3ab-0x0;var _0x3b1edc=_0x852e[_0x11f3ab];return _0x3b1edc;};'use strict';var multer=require(_0xe852('0x0'));var util=require(_0xe852('0x1'));var path=require(_0xe852('0x2'));var timeout=require(_0xe852('0x3'));var express=require(_0xe852('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe852('0x5'));var controller=require(_0xe852('0x6'));router[_0xe852('0x7')]('/',auth['isAuthenticated'](),controller[_0xe852('0x8')]);router[_0xe852('0x7')](_0xe852('0x9'),auth[_0xe852('0xa')](),controller[_0xe852('0xb')]);router[_0xe852('0x7')](_0xe852('0xc'),auth[_0xe852('0xa')](),controller[_0xe852('0xd')]);router[_0xe852('0xe')]('/',auth['isAuthenticated'](),interaction[_0xe852('0xf')]('chat','chatmessage:create'),controller[_0xe852('0x10')]);router[_0xe852('0x11')](_0xe852('0xc'),controller[_0xe852('0x12')]);router['put'](_0xe852('0x13'),auth[_0xe852('0xa')](),controller['accept']);router[_0xe852('0x11')]('/:id/reject',auth[_0xe852('0xa')](),controller['reject']);router[_0xe852('0x14')](_0xe852('0xc'),auth['isAuthenticated'](),controller[_0xe852('0x15')]);module[_0xe852('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 b5666f3..6eef4fe 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(_0x81b8f4,_0x3526ee){var _0x516bfd=function(_0x262d39){while(--_0x262d39){_0x81b8f4['push'](_0x81b8f4['shift']());}};_0x516bfd(++_0x3526ee);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'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 _0x2032=['medium','exports','TEXT'];(function(_0x5af95d,_0x52dc48){var _0x19c597=function(_0x477378){while(--_0x477378){_0x5af95d['push'](_0x5af95d['shift']());}};_0x19c597(++_0x52dc48);}(_0x2032,0xd9));var _0x2203=function(_0x5d1f02,_0x44161b){_0x5d1f02=_0x5d1f02-0x0;var _0x28d159=_0x2032[_0x5d1f02];return _0x28d159;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index f1e393d..ce4a8cb 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x26cfe9,_0x550174){var _0x54c563=function(_0x360c6b){while(--_0x360c6b){_0x26cfe9['push'](_0x26cfe9['shift']());}};_0x54c563(++_0x550174);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x7a54,0x106));var _0x47a5=function(_0x25de57,_0x36dfee){_0x25de57=_0x25de57-0x0;var _0x2e38b6=_0x7a54[_0x25de57];return _0x2e38b6;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 5bc61fe..1be01ab 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 _0xbc4a=['exports','events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4788a5,_0x28409c){var _0x522ece=function(_0x479426){while(--_0x479426){_0x4788a5['push'](_0x4788a5['shift']());}};_0x522ece(++_0x28409c);}(_0xbc4a,0x137));var _0xabc4=function(_0xbc47f1,_0x489fcb){_0xbc47f1=_0xbc47f1-0x0;var _0xb3387b=_0xbc4a[_0xbc47f1];return _0xb3387b;};'use strict';var EventEmitter=require(_0xabc4('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xabc4('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xabc4('0x2')](0x0);var events={'afterCreate':_0xabc4('0x3'),'afterUpdate':_0xabc4('0x4'),'afterDestroy':_0xabc4('0x5')};function emitEvent(_0x236cb3){return function(_0x1387ac,_0x17af24,_0x17a4d4){ChatOfflineMessageEvents[_0xabc4('0x6')](_0x236cb3+':'+_0x1387ac['id'],_0x1387ac);ChatOfflineMessageEvents[_0xabc4('0x6')](_0x236cb3,_0x1387ac);_0x17a4d4(null);};}for(var e in events){if(events[_0xabc4('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xabc4('0x8')](e,emitEvent(event));}}module[_0xabc4('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x885b=['ChatOfflineMessage','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0x885b,0x6a));var _0xb885=function(_0x2fbe3c,_0x174e52){_0x2fbe3c=_0x2fbe3c-0x0;var _0x223da1=_0x885b[_0x2fbe3c];return _0x223da1;};'use strict';var EventEmitter=require(_0xb885('0x0'));var ChatOfflineMessage=require(_0xb885('0x1'))['db'][_0xb885('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb885('0x3'),'afterUpdate':'update','afterDestroy':_0xb885('0x4')};function emitEvent(_0x589317){return function(_0x35e26f,_0x4bec7e,_0x4fe6cd){ChatOfflineMessageEvents['emit'](_0x589317+':'+_0x35e26f['id'],_0x35e26f);ChatOfflineMessageEvents[_0xb885('0x5')](_0x589317,_0x35e26f);_0x4fe6cd(null);};}for(var e in events){if(events[_0xb885('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xb885('0x7')](e,emitEvent(event));}}module[_0xb885('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index b649d76..f170edd 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 _0xb412=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x1a91f0,_0x11e203){var _0x12f862=function(_0x48983c){while(--_0x48983c){_0x1a91f0['push'](_0x1a91f0['shift']());}};_0x12f862(++_0x11e203);}(_0xb412,0xaf));var _0x2b41=function(_0x16eafb,_0x26d0be){_0x16eafb=_0x16eafb-0x0;var _0x3e8fdc=_0xb412[_0x16eafb];return _0x3e8fdc;};'use strict';var attributes=require(_0x2b41('0x0'));module['exports']=function(_0x16725){return _0x16725[_0x2b41('0x1')](_0x2b41('0x2'),attributes,{'tableName':_0x2b41('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b41('0x4'),'collate':_0x2b41('0x5')});};
\ No newline at end of file
+var _0x35ce=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x91cf75,_0x156959){var _0x562f63=function(_0x3f1f8a){while(--_0x3f1f8a){_0x91cf75['push'](_0x91cf75['shift']());}};_0x562f63(++_0x156959);}(_0x35ce,0x103));var _0xe35c=function(_0x28907c,_0x4c35eb){_0x28907c=_0x28907c-0x0;var _0x39b605=_0x35ce[_0x28907c];return _0x39b605;};'use strict';var attributes=require(_0xe35c('0x0'));module['exports']=function(_0x167417){return _0x167417[_0xe35c('0x1')](_0xe35c('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe35c('0x3'),'collate':_0xe35c('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index d50fa8b..19202f7 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 _0xfa27=['jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x458dad,_0x573c0b){var _0x534d3a=function(_0x5889af){while(--_0x5889af){_0x458dad['push'](_0x458dad['shift']());}};_0x534d3a(++_0x573c0b);}(_0xfa27,0x1b2));var _0x7fa2=function(_0x5d4596,_0x2e2147){_0x5d4596=_0x5d4596-0x0;var _0x225f03=_0xfa27[_0x5d4596];return _0x225f03;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7fa2('0x0'));var BPromise=require(_0x7fa2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fa2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fa2('0x3'))(_0x7fa2('0x4'));var config=require(_0x7fa2('0x5'));var jayson=require(_0x7fa2('0x6'));var client=jayson[_0x7fa2('0x7')][_0x7fa2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40cebe,_0x32a6cd,_0x3dd2df){return new BPromise(function(_0x42e47f,_0x2be7e1){return client[_0x7fa2('0x9')](_0x40cebe,_0x3dd2df)[_0x7fa2('0xa')](function(_0x5f54eb){logger[_0x7fa2('0xb')](_0x7fa2('0xc'),_0x32a6cd,_0x7fa2('0xd'));logger[_0x7fa2('0xe')](_0x7fa2('0xf'),_0x32a6cd,_0x7fa2('0xd'),JSON[_0x7fa2('0x10')](_0x5f54eb));if(_0x5f54eb[_0x7fa2('0x11')]){if(_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x12')]===0x1f4){logger[_0x7fa2('0x11')](_0x7fa2('0xc'),_0x32a6cd,_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x13')]);return _0x2be7e1(_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x13')]);}logger[_0x7fa2('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32a6cd,_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x13')]);return _0x42e47f(_0x5f54eb[_0x7fa2('0x11')][_0x7fa2('0x13')]);}else{logger[_0x7fa2('0xb')](_0x7fa2('0xc'),_0x32a6cd,_0x7fa2('0xd'));_0x42e47f(_0x5f54eb['result'][_0x7fa2('0x13')]);}})['catch'](function(_0x4a978f){logger[_0x7fa2('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32a6cd,_0x4a978f);_0x2be7e1(_0x4a978f);});});}
\ No newline at end of file
+var _0x5bb7=['jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x23a8ec,_0x3ddb28){var _0x2b2ce1=function(_0x598832){while(--_0x598832){_0x23a8ec['push'](_0x23a8ec['shift']());}};_0x2b2ce1(++_0x3ddb28);}(_0x5bb7,0x1ee));var _0x75bb=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x5bb7[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x75bb('0x0'));var util=require(_0x75bb('0x1'));var moment=require(_0x75bb('0x2'));var BPromise=require(_0x75bb('0x3'));var rs=require(_0x75bb('0x4'));var fs=require('fs');var Redis=require(_0x75bb('0x5'));var db=require(_0x75bb('0x6'))['db'];var utils=require(_0x75bb('0x7'));var logger=require('../../config/logger')(_0x75bb('0x8'));var config=require(_0x75bb('0x9'));var jayson=require(_0x75bb('0xa'));var client=jayson[_0x75bb('0xb')][_0x75bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x581208,_0x5099ab,_0x4ce4af){return new BPromise(function(_0x372ade,_0x5e5dfd){return client[_0x75bb('0xd')](_0x581208,_0x4ce4af)[_0x75bb('0xe')](function(_0x14ac96){logger[_0x75bb('0xf')](_0x75bb('0x10'),_0x5099ab,'request\x20sent');logger[_0x75bb('0x11')](_0x75bb('0x12'),_0x5099ab,_0x75bb('0x13'),JSON[_0x75bb('0x14')](_0x14ac96));if(_0x14ac96[_0x75bb('0x15')]){if(_0x14ac96['error']['code']===0x1f4){logger['error'](_0x75bb('0x10'),_0x5099ab,_0x14ac96['error'][_0x75bb('0x16')]);return _0x5e5dfd(_0x14ac96[_0x75bb('0x15')][_0x75bb('0x16')]);}logger[_0x75bb('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5099ab,_0x14ac96['error'][_0x75bb('0x16')]);return _0x372ade(_0x14ac96[_0x75bb('0x15')][_0x75bb('0x16')]);}else{logger[_0x75bb('0xf')](_0x75bb('0x10'),_0x5099ab,_0x75bb('0x13'));_0x372ade(_0x14ac96['result'][_0x75bb('0x16')]);}})[_0x75bb('0x17')](function(_0x3b77e2){logger[_0x75bb('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5099ab,_0x3b77e2);_0x5e5dfd(_0x3b77e2);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index fb1ff1f..f37f410 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 _0xc014=['describe','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xc014,0x1e1));var _0x4c01=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xc014[_0xd0a847];return _0x2536ec;};'use strict';var multer=require(_0x4c01('0x0'));var util=require(_0x4c01('0x1'));var path=require(_0x4c01('0x2'));var timeout=require(_0x4c01('0x3'));var express=require(_0x4c01('0x4'));var router=express[_0x4c01('0x5')]();var fs_extra=require(_0x4c01('0x6'));var auth=require(_0x4c01('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4c01('0x8'));router['get']('/',auth[_0x4c01('0x9')](),controller[_0x4c01('0xa')]);router[_0x4c01('0xb')](_0x4c01('0xc'),auth[_0x4c01('0x9')](),controller[_0x4c01('0xd')]);router[_0x4c01('0xb')](_0x4c01('0xe'),auth[_0x4c01('0x9')](),controller[_0x4c01('0xf')]);router['post']('/',auth[_0x4c01('0x9')](),controller['create']);router['put']('/:id',auth[_0x4c01('0x9')](),controller['update']);router[_0x4c01('0x10')](_0x4c01('0xe'),auth[_0x4c01('0x9')](),controller[_0x4c01('0x11')]);module[_0x4c01('0x12')]=router;
\ No newline at end of file
+var _0xfcc5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x59f3d4,_0x424a23){var _0x139400=function(_0x3c478c){while(--_0x3c478c){_0x59f3d4['push'](_0x59f3d4['shift']());}};_0x139400(++_0x424a23);}(_0xfcc5,0x15d));var _0x5fcc=function(_0x45327d,_0xcf4973){_0x45327d=_0x45327d-0x0;var _0x547ae1=_0xfcc5[_0x45327d];return _0x547ae1;};'use strict';var multer=require(_0x5fcc('0x0'));var util=require('util');var path=require(_0x5fcc('0x1'));var timeout=require(_0x5fcc('0x2'));var express=require(_0x5fcc('0x3'));var router=express[_0x5fcc('0x4')]();var fs_extra=require(_0x5fcc('0x5'));var auth=require(_0x5fcc('0x6'));var interaction=require(_0x5fcc('0x7'));var config=require(_0x5fcc('0x8'));var controller=require(_0x5fcc('0x9'));router[_0x5fcc('0xa')]('/',auth[_0x5fcc('0xb')](),controller[_0x5fcc('0xc')]);router['get'](_0x5fcc('0xd'),auth[_0x5fcc('0xb')](),controller[_0x5fcc('0xe')]);router['get'](_0x5fcc('0xf'),auth['isAuthenticated'](),controller[_0x5fcc('0x10')]);router[_0x5fcc('0x11')]('/',auth[_0x5fcc('0xb')](),controller[_0x5fcc('0x12')]);router[_0x5fcc('0x13')](_0x5fcc('0xf'),auth['isAuthenticated'](),controller[_0x5fcc('0x14')]);router['delete'](_0x5fcc('0xf'),auth[_0x5fcc('0xb')](),controller[_0x5fcc('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 363c33c..6e0e2a1 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 _0xb655=['exports','ENUM','timeout','STRING','sequelize'];(function(_0x12260c,_0x1d8909){var _0x440ab1=function(_0x28faa6){while(--_0x28faa6){_0x12260c['push'](_0x12260c['shift']());}};_0x440ab1(++_0x1d8909);}(_0xb655,0x14e));var _0x5b65=function(_0x4dd11f,_0x574e8c){_0x4dd11f=_0x4dd11f-0x0;var _0x6369ad=_0xb655[_0x4dd11f];return _0x6369ad;};'use strict';var Sequelize=require(_0x5b65('0x0'));module[_0x5b65('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5b65('0x2')]('mouseOver',_0x5b65('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x5b65('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdb7b=['sequelize','exports','STRING','timeout','INTEGER'];(function(_0x905b57,_0x3b9889){var _0x8e7a67=function(_0x5e34ee){while(--_0x5e34ee){_0x905b57['push'](_0x905b57['shift']());}};_0x8e7a67(++_0x3b9889);}(_0xdb7b,0xeb));var _0xbdb7=function(_0x56bbd5,_0x20f4e0){_0x56bbd5=_0x56bbd5-0x0;var _0x42e2aa=_0xdb7b[_0x56bbd5];return _0x42e2aa;};'use strict';var Sequelize=require(_0xbdb7('0x0'));module[_0xbdb7('0x1')]={'name':{'type':Sequelize[_0xbdb7('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xbdb7('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xbdb7('0x2')]},'timeout':{'type':Sequelize[_0xbdb7('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 8cc6f54..76f9cef 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 _0x2cd3=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/environment','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','name','show','params','keys','ChatProactiveAction','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','catch'];(function(_0x2a99f1,_0x198fd7){var _0x6948e5=function(_0x2ae413){while(--_0x2ae413){_0x2a99f1['push'](_0x2a99f1['shift']());}};_0x6948e5(++_0x198fd7);}(_0x2cd3,0xf1));var _0x32cd=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x2cd3[_0x3042c5];return _0x7cd140;};'use strict';var emlformat=require(_0x32cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32cd('0x1'));var jsonpatch=require(_0x32cd('0x2'));var rp=require(_0x32cd('0x3'));var moment=require(_0x32cd('0x4'));var BPromise=require(_0x32cd('0x5'));var Mustache=require(_0x32cd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x32cd('0x7'));var csv=require(_0x32cd('0x8'));var ejs=require(_0x32cd('0x9'));var fs=require('fs');var fs_extra=require(_0x32cd('0xa'));var _=require(_0x32cd('0xb'));var squel=require(_0x32cd('0xc'));var crypto=require(_0x32cd('0xd'));var jsforce=require(_0x32cd('0xe'));var deskjs=require(_0x32cd('0xf'));var toCsv=require(_0x32cd('0x8'));var querystring=require(_0x32cd('0x10'));var Papa=require(_0x32cd('0x11'));var Redis=require(_0x32cd('0x12'));var authService=require(_0x32cd('0x13'));var qs=require(_0x32cd('0x14'));var as=require(_0x32cd('0x15'));var hardwareService=require(_0x32cd('0x16'));var logger=require(_0x32cd('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x32cd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27db2b,_0x4610ed){_0x4610ed=_0x4610ed||0xcc;return function(_0x459f80){if(_0x459f80){return _0x27db2b[_0x32cd('0x19')](_0x4610ed);}return _0x27db2b[_0x32cd('0x1a')](_0x4610ed)[_0x32cd('0x1b')]();};}function respondWithResult(_0x3ce589,_0x542a02){_0x542a02=_0x542a02||0xc8;return function(_0x51b452){if(_0x51b452){return _0x3ce589[_0x32cd('0x1a')](_0x542a02)[_0x32cd('0x1c')](_0x51b452);}};}function respondWithFilteredResult(_0x149448,_0x440984){return function(_0x4a14b5){if(_0x4a14b5){var _0x3a542b=typeof _0x440984['offset']==='undefined'&&typeof _0x440984[_0x32cd('0x1d')]===_0x32cd('0x1e');var _0x3f9c9c=_0x4a14b5[_0x32cd('0x1f')];var _0x4690c9=_0x3a542b?0x0:_0x440984[_0x32cd('0x20')];var _0x4bfabf=_0x3a542b?_0x4a14b5[_0x32cd('0x1f')]:_0x440984[_0x32cd('0x20')]+_0x440984[_0x32cd('0x1d')];var _0x5d36c9;if(_0x4bfabf>=_0x3f9c9c){_0x4bfabf=_0x3f9c9c;_0x5d36c9=0xc8;}else{_0x5d36c9=0xce;}_0x149448['status'](_0x5d36c9);return _0x149448[_0x32cd('0x21')](_0x32cd('0x22'),_0x4690c9+'-'+_0x4bfabf+'/'+_0x3f9c9c)[_0x32cd('0x1c')](_0x4a14b5);}return null;};}function patchUpdates(_0x19ab29){return function(_0x14b3fe){try{jsonpatch['apply'](_0x14b3fe,_0x19ab29,!![]);}catch(_0x4311cb){return BPromise[_0x32cd('0x23')](_0x4311cb);}return _0x14b3fe[_0x32cd('0x24')]();};}function saveUpdates(_0x1a50a6,_0x3bc9c8){return function(_0x192b1d){if(_0x192b1d){return _0x192b1d[_0x32cd('0x25')](_0x1a50a6)[_0x32cd('0x26')](function(_0x575f97){return _0x575f97;});}return null;};}function removeEntity(_0x3eb73c,_0x5ddfaa){return function(_0x4c7f55){if(_0x4c7f55){return _0x4c7f55[_0x32cd('0x27')]()['then'](function(){_0x3eb73c['status'](0xcc)[_0x32cd('0x1b')]();});}};}function handleEntityNotFound(_0x57782c,_0x54be38){return function(_0x48dadb){if(!_0x48dadb){_0x57782c[_0x32cd('0x19')](0x194);}return _0x48dadb;};}function handleError(_0x1abddd,_0x25d9be){_0x25d9be=_0x25d9be||0x1f4;return function(_0x1af82f){logger['error'](_0x1af82f['stack']);if(_0x1af82f['name']){delete _0x1af82f[_0x32cd('0x28')];}_0x1abddd[_0x32cd('0x1a')](_0x25d9be)['send'](_0x1af82f);};}exports[_0x32cd('0x29')]=function(_0x35f798,_0x1a6754){var _0x241424={'raw':!![],'where':{'id':_0x35f798[_0x32cd('0x2a')]['id']}},_0x27bd86={};_0x27bd86['model']=_[_0x32cd('0x2b')](db[_0x32cd('0x2c')][_0x32cd('0x2d')]);_0x27bd86[_0x32cd('0x2e')]=_[_0x32cd('0x2b')](_0x35f798[_0x32cd('0x2e')]);_0x27bd86['filters']=_[_0x32cd('0x2f')](_0x27bd86[_0x32cd('0x30')],_0x27bd86[_0x32cd('0x2e')]);_0x241424[_0x32cd('0x31')]=_[_0x32cd('0x2f')](_0x27bd86[_0x32cd('0x30')],qs['fields'](_0x35f798[_0x32cd('0x2e')][_0x32cd('0x32')]));_0x241424['attributes']=_0x241424[_0x32cd('0x31')][_0x32cd('0x33')]?_0x241424[_0x32cd('0x31')]:_0x27bd86[_0x32cd('0x30')];if(_0x35f798[_0x32cd('0x2e')][_0x32cd('0x34')]){_0x241424[_0x32cd('0x35')]=[{'all':!![]}];}_0x241424=_[_0x32cd('0x36')]({},_0x241424,_0x35f798[_0x32cd('0x37')]);return db[_0x32cd('0x2c')][_0x32cd('0x38')](_0x241424)[_0x32cd('0x26')](handleEntityNotFound(_0x1a6754,null))[_0x32cd('0x26')](respondWithResult(_0x1a6754,null))['catch'](handleError(_0x1a6754,null));};exports[_0x32cd('0x39')]=function(_0x5baa3a,_0x1911c0){return db[_0x32cd('0x2c')]['create'](_0x5baa3a['body'],{})[_0x32cd('0x26')](respondWithResult(_0x1911c0,0xc9))[_0x32cd('0x3a')](handleError(_0x1911c0,null));};exports[_0x32cd('0x25')]=function(_0x481e23,_0x3a4f49){if(_0x481e23[_0x32cd('0x3b')]['id']){delete _0x481e23[_0x32cd('0x3b')]['id'];}return db[_0x32cd('0x2c')][_0x32cd('0x38')]({'where':{'id':_0x481e23[_0x32cd('0x2a')]['id']}})[_0x32cd('0x26')](handleEntityNotFound(_0x3a4f49,null))[_0x32cd('0x26')](saveUpdates(_0x481e23[_0x32cd('0x3b')],null))['then'](respondWithResult(_0x3a4f49,null))[_0x32cd('0x3a')](handleError(_0x3a4f49,null));};exports['destroy']=function(_0xeb31bb,_0x134ea7){return db[_0x32cd('0x2c')][_0x32cd('0x38')]({'where':{'id':_0xeb31bb['params']['id']}})[_0x32cd('0x26')](handleEntityNotFound(_0x134ea7,null))[_0x32cd('0x26')](removeEntity(_0x134ea7,null))[_0x32cd('0x3a')](handleError(_0x134ea7,null));};
\ No newline at end of file
+var _0x6f7b=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','show','model','keys','ChatProactiveAction','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x6f7b,0x168));var _0xb6f7=function(_0x1b21d3,_0x26e200){_0x1b21d3=_0x1b21d3-0x0;var _0x44e919=_0x6f7b[_0x1b21d3];return _0x44e919;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6f7('0x0'));var zipdir=require(_0xb6f7('0x1'));var jsonpatch=require(_0xb6f7('0x2'));var rp=require(_0xb6f7('0x3'));var moment=require(_0xb6f7('0x4'));var BPromise=require(_0xb6f7('0x5'));var Mustache=require(_0xb6f7('0x6'));var util=require('util');var path=require(_0xb6f7('0x7'));var sox=require('sox');var csv=require(_0xb6f7('0x8'));var ejs=require(_0xb6f7('0x9'));var fs=require('fs');var fs_extra=require(_0xb6f7('0xa'));var _=require(_0xb6f7('0xb'));var squel=require('squel');var crypto=require(_0xb6f7('0xc'));var jsforce=require(_0xb6f7('0xd'));var deskjs=require(_0xb6f7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb6f7('0xf'));var authService=require(_0xb6f7('0x10'));var qs=require(_0xb6f7('0x11'));var as=require(_0xb6f7('0x12'));var hardwareService=require(_0xb6f7('0x13'));var logger=require(_0xb6f7('0x14'))(_0xb6f7('0x15'));var utils=require(_0xb6f7('0x16'));var config=require(_0xb6f7('0x17'));var licenseUtil=require(_0xb6f7('0x18'));var db=require(_0xb6f7('0x19'))['db'];function respondWithStatusCode(_0x34960,_0x470b4d){_0x470b4d=_0x470b4d||0xcc;return function(_0x279785){if(_0x279785){return _0x34960[_0xb6f7('0x1a')](_0x470b4d);}return _0x34960[_0xb6f7('0x1b')](_0x470b4d)[_0xb6f7('0x1c')]();};}function respondWithResult(_0x3723d2,_0xa1d946){_0xa1d946=_0xa1d946||0xc8;return function(_0x31099c){if(_0x31099c){return _0x3723d2[_0xb6f7('0x1b')](_0xa1d946)[_0xb6f7('0x1d')](_0x31099c);}};}function respondWithFilteredResult(_0xa3e8fd,_0xc03835){return function(_0x5be484){if(_0x5be484){var _0xc3859c=typeof _0xc03835[_0xb6f7('0x1e')]===_0xb6f7('0x1f')&&typeof _0xc03835[_0xb6f7('0x20')]==='undefined';var _0x17938a=_0x5be484[_0xb6f7('0x21')];var _0x148b87=_0xc3859c?0x0:_0xc03835['offset'];var _0x220951=_0xc3859c?_0x5be484[_0xb6f7('0x21')]:_0xc03835[_0xb6f7('0x1e')]+_0xc03835[_0xb6f7('0x20')];var _0x9b9bde;if(_0x220951>=_0x17938a){_0x220951=_0x17938a;_0x9b9bde=0xc8;}else{_0x9b9bde=0xce;}_0xa3e8fd[_0xb6f7('0x1b')](_0x9b9bde);return _0xa3e8fd[_0xb6f7('0x22')](_0xb6f7('0x23'),_0x148b87+'-'+_0x220951+'/'+_0x17938a)['json'](_0x5be484);}return null;};}function patchUpdates(_0x2a0795){return function(_0x59f716){try{jsonpatch[_0xb6f7('0x24')](_0x59f716,_0x2a0795,!![]);}catch(_0x3b6403){return BPromise['reject'](_0x3b6403);}return _0x59f716[_0xb6f7('0x25')]();};}function saveUpdates(_0x1508d6,_0x6f7593){return function(_0x55c3dd){if(_0x55c3dd){return _0x55c3dd[_0xb6f7('0x26')](_0x1508d6)['then'](function(_0x25b109){return _0x25b109;});}return null;};}function removeEntity(_0x156a12,_0xc9d994){return function(_0x37d24c){if(_0x37d24c){return _0x37d24c[_0xb6f7('0x27')]()[_0xb6f7('0x28')](function(){_0x156a12[_0xb6f7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2968a7,_0x21578b){return function(_0x455bf6){if(!_0x455bf6){_0x2968a7['sendStatus'](0x194);}return _0x455bf6;};}function handleError(_0x3cf307,_0x37d70d){_0x37d70d=_0x37d70d||0x1f4;return function(_0x48eded){logger[_0xb6f7('0x29')](_0x48eded[_0xb6f7('0x2a')]);if(_0x48eded[_0xb6f7('0x2b')]){delete _0x48eded[_0xb6f7('0x2b')];}_0x3cf307[_0xb6f7('0x1b')](_0x37d70d)[_0xb6f7('0x2c')](_0x48eded);};}exports[_0xb6f7('0x2d')]=function(_0x53903f,_0x478d75){var _0x3c5f07={'raw':!![],'where':{'id':_0x53903f['params']['id']}},_0x539587={};_0x539587[_0xb6f7('0x2e')]=_[_0xb6f7('0x2f')](db[_0xb6f7('0x30')]['rawAttributes']);_0x539587[_0xb6f7('0x31')]=_['keys'](_0x53903f[_0xb6f7('0x31')]);_0x539587[_0xb6f7('0x32')]=_[_0xb6f7('0x33')](_0x539587['model'],_0x539587[_0xb6f7('0x31')]);_0x3c5f07['attributes']=_[_0xb6f7('0x33')](_0x539587[_0xb6f7('0x2e')],qs['fields'](_0x53903f[_0xb6f7('0x31')][_0xb6f7('0x34')]));_0x3c5f07[_0xb6f7('0x35')]=_0x3c5f07['attributes'][_0xb6f7('0x36')]?_0x3c5f07['attributes']:_0x539587[_0xb6f7('0x2e')];if(_0x53903f[_0xb6f7('0x31')][_0xb6f7('0x37')]){_0x3c5f07[_0xb6f7('0x38')]=[{'all':!![]}];}_0x3c5f07=_[_0xb6f7('0x39')]({},_0x3c5f07,_0x53903f[_0xb6f7('0x3a')]);return db[_0xb6f7('0x30')][_0xb6f7('0x3b')](_0x3c5f07)[_0xb6f7('0x28')](handleEntityNotFound(_0x478d75,null))[_0xb6f7('0x28')](respondWithResult(_0x478d75,null))['catch'](handleError(_0x478d75,null));};exports[_0xb6f7('0x3c')]=function(_0x3c7787,_0x54e5ef){return db[_0xb6f7('0x30')]['create'](_0x3c7787[_0xb6f7('0x3d')],{})[_0xb6f7('0x28')](respondWithResult(_0x54e5ef,0xc9))[_0xb6f7('0x3e')](handleError(_0x54e5ef,null));};exports['update']=function(_0x1708f5,_0x1bbf07){if(_0x1708f5[_0xb6f7('0x3d')]['id']){delete _0x1708f5[_0xb6f7('0x3d')]['id'];}return db[_0xb6f7('0x30')][_0xb6f7('0x3b')]({'where':{'id':_0x1708f5[_0xb6f7('0x3f')]['id']}})[_0xb6f7('0x28')](handleEntityNotFound(_0x1bbf07,null))[_0xb6f7('0x28')](saveUpdates(_0x1708f5['body'],null))[_0xb6f7('0x28')](respondWithResult(_0x1bbf07,null))[_0xb6f7('0x3e')](handleError(_0x1bbf07,null));};exports[_0xb6f7('0x27')]=function(_0x1e202e,_0x3e3c51){return db[_0xb6f7('0x30')][_0xb6f7('0x3b')]({'where':{'id':_0x1e202e[_0xb6f7('0x3f')]['id']}})[_0xb6f7('0x28')](handleEntityNotFound(_0x3e3c51,null))[_0xb6f7('0x28')](removeEntity(_0x3e3c51,null))[_0xb6f7('0x3e')](handleError(_0x3e3c51,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2de7dba..02a495f 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 _0xe4b2=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','chat_proactive_actions','util'];(function(_0x404d52,_0x68f0ae){var _0x433640=function(_0x21b651){while(--_0x21b651){_0x404d52['push'](_0x404d52['shift']());}};_0x433640(++_0x68f0ae);}(_0xe4b2,0x175));var _0x2e4b=function(_0x1c10bc,_0x1fa89c){_0x1c10bc=_0x1c10bc-0x0;var _0x5e09cd=_0xe4b2[_0x1c10bc];return _0x5e09cd;};'use strict';var _=require('lodash');var util=require(_0x2e4b('0x0'));var logger=require(_0x2e4b('0x1'))(_0x2e4b('0x2'));var moment=require(_0x2e4b('0x3'));var BPromise=require(_0x2e4b('0x4'));var rp=require(_0x2e4b('0x5'));var fs=require('fs');var path=require(_0x2e4b('0x6'));var rimraf=require('rimraf');var config=require(_0x2e4b('0x7'));var attributes=require(_0x2e4b('0x8'));module[_0x2e4b('0x9')]=function(_0x19214f,_0x2e496f){return _0x19214f['define']('ChatProactiveAction',attributes,{'tableName':_0x2e4b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd207=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x16bfac,_0x3c5483){var _0x8d22fb=function(_0x157138){while(--_0x157138){_0x16bfac['push'](_0x16bfac['shift']());}};_0x8d22fb(++_0x3c5483);}(_0xd207,0x1ca));var _0x7d20=function(_0x1a841e,_0x225b53){_0x1a841e=_0x1a841e-0x0;var _0x1eeeeb=_0xd207[_0x1a841e];return _0x1eeeeb;};'use strict';var _=require(_0x7d20('0x0'));var util=require(_0x7d20('0x1'));var logger=require(_0x7d20('0x2'))(_0x7d20('0x3'));var moment=require(_0x7d20('0x4'));var BPromise=require(_0x7d20('0x5'));var rp=require(_0x7d20('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d20('0x7'));var config=require(_0x7d20('0x8'));var attributes=require(_0x7d20('0x9'));module[_0x7d20('0xa')]=function(_0x2a2257,_0x345d82){return _0x2a2257[_0x7d20('0xb')](_0x7d20('0xc'),attributes,{'tableName':_0x7d20('0xd'),'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 c00aba0..341b537 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 _0xb624=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x580c4d,_0x2503b6){var _0x5c4b14=function(_0xc843ec){while(--_0xc843ec){_0x580c4d['push'](_0x580c4d['shift']());}};_0x5c4b14(++_0x2503b6);}(_0xb624,0x15a));var _0x4b62=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0xb624[_0x8560d3];return _0x33b1b5;};'use strict';var _=require(_0x4b62('0x0'));var util=require('util');var moment=require(_0x4b62('0x1'));var BPromise=require('bluebird');var rs=require(_0x4b62('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b62('0x3'))['db'];var utils=require(_0x4b62('0x4'));var logger=require('../../config/logger')(_0x4b62('0x5'));var config=require(_0x4b62('0x6'));var jayson=require(_0x4b62('0x7'));var client=jayson[_0x4b62('0x8')][_0x4b62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x407392,_0x3a3bf4,_0x1b5718){return new BPromise(function(_0x427a3d,_0x59ecd9){return client[_0x4b62('0xa')](_0x407392,_0x1b5718)['then'](function(_0x125000){logger[_0x4b62('0xb')](_0x4b62('0xc'),_0x3a3bf4,_0x4b62('0xd'));logger[_0x4b62('0xe')](_0x4b62('0xf'),_0x3a3bf4,_0x4b62('0xd'),JSON[_0x4b62('0x10')](_0x125000));if(_0x125000[_0x4b62('0x11')]){if(_0x125000[_0x4b62('0x11')][_0x4b62('0x12')]===0x1f4){logger['error'](_0x4b62('0xc'),_0x3a3bf4,_0x125000[_0x4b62('0x11')][_0x4b62('0x13')]);return _0x59ecd9(_0x125000[_0x4b62('0x11')][_0x4b62('0x13')]);}logger[_0x4b62('0x11')](_0x4b62('0xc'),_0x3a3bf4,_0x125000['error'][_0x4b62('0x13')]);return _0x427a3d(_0x125000[_0x4b62('0x11')][_0x4b62('0x13')]);}else{logger['info'](_0x4b62('0xc'),_0x3a3bf4,_0x4b62('0xd'));_0x427a3d(_0x125000[_0x4b62('0x14')][_0x4b62('0x13')]);}})['catch'](function(_0xf23d04){logger['error'](_0x4b62('0xc'),_0x3a3bf4,_0xf23d04);_0x59ecd9(_0xf23d04);});});}
\ No newline at end of file
+var _0x6e14=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x32cb07,_0x439d27){var _0xbb048b=function(_0x5c7830){while(--_0x5c7830){_0x32cb07['push'](_0x32cb07['shift']());}};_0xbb048b(++_0x439d27);}(_0x6e14,0xd1));var _0x46e1=function(_0x80c2dd,_0x492c8c){_0x80c2dd=_0x80c2dd-0x0;var _0x51f554=_0x6e14[_0x80c2dd];return _0x51f554;};'use strict';var _=require(_0x46e1('0x0'));var util=require(_0x46e1('0x1'));var moment=require(_0x46e1('0x2'));var BPromise=require(_0x46e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46e1('0x4'));var db=require(_0x46e1('0x5'))['db'];var utils=require(_0x46e1('0x6'));var logger=require(_0x46e1('0x7'))(_0x46e1('0x8'));var config=require(_0x46e1('0x9'));var jayson=require(_0x46e1('0xa'));var client=jayson[_0x46e1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e6afe,_0x1ed85e,_0x1504ac){return new BPromise(function(_0x410af0,_0x3b96bb){return client[_0x46e1('0xc')](_0x5e6afe,_0x1504ac)[_0x46e1('0xd')](function(_0x2b7f3f){logger[_0x46e1('0xe')](_0x46e1('0xf'),_0x1ed85e,'request\x20sent');logger[_0x46e1('0x10')](_0x46e1('0x11'),_0x1ed85e,_0x46e1('0x12'),JSON[_0x46e1('0x13')](_0x2b7f3f));if(_0x2b7f3f['error']){if(_0x2b7f3f[_0x46e1('0x14')]['code']===0x1f4){logger[_0x46e1('0x14')](_0x46e1('0xf'),_0x1ed85e,_0x2b7f3f[_0x46e1('0x14')]['message']);return _0x3b96bb(_0x2b7f3f['error'][_0x46e1('0x15')]);}logger['error'](_0x46e1('0xf'),_0x1ed85e,_0x2b7f3f['error'][_0x46e1('0x15')]);return _0x410af0(_0x2b7f3f[_0x46e1('0x14')]['message']);}else{logger[_0x46e1('0xe')](_0x46e1('0xf'),_0x1ed85e,_0x46e1('0x12'));_0x410af0(_0x2b7f3f[_0x46e1('0x16')][_0x46e1('0x15')]);}})[_0x46e1('0x17')](function(_0xed389){logger[_0x46e1('0x14')](_0x46e1('0xf'),_0x1ed85e,_0xed389);_0x3b96bb(_0xed389);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 5533d91..733d671 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 _0x3f8a=['/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x313377,_0x3afbc8){var _0x4fff39=function(_0x287eb7){while(--_0x287eb7){_0x313377['push'](_0x313377['shift']());}};_0x4fff39(++_0x3afbc8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x55fd5c,_0x7db0da){_0x55fd5c=_0x55fd5c-0x0;var _0x5b21e5=_0x3f8a[_0x55fd5c];return _0x5b21e5;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x11')]);router['delete'](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('0x13')]=router;
\ No newline at end of file
+var _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x98a8,0x12c));var _0x898a=function(_0x395309,_0x2a9d1a){_0x395309=_0x395309-0x0;var _0xe3228a=_0x98a8[_0x395309];return _0xe3228a;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index f7b4adf..ff13710 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 _0x4d4e=['exports','name','STRING','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x1af90a,_0x323b95){var _0x1e0730=function(_0x15f94a){while(--_0x15f94a){_0x1af90a['push'](_0x1af90a['shift']());}};_0x1e0730(++_0x323b95);}(_0x4d4e,0x1bf));var _0xe4d4=function(_0x3b9007,_0x482404){_0x3b9007=_0x3b9007-0x0;var _0xfe01e7=_0x4d4e[_0x3b9007];return _0xfe01e7;};'use strict';var Sequelize=require(_0xe4d4('0x0'));module[_0xe4d4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe4d4('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe4d4('0x3')]},'timeout':{'type':Sequelize[_0xe4d4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe4d4('0x5')]('rrmemory','beepall',_0xe4d4('0x6'))}};
\ No newline at end of file
+var _0x8317=['ENUM','rrmemory','roundrobin','exports','name','STRING','INTEGER'];(function(_0x28a9d7,_0x1e285d){var _0x542d8e=function(_0x30cd93){while(--_0x30cd93){_0x28a9d7['push'](_0x28a9d7['shift']());}};_0x542d8e(++_0x1e285d);}(_0x8317,0x7a));var _0x7831=function(_0x7a7891,_0x43ca68){_0x7a7891=_0x7a7891-0x0;var _0x39a79d=_0x8317[_0x7a7891];return _0x39a79d;};'use strict';var Sequelize=require('sequelize');module[_0x7831('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7831('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7831('0x2')]},'timeout':{'type':Sequelize[_0x7831('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7831('0x4')](_0x7831('0x5'),'beepall',_0x7831('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c36aaec..6692018 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 _0xfb57=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','ChatQueues','UserProfileResource','status','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','destroy','describe','getMembers','findOne','UserChatQueue','User','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfb57,0x85));var _0x7fb5=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xfb57[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x7fb5('0x0'));var rimraf=require(_0x7fb5('0x1'));var zipdir=require(_0x7fb5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fb5('0x3'));var moment=require('moment');var BPromise=require(_0x7fb5('0x4'));var Mustache=require(_0x7fb5('0x5'));var util=require(_0x7fb5('0x6'));var path=require(_0x7fb5('0x7'));var sox=require(_0x7fb5('0x8'));var csv=require('to-csv');var ejs=require(_0x7fb5('0x9'));var fs=require('fs');var fs_extra=require(_0x7fb5('0xa'));var _=require(_0x7fb5('0xb'));var squel=require('squel');var crypto=require(_0x7fb5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7fb5('0xd'));var toCsv=require(_0x7fb5('0xe'));var querystring=require(_0x7fb5('0xf'));var Papa=require(_0x7fb5('0x10'));var Redis=require(_0x7fb5('0x11'));var authService=require(_0x7fb5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb5('0x14'))(_0x7fb5('0x15'));var utils=require(_0x7fb5('0x16'));var config=require(_0x7fb5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fb5('0x18'))['db'];config[_0x7fb5('0x19')]=_['defaults'](config[_0x7fb5('0x19')],{'host':_0x7fb5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fb5('0x19')]));require(_0x7fb5('0x1b'))[_0x7fb5('0x1c')](socket);var jayson=require(_0x7fb5('0x1d'));var client=jayson[_0x7fb5('0x1e')][_0x7fb5('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4e8879,_0x258bb9,_0x1b187b,_0x15359a){return new BPromise(function(_0x3abb85,_0xbd13b3){var _0x1d6af6=_0x15359a||client;return _0x1d6af6['request'](_0x4e8879,_0x1b187b)[_0x7fb5('0x20')](function(_0x9d6bc4){logger[_0x7fb5('0x21')](_0x7fb5('0x22'),_0x258bb9,'request\x20sent');logger[_0x7fb5('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x258bb9,_0x7fb5('0x24'),JSON[_0x7fb5('0x25')](_0x9d6bc4));if(_0x9d6bc4[_0x7fb5('0x26')]){if(_0x9d6bc4[_0x7fb5('0x26')]['code']===0x1f4){logger[_0x7fb5('0x26')]('ChatQueue,\x20%s,\x20%s',_0x258bb9,_0x9d6bc4[_0x7fb5('0x26')][_0x7fb5('0x27')]);return _0xbd13b3(_0x9d6bc4[_0x7fb5('0x26')][_0x7fb5('0x27')]);}logger[_0x7fb5('0x26')](_0x7fb5('0x22'),_0x258bb9,_0x9d6bc4[_0x7fb5('0x26')]['message']);return _0x3abb85(_0x9d6bc4['error']['message']);}else{logger['info'](_0x7fb5('0x22'),_0x258bb9,'request\x20sent');_0x3abb85(_0x9d6bc4[_0x7fb5('0x28')]['message']);}})[_0x7fb5('0x29')](function(_0x5f5a4c){logger[_0x7fb5('0x26')](_0x7fb5('0x22'),_0x258bb9,_0x5f5a4c);_0xbd13b3(_0x5f5a4c);});});}function respondWithStatusCode(_0x97c140,_0x2ad7a3){_0x2ad7a3=_0x2ad7a3||0xcc;return function(_0x21bb89){if(_0x21bb89){return _0x97c140[_0x7fb5('0x2a')](_0x2ad7a3);}return _0x97c140['status'](_0x2ad7a3)[_0x7fb5('0x2b')]();};}function respondWithResult(_0x18aeb3,_0x5abf95){_0x5abf95=_0x5abf95||0xc8;return function(_0x2326f5){if(_0x2326f5){return _0x18aeb3['status'](_0x5abf95)[_0x7fb5('0x2c')](_0x2326f5);}};}function respondWithFilteredResult(_0x5c2ff9,_0x28e639){return function(_0x26475f){if(_0x26475f){var _0x2f1234=typeof _0x28e639[_0x7fb5('0x2d')]===_0x7fb5('0x2e')&&typeof _0x28e639[_0x7fb5('0x2f')]===_0x7fb5('0x2e');var _0x304cd6=_0x26475f['count'];var _0x4ff037=_0x2f1234?0x0:_0x28e639['offset'];var _0x30d484=_0x2f1234?_0x26475f['count']:_0x28e639['offset']+_0x28e639[_0x7fb5('0x2f')];var _0x5570e7;if(_0x30d484>=_0x304cd6){_0x30d484=_0x304cd6;_0x5570e7=0xc8;}else{_0x5570e7=0xce;}_0x5c2ff9['status'](_0x5570e7);return _0x5c2ff9[_0x7fb5('0x30')](_0x7fb5('0x31'),_0x4ff037+'-'+_0x30d484+'/'+_0x304cd6)[_0x7fb5('0x2c')](_0x26475f);}return null;};}function patchUpdates(_0x1a0df5){return function(_0x4d24af){try{jsonpatch[_0x7fb5('0x32')](_0x4d24af,_0x1a0df5,!![]);}catch(_0x344986){return BPromise[_0x7fb5('0x33')](_0x344986);}return _0x4d24af[_0x7fb5('0x34')]();};}function saveUpdates(_0x5ecefd,_0x325019){return function(_0x20be40){if(_0x20be40){return _0x20be40[_0x7fb5('0x35')](_0x5ecefd)[_0x7fb5('0x20')](function(_0x3b77ca){return _0x3b77ca;});}return null;};}function removeEntity(_0x867d60,_0x8eb259){return function(_0x2a9deb){if(_0x2a9deb){return _0x2a9deb['destroy']()[_0x7fb5('0x20')](function(){var _0x1455a8=_0x2a9deb['get']({'plain':!![]});var _0x313fa9=_0x7fb5('0x36');return db[_0x7fb5('0x37')]['destroy']({'where':{'type':_0x313fa9,'resourceId':_0x1455a8['id']}})[_0x7fb5('0x20')](function(){return _0x2a9deb;});})[_0x7fb5('0x20')](function(){_0x867d60[_0x7fb5('0x38')](0xcc)['end']();});}};}function handleEntityNotFound(_0x866895,_0x12010d){return function(_0x5d0d39){if(!_0x5d0d39){_0x866895[_0x7fb5('0x2a')](0x194);}return _0x5d0d39;};}function handleError(_0x13446f,_0x236e55){_0x236e55=_0x236e55||0x1f4;return function(_0xb93000){logger[_0x7fb5('0x26')](_0xb93000['stack']);if(_0xb93000[_0x7fb5('0x39')]){delete _0xb93000[_0x7fb5('0x39')];}_0x13446f[_0x7fb5('0x38')](_0x236e55)[_0x7fb5('0x3a')](_0xb93000);};}exports[_0x7fb5('0x3b')]=function(_0x583f7d,_0x48b09e){var _0x1da6aa={},_0x1ca2e3={},_0x5bcb66={'count':0x0,'rows':[]};var _0x37efd4=_[_0x7fb5('0x3c')](db[_0x7fb5('0x3d')][_0x7fb5('0x3e')],function(_0x425ef8){return{'name':_0x425ef8[_0x7fb5('0x3f')],'type':_0x425ef8['type'][_0x7fb5('0x40')]};});_0x1ca2e3['model']=_[_0x7fb5('0x3c')](_0x37efd4,_0x7fb5('0x39'));_0x1ca2e3[_0x7fb5('0x41')]=_[_0x7fb5('0x42')](_0x583f7d[_0x7fb5('0x41')]);_0x1ca2e3[_0x7fb5('0x43')]=_[_0x7fb5('0x44')](_0x1ca2e3['model'],_0x1ca2e3[_0x7fb5('0x41')]);_0x1da6aa[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0x1ca2e3[_0x7fb5('0x46')],qs[_0x7fb5('0x47')](_0x583f7d[_0x7fb5('0x41')][_0x7fb5('0x47')]));_0x1da6aa[_0x7fb5('0x45')]=_0x1da6aa[_0x7fb5('0x45')]['length']?_0x1da6aa[_0x7fb5('0x45')]:_0x1ca2e3[_0x7fb5('0x46')];if(!_0x583f7d['query'][_0x7fb5('0x48')](_0x7fb5('0x49'))){_0x1da6aa[_0x7fb5('0x2f')]=qs[_0x7fb5('0x2f')](_0x583f7d['query']['limit']);_0x1da6aa[_0x7fb5('0x2d')]=qs[_0x7fb5('0x2d')](_0x583f7d['query']['offset']);}_0x1da6aa[_0x7fb5('0x4a')]=qs[_0x7fb5('0x4b')](_0x583f7d[_0x7fb5('0x41')][_0x7fb5('0x4b')]);_0x1da6aa[_0x7fb5('0x4c')]=qs[_0x7fb5('0x43')](_[_0x7fb5('0x4d')](_0x583f7d[_0x7fb5('0x41')],_0x1ca2e3['filters']),_0x37efd4);if(_0x583f7d[_0x7fb5('0x41')][_0x7fb5('0x4e')]){_0x1da6aa[_0x7fb5('0x4c')]=_[_0x7fb5('0x4f')](_0x1da6aa[_0x7fb5('0x4c')],{'$or':_[_0x7fb5('0x3c')](_0x37efd4,function(_0x377839){if(_0x377839[_0x7fb5('0x50')]!==_0x7fb5('0x51')){var _0x48f18f={};_0x48f18f[_0x377839[_0x7fb5('0x39')]]={'$like':'%'+_0x583f7d['query'][_0x7fb5('0x4e')]+'%'};return _0x48f18f;}})});}_0x1da6aa=_[_0x7fb5('0x4f')]({},_0x1da6aa,_0x583f7d[_0x7fb5('0x52')]);var _0x33ed36={'where':_0x1da6aa['where']};return db['ChatQueue'][_0x7fb5('0x53')](_0x33ed36)[_0x7fb5('0x20')](function(_0x367dde){_0x5bcb66[_0x7fb5('0x53')]=_0x367dde;if(_0x583f7d['query'][_0x7fb5('0x54')]){_0x1da6aa[_0x7fb5('0x55')]=[{'all':!![]}];}return db['ChatQueue'][_0x7fb5('0x56')](_0x1da6aa);})[_0x7fb5('0x20')](function(_0x53070f){_0x5bcb66['rows']=_0x53070f;return _0x5bcb66;})['then'](respondWithFilteredResult(_0x48b09e,_0x1da6aa))['catch'](handleError(_0x48b09e,null));};exports[_0x7fb5('0x57')]=function(_0xdc2775,_0xf32f5a){var _0x381607={'raw':!![],'where':{'id':_0xdc2775[_0x7fb5('0x58')]['id']}},_0x42a00e={};_0x42a00e[_0x7fb5('0x46')]=_[_0x7fb5('0x42')](db[_0x7fb5('0x3d')][_0x7fb5('0x3e')]);_0x42a00e[_0x7fb5('0x41')]=_['keys'](_0xdc2775[_0x7fb5('0x41')]);_0x42a00e[_0x7fb5('0x43')]=_[_0x7fb5('0x44')](_0x42a00e[_0x7fb5('0x46')],_0x42a00e[_0x7fb5('0x41')]);_0x381607[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0x42a00e[_0x7fb5('0x46')],qs[_0x7fb5('0x47')](_0xdc2775[_0x7fb5('0x41')][_0x7fb5('0x47')]));_0x381607[_0x7fb5('0x45')]=_0x381607[_0x7fb5('0x45')][_0x7fb5('0x59')]?_0x381607[_0x7fb5('0x45')]:_0x42a00e[_0x7fb5('0x46')];if(_0xdc2775[_0x7fb5('0x41')][_0x7fb5('0x54')]){_0x381607[_0x7fb5('0x55')]=[{'all':!![]}];}_0x381607=_['merge']({},_0x381607,_0xdc2775[_0x7fb5('0x52')]);return db[_0x7fb5('0x3d')][_0x7fb5('0x5a')](_0x381607)[_0x7fb5('0x20')](handleEntityNotFound(_0xf32f5a,null))[_0x7fb5('0x20')](respondWithResult(_0xf32f5a,null))[_0x7fb5('0x29')](handleError(_0xf32f5a,null));};exports[_0x7fb5('0x5b')]=function(_0x2c4c8b,_0x3c8449){return db[_0x7fb5('0x3d')][_0x7fb5('0x5b')](_0x2c4c8b[_0x7fb5('0x5c')],{})[_0x7fb5('0x20')](function(_0x41b386){var _0x9db8e5=_0x2c4c8b[_0x7fb5('0x5d')]['get']({'plain':!![]});if(!_0x9db8e5)throw new Error(_0x7fb5('0x5e'));if(_0x9db8e5[_0x7fb5('0x5f')]===_0x7fb5('0x5d')){var _0x166ef6=_0x41b386[_0x7fb5('0x60')]({'plain':!![]});var _0x5c9d83=_0x7fb5('0x36');return db[_0x7fb5('0x61')][_0x7fb5('0x5a')]({'where':{'name':_0x5c9d83,'userProfileId':_0x9db8e5['userProfileId']},'raw':!![]})[_0x7fb5('0x20')](function(_0x4def82){if(_0x4def82&&_0x4def82[_0x7fb5('0x62')]===0x0){return db['UserProfileResource'][_0x7fb5('0x5b')]({'name':_0x166ef6[_0x7fb5('0x39')],'resourceId':_0x166ef6['id'],'type':_0x4def82['name'],'sectionId':_0x4def82['id']},{})[_0x7fb5('0x20')](function(){return _0x41b386;});}else{return _0x41b386;}})['catch'](function(_0x44cd72){logger[_0x7fb5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44cd72);throw _0x44cd72;});}return _0x41b386;})[_0x7fb5('0x20')](respondWithResult(_0x3c8449,0xc9))[_0x7fb5('0x29')](handleError(_0x3c8449,null));};exports[_0x7fb5('0x35')]=function(_0x6d6b41,_0x7dee4b){if(_0x6d6b41['body']['id']){delete _0x6d6b41[_0x7fb5('0x5c')]['id'];}return db[_0x7fb5('0x3d')]['find']({'where':{'id':_0x6d6b41[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x7dee4b,null))['then'](saveUpdates(_0x6d6b41[_0x7fb5('0x5c')],null))[_0x7fb5('0x20')](respondWithResult(_0x7dee4b,null))['catch'](handleError(_0x7dee4b,null));};exports[_0x7fb5('0x63')]=function(_0x359166,_0x100660){return db[_0x7fb5('0x3d')][_0x7fb5('0x5a')]({'where':{'id':_0x359166['params']['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x100660,null))[_0x7fb5('0x20')](removeEntity(_0x100660,null))[_0x7fb5('0x29')](handleError(_0x100660,null));};exports[_0x7fb5('0x64')]=function(_0x55a8dd,_0x395e31){return db[_0x7fb5('0x3d')]['describe']()[_0x7fb5('0x20')](respondWithResult(_0x395e31,null))[_0x7fb5('0x29')](handleError(_0x395e31,null));};exports[_0x7fb5('0x65')]=function(_0x2fbf79,_0x12e6a5,_0x460e12){var _0x167620={'raw':!![],'where':{}},_0x294cdd={},_0x403dc5;return db[_0x7fb5('0x3d')][_0x7fb5('0x66')]({'where':{'id':_0x2fbf79['params']['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x12e6a5,null))[_0x7fb5('0x20')](function(_0x4341b1){if(_0x4341b1){_0x403dc5=_0x4341b1['get']({'plain':!![]});_0x294cdd[_0x7fb5('0x46')]=_['keys'](db[_0x7fb5('0x67')][_0x7fb5('0x3e')]);_0x294cdd['query']=_['keys'](_0x2fbf79[_0x7fb5('0x41')]);_0x294cdd[_0x7fb5('0x43')]=_['intersection'](_0x294cdd['model'],_0x294cdd[_0x7fb5('0x41')]);_0x167620[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0x294cdd[_0x7fb5('0x46')],qs[_0x7fb5('0x47')](_0x2fbf79[_0x7fb5('0x41')][_0x7fb5('0x47')]));_0x167620[_0x7fb5('0x45')]=_0x167620[_0x7fb5('0x45')][_0x7fb5('0x59')]?_0x167620['attributes']:_0x294cdd['model'];if(!_0x2fbf79['query'][_0x7fb5('0x48')](_0x7fb5('0x49'))){_0x167620[_0x7fb5('0x2f')]=qs['limit'](_0x2fbf79['query'][_0x7fb5('0x2f')]);_0x167620[_0x7fb5('0x2d')]=qs[_0x7fb5('0x2d')](_0x2fbf79[_0x7fb5('0x41')]['offset']);}_0x167620[_0x7fb5('0x4a')]=qs[_0x7fb5('0x4b')](_0x2fbf79['query'][_0x7fb5('0x4b')]);_0x167620['where']=qs[_0x7fb5('0x43')](_['pick'](_0x2fbf79[_0x7fb5('0x41')],_0x294cdd['filters']));_0x167620[_0x7fb5('0x4c')]['ChatQueueId']=_0x4341b1['id'];if(_0x2fbf79[_0x7fb5('0x41')][_0x7fb5('0x4e')]){_0x167620[_0x7fb5('0x4c')]=_[_0x7fb5('0x4f')](_0x167620[_0x7fb5('0x4c')],{'$or':_['map'](_0x167620[_0x7fb5('0x45')],function(_0x2ff327){var _0x10ac8b={};_0x10ac8b[_0x2ff327]={'$like':'%'+_0x2fbf79[_0x7fb5('0x41')]['filter']+'%'};return _0x10ac8b;})});}_0x167620=_['merge']({},_0x167620,_0x2fbf79[_0x7fb5('0x52')]);return db['UserChatQueue'][_0x7fb5('0x56')](_0x167620);}})[_0x7fb5('0x20')](function(_0x15e7ab){if(_0x15e7ab){return db[_0x7fb5('0x68')]['findAndCountAll']({'where':{'id':_[_0x7fb5('0x3c')](_0x15e7ab,_0x7fb5('0x69')),'role':_0x7fb5('0x6a')},'attributes':['id',_0x7fb5('0x39'),_0x7fb5('0x6b'),'updatedAt',_0x7fb5('0x6c')]});}})['then'](function(_0x5e9bfb){if(_0x5e9bfb){return{'count':_0x5e9bfb[_0x7fb5('0x53')],'rows':_['map'](_0x5e9bfb['rows'],function(_0x313e49){return{'membername':_0x313e49[_0x7fb5('0x39')],'UserId':_0x313e49['id'],'queue_name':_0x403dc5[_0x7fb5('0x39')],'ChatQueueId':_0x403dc5['id'],'interface':util[_0x7fb5('0x6d')](_0x7fb5('0x6e'),_0x7fb5('0x6f'),_0x313e49[_0x7fb5('0x39')]),'penalty':0x0,'paused':_0x313e49[_0x7fb5('0x6b')],'createdAt':_0x313e49[_0x7fb5('0x6c')],'updatedAt':_0x313e49[_0x7fb5('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x12e6a5,_0x167620))[_0x7fb5('0x29')](handleError(_0x12e6a5,null));};exports['getTeams']=function(_0x3d5b22,_0x402855,_0x55853f){var _0x5c058a={};var _0x4caad3={};var _0xc1f352;var _0x1da22f;return db[_0x7fb5('0x3d')]['findOne']({'where':{'id':_0x3d5b22[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x402855,null))[_0x7fb5('0x20')](function(_0x278ea6){if(_0x278ea6){_0xc1f352=_0x278ea6;_0x4caad3[_0x7fb5('0x46')]=_[_0x7fb5('0x42')](db['Team'][_0x7fb5('0x3e')]);_0x4caad3[_0x7fb5('0x41')]=_['keys'](_0x3d5b22[_0x7fb5('0x41')]);_0x4caad3[_0x7fb5('0x43')]=_[_0x7fb5('0x44')](_0x4caad3[_0x7fb5('0x46')],_0x4caad3[_0x7fb5('0x41')]);_0x5c058a[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0x4caad3['model'],qs['fields'](_0x3d5b22['query'][_0x7fb5('0x47')]));_0x5c058a['attributes']=_0x5c058a[_0x7fb5('0x45')]['length']?_0x5c058a[_0x7fb5('0x45')]:_0x4caad3['model'];_0x5c058a[_0x7fb5('0x4a')]=qs[_0x7fb5('0x4b')](_0x3d5b22[_0x7fb5('0x41')]['sort']);_0x5c058a[_0x7fb5('0x4c')]=qs[_0x7fb5('0x43')](_[_0x7fb5('0x4d')](_0x3d5b22[_0x7fb5('0x41')],_0x4caad3[_0x7fb5('0x43')]));if(_0x3d5b22['query']['filter']){_0x5c058a['where']=_[_0x7fb5('0x4f')](_0x5c058a[_0x7fb5('0x4c')],{'$or':_[_0x7fb5('0x3c')](_0x5c058a['attributes'],function(_0x466b87){var _0x232506={};_0x232506[_0x466b87]={'$like':'%'+_0x3d5b22[_0x7fb5('0x41')][_0x7fb5('0x4e')]+'%'};return _0x232506;})});}_0x5c058a=_['merge']({},_0x5c058a,_0x3d5b22[_0x7fb5('0x52')]);return _0xc1f352['getTeams'](_0x5c058a);}})[_0x7fb5('0x20')](function(_0x119fac){if(_0x119fac){_0x1da22f=_0x119fac[_0x7fb5('0x59')];if(!_0x3d5b22[_0x7fb5('0x41')][_0x7fb5('0x48')](_0x7fb5('0x49'))){_0x5c058a['limit']=qs[_0x7fb5('0x2f')](_0x3d5b22[_0x7fb5('0x41')]['limit']);_0x5c058a['offset']=qs[_0x7fb5('0x2d')](_0x3d5b22['query'][_0x7fb5('0x2d')]);}return _0xc1f352[_0x7fb5('0x71')](_0x5c058a);}})[_0x7fb5('0x20')](function(_0x4f448b){if(_0x4f448b){return _0x4f448b?{'count':_0x1da22f,'rows':_0x4f448b}:null;}})[_0x7fb5('0x20')](respondWithResult(_0x402855,null))[_0x7fb5('0x29')](handleError(_0x402855,null));};exports['addTeams']=function(_0x2adbeb,_0x29698e,_0x570d29){var _0x527ef6=_0x2adbeb['body'][_0x7fb5('0x72')];return db[_0x7fb5('0x73')]['findAll']({'where':{'id':_0x527ef6},'attributes':['id'],'include':[{'model':db[_0x7fb5('0x68')],'as':_0x7fb5('0x74'),'attributes':['id','name',_0x7fb5('0x75'),_0x7fb5('0x76'),_0x7fb5('0x77')],'raw':!![]}]})[_0x7fb5('0x20')](function(_0x20fdfc){if(_0x20fdfc){var _0x2ebd58=_[_0x7fb5('0x78')](_0x20fdfc,function(_0x48576c){var _0x398eef=_0x48576c['get']({'plain':!![]});return _0x398eef[_0x7fb5('0x74')];});return db[_0x7fb5('0x3d')]['find']({'where':{'id':_0x2adbeb[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](function(_0x3c66ad){return db[_0x7fb5('0x79')]['transaction'](function(_0x311fa2){return _0x3c66ad['addTeams'](_0x527ef6,{'transaction':_0x311fa2})[_0x7fb5('0x20')](function(){return BPromise[_0x7fb5('0x7a')](_0x2ebd58,function(_0x159d6e){return db[_0x7fb5('0x67')][_0x7fb5('0x7b')]({'where':{'UserId':_0x159d6e['id'],'ChatQueueId':_0x2adbeb[_0x7fb5('0x58')]['id']},'transaction':_0x311fa2});});})[_0x7fb5('0x20')](function(){_0x2ebd58[_0x7fb5('0x7c')](function(_0x5b4775){socket[_0x7fb5('0x7d')]('userChatQueue:save',{'UserId':_0x5b4775['id'],'ChatQueueId':_0x3c66ad['id']});});});});});}})[_0x7fb5('0x20')](respondWithStatusCode(_0x29698e,null))[_0x7fb5('0x29')](handleError(_0x29698e,null));};exports[_0x7fb5('0x7e')]=function(_0x450080,_0xeece0e,_0x77e71d){return db[_0x7fb5('0x73')]['findAll']({'where':{'id':_0x450080[_0x7fb5('0x41')][_0x7fb5('0x72')]},'attributes':['id'],'include':[{'model':db[_0x7fb5('0x68')],'as':_0x7fb5('0x74'),'attributes':['id'],'raw':!![]}]})[_0x7fb5('0x20')](handleEntityNotFound(_0xeece0e,null))[_0x7fb5('0x20')](function(_0x3ae8f5){var _0x56b43f=_['map'](_0x3ae8f5,'id');var _0x57902f=[];var _0x1fa6d9=[];var _0x19240c=squel[_0x7fb5('0x7f')]();_0x19240c[_0x7fb5('0x80')]('tq.TeamId')[_0x7fb5('0x81')](_0x7fb5('0x82'),'tq')['join']('user_has_teams','ut',_0x7fb5('0x83'))[_0x7fb5('0x4c')](_0x7fb5('0x84'),_0x450080[_0x7fb5('0x58')]['id']);for(var _0x405fdc=0x0;_0x405fdc<_0x3ae8f5[_0x7fb5('0x59')];_0x405fdc+=0x1){let _0xb88478=_0x3ae8f5[_0x405fdc];for(var _0x49eb17=0x0;_0x49eb17<_0xb88478[_0x7fb5('0x74')][_0x7fb5('0x59')];_0x49eb17+=0x1){let _0x22a242=_0xb88478[_0x7fb5('0x74')][_0x49eb17];var _0x509584=_0x19240c[_0x7fb5('0x85')]();_0x509584[_0x7fb5('0x4c')](_0x7fb5('0x86'),_0x22a242['id']);_0x1fa6d9[_0x7fb5('0x87')](db[_0x7fb5('0x79')][_0x7fb5('0x41')](_0x509584['toString'](),{'type':db['sequelize'][_0x7fb5('0x88')]['SELECT']})[_0x7fb5('0x20')](function(_0x465a9a){if(_0x465a9a['length']===0x1){return _0x22a242['id'];}else{var _0xcddba8=_[_0x7fb5('0x89')](_['map'](_0x465a9a,_0x7fb5('0x8a')),function(_0x2fdbd3){return _[_0x7fb5('0x8b')](_0x56b43f,_0x2fdbd3);});if(_0xcddba8){return _0x22a242['id'];}}}));}}return BPromise[_0x7fb5('0x8c')](_0x1fa6d9)['then'](function(_0x136560){_0x57902f=_(_0x57902f)['union'](_0x136560)[_0x7fb5('0x8d')]()[_0x7fb5('0x8e')]();return db[_0x7fb5('0x3d')]['find']({'where':{'id':_0x450080[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](function(_0x38eb17){return db[_0x7fb5('0x79')][_0x7fb5('0x8f')](function(_0x22553f){return _0x38eb17[_0x7fb5('0x7e')](_0x450080['query'][_0x7fb5('0x72')],{'transaction':_0x22553f})[_0x7fb5('0x20')](function(){if(!_[_0x7fb5('0x90')](_0x57902f)){return _0x38eb17[_0x7fb5('0x91')](_0x57902f,{'transaction':_0x22553f});}})[_0x7fb5('0x20')](function(){_0x57902f[_0x7fb5('0x7c')](function(_0x4d78d7){socket[_0x7fb5('0x7d')](_0x7fb5('0x92'),{'UserId':_0x4d78d7,'ChatQueueId':_0x38eb17['id']});});});});});});})[_0x7fb5('0x20')](respondWithStatusCode(_0xeece0e,null))['catch'](handleError(_0xeece0e,null));};exports[_0x7fb5('0x93')]=function(_0x2bfbd0,_0xc08a5a,_0x806dee){return db[_0x7fb5('0x3d')][_0x7fb5('0x5a')]({'where':{'id':_0x2bfbd0[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0xc08a5a,null))[_0x7fb5('0x20')](function(_0x395462){if(_0x395462){return _0x395462[_0x7fb5('0x93')](_0x2bfbd0[_0x7fb5('0x5c')]['ids'],_['omit'](_0x2bfbd0['body'],['ids','id'])||{})[_0x7fb5('0x94')](function(_0x3bc4ec){for(var _0x4812c8=0x0;_0x4812c8<_0x2bfbd0[_0x7fb5('0x5c')]['ids'][_0x7fb5('0x59')];_0x4812c8+=0x1){socket['emit'](_0x7fb5('0x95'),{'UserId':Number(_0x2bfbd0[_0x7fb5('0x5c')][_0x7fb5('0x72')][_0x4812c8]),'ChatQueueId':Number(_0x2bfbd0[_0x7fb5('0x58')]['id'])});}return _0x3bc4ec;});}})[_0x7fb5('0x20')](respondWithResult(_0xc08a5a,null))[_0x7fb5('0x29')](handleError(_0xc08a5a,null));};exports[_0x7fb5('0x91')]=function(_0x5dc5eb,_0x42cdf0,_0x52103a){return db[_0x7fb5('0x3d')]['find']({'where':{'id':_0x5dc5eb[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x42cdf0,null))[_0x7fb5('0x20')](function(_0x1b1222){if(_0x1b1222){return _0x1b1222['removeAgents'](_0x5dc5eb[_0x7fb5('0x41')][_0x7fb5('0x72')])[_0x7fb5('0x20')](function(){if(_['isArray'](_0x5dc5eb[_0x7fb5('0x41')][_0x7fb5('0x72')])){for(var _0x4596d2=0x0;_0x4596d2<_0x5dc5eb[_0x7fb5('0x41')]['ids'][_0x7fb5('0x59')];_0x4596d2+=0x1){socket['emit'](_0x7fb5('0x92'),{'UserId':Number(_0x5dc5eb[_0x7fb5('0x41')][_0x7fb5('0x72')][_0x4596d2]),'ChatQueueId':Number(_0x5dc5eb[_0x7fb5('0x58')]['id'])});}}else{socket[_0x7fb5('0x7d')](_0x7fb5('0x92'),{'UserId':Number(_0x5dc5eb[_0x7fb5('0x41')][_0x7fb5('0x72')]),'ChatQueueId':Number(_0x5dc5eb['params']['id'])});}});}})[_0x7fb5('0x20')](respondWithStatusCode(_0x42cdf0,null))['catch'](handleError(_0x42cdf0,null));};exports[_0x7fb5('0x96')]=function(_0x2fa0b1,_0x2d0fed,_0x25496c){var _0x12fbab={};var _0xdaf336={};var _0x545da5;var _0x173461;return db[_0x7fb5('0x3d')]['findOne']({'where':{'id':_0x2fa0b1[_0x7fb5('0x58')]['id']}})[_0x7fb5('0x20')](handleEntityNotFound(_0x2d0fed,null))[_0x7fb5('0x20')](function(_0x3afc9f){if(_0x3afc9f){_0x545da5=_0x3afc9f;_0xdaf336[_0x7fb5('0x46')]=_[_0x7fb5('0x42')](db[_0x7fb5('0x68')]['rawAttributes']);_0xdaf336[_0x7fb5('0x41')]=_['keys'](_0x2fa0b1[_0x7fb5('0x41')]);_0xdaf336['filters']=_[_0x7fb5('0x44')](_0xdaf336['model'],_0xdaf336[_0x7fb5('0x41')]);_0x12fbab[_0x7fb5('0x45')]=_[_0x7fb5('0x44')](_0xdaf336[_0x7fb5('0x46')],qs[_0x7fb5('0x47')](_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x47')]));_0x12fbab[_0x7fb5('0x45')]=_0x12fbab['attributes'][_0x7fb5('0x59')]?_0x12fbab[_0x7fb5('0x45')]:_0xdaf336[_0x7fb5('0x46')];_0x12fbab[_0x7fb5('0x4a')]=qs[_0x7fb5('0x4b')](_0x2fa0b1['query'][_0x7fb5('0x4b')]);_0x12fbab[_0x7fb5('0x4c')]=qs[_0x7fb5('0x43')](_['pick'](_0x2fa0b1[_0x7fb5('0x41')],_0xdaf336[_0x7fb5('0x43')]));if(_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x4e')]){_0x12fbab['where']=_[_0x7fb5('0x4f')](_0x12fbab['where'],{'$or':_[_0x7fb5('0x3c')](_0x12fbab[_0x7fb5('0x45')],function(_0x48839b){var _0x7b2fe4={};_0x7b2fe4[_0x48839b]={'$like':'%'+_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x4e')]+'%'};return _0x7b2fe4;})});}_0x12fbab=_[_0x7fb5('0x4f')]({},_0x12fbab,_0x2fa0b1['options']);return _0x545da5[_0x7fb5('0x96')](_0x12fbab);}})[_0x7fb5('0x20')](function(_0x21e60b){if(_0x21e60b){_0x173461=_0x21e60b[_0x7fb5('0x59')];if(!_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x48')](_0x7fb5('0x49'))){_0x12fbab['limit']=qs[_0x7fb5('0x2f')](_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x2f')]);_0x12fbab[_0x7fb5('0x2d')]=qs[_0x7fb5('0x2d')](_0x2fa0b1[_0x7fb5('0x41')][_0x7fb5('0x2d')]);}return _0x545da5['getAgents'](_0x12fbab);}})['then'](function(_0x507a6a){if(_0x507a6a){return _0x507a6a?{'count':_0x173461,'rows':_0x507a6a}:null;}})[_0x7fb5('0x20')](respondWithResult(_0x2d0fed,null))[_0x7fb5('0x29')](handleError(_0x2d0fed,null));};
\ No newline at end of file
+var _0xdcfe=['../../config/license/util','../../mysqldb','redis','defaults','localhost','./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','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','ChatQueues','UserProfileResource','destroy','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','UserId','agent','chatPause','createdAt','format','%s/%s','getTeams','Team','ids','Agents','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','all','compact','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x5053c0,_0x243534){var _0x340f24=function(_0x5ad9b5){while(--_0x5ad9b5){_0x5053c0['push'](_0x5053c0['shift']());}};_0x340f24(++_0x243534);}(_0xdcfe,0x10f));var _0xedcf=function(_0x13a144,_0x56f897){_0x13a144=_0x13a144-0x0;var _0x201d3b=_0xdcfe[_0x13a144];return _0x201d3b;};'use strict';var emlformat=require(_0xedcf('0x0'));var rimraf=require(_0xedcf('0x1'));var zipdir=require(_0xedcf('0x2'));var jsonpatch=require(_0xedcf('0x3'));var rp=require(_0xedcf('0x4'));var moment=require(_0xedcf('0x5'));var BPromise=require(_0xedcf('0x6'));var Mustache=require(_0xedcf('0x7'));var util=require(_0xedcf('0x8'));var path=require(_0xedcf('0x9'));var sox=require(_0xedcf('0xa'));var csv=require('to-csv');var ejs=require(_0xedcf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedcf('0xc'));var squel=require('squel');var crypto=require(_0xedcf('0xd'));var jsforce=require(_0xedcf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xedcf('0xf'));var querystring=require(_0xedcf('0x10'));var Papa=require(_0xedcf('0x11'));var Redis=require(_0xedcf('0x12'));var authService=require(_0xedcf('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xedcf('0x14'));var hardwareService=require(_0xedcf('0x15'));var logger=require(_0xedcf('0x16'))(_0xedcf('0x17'));var utils=require('../../config/utils');var config=require(_0xedcf('0x18'));var licenseUtil=require(_0xedcf('0x19'));var db=require(_0xedcf('0x1a'))['db'];config[_0xedcf('0x1b')]=_[_0xedcf('0x1c')](config['redis'],{'host':_0xedcf('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedcf('0x1b')]));require(_0xedcf('0x1e'))['register'](socket);var jayson=require(_0xedcf('0x1f'));var client=jayson[_0xedcf('0x20')][_0xedcf('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x415130,_0x259cc3,_0x31797f,_0x14f5c8){return new BPromise(function(_0x52a347,_0xc1a093){var _0x4a0608=_0x14f5c8||client;return _0x4a0608[_0xedcf('0x22')](_0x415130,_0x31797f)[_0xedcf('0x23')](function(_0x486ec6){logger[_0xedcf('0x24')](_0xedcf('0x25'),_0x259cc3,_0xedcf('0x26'));logger[_0xedcf('0x27')](_0xedcf('0x28'),_0x259cc3,_0xedcf('0x26'),JSON[_0xedcf('0x29')](_0x486ec6));if(_0x486ec6[_0xedcf('0x2a')]){if(_0x486ec6[_0xedcf('0x2a')][_0xedcf('0x2b')]===0x1f4){logger[_0xedcf('0x2a')](_0xedcf('0x25'),_0x259cc3,_0x486ec6[_0xedcf('0x2a')][_0xedcf('0x2c')]);return _0xc1a093(_0x486ec6[_0xedcf('0x2a')][_0xedcf('0x2c')]);}logger[_0xedcf('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x259cc3,_0x486ec6[_0xedcf('0x2a')]['message']);return _0x52a347(_0x486ec6[_0xedcf('0x2a')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x259cc3,_0xedcf('0x26'));_0x52a347(_0x486ec6['result'][_0xedcf('0x2c')]);}})['catch'](function(_0x56f2ad){logger[_0xedcf('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x259cc3,_0x56f2ad);_0xc1a093(_0x56f2ad);});});}function respondWithStatusCode(_0x5474b9,_0x19f5b6){_0x19f5b6=_0x19f5b6||0xcc;return function(_0x4acdfd){if(_0x4acdfd){return _0x5474b9[_0xedcf('0x2d')](_0x19f5b6);}return _0x5474b9[_0xedcf('0x2e')](_0x19f5b6)[_0xedcf('0x2f')]();};}function respondWithResult(_0x6df240,_0x192c64){_0x192c64=_0x192c64||0xc8;return function(_0x31bab5){if(_0x31bab5){return _0x6df240[_0xedcf('0x2e')](_0x192c64)['json'](_0x31bab5);}};}function respondWithFilteredResult(_0x2cd776,_0x258037){return function(_0x406173){if(_0x406173){var _0x56a4c4=typeof _0x258037['offset']===_0xedcf('0x30')&&typeof _0x258037[_0xedcf('0x31')]===_0xedcf('0x30');var _0x425453=_0x406173[_0xedcf('0x32')];var _0x2d8d85=_0x56a4c4?0x0:_0x258037[_0xedcf('0x33')];var _0xf5b12c=_0x56a4c4?_0x406173['count']:_0x258037[_0xedcf('0x33')]+_0x258037[_0xedcf('0x31')];var _0x32260b;if(_0xf5b12c>=_0x425453){_0xf5b12c=_0x425453;_0x32260b=0xc8;}else{_0x32260b=0xce;}_0x2cd776[_0xedcf('0x2e')](_0x32260b);return _0x2cd776[_0xedcf('0x34')]('Content-Range',_0x2d8d85+'-'+_0xf5b12c+'/'+_0x425453)[_0xedcf('0x35')](_0x406173);}return null;};}function patchUpdates(_0x3ca322){return function(_0xdcbde5){try{jsonpatch[_0xedcf('0x36')](_0xdcbde5,_0x3ca322,!![]);}catch(_0x8ad0d8){return BPromise[_0xedcf('0x37')](_0x8ad0d8);}return _0xdcbde5[_0xedcf('0x38')]();};}function saveUpdates(_0x43052e,_0x20cc06){return function(_0x4a8b60){if(_0x4a8b60){return _0x4a8b60[_0xedcf('0x39')](_0x43052e)[_0xedcf('0x23')](function(_0x20cbca){return _0x20cbca;});}return null;};}function removeEntity(_0x4dace7,_0x2aed3a){return function(_0x2f53e3){if(_0x2f53e3){return _0x2f53e3['destroy']()[_0xedcf('0x23')](function(){var _0x542ac7=_0x2f53e3['get']({'plain':!![]});var _0xd0be89=_0xedcf('0x3a');return db[_0xedcf('0x3b')][_0xedcf('0x3c')]({'where':{'type':_0xd0be89,'resourceId':_0x542ac7['id']}})[_0xedcf('0x23')](function(){return _0x2f53e3;});})[_0xedcf('0x23')](function(){_0x4dace7[_0xedcf('0x2e')](0xcc)[_0xedcf('0x2f')]();});}};}function handleEntityNotFound(_0x36b6eb,_0x5a83f1){return function(_0xc6340e){if(!_0xc6340e){_0x36b6eb[_0xedcf('0x2d')](0x194);}return _0xc6340e;};}function handleError(_0x5b5d8e,_0x24db41){_0x24db41=_0x24db41||0x1f4;return function(_0x1a3f80){logger[_0xedcf('0x2a')](_0x1a3f80[_0xedcf('0x3d')]);if(_0x1a3f80[_0xedcf('0x3e')]){delete _0x1a3f80['name'];}_0x5b5d8e['status'](_0x24db41)[_0xedcf('0x3f')](_0x1a3f80);};}exports['index']=function(_0x35d369,_0x57d6c3){var _0x459c6f={},_0x30029d={},_0x25dc1f={'count':0x0,'rows':[]};var _0xa258f6=_[_0xedcf('0x40')](db[_0xedcf('0x41')][_0xedcf('0x42')],function(_0x2b257e){return{'name':_0x2b257e[_0xedcf('0x43')],'type':_0x2b257e[_0xedcf('0x44')]['key']};});_0x30029d[_0xedcf('0x45')]=_['map'](_0xa258f6,'name');_0x30029d[_0xedcf('0x46')]=_[_0xedcf('0x47')](_0x35d369[_0xedcf('0x46')]);_0x30029d['filters']=_[_0xedcf('0x48')](_0x30029d[_0xedcf('0x45')],_0x30029d[_0xedcf('0x46')]);_0x459c6f[_0xedcf('0x49')]=_['intersection'](_0x30029d[_0xedcf('0x45')],qs[_0xedcf('0x4a')](_0x35d369[_0xedcf('0x46')][_0xedcf('0x4a')]));_0x459c6f[_0xedcf('0x49')]=_0x459c6f[_0xedcf('0x49')][_0xedcf('0x4b')]?_0x459c6f['attributes']:_0x30029d[_0xedcf('0x45')];if(!_0x35d369['query'][_0xedcf('0x4c')]('nolimit')){_0x459c6f[_0xedcf('0x31')]=qs[_0xedcf('0x31')](_0x35d369[_0xedcf('0x46')][_0xedcf('0x31')]);_0x459c6f[_0xedcf('0x33')]=qs[_0xedcf('0x33')](_0x35d369[_0xedcf('0x46')][_0xedcf('0x33')]);}_0x459c6f[_0xedcf('0x4d')]=qs[_0xedcf('0x4e')](_0x35d369[_0xedcf('0x46')][_0xedcf('0x4e')]);_0x459c6f[_0xedcf('0x4f')]=qs[_0xedcf('0x50')](_[_0xedcf('0x51')](_0x35d369['query'],_0x30029d[_0xedcf('0x50')]),_0xa258f6);if(_0x35d369[_0xedcf('0x46')][_0xedcf('0x52')]){_0x459c6f[_0xedcf('0x4f')]=_[_0xedcf('0x53')](_0x459c6f['where'],{'$or':_[_0xedcf('0x40')](_0xa258f6,function(_0x2acced){if(_0x2acced[_0xedcf('0x44')]!==_0xedcf('0x54')){var _0x4ab48c={};_0x4ab48c[_0x2acced['name']]={'$like':'%'+_0x35d369['query'][_0xedcf('0x52')]+'%'};return _0x4ab48c;}})});}_0x459c6f=_[_0xedcf('0x53')]({},_0x459c6f,_0x35d369[_0xedcf('0x55')]);var _0x85cae1={'where':_0x459c6f[_0xedcf('0x4f')]};return db[_0xedcf('0x41')][_0xedcf('0x32')](_0x85cae1)['then'](function(_0xb4ed6d){_0x25dc1f[_0xedcf('0x32')]=_0xb4ed6d;if(_0x35d369['query'][_0xedcf('0x56')]){_0x459c6f['include']=[{'all':!![]}];}return db[_0xedcf('0x41')][_0xedcf('0x57')](_0x459c6f);})[_0xedcf('0x23')](function(_0x57188d){_0x25dc1f[_0xedcf('0x58')]=_0x57188d;return _0x25dc1f;})['then'](respondWithFilteredResult(_0x57d6c3,_0x459c6f))[_0xedcf('0x59')](handleError(_0x57d6c3,null));};exports[_0xedcf('0x5a')]=function(_0x587062,_0x183579){var _0x37865e={'raw':!![],'where':{'id':_0x587062['params']['id']}},_0x300cb2={};_0x300cb2[_0xedcf('0x45')]=_['keys'](db[_0xedcf('0x41')][_0xedcf('0x42')]);_0x300cb2[_0xedcf('0x46')]=_[_0xedcf('0x47')](_0x587062[_0xedcf('0x46')]);_0x300cb2[_0xedcf('0x50')]=_[_0xedcf('0x48')](_0x300cb2[_0xedcf('0x45')],_0x300cb2[_0xedcf('0x46')]);_0x37865e['attributes']=_[_0xedcf('0x48')](_0x300cb2[_0xedcf('0x45')],qs[_0xedcf('0x4a')](_0x587062[_0xedcf('0x46')][_0xedcf('0x4a')]));_0x37865e[_0xedcf('0x49')]=_0x37865e[_0xedcf('0x49')]['length']?_0x37865e[_0xedcf('0x49')]:_0x300cb2['model'];if(_0x587062['query'][_0xedcf('0x56')]){_0x37865e[_0xedcf('0x5b')]=[{'all':!![]}];}_0x37865e=_[_0xedcf('0x53')]({},_0x37865e,_0x587062['options']);return db[_0xedcf('0x41')][_0xedcf('0x5c')](_0x37865e)[_0xedcf('0x23')](handleEntityNotFound(_0x183579,null))[_0xedcf('0x23')](respondWithResult(_0x183579,null))[_0xedcf('0x59')](handleError(_0x183579,null));};exports[_0xedcf('0x5d')]=function(_0x1be3e4,_0x1060e2){return db[_0xedcf('0x41')][_0xedcf('0x5d')](_0x1be3e4[_0xedcf('0x5e')],{})[_0xedcf('0x23')](function(_0x592d33){var _0x354ca3=_0x1be3e4[_0xedcf('0x5f')][_0xedcf('0x60')]({'plain':!![]});if(!_0x354ca3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x354ca3[_0xedcf('0x61')]==='user'){var _0x154688=_0x592d33[_0xedcf('0x60')]({'plain':!![]});var _0x1edc13='ChatQueues';return db['UserProfileSection'][_0xedcf('0x5c')]({'where':{'name':_0x1edc13,'userProfileId':_0x354ca3['userProfileId']},'raw':!![]})[_0xedcf('0x23')](function(_0x383cab){if(_0x383cab&&_0x383cab[_0xedcf('0x62')]===0x0){return db[_0xedcf('0x3b')][_0xedcf('0x5d')]({'name':_0x154688[_0xedcf('0x3e')],'resourceId':_0x154688['id'],'type':_0x383cab[_0xedcf('0x3e')],'sectionId':_0x383cab['id']},{})[_0xedcf('0x23')](function(){return _0x592d33;});}else{return _0x592d33;}})['catch'](function(_0x44b9b8){logger[_0xedcf('0x2a')](_0xedcf('0x63'),_0x44b9b8);throw _0x44b9b8;});}return _0x592d33;})[_0xedcf('0x23')](respondWithResult(_0x1060e2,0xc9))[_0xedcf('0x59')](handleError(_0x1060e2,null));};exports[_0xedcf('0x39')]=function(_0x5d441d,_0x1f7399){if(_0x5d441d[_0xedcf('0x5e')]['id']){delete _0x5d441d[_0xedcf('0x5e')]['id'];}return db[_0xedcf('0x41')][_0xedcf('0x5c')]({'where':{'id':_0x5d441d[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x1f7399,null))[_0xedcf('0x23')](saveUpdates(_0x5d441d['body'],null))[_0xedcf('0x23')](respondWithResult(_0x1f7399,null))['catch'](handleError(_0x1f7399,null));};exports['destroy']=function(_0x6d266f,_0x84d7e4){return db[_0xedcf('0x41')][_0xedcf('0x5c')]({'where':{'id':_0x6d266f[_0xedcf('0x64')]['id']}})['then'](handleEntityNotFound(_0x84d7e4,null))[_0xedcf('0x23')](removeEntity(_0x84d7e4,null))[_0xedcf('0x59')](handleError(_0x84d7e4,null));};exports[_0xedcf('0x65')]=function(_0xbb34f1,_0x378a87){return db[_0xedcf('0x41')][_0xedcf('0x65')]()[_0xedcf('0x23')](respondWithResult(_0x378a87,null))[_0xedcf('0x59')](handleError(_0x378a87,null));};exports[_0xedcf('0x66')]=function(_0x4873ab,_0x5ed679,_0x571c3a){var _0x16a1d8={'raw':!![],'where':{}},_0x10a725={},_0xcc6973;return db[_0xedcf('0x41')][_0xedcf('0x67')]({'where':{'id':_0x4873ab[_0xedcf('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ed679,null))[_0xedcf('0x23')](function(_0x62d9c7){if(_0x62d9c7){_0xcc6973=_0x62d9c7[_0xedcf('0x60')]({'plain':!![]});_0x10a725[_0xedcf('0x45')]=_[_0xedcf('0x47')](db[_0xedcf('0x68')]['rawAttributes']);_0x10a725[_0xedcf('0x46')]=_[_0xedcf('0x47')](_0x4873ab[_0xedcf('0x46')]);_0x10a725['filters']=_[_0xedcf('0x48')](_0x10a725[_0xedcf('0x45')],_0x10a725['query']);_0x16a1d8[_0xedcf('0x49')]=_['intersection'](_0x10a725[_0xedcf('0x45')],qs['fields'](_0x4873ab['query'][_0xedcf('0x4a')]));_0x16a1d8['attributes']=_0x16a1d8[_0xedcf('0x49')][_0xedcf('0x4b')]?_0x16a1d8['attributes']:_0x10a725['model'];if(!_0x4873ab[_0xedcf('0x46')]['hasOwnProperty'](_0xedcf('0x69'))){_0x16a1d8[_0xedcf('0x31')]=qs[_0xedcf('0x31')](_0x4873ab[_0xedcf('0x46')][_0xedcf('0x31')]);_0x16a1d8[_0xedcf('0x33')]=qs[_0xedcf('0x33')](_0x4873ab[_0xedcf('0x46')][_0xedcf('0x33')]);}_0x16a1d8[_0xedcf('0x4d')]=qs[_0xedcf('0x4e')](_0x4873ab['query'][_0xedcf('0x4e')]);_0x16a1d8[_0xedcf('0x4f')]=qs[_0xedcf('0x50')](_[_0xedcf('0x51')](_0x4873ab[_0xedcf('0x46')],_0x10a725[_0xedcf('0x50')]));_0x16a1d8['where'][_0xedcf('0x6a')]=_0x62d9c7['id'];if(_0x4873ab[_0xedcf('0x46')]['filter']){_0x16a1d8[_0xedcf('0x4f')]=_[_0xedcf('0x53')](_0x16a1d8['where'],{'$or':_[_0xedcf('0x40')](_0x16a1d8[_0xedcf('0x49')],function(_0x1699e8){var _0x335d38={};_0x335d38[_0x1699e8]={'$like':'%'+_0x4873ab[_0xedcf('0x46')][_0xedcf('0x52')]+'%'};return _0x335d38;})});}_0x16a1d8=_[_0xedcf('0x53')]({},_0x16a1d8,_0x4873ab[_0xedcf('0x55')]);return db['UserChatQueue'][_0xedcf('0x57')](_0x16a1d8);}})[_0xedcf('0x23')](function(_0x41e16c){if(_0x41e16c){return db[_0xedcf('0x6b')]['findAndCountAll']({'where':{'id':_[_0xedcf('0x40')](_0x41e16c,_0xedcf('0x6c')),'role':_0xedcf('0x6d')},'attributes':['id','name',_0xedcf('0x6e'),'updatedAt',_0xedcf('0x6f')]});}})[_0xedcf('0x23')](function(_0x16671c){if(_0x16671c){return{'count':_0x16671c[_0xedcf('0x32')],'rows':_[_0xedcf('0x40')](_0x16671c[_0xedcf('0x58')],function(_0x580d79){return{'membername':_0x580d79[_0xedcf('0x3e')],'UserId':_0x580d79['id'],'queue_name':_0xcc6973[_0xedcf('0x3e')],'ChatQueueId':_0xcc6973['id'],'interface':util[_0xedcf('0x70')](_0xedcf('0x71'),'SIP',_0x580d79[_0xedcf('0x3e')]),'penalty':0x0,'paused':_0x580d79['chatPause'],'createdAt':_0x580d79[_0xedcf('0x6f')],'updatedAt':_0x580d79['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xedcf('0x23')](respondWithFilteredResult(_0x5ed679,_0x16a1d8))[_0xedcf('0x59')](handleError(_0x5ed679,null));};exports[_0xedcf('0x72')]=function(_0x5a3cc9,_0x3fe188,_0x3d2fa1){var _0x3d34b2={};var _0x27a767={};var _0x249fcf;var _0x32bda6;return db[_0xedcf('0x41')]['findOne']({'where':{'id':_0x5a3cc9[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x3fe188,null))['then'](function(_0x3bd648){if(_0x3bd648){_0x249fcf=_0x3bd648;_0x27a767[_0xedcf('0x45')]=_[_0xedcf('0x47')](db[_0xedcf('0x73')][_0xedcf('0x42')]);_0x27a767[_0xedcf('0x46')]=_[_0xedcf('0x47')](_0x5a3cc9['query']);_0x27a767[_0xedcf('0x50')]=_[_0xedcf('0x48')](_0x27a767[_0xedcf('0x45')],_0x27a767[_0xedcf('0x46')]);_0x3d34b2[_0xedcf('0x49')]=_[_0xedcf('0x48')](_0x27a767[_0xedcf('0x45')],qs[_0xedcf('0x4a')](_0x5a3cc9[_0xedcf('0x46')][_0xedcf('0x4a')]));_0x3d34b2[_0xedcf('0x49')]=_0x3d34b2['attributes'][_0xedcf('0x4b')]?_0x3d34b2['attributes']:_0x27a767[_0xedcf('0x45')];_0x3d34b2[_0xedcf('0x4d')]=qs[_0xedcf('0x4e')](_0x5a3cc9[_0xedcf('0x46')]['sort']);_0x3d34b2[_0xedcf('0x4f')]=qs[_0xedcf('0x50')](_['pick'](_0x5a3cc9[_0xedcf('0x46')],_0x27a767[_0xedcf('0x50')]));if(_0x5a3cc9['query'][_0xedcf('0x52')]){_0x3d34b2[_0xedcf('0x4f')]=_[_0xedcf('0x53')](_0x3d34b2['where'],{'$or':_[_0xedcf('0x40')](_0x3d34b2[_0xedcf('0x49')],function(_0x4a3014){var _0x58ea81={};_0x58ea81[_0x4a3014]={'$like':'%'+_0x5a3cc9[_0xedcf('0x46')][_0xedcf('0x52')]+'%'};return _0x58ea81;})});}_0x3d34b2=_[_0xedcf('0x53')]({},_0x3d34b2,_0x5a3cc9[_0xedcf('0x55')]);return _0x249fcf[_0xedcf('0x72')](_0x3d34b2);}})[_0xedcf('0x23')](function(_0x5b4c00){if(_0x5b4c00){_0x32bda6=_0x5b4c00[_0xedcf('0x4b')];if(!_0x5a3cc9[_0xedcf('0x46')]['hasOwnProperty'](_0xedcf('0x69'))){_0x3d34b2[_0xedcf('0x31')]=qs['limit'](_0x5a3cc9['query'][_0xedcf('0x31')]);_0x3d34b2[_0xedcf('0x33')]=qs['offset'](_0x5a3cc9[_0xedcf('0x46')]['offset']);}return _0x249fcf[_0xedcf('0x72')](_0x3d34b2);}})[_0xedcf('0x23')](function(_0x2574c8){if(_0x2574c8){return _0x2574c8?{'count':_0x32bda6,'rows':_0x2574c8}:null;}})[_0xedcf('0x23')](respondWithResult(_0x3fe188,null))[_0xedcf('0x59')](handleError(_0x3fe188,null));};exports['addTeams']=function(_0x5d2b1c,_0x398b64,_0x3b4fb6){var _0x1751c3=_0x5d2b1c[_0xedcf('0x5e')][_0xedcf('0x74')];return db['Team'][_0xedcf('0x57')]({'where':{'id':_0x1751c3},'attributes':['id'],'include':[{'model':db[_0xedcf('0x6b')],'as':_0xedcf('0x75'),'attributes':['id','name','online',_0xedcf('0x76'),_0xedcf('0x77')],'raw':!![]}]})[_0xedcf('0x23')](function(_0x47bfe1){if(_0x47bfe1){var _0x22a436=_['flatMap'](_0x47bfe1,function(_0x3e3015){var _0x269469=_0x3e3015[_0xedcf('0x60')]({'plain':!![]});return _0x269469[_0xedcf('0x75')];});return db['ChatQueue'][_0xedcf('0x5c')]({'where':{'id':_0x5d2b1c[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](function(_0x3a3dc6){return db[_0xedcf('0x78')][_0xedcf('0x79')](function(_0x114df4){return _0x3a3dc6[_0xedcf('0x7a')](_0x1751c3,{'transaction':_0x114df4})['then'](function(){return BPromise['each'](_0x22a436,function(_0x157e38){return db['UserChatQueue'][_0xedcf('0x7b')]({'where':{'UserId':_0x157e38['id'],'ChatQueueId':_0x5d2b1c[_0xedcf('0x64')]['id']},'transaction':_0x114df4});});})[_0xedcf('0x23')](function(){_0x22a436[_0xedcf('0x7c')](function(_0x166c9a){socket[_0xedcf('0x7d')](_0xedcf('0x7e'),{'UserId':_0x166c9a['id'],'ChatQueueId':_0x3a3dc6['id']});});});});});}})[_0xedcf('0x23')](respondWithStatusCode(_0x398b64,null))['catch'](handleError(_0x398b64,null));};exports['removeTeams']=function(_0x30aa28,_0x20cb3b,_0x2ff87c){return db[_0xedcf('0x73')][_0xedcf('0x57')]({'where':{'id':_0x30aa28[_0xedcf('0x46')][_0xedcf('0x74')]},'attributes':['id'],'include':[{'model':db[_0xedcf('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xedcf('0x23')](handleEntityNotFound(_0x20cb3b,null))[_0xedcf('0x23')](function(_0x1a560a){var _0x130f7e=_[_0xedcf('0x40')](_0x1a560a,'id');var _0x25c462=[];var _0x366127=[];var _0x3d874f=squel[_0xedcf('0x7f')]();_0x3d874f[_0xedcf('0x80')](_0xedcf('0x81'))[_0xedcf('0x82')]('team_has_chat_queues','tq')[_0xedcf('0x83')](_0xedcf('0x84'),'ut',_0xedcf('0x85'))[_0xedcf('0x4f')]('ChatQueueId\x20=\x20?',_0x30aa28[_0xedcf('0x64')]['id']);for(var _0x2a5b54=0x0;_0x2a5b54<_0x1a560a[_0xedcf('0x4b')];_0x2a5b54+=0x1){let _0x501933=_0x1a560a[_0x2a5b54];for(var _0x2ab8fc=0x0;_0x2ab8fc<_0x501933[_0xedcf('0x75')][_0xedcf('0x4b')];_0x2ab8fc+=0x1){let _0x46b36d=_0x501933[_0xedcf('0x75')][_0x2ab8fc];var _0x174aae=_0x3d874f['clone']();_0x174aae[_0xedcf('0x4f')](_0xedcf('0x86'),_0x46b36d['id']);_0x366127['push'](db[_0xedcf('0x78')][_0xedcf('0x46')](_0x174aae[_0xedcf('0x87')](),{'type':db[_0xedcf('0x78')][_0xedcf('0x88')][_0xedcf('0x89')]})['then'](function(_0x1b0484){if(_0x1b0484[_0xedcf('0x4b')]===0x1){return _0x46b36d['id'];}else{var _0x3787e9=_['every'](_['map'](_0x1b0484,_0xedcf('0x8a')),function(_0x3253ae){return _['includes'](_0x130f7e,_0x3253ae);});if(_0x3787e9){return _0x46b36d['id'];}}}));}}return BPromise[_0xedcf('0x8b')](_0x366127)[_0xedcf('0x23')](function(_0x193259){_0x25c462=_(_0x25c462)['union'](_0x193259)[_0xedcf('0x8c')]()['value']();return db['ChatQueue']['find']({'where':{'id':_0x30aa28['params']['id']}})[_0xedcf('0x23')](function(_0x18be03){return db['sequelize']['transaction'](function(_0x341b48){return _0x18be03[_0xedcf('0x8d')](_0x30aa28[_0xedcf('0x46')][_0xedcf('0x74')],{'transaction':_0x341b48})[_0xedcf('0x23')](function(){if(!_['isEmpty'](_0x25c462)){return _0x18be03[_0xedcf('0x8e')](_0x25c462,{'transaction':_0x341b48});}})[_0xedcf('0x23')](function(){_0x25c462[_0xedcf('0x7c')](function(_0x408f07){socket[_0xedcf('0x7d')](_0xedcf('0x8f'),{'UserId':_0x408f07,'ChatQueueId':_0x18be03['id']});});});});});});})['then'](respondWithStatusCode(_0x20cb3b,null))[_0xedcf('0x59')](handleError(_0x20cb3b,null));};exports['addAgents']=function(_0xda2483,_0x4d5bc9,_0x122431){return db[_0xedcf('0x41')][_0xedcf('0x5c')]({'where':{'id':_0xda2483['params']['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x4d5bc9,null))['then'](function(_0x40b17b){if(_0x40b17b){return _0x40b17b[_0xedcf('0x90')](_0xda2483[_0xedcf('0x5e')]['ids'],_[_0xedcf('0x91')](_0xda2483[_0xedcf('0x5e')],['ids','id'])||{})['spread'](function(_0x4c042e){for(var _0x14b1e5=0x0;_0x14b1e5<_0xda2483[_0xedcf('0x5e')][_0xedcf('0x74')][_0xedcf('0x4b')];_0x14b1e5+=0x1){socket['emit'](_0xedcf('0x7e'),{'UserId':Number(_0xda2483[_0xedcf('0x5e')][_0xedcf('0x74')][_0x14b1e5]),'ChatQueueId':Number(_0xda2483[_0xedcf('0x64')]['id'])});}return _0x4c042e;});}})[_0xedcf('0x23')](respondWithResult(_0x4d5bc9,null))[_0xedcf('0x59')](handleError(_0x4d5bc9,null));};exports[_0xedcf('0x8e')]=function(_0x27431a,_0x34fb05,_0x3a93ad){return db[_0xedcf('0x41')][_0xedcf('0x5c')]({'where':{'id':_0x27431a[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x34fb05,null))[_0xedcf('0x23')](function(_0x8e3e3e){if(_0x8e3e3e){return _0x8e3e3e[_0xedcf('0x8e')](_0x27431a[_0xedcf('0x46')][_0xedcf('0x74')])[_0xedcf('0x23')](function(){if(_[_0xedcf('0x92')](_0x27431a[_0xedcf('0x46')]['ids'])){for(var _0x80ec6a=0x0;_0x80ec6a<_0x27431a[_0xedcf('0x46')]['ids'][_0xedcf('0x4b')];_0x80ec6a+=0x1){socket[_0xedcf('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x27431a[_0xedcf('0x46')][_0xedcf('0x74')][_0x80ec6a]),'ChatQueueId':Number(_0x27431a['params']['id'])});}}else{socket['emit'](_0xedcf('0x8f'),{'UserId':Number(_0x27431a['query'][_0xedcf('0x74')]),'ChatQueueId':Number(_0x27431a['params']['id'])});}});}})[_0xedcf('0x23')](respondWithStatusCode(_0x34fb05,null))[_0xedcf('0x59')](handleError(_0x34fb05,null));};exports[_0xedcf('0x93')]=function(_0xe08849,_0x5840b6,_0xa91c){var _0xee2507={};var _0x6a8f5a={};var _0x5f1614;var _0xd341f8;return db[_0xedcf('0x41')][_0xedcf('0x67')]({'where':{'id':_0xe08849[_0xedcf('0x64')]['id']}})[_0xedcf('0x23')](handleEntityNotFound(_0x5840b6,null))[_0xedcf('0x23')](function(_0x259f7b){if(_0x259f7b){_0x5f1614=_0x259f7b;_0x6a8f5a[_0xedcf('0x45')]=_['keys'](db[_0xedcf('0x6b')][_0xedcf('0x42')]);_0x6a8f5a[_0xedcf('0x46')]=_['keys'](_0xe08849[_0xedcf('0x46')]);_0x6a8f5a['filters']=_[_0xedcf('0x48')](_0x6a8f5a[_0xedcf('0x45')],_0x6a8f5a[_0xedcf('0x46')]);_0xee2507[_0xedcf('0x49')]=_['intersection'](_0x6a8f5a['model'],qs[_0xedcf('0x4a')](_0xe08849[_0xedcf('0x46')][_0xedcf('0x4a')]));_0xee2507[_0xedcf('0x49')]=_0xee2507[_0xedcf('0x49')][_0xedcf('0x4b')]?_0xee2507[_0xedcf('0x49')]:_0x6a8f5a[_0xedcf('0x45')];_0xee2507[_0xedcf('0x4d')]=qs['sort'](_0xe08849[_0xedcf('0x46')][_0xedcf('0x4e')]);_0xee2507[_0xedcf('0x4f')]=qs[_0xedcf('0x50')](_[_0xedcf('0x51')](_0xe08849[_0xedcf('0x46')],_0x6a8f5a[_0xedcf('0x50')]));if(_0xe08849['query'][_0xedcf('0x52')]){_0xee2507['where']=_[_0xedcf('0x53')](_0xee2507[_0xedcf('0x4f')],{'$or':_['map'](_0xee2507['attributes'],function(_0x229186){var _0xb7e230={};_0xb7e230[_0x229186]={'$like':'%'+_0xe08849[_0xedcf('0x46')]['filter']+'%'};return _0xb7e230;})});}_0xee2507=_[_0xedcf('0x53')]({},_0xee2507,_0xe08849[_0xedcf('0x55')]);return _0x5f1614[_0xedcf('0x93')](_0xee2507);}})[_0xedcf('0x23')](function(_0x35e0f5){if(_0x35e0f5){_0xd341f8=_0x35e0f5[_0xedcf('0x4b')];if(!_0xe08849[_0xedcf('0x46')][_0xedcf('0x4c')](_0xedcf('0x69'))){_0xee2507[_0xedcf('0x31')]=qs[_0xedcf('0x31')](_0xe08849['query'][_0xedcf('0x31')]);_0xee2507['offset']=qs[_0xedcf('0x33')](_0xe08849[_0xedcf('0x46')]['offset']);}return _0x5f1614[_0xedcf('0x93')](_0xee2507);}})[_0xedcf('0x23')](function(_0x2e0b4a){if(_0x2e0b4a){return _0x2e0b4a?{'count':_0xd341f8,'rows':_0x2e0b4a}:null;}})[_0xedcf('0x23')](respondWithResult(_0x5840b6,null))[_0xedcf('0x59')](handleError(_0x5840b6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 9c8c75a..ad05946 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 _0xbfd2=['hook','events','ChatQueue','setMaxListeners','hasOwnProperty'];(function(_0xcfed91,_0x29b51b){var _0x42e245=function(_0x1a131c){while(--_0x1a131c){_0xcfed91['push'](_0xcfed91['shift']());}};_0x42e245(++_0x29b51b);}(_0xbfd2,0x123));var _0x2bfd=function(_0x689c44,_0x4ddbfb){_0x689c44=_0x689c44-0x0;var _0x351f6a=_0xbfd2[_0x689c44];return _0x351f6a;};'use strict';var EventEmitter=require(_0x2bfd('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x2bfd('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2bfd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x43dd0f){return function(_0x524a99,_0x1e40a2,_0x2f81d1){ChatQueueEvents['emit'](_0x43dd0f+':'+_0x524a99['id'],_0x524a99);ChatQueueEvents['emit'](_0x43dd0f,_0x524a99);_0x2f81d1(null);};}for(var e in events){if(events[_0x2bfd('0x3')](e)){var event=events[e];ChatQueue[_0x2bfd('0x4')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xd2ce=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4bb26d,_0x1085b0){var _0x42b6d0=function(_0xffa2a2){while(--_0xffa2a2){_0x4bb26d['push'](_0x4bb26d['shift']());}};_0x42b6d0(++_0x1085b0);}(_0xd2ce,0x13c));var _0xed2c=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xd2ce[_0x4dbaad];return _0x226c72;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xed2c('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xed2c('0x1')](0x0);var events={'afterCreate':_0xed2c('0x2'),'afterUpdate':_0xed2c('0x3'),'afterDestroy':_0xed2c('0x4')};function emitEvent(_0x167209){return function(_0x2fe29b,_0x418d1c,_0x5bc2bf){ChatQueueEvents[_0xed2c('0x5')](_0x167209+':'+_0x2fe29b['id'],_0x2fe29b);ChatQueueEvents['emit'](_0x167209,_0x2fe29b);_0x5bc2bf(null);};}for(var e in events){if(events[_0xed2c('0x6')](e)){var event=events[e];ChatQueue[_0xed2c('0x7')](e,emitEvent(event));}}module[_0xed2c('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index d159a64..240e6a8 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 _0xcba4=['define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0xcba4,0x117));var _0x4cba=function(_0x9a65e4,_0x3589df){_0x9a65e4=_0x9a65e4-0x0;var _0x2aeb25=_0xcba4[_0x9a65e4];return _0x2aeb25;};'use strict';var _=require(_0x4cba('0x0'));var util=require('util');var logger=require(_0x4cba('0x1'))(_0x4cba('0x2'));var moment=require(_0x4cba('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cba('0x4'));var rimraf=require(_0x4cba('0x5'));var config=require(_0x4cba('0x6'));var attributes=require(_0x4cba('0x7'));module[_0x4cba('0x8')]=function(_0x2a9a56,_0xe5fd6c){return _0x2a9a56[_0x4cba('0x9')](_0x4cba('0xa'),attributes,{'tableName':_0x4cba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x32ee=['exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x4a962f,_0x5e36ea){var _0xf66bad=function(_0x4707b7){while(--_0x4707b7){_0x4a962f['push'](_0x4a962f['shift']());}};_0xf66bad(++_0x5e36ea);}(_0x32ee,0x9e));var _0xe32e=function(_0x53c8af,_0xdb5075){_0x53c8af=_0x53c8af-0x0;var _0x229f1d=_0x32ee[_0x53c8af];return _0x229f1d;};'use strict';var _=require(_0xe32e('0x0'));var util=require('util');var logger=require(_0xe32e('0x1'))(_0xe32e('0x2'));var moment=require(_0xe32e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe32e('0x4'));var rimraf=require(_0xe32e('0x5'));var config=require(_0xe32e('0x6'));var attributes=require('./chatQueue.attributes');module[_0xe32e('0x7')]=function(_0x137097,_0x44d4d4){return _0x137097[_0xe32e('0x8')](_0xe32e('0x9'),attributes,{'tableName':_0xe32e('0xa'),'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 cd2ee31..718538a 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 _0xbbaf=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','model','include','debug','find','map','ShowChatQueue'];(function(_0x229b42,_0x323c51){var _0x51883c=function(_0x342b81){while(--_0x342b81){_0x229b42['push'](_0x229b42['shift']());}};_0x51883c(++_0x323c51);}(_0xbbaf,0x158));var _0xfbba=function(_0x51ec44,_0x5d81ff){_0x51ec44=_0x51ec44-0x0;var _0x3111dd=_0xbbaf[_0x51ec44];return _0x3111dd;};'use strict';var _=require(_0xfbba('0x0'));var util=require(_0xfbba('0x1'));var moment=require(_0xfbba('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbba('0x3'));var db=require(_0xfbba('0x4'))['db'];var utils=require(_0xfbba('0x5'));var logger=require(_0xfbba('0x6'))(_0xfbba('0x7'));var config=require(_0xfbba('0x8'));var jayson=require(_0xfbba('0x9'));var client=jayson[_0xfbba('0xa')][_0xfbba('0xb')]({'port':0x232a});config[_0xfbba('0xc')]=_[_0xfbba('0xd')](config[_0xfbba('0xc')],{'host':_0xfbba('0xe'),'port':0x18eb});var socket=require(_0xfbba('0xf'))(new Redis(config[_0xfbba('0xc')]));require(_0xfbba('0x10'))[_0xfbba('0x11')](socket);function respondWithRpcPromise(_0x294ecc,_0x320523,_0x1e7080){return new BPromise(function(_0x2d416b,_0x509a14){return client['request'](_0x294ecc,_0x1e7080)[_0xfbba('0x12')](function(_0x27df1c){logger['info'](_0xfbba('0x13'),_0x320523,_0xfbba('0x14'));logger['debug'](_0xfbba('0x15'),_0x320523,'request\x20sent',JSON[_0xfbba('0x16')](_0x27df1c));if(_0x27df1c[_0xfbba('0x17')]){if(_0x27df1c[_0xfbba('0x17')][_0xfbba('0x18')]===0x1f4){logger['error'](_0xfbba('0x13'),_0x320523,_0x27df1c[_0xfbba('0x17')]['message']);return _0x509a14(_0x27df1c[_0xfbba('0x17')][_0xfbba('0x19')]);}logger[_0xfbba('0x17')](_0xfbba('0x13'),_0x320523,_0x27df1c[_0xfbba('0x17')][_0xfbba('0x19')]);return _0x2d416b(_0x27df1c['error'][_0xfbba('0x19')]);}else{logger[_0xfbba('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x320523,_0xfbba('0x14'));_0x2d416b(_0x27df1c[_0xfbba('0x1b')][_0xfbba('0x19')]);}})[_0xfbba('0x1c')](function(_0x1e8464){logger['error']('ChatQueue,\x20%s,\x20%s',_0x320523,_0x1e8464);_0x509a14(_0x1e8464);});});}exports[_0xfbba('0x1d')]=function(_0x3e6e29){var _0x19419e=this;return new Promise(function(_0x5a3cdf,_0x1af2a6){return db[_0xfbba('0x1e')][_0xfbba('0x1f')]({'raw':_0x3e6e29[_0xfbba('0x20')]?_0x3e6e29[_0xfbba('0x20')][_0xfbba('0x21')]===undefined?!![]:![]:!![],'where':_0x3e6e29[_0xfbba('0x20')]?_0x3e6e29['options'][_0xfbba('0x22')]||null:null,'attributes':_0x3e6e29[_0xfbba('0x20')]?_0x3e6e29[_0xfbba('0x20')][_0xfbba('0x23')]||null:null,'limit':_0x3e6e29['options']?_0x3e6e29[_0xfbba('0x20')][_0xfbba('0x24')]||null:null,'include':_0x3e6e29[_0xfbba('0x20')]?_0x3e6e29['options']['include']?_['map'](_0x3e6e29[_0xfbba('0x20')]['include'],function(_0x2f9829){return{'model':db[_0x2f9829[_0xfbba('0x25')]],'as':_0x2f9829['as'],'attributes':_0x2f9829[_0xfbba('0x23')],'include':_0x2f9829[_0xfbba('0x26')]?_['map'](_0x2f9829[_0xfbba('0x26')],function(_0x2fd203){return{'model':db[_0x2fd203[_0xfbba('0x25')]],'as':_0x2fd203['as'],'attributes':_0x2fd203[_0xfbba('0x23')],'include':_0x2fd203[_0xfbba('0x26')]?_['map'](_0x2fd203[_0xfbba('0x26')],function(_0x3a5af2){return{'model':db[_0x3a5af2['model']],'as':_0x3a5af2['as'],'attributes':_0x3a5af2[_0xfbba('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18bf76){logger[_0xfbba('0x1a')]('GetChatQueue',_0x3e6e29);logger[_0xfbba('0x27')]('GetChatQueue',_0x3e6e29,JSON[_0xfbba('0x16')](_0x18bf76));_0x5a3cdf(_0x18bf76);})[_0xfbba('0x1c')](function(_0xa0a64){logger[_0xfbba('0x17')](_0xfbba('0x1d'),_0xa0a64[_0xfbba('0x19')],_0x3e6e29);_0x1af2a6(_0x19419e[_0xfbba('0x17')](0x1f4,_0xa0a64[_0xfbba('0x19')]));});});};exports['ShowChatQueue']=function(_0x296f6b){var _0x158edc=this;return new Promise(function(_0x3fb7a2,_0x219824){return db[_0xfbba('0x1e')][_0xfbba('0x28')]({'raw':_0x296f6b[_0xfbba('0x20')]?_0x296f6b[_0xfbba('0x20')][_0xfbba('0x21')]===undefined?!![]:![]:!![],'where':_0x296f6b['options']?_0x296f6b[_0xfbba('0x20')][_0xfbba('0x22')]||null:null,'attributes':_0x296f6b[_0xfbba('0x20')]?_0x296f6b[_0xfbba('0x20')]['attributes']||null:null,'include':_0x296f6b[_0xfbba('0x20')]?_0x296f6b[_0xfbba('0x20')][_0xfbba('0x26')]?_['map'](_0x296f6b['options'][_0xfbba('0x26')],function(_0x2f8ef4){return{'model':db[_0x2f8ef4[_0xfbba('0x25')]],'as':_0x2f8ef4['as'],'attributes':_0x2f8ef4[_0xfbba('0x23')],'include':_0x2f8ef4['include']?_[_0xfbba('0x29')](_0x2f8ef4[_0xfbba('0x26')],function(_0x1a2f09){return{'model':db[_0x1a2f09['model']],'as':_0x1a2f09['as'],'attributes':_0x1a2f09[_0xfbba('0x23')],'include':_0x1a2f09['include']?_['map'](_0x1a2f09[_0xfbba('0x26')],function(_0xc408e4){return{'model':db[_0xc408e4[_0xfbba('0x25')]],'as':_0xc408e4['as'],'attributes':_0xc408e4[_0xfbba('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfbba('0x12')](function(_0x5da984){logger[_0xfbba('0x1a')](_0xfbba('0x2a'),_0x296f6b);logger['debug']('ShowChatQueue',_0x296f6b,JSON[_0xfbba('0x16')](_0x5da984));_0x3fb7a2(_0x5da984);})[_0xfbba('0x1c')](function(_0x33ef07){logger[_0xfbba('0x17')]('ShowChatQueue',_0x33ef07[_0xfbba('0x19')],_0x296f6b);_0x219824(_0x158edc['error'](0x1f4,_0x33ef07[_0xfbba('0x19')]));});});};
\ No newline at end of file
+var _0xf4c9=['../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','ChatQueue,\x20%s,\x20%s','request\x20sent','result','options','limit','include','map','model','attributes','GetChatQueue','debug','stringify','ShowChatQueue','ChatQueue','where','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0xb6c185,_0x1fba89){var _0x18717b=function(_0x1ac33d){while(--_0x1ac33d){_0xb6c185['push'](_0xb6c185['shift']());}};_0x18717b(++_0x1fba89);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf4c9[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var moment=require(_0x9f4c('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f4c('0x4'))['db'];var utils=require(_0x9f4c('0x5'));var logger=require(_0x9f4c('0x6'))('rpc');var config=require(_0x9f4c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f4c('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9f4c('0x9')],{'host':_0x9f4c('0xa'),'port':0x18eb});var socket=require(_0x9f4c('0xb'))(new Redis(config[_0x9f4c('0x9')]));require(_0x9f4c('0xc'))[_0x9f4c('0xd')](socket);function respondWithRpcPromise(_0x553357,_0x3cc67a,_0x57ff14){return new BPromise(function(_0x20c329,_0x700e2d){return client[_0x9f4c('0xe')](_0x553357,_0x57ff14)[_0x9f4c('0xf')](function(_0x20ab7c){logger[_0x9f4c('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3cc67a,'request\x20sent');logger['debug'](_0x9f4c('0x11'),_0x3cc67a,'request\x20sent',JSON['stringify'](_0x20ab7c));if(_0x20ab7c[_0x9f4c('0x12')]){if(_0x20ab7c['error']['code']===0x1f4){logger[_0x9f4c('0x12')]('ChatQueue,\x20%s,\x20%s',_0x3cc67a,_0x20ab7c['error'][_0x9f4c('0x13')]);return _0x700e2d(_0x20ab7c['error'][_0x9f4c('0x13')]);}logger[_0x9f4c('0x12')](_0x9f4c('0x14'),_0x3cc67a,_0x20ab7c[_0x9f4c('0x12')][_0x9f4c('0x13')]);return _0x20c329(_0x20ab7c[_0x9f4c('0x12')]['message']);}else{logger[_0x9f4c('0x10')](_0x9f4c('0x14'),_0x3cc67a,_0x9f4c('0x15'));_0x20c329(_0x20ab7c[_0x9f4c('0x16')][_0x9f4c('0x13')]);}})['catch'](function(_0x272778){logger[_0x9f4c('0x12')](_0x9f4c('0x14'),_0x3cc67a,_0x272778);_0x700e2d(_0x272778);});});}exports['GetChatQueue']=function(_0x4a33c7){var _0x502a33=this;return new Promise(function(_0x53d301,_0x2040a5){return db['ChatQueue']['findAll']({'raw':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')]['where']||null:null,'attributes':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7['options']['attributes']||null:null,'limit':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7['options'][_0x9f4c('0x18')]||null:null,'include':_0x4a33c7[_0x9f4c('0x17')]?_0x4a33c7[_0x9f4c('0x17')][_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x4a33c7[_0x9f4c('0x17')]['include'],function(_0x25b775){return{'model':db[_0x25b775[_0x9f4c('0x1b')]],'as':_0x25b775['as'],'attributes':_0x25b775[_0x9f4c('0x1c')],'include':_0x25b775[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x25b775[_0x9f4c('0x19')],function(_0x945f00){return{'model':db[_0x945f00[_0x9f4c('0x1b')]],'as':_0x945f00['as'],'attributes':_0x945f00[_0x9f4c('0x1c')],'include':_0x945f00[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x945f00[_0x9f4c('0x19')],function(_0x168ed8){return{'model':db[_0x168ed8[_0x9f4c('0x1b')]],'as':_0x168ed8['as'],'attributes':_0x168ed8[_0x9f4c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f4c('0xf')](function(_0x31d486){logger[_0x9f4c('0x10')](_0x9f4c('0x1d'),_0x4a33c7);logger[_0x9f4c('0x1e')](_0x9f4c('0x1d'),_0x4a33c7,JSON[_0x9f4c('0x1f')](_0x31d486));_0x53d301(_0x31d486);})['catch'](function(_0x4b6d91){logger['error'](_0x9f4c('0x1d'),_0x4b6d91[_0x9f4c('0x13')],_0x4a33c7);_0x2040a5(_0x502a33['error'](0x1f4,_0x4b6d91[_0x9f4c('0x13')]));});});};exports[_0x9f4c('0x20')]=function(_0x2ca433){var _0x4f5c2f=this;return new Promise(function(_0x5b1ddb,_0xa7ebad){return db[_0x9f4c('0x21')]['find']({'raw':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x22')]||null:null,'attributes':_0x2ca433[_0x9f4c('0x17')]?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x1c')]||null:null,'include':_0x2ca433['options']?_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0x2ca433[_0x9f4c('0x17')][_0x9f4c('0x19')],function(_0xe700df){return{'model':db[_0xe700df[_0x9f4c('0x1b')]],'as':_0xe700df['as'],'attributes':_0xe700df[_0x9f4c('0x1c')],'include':_0xe700df[_0x9f4c('0x19')]?_[_0x9f4c('0x1a')](_0xe700df[_0x9f4c('0x19')],function(_0x352b2b){return{'model':db[_0x352b2b[_0x9f4c('0x1b')]],'as':_0x352b2b['as'],'attributes':_0x352b2b['attributes'],'include':_0x352b2b[_0x9f4c('0x19')]?_['map'](_0x352b2b[_0x9f4c('0x19')],function(_0x1e22ed){return{'model':db[_0x1e22ed[_0x9f4c('0x1b')]],'as':_0x1e22ed['as'],'attributes':_0x1e22ed[_0x9f4c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f4c('0xf')](function(_0x649bc){logger[_0x9f4c('0x10')](_0x9f4c('0x20'),_0x2ca433);logger[_0x9f4c('0x1e')](_0x9f4c('0x20'),_0x2ca433,JSON[_0x9f4c('0x1f')](_0x649bc));_0x5b1ddb(_0x649bc);})[_0x9f4c('0x23')](function(_0x5653ff){logger[_0x9f4c('0x12')](_0x9f4c('0x20'),_0x5653ff[_0x9f4c('0x13')],_0x2ca433);_0xa7ebad(_0x4f5c2f['error'](0x1f4,_0x5653ff[_0x9f4c('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index bc3e60a..1f1e144 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 _0xca66=['update','emit','register','length','./chatQueue.events'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xca66,0x8b));var _0x6ca6=function(_0x56bcca,_0x3b684f){_0x56bcca=_0x56bcca-0x0;var _0x4181a4=_0xca66[_0x56bcca];return _0x4181a4;};'use strict';var ChatQueueEvents=require(_0x6ca6('0x0'));var events=['save','remove',_0x6ca6('0x1')];function createListener(_0x1a863a,_0x44d1de){return function(_0x571335){_0x44d1de[_0x6ca6('0x2')](_0x1a863a,_0x571335);};}function removeListener(_0x4b1a10,_0x3ab489){return function(){ChatQueueEvents['removeListener'](_0x4b1a10,_0x3ab489);};}exports[_0x6ca6('0x3')]=function(_0x27d8c6){for(var _0x34836f=0x0,_0x44019c=events[_0x6ca6('0x4')];_0x34836f<_0x44019c;_0x34836f++){var _0x27a210=events[_0x34836f];var _0x27d280=createListener('chatQueue:'+_0x27a210,_0x27d8c6);ChatQueueEvents['on'](_0x27a210,_0x27d280);}};
\ No newline at end of file
+var _0xaba6=['emit','removeListener','./chatQueue.events','save'];(function(_0x354ab5,_0x4dcfef){var _0xf3d138=function(_0x5abfe9){while(--_0x5abfe9){_0x354ab5['push'](_0x354ab5['shift']());}};_0xf3d138(++_0x4dcfef);}(_0xaba6,0xe2));var _0x6aba=function(_0x4dca4f,_0x3d3989){_0x4dca4f=_0x4dca4f-0x0;var _0xb1f24e=_0xaba6[_0x4dca4f];return _0xb1f24e;};'use strict';var ChatQueueEvents=require(_0x6aba('0x0'));var events=[_0x6aba('0x1'),'remove','update'];function createListener(_0x5140ee,_0x596c18){return function(_0x42fd1f){_0x596c18[_0x6aba('0x2')](_0x5140ee,_0x42fd1f);};}function removeListener(_0x58d8a8,_0x1e32a1){return function(){ChatQueueEvents[_0x6aba('0x3')](_0x58d8a8,_0x1e32a1);};}exports['register']=function(_0x4e929a){for(var _0x5ae14c=0x0,_0x39c32a=events['length'];_0x5ae14c<_0x39c32a;_0x5ae14c++){var _0x3766d4=events[_0x5ae14c];var _0x1a4fbc=createListener('chatQueue:'+_0x3766d4,_0x4e929a);ChatQueueEvents['on'](_0x3766d4,_0x1a4fbc);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 1561b46..db20f01 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(_0x404c3e,_0x5d6050){var _0x2595ae=function(_0x3872c3){while(--_0x3872c3){_0x404c3e['push'](_0x404c3e['shift']());}};_0x2595ae(++_0x5d6050);}(_0x7217,0x19e));var _0x7721=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7217[_0x5b644e];return _0x49c6bf;};'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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4f2114,_0x1416d4){var _0x87caf5=function(_0x5e68ac){while(--_0x5e68ac){_0x4f2114['push'](_0x4f2114['shift']());}};_0x87caf5(++_0x1416d4);}(_0x55ca,0x126));var _0xa55c=function(_0x312931,_0x22e92b){_0x312931=_0x312931-0x0;var _0xdf26e5=_0x55ca[_0x312931];return _0xdf26e5;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e8657e1..68d8318 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 _0x9576=['DATE','moment','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9576,0x182));var _0x6957=function(_0x4a6eec,_0x7607eb){_0x4a6eec=_0x4a6eec-0x0;var _0x2faff2=_0x9576[_0x4a6eec];return _0x2faff2;};'use strict';var moment=require(_0x6957('0x0'));var Sequelize=require(_0x6957('0x1'));module[_0x6957('0x2')]={'uniqueid':{'type':Sequelize[_0x6957('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6957('0x4')]},'acceptAt':{'type':Sequelize[_0x6957('0x4')]},'exitAt':{'type':Sequelize[_0x6957('0x4')]},'reason':{'type':Sequelize[_0x6957('0x3')]}};
\ No newline at end of file
+var _0x6912=['exports','STRING','DATE','moment'];(function(_0x1736e9,_0x5bdc96){var _0x4fdf3=function(_0x3af4cd){while(--_0x3af4cd){_0x1736e9['push'](_0x1736e9['shift']());}};_0x4fdf3(++_0x5bdc96);}(_0x6912,0x143));var _0x2691=function(_0x67b72e,_0x105a68){_0x67b72e=_0x67b72e-0x0;var _0x4d86d2=_0x6912[_0x67b72e];return _0x4d86d2;};'use strict';var moment=require(_0x2691('0x0'));var Sequelize=require('sequelize');module[_0x2691('0x1')]={'uniqueid':{'type':Sequelize[_0x2691('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2691('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2691('0x3')]},'acceptAt':{'type':Sequelize[_0x2691('0x3')]},'exitAt':{'type':Sequelize[_0x2691('0x3')]},'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 9f56bcc..3ee8ef1 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 _0x5d58=['undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','ChatQueueReport','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','create','update','find','catch','destroy','describe','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0x5d58,0x187));var _0x85d5=function(_0x47dab6,_0x24836c){_0x47dab6=_0x47dab6-0x0;var _0xeeb402=_0x5d58[_0x47dab6];return _0xeeb402;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['ChatQueueReport']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['ChatQueueReport'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')](_0x13ab32['body'],{})[_0x85d5('0x1c')](respondWithResult(_0x12a03,0xc9))['catch'](handleError(_0x12a03,null));};exports[_0x85d5('0x40')]=function(_0xd8db57,_0x219154){if(_0xd8db57['body']['id']){delete _0xd8db57['body']['id'];}return db['ChatQueueReport'][_0x85d5('0x41')]({'where':{'id':_0xd8db57[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x219154,null))['then'](saveUpdates(_0xd8db57['body'],null))[_0x85d5('0x1c')](respondWithResult(_0x219154,null))[_0x85d5('0x42')](handleError(_0x219154,null));};exports[_0x85d5('0x43')]=function(_0x288b56,_0x4b2dce){return db[_0x85d5('0x34')][_0x85d5('0x41')]({'where':{'id':_0x288b56[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x4b2dce,null))[_0x85d5('0x1c')](removeEntity(_0x4b2dce,null))[_0x85d5('0x42')](handleError(_0x4b2dce,null));};exports[_0x85d5('0x44')]=function(_0x34b784,_0x185a70){return db[_0x85d5('0x34')][_0x85d5('0x44')]()[_0x85d5('0x1c')](respondWithResult(_0x185a70,null))[_0x85d5('0x42')](handleError(_0x185a70,null));};
\ No newline at end of file
+var _0x6050=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0x4eedc6,_0x27632a){var _0x1f0ea0=function(_0x545585){while(--_0x545585){_0x4eedc6['push'](_0x4eedc6['shift']());}};_0x1f0ea0(++_0x27632a);}(_0x6050,0x196));var _0x0605=function(_0x3e803e,_0x23a962){_0x3e803e=_0x3e803e-0x0;var _0x3a560a=_0x6050[_0x3e803e];return _0x3a560a;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['ChatQueueReport'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['ChatQueueReport'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));};exports[_0x0605('0x4b')]=function(_0x286485,_0x184232){return db[_0x0605('0x2b')]['describe']()[_0x0605('0x25')](respondWithResult(_0x184232,null))[_0x0605('0x43')](handleError(_0x184232,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index b23fd51..008e289 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(_0xccc8e1,_0x4a5076){var _0x30978c=function(_0x17e6f0){while(--_0x17e6f0){_0xccc8e1['push'](_0xccc8e1['shift']());}};_0x30978c(++_0x4a5076);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b21eb,_0x540b6d){_0x5b21eb=_0x5b21eb-0x0;var _0x279c63=_0xb10b[_0x5b21eb];return _0x279c63;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 561b58d..71fb547 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 _0x0066=['then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xfa191e,_0x2b597f){var _0xcfb50d=function(_0x851fb9){while(--_0x851fb9){_0xfa191e['push'](_0xfa191e['shift']());}};_0xcfb50d(++_0x2b597f);}(_0x0066,0x111));var _0x6006=function(_0x4b004b,_0x15b81d){_0x4b004b=_0x4b004b-0x0;var _0x469af9=_0x0066[_0x4b004b];return _0x469af9;};'use strict';var _=require(_0x6006('0x0'));var util=require(_0x6006('0x1'));var moment=require(_0x6006('0x2'));var BPromise=require(_0x6006('0x3'));var rs=require(_0x6006('0x4'));var fs=require('fs');var Redis=require(_0x6006('0x5'));var db=require(_0x6006('0x6'))['db'];var utils=require(_0x6006('0x7'));var logger=require(_0x6006('0x8'))(_0x6006('0x9'));var config=require(_0x6006('0xa'));var jayson=require(_0x6006('0xb'));var client=jayson[_0x6006('0xc')][_0x6006('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3aee4f,_0x568810,_0x4af6e8){return new BPromise(function(_0xdf0291,_0x5afcb3){return client[_0x6006('0xe')](_0x3aee4f,_0x4af6e8)[_0x6006('0xf')](function(_0x2e6093){logger[_0x6006('0x10')](_0x6006('0x11'),_0x568810,'request\x20sent');logger[_0x6006('0x12')](_0x6006('0x13'),_0x568810,'request\x20sent',JSON[_0x6006('0x14')](_0x2e6093));if(_0x2e6093[_0x6006('0x15')]){if(_0x2e6093['error'][_0x6006('0x16')]===0x1f4){logger[_0x6006('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x568810,_0x2e6093[_0x6006('0x15')][_0x6006('0x17')]);return _0x5afcb3(_0x2e6093[_0x6006('0x15')][_0x6006('0x17')]);}logger[_0x6006('0x15')](_0x6006('0x11'),_0x568810,_0x2e6093['error']['message']);return _0xdf0291(_0x2e6093['error'][_0x6006('0x17')]);}else{logger[_0x6006('0x10')](_0x6006('0x11'),_0x568810,_0x6006('0x18'));_0xdf0291(_0x2e6093['result'][_0x6006('0x17')]);}})['catch'](function(_0x5d277e){logger['error'](_0x6006('0x11'),_0x568810,_0x5d277e);_0x5afcb3(_0x5d277e);});});}exports['CreateChatQueueReport']=function(_0x3be2b0){var _0x213493=this;return new Promise(function(_0x49f63f,_0xd97b56){return db[_0x6006('0x19')][_0x6006('0x1a')](_0x3be2b0[_0x6006('0x1b')],{'raw':_0x3be2b0[_0x6006('0x1c')]?_0x3be2b0[_0x6006('0x1c')][_0x6006('0x1d')]===undefined?!![]:![]:!![]})[_0x6006('0xf')](function(_0x62bf30){logger['info'](_0x6006('0x1e'),_0x3be2b0);logger['debug'](_0x6006('0x1e'),_0x3be2b0,JSON[_0x6006('0x14')](_0x62bf30));_0x49f63f(_0x62bf30);})['catch'](function(_0x229ba9){logger[_0x6006('0x15')](_0x6006('0x1e'),_0x229ba9[_0x6006('0x17')],_0x3be2b0);_0xd97b56(_0x213493['error'](0x1f4,_0x229ba9[_0x6006('0x17')]));});});};exports[_0x6006('0x1f')]=function(_0x1e1eb4){var _0x4c52fb=this;return new Promise(function(_0x515952,_0x30744e){return db[_0x6006('0x19')][_0x6006('0x20')](_0x1e1eb4['body'],{'raw':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4[_0x6006('0x1c')][_0x6006('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4[_0x6006('0x1c')][_0x6006('0x21')]||null:null,'attributes':_0x1e1eb4['options']?_0x1e1eb4[_0x6006('0x1c')]['attributes']||null:null,'limit':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4['options'][_0x6006('0x22')]||null:null})[_0x6006('0xf')](function(_0x137b1a){logger[_0x6006('0x10')]('UpdateChatQueueReport',_0x1e1eb4);logger['debug'](_0x6006('0x1f'),_0x1e1eb4,JSON[_0x6006('0x14')](_0x137b1a));_0x515952(_0x137b1a);})[_0x6006('0x23')](function(_0xa63979){logger[_0x6006('0x15')]('UpdateChatQueueReport',_0xa63979['message'],_0x1e1eb4);_0x30744e(_0x4c52fb[_0x6006('0x15')](0x1f4,_0xa63979['message']));});});};
\ No newline at end of file
+var _0x7e12=['../../mysqldb','../../config/utils','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','ChatQueueReport','create','options','CreateChatQueueReport','UpdateChatQueueReport','update','body','raw','where','attributes','limit','lodash','util','bluebird','randomstring'];(function(_0xc31e71,_0x5b8183){var _0x350a14=function(_0x3ed33f){while(--_0x3ed33f){_0xc31e71['push'](_0xc31e71['shift']());}};_0x350a14(++_0x5b8183);}(_0x7e12,0x17c));var _0x27e1=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x7e12[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0x27e1('0x0'));var util=require(_0x27e1('0x1'));var moment=require('moment');var BPromise=require(_0x27e1('0x2'));var rs=require(_0x27e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27e1('0x4'))['db'];var utils=require(_0x27e1('0x5'));var logger=require('../../config/logger')(_0x27e1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x27e1('0x7')][_0x27e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bd783,_0x4768ba,_0x38d22c){return new BPromise(function(_0x23e772,_0x382056){return client[_0x27e1('0x9')](_0x2bd783,_0x38d22c)[_0x27e1('0xa')](function(_0x3ebe62){logger[_0x27e1('0xb')](_0x27e1('0xc'),_0x4768ba,_0x27e1('0xd'));logger[_0x27e1('0xe')](_0x27e1('0xf'),_0x4768ba,_0x27e1('0xd'),JSON[_0x27e1('0x10')](_0x3ebe62));if(_0x3ebe62['error']){if(_0x3ebe62['error'][_0x27e1('0x11')]===0x1f4){logger[_0x27e1('0x12')](_0x27e1('0xc'),_0x4768ba,_0x3ebe62[_0x27e1('0x12')][_0x27e1('0x13')]);return _0x382056(_0x3ebe62['error'][_0x27e1('0x13')]);}logger[_0x27e1('0x12')](_0x27e1('0xc'),_0x4768ba,_0x3ebe62[_0x27e1('0x12')]['message']);return _0x23e772(_0x3ebe62[_0x27e1('0x12')][_0x27e1('0x13')]);}else{logger[_0x27e1('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x4768ba,_0x27e1('0xd'));_0x23e772(_0x3ebe62['result'][_0x27e1('0x13')]);}})[_0x27e1('0x14')](function(_0x4cc741){logger['error'](_0x27e1('0xc'),_0x4768ba,_0x4cc741);_0x382056(_0x4cc741);});});}exports['CreateChatQueueReport']=function(_0x511dc9){var _0xef1e90=this;return new Promise(function(_0x93f044,_0x15cc59){return db[_0x27e1('0x15')][_0x27e1('0x16')](_0x511dc9['body'],{'raw':_0x511dc9[_0x27e1('0x17')]?_0x511dc9[_0x27e1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x27e1('0xa')](function(_0x2e0ba7){logger['info'](_0x27e1('0x18'),_0x511dc9);logger['debug'](_0x27e1('0x18'),_0x511dc9,JSON[_0x27e1('0x10')](_0x2e0ba7));_0x93f044(_0x2e0ba7);})[_0x27e1('0x14')](function(_0x7a1000){logger['error'](_0x27e1('0x18'),_0x7a1000[_0x27e1('0x13')],_0x511dc9);_0x15cc59(_0xef1e90['error'](0x1f4,_0x7a1000[_0x27e1('0x13')]));});});};exports[_0x27e1('0x19')]=function(_0x55e772){var _0x35dbb4=this;return new Promise(function(_0x17ed05,_0x5e6df6){return db[_0x27e1('0x15')][_0x27e1('0x1a')](_0x55e772[_0x27e1('0x1b')],{'raw':_0x55e772['options']?_0x55e772[_0x27e1('0x17')][_0x27e1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55e772['options']?_0x55e772['options'][_0x27e1('0x1d')]||null:null,'attributes':_0x55e772['options']?_0x55e772[_0x27e1('0x17')][_0x27e1('0x1e')]||null:null,'limit':_0x55e772['options']?_0x55e772[_0x27e1('0x17')][_0x27e1('0x1f')]||null:null})[_0x27e1('0xa')](function(_0x1507ab){logger[_0x27e1('0xb')](_0x27e1('0x19'),_0x55e772);logger[_0x27e1('0xe')](_0x27e1('0x19'),_0x55e772,JSON[_0x27e1('0x10')](_0x1507ab));_0x17ed05(_0x1507ab);})[_0x27e1('0x14')](function(_0x4c513f){logger[_0x27e1('0x12')](_0x27e1('0x19'),_0x4c513f['message'],_0x55e772);_0x5e6df6(_0x35dbb4[_0x27e1('0x12')](0x1f4,_0x4c513f[_0x27e1('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 58e0392..bc989b1 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 _0x624b=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x624b,0x1a4));var _0xb624=function(_0x2b9336,_0x25980b){_0x2b9336=_0x2b9336-0x0;var _0x4dd80a=_0x624b[_0x2b9336];return _0x4dd80a;};'use strict';var multer=require(_0xb624('0x0'));var util=require(_0xb624('0x1'));var path=require(_0xb624('0x2'));var timeout=require(_0xb624('0x3'));var express=require(_0xb624('0x4'));var router=express[_0xb624('0x5')]();var fs_extra=require(_0xb624('0x6'));var auth=require(_0xb624('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb624('0x8'));var controller=require(_0xb624('0x9'));router[_0xb624('0xa')]('/',auth[_0xb624('0xb')](),controller[_0xb624('0xc')]);router['get'](_0xb624('0xd'),auth[_0xb624('0xb')](),controller['describe']);router[_0xb624('0xa')](_0xb624('0xe'),auth[_0xb624('0xb')](),controller[_0xb624('0xf')]);router[_0xb624('0x10')]('/',auth[_0xb624('0xb')](),controller['create']);router['put'](_0xb624('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xb624('0x11')](_0xb624('0xe'),auth[_0xb624('0xb')](),controller[_0xb624('0x12')]);module[_0xb624('0x13')]=router;
\ No newline at end of file
+var _0x96e1=['destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','put','update','delete'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x96e1,0x190));var _0x196e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x96e1[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0x196e('0x0'));var path=require(_0x196e('0x1'));var timeout=require(_0x196e('0x2'));var express=require(_0x196e('0x3'));var router=express['Router']();var fs_extra=require(_0x196e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x196e('0x5'));var config=require(_0x196e('0x6'));var controller=require(_0x196e('0x7'));router[_0x196e('0x8')]('/',auth['isAuthenticated'](),controller[_0x196e('0x9')]);router[_0x196e('0x8')](_0x196e('0xa'),auth['isAuthenticated'](),controller[_0x196e('0xb')]);router['get'](_0x196e('0xc'),auth[_0x196e('0xd')](),controller[_0x196e('0xe')]);router['post']('/',auth[_0x196e('0xd')](),controller['create']);router[_0x196e('0xf')](_0x196e('0xc'),auth[_0x196e('0xd')](),controller[_0x196e('0x10')]);router[_0x196e('0x11')](_0x196e('0xc'),auth['isAuthenticated'](),controller[_0x196e('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index ffe7d88..f1e7cd4 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x30b94a,_0xfb8634){var _0x291adc=function(_0x47d0c3){while(--_0x47d0c3){_0x30b94a['push'](_0x30b94a['shift']());}};_0x291adc(++_0xfb8634);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x36eed5,_0xdaeafa){var _0x265b98=function(_0x46d297){while(--_0x46d297){_0x36eed5['push'](_0x36eed5['shift']());}};_0x265b98(++_0xdaeafa);}(_0x00bb,0x1d8));var _0xb00b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x00bb[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 95e3b57..6166a6c 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 _0x5d80=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','ChatTransferReport','findAll','catch','show','intersection','length','includeAll','find','create','body','params','describe','eml-format'];(function(_0x521629,_0x31dfab){var _0x1d3ba5=function(_0x3c2605){while(--_0x3c2605){_0x521629['push'](_0x521629['shift']());}};_0x1d3ba5(++_0x31dfab);}(_0x5d80,0x1cd));var _0x05d8=function(_0x1ec8a2,_0x38e9d1){_0x1ec8a2=_0x1ec8a2-0x0;var _0x37788a=_0x5d80[_0x1ec8a2];return _0x37788a;};'use strict';var emlformat=require(_0x05d8('0x0'));var rimraf=require(_0x05d8('0x1'));var zipdir=require(_0x05d8('0x2'));var jsonpatch=require(_0x05d8('0x3'));var rp=require(_0x05d8('0x4'));var moment=require(_0x05d8('0x5'));var BPromise=require(_0x05d8('0x6'));var Mustache=require(_0x05d8('0x7'));var util=require('util');var path=require('path');var sox=require(_0x05d8('0x8'));var csv=require(_0x05d8('0x9'));var ejs=require(_0x05d8('0xa'));var fs=require('fs');var fs_extra=require(_0x05d8('0xb'));var _=require(_0x05d8('0xc'));var squel=require(_0x05d8('0xd'));var crypto=require(_0x05d8('0xe'));var jsforce=require(_0x05d8('0xf'));var deskjs=require(_0x05d8('0x10'));var toCsv=require(_0x05d8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x05d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x05d8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05d8('0x13'));var logger=require(_0x05d8('0x14'))(_0x05d8('0x15'));var utils=require('../../config/utils');var config=require(_0x05d8('0x16'));var licenseUtil=require(_0x05d8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa1ffa8,_0x2a47f0){_0x2a47f0=_0x2a47f0||0xcc;return function(_0xc638f){if(_0xc638f){return _0xa1ffa8[_0x05d8('0x18')](_0x2a47f0);}return _0xa1ffa8['status'](_0x2a47f0)[_0x05d8('0x19')]();};}function respondWithResult(_0x138fe0,_0x7fbd37){_0x7fbd37=_0x7fbd37||0xc8;return function(_0xbcefdc){if(_0xbcefdc){return _0x138fe0[_0x05d8('0x1a')](_0x7fbd37)['json'](_0xbcefdc);}};}function respondWithFilteredResult(_0x17bb06,_0x5502d0){return function(_0x3e1973){if(_0x3e1973){var _0x14409d=typeof _0x5502d0[_0x05d8('0x1b')]===_0x05d8('0x1c')&&typeof _0x5502d0['limit']===_0x05d8('0x1c');var _0x19c7de=_0x3e1973[_0x05d8('0x1d')];var _0x2df4dd=_0x14409d?0x0:_0x5502d0[_0x05d8('0x1b')];var _0x420182=_0x14409d?_0x3e1973[_0x05d8('0x1d')]:_0x5502d0['offset']+_0x5502d0[_0x05d8('0x1e')];var _0x4052c4;if(_0x420182>=_0x19c7de){_0x420182=_0x19c7de;_0x4052c4=0xc8;}else{_0x4052c4=0xce;}_0x17bb06[_0x05d8('0x1a')](_0x4052c4);return _0x17bb06[_0x05d8('0x1f')](_0x05d8('0x20'),_0x2df4dd+'-'+_0x420182+'/'+_0x19c7de)[_0x05d8('0x21')](_0x3e1973);}return null;};}function patchUpdates(_0x3b468e){return function(_0x35ce4b){try{jsonpatch[_0x05d8('0x22')](_0x35ce4b,_0x3b468e,!![]);}catch(_0x39d575){return BPromise[_0x05d8('0x23')](_0x39d575);}return _0x35ce4b[_0x05d8('0x24')]();};}function saveUpdates(_0x5cea68,_0x4a2eac){return function(_0x515398){if(_0x515398){return _0x515398[_0x05d8('0x25')](_0x5cea68)[_0x05d8('0x26')](function(_0x470526){return _0x470526;});}return null;};}function removeEntity(_0x123242,_0x53b5bf){return function(_0x2fe000){if(_0x2fe000){return _0x2fe000[_0x05d8('0x27')]()[_0x05d8('0x26')](function(){_0x123242['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cbfd4,_0x1d93b5){return function(_0x5d7d9c){if(!_0x5d7d9c){_0x5cbfd4['sendStatus'](0x194);}return _0x5d7d9c;};}function handleError(_0x5c55f9,_0x26a6e4){_0x26a6e4=_0x26a6e4||0x1f4;return function(_0x9d2b61){logger[_0x05d8('0x28')](_0x9d2b61[_0x05d8('0x29')]);if(_0x9d2b61[_0x05d8('0x2a')]){delete _0x9d2b61[_0x05d8('0x2a')];}_0x5c55f9['status'](_0x26a6e4)[_0x05d8('0x2b')](_0x9d2b61);};}exports[_0x05d8('0x2c')]=function(_0x4618c1,_0x27a0fe){var _0x6cd67a={},_0x54f9d6={},_0x39308b={'count':0x0,'rows':[]};var _0x1e900e=_[_0x05d8('0x2d')](db['ChatTransferReport'][_0x05d8('0x2e')],function(_0x47ef9e){return{'name':_0x47ef9e[_0x05d8('0x2f')],'type':_0x47ef9e[_0x05d8('0x30')]['key']};});_0x54f9d6[_0x05d8('0x31')]=_['map'](_0x1e900e,_0x05d8('0x2a'));_0x54f9d6[_0x05d8('0x32')]=_[_0x05d8('0x33')](_0x4618c1[_0x05d8('0x32')]);_0x54f9d6[_0x05d8('0x34')]=_['intersection'](_0x54f9d6[_0x05d8('0x31')],_0x54f9d6[_0x05d8('0x32')]);_0x6cd67a[_0x05d8('0x35')]=_['intersection'](_0x54f9d6[_0x05d8('0x31')],qs[_0x05d8('0x36')](_0x4618c1[_0x05d8('0x32')]['fields']));_0x6cd67a[_0x05d8('0x35')]=_0x6cd67a[_0x05d8('0x35')]['length']?_0x6cd67a['attributes']:_0x54f9d6[_0x05d8('0x31')];if(!_0x4618c1[_0x05d8('0x32')]['hasOwnProperty'](_0x05d8('0x37'))){_0x6cd67a['limit']=qs[_0x05d8('0x1e')](_0x4618c1[_0x05d8('0x32')][_0x05d8('0x1e')]);_0x6cd67a['offset']=qs['offset'](_0x4618c1[_0x05d8('0x32')][_0x05d8('0x1b')]);}_0x6cd67a[_0x05d8('0x38')]=qs[_0x05d8('0x39')](_0x4618c1[_0x05d8('0x32')][_0x05d8('0x39')]);_0x6cd67a[_0x05d8('0x3a')]=qs[_0x05d8('0x34')](_[_0x05d8('0x3b')](_0x4618c1[_0x05d8('0x32')],_0x54f9d6['filters']),_0x1e900e);if(_0x4618c1[_0x05d8('0x32')][_0x05d8('0x3c')]){_0x6cd67a[_0x05d8('0x3a')]=_[_0x05d8('0x3d')](_0x6cd67a[_0x05d8('0x3a')],{'$or':_['map'](_0x1e900e,function(_0x48f3f2){if(_0x48f3f2[_0x05d8('0x30')]!==_0x05d8('0x3e')){var _0x553cec={};_0x553cec[_0x48f3f2['name']]={'$like':'%'+_0x4618c1[_0x05d8('0x32')][_0x05d8('0x3c')]+'%'};return _0x553cec;}})});}_0x6cd67a=_[_0x05d8('0x3d')]({},_0x6cd67a,_0x4618c1[_0x05d8('0x3f')]);var _0x537734={'where':_0x6cd67a[_0x05d8('0x3a')]};return db['ChatTransferReport'][_0x05d8('0x1d')](_0x537734)[_0x05d8('0x26')](function(_0x578025){_0x39308b['count']=_0x578025;if(_0x4618c1[_0x05d8('0x32')]['includeAll']){_0x6cd67a[_0x05d8('0x40')]=[{'all':!![]}];}return db[_0x05d8('0x41')][_0x05d8('0x42')](_0x6cd67a);})[_0x05d8('0x26')](function(_0x582d92){_0x39308b['rows']=_0x582d92;return _0x39308b;})[_0x05d8('0x26')](respondWithFilteredResult(_0x27a0fe,_0x6cd67a))[_0x05d8('0x43')](handleError(_0x27a0fe,null));};exports[_0x05d8('0x44')]=function(_0xfc570,_0x3f00cc){var _0x39d227={'raw':!![],'where':{'id':_0xfc570['params']['id']}},_0x44b4b5={};_0x44b4b5[_0x05d8('0x31')]=_[_0x05d8('0x33')](db[_0x05d8('0x41')][_0x05d8('0x2e')]);_0x44b4b5[_0x05d8('0x32')]=_[_0x05d8('0x33')](_0xfc570[_0x05d8('0x32')]);_0x44b4b5[_0x05d8('0x34')]=_[_0x05d8('0x45')](_0x44b4b5[_0x05d8('0x31')],_0x44b4b5[_0x05d8('0x32')]);_0x39d227[_0x05d8('0x35')]=_[_0x05d8('0x45')](_0x44b4b5[_0x05d8('0x31')],qs[_0x05d8('0x36')](_0xfc570['query'][_0x05d8('0x36')]));_0x39d227[_0x05d8('0x35')]=_0x39d227[_0x05d8('0x35')][_0x05d8('0x46')]?_0x39d227['attributes']:_0x44b4b5[_0x05d8('0x31')];if(_0xfc570[_0x05d8('0x32')][_0x05d8('0x47')]){_0x39d227[_0x05d8('0x40')]=[{'all':!![]}];}_0x39d227=_[_0x05d8('0x3d')]({},_0x39d227,_0xfc570[_0x05d8('0x3f')]);return db[_0x05d8('0x41')][_0x05d8('0x48')](_0x39d227)[_0x05d8('0x26')](handleEntityNotFound(_0x3f00cc,null))[_0x05d8('0x26')](respondWithResult(_0x3f00cc,null))[_0x05d8('0x43')](handleError(_0x3f00cc,null));};exports[_0x05d8('0x49')]=function(_0x414d6b,_0x3b28be){return db['ChatTransferReport'][_0x05d8('0x49')](_0x414d6b[_0x05d8('0x4a')],{})[_0x05d8('0x26')](respondWithResult(_0x3b28be,0xc9))['catch'](handleError(_0x3b28be,null));};exports[_0x05d8('0x25')]=function(_0x42c85c,_0x14ebfe){if(_0x42c85c[_0x05d8('0x4a')]['id']){delete _0x42c85c[_0x05d8('0x4a')]['id'];}return db[_0x05d8('0x41')]['find']({'where':{'id':_0x42c85c[_0x05d8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x14ebfe,null))['then'](saveUpdates(_0x42c85c[_0x05d8('0x4a')],null))[_0x05d8('0x26')](respondWithResult(_0x14ebfe,null))[_0x05d8('0x43')](handleError(_0x14ebfe,null));};exports[_0x05d8('0x27')]=function(_0x4d3b72,_0x4aad16){return db[_0x05d8('0x41')]['find']({'where':{'id':_0x4d3b72[_0x05d8('0x4b')]['id']}})[_0x05d8('0x26')](handleEntityNotFound(_0x4aad16,null))[_0x05d8('0x26')](removeEntity(_0x4aad16,null))[_0x05d8('0x43')](handleError(_0x4aad16,null));};exports[_0x05d8('0x4c')]=function(_0x565b27,_0x36a943){return db[_0x05d8('0x41')]['describe']()['then'](respondWithResult(_0x36a943,null))[_0x05d8('0x43')](handleError(_0x36a943,null));};
\ No newline at end of file
+var _0xc91e=['params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show'];(function(_0x10c5e2,_0x272dcf){var _0x5bb7ca=function(_0x26289a){while(--_0x26289a){_0x10c5e2['push'](_0x10c5e2['shift']());}};_0x5bb7ca(++_0x272dcf);}(_0xc91e,0xf3));var _0xec91=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc91e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec91('0x0'));var zipdir=require(_0xec91('0x1'));var jsonpatch=require(_0xec91('0x2'));var rp=require(_0xec91('0x3'));var moment=require(_0xec91('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec91('0x5'));var util=require(_0xec91('0x6'));var path=require(_0xec91('0x7'));var sox=require(_0xec91('0x8'));var csv=require(_0xec91('0x9'));var ejs=require(_0xec91('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec91('0xb'));var squel=require(_0xec91('0xc'));var crypto=require(_0xec91('0xd'));var jsforce=require(_0xec91('0xe'));var deskjs=require(_0xec91('0xf'));var toCsv=require(_0xec91('0x9'));var querystring=require(_0xec91('0x10'));var Papa=require('papaparse');var Redis=require(_0xec91('0x11'));var authService=require(_0xec91('0x12'));var qs=require(_0xec91('0x13'));var as=require(_0xec91('0x14'));var hardwareService=require(_0xec91('0x15'));var logger=require(_0xec91('0x16'))(_0xec91('0x17'));var utils=require(_0xec91('0x18'));var config=require(_0xec91('0x19'));var licenseUtil=require(_0xec91('0x1a'));var db=require(_0xec91('0x1b'))['db'];function respondWithStatusCode(_0x434c9b,_0x12f5a9){_0x12f5a9=_0x12f5a9||0xcc;return function(_0x30c755){if(_0x30c755){return _0x434c9b[_0xec91('0x1c')](_0x12f5a9);}return _0x434c9b[_0xec91('0x1d')](_0x12f5a9)['end']();};}function respondWithResult(_0x1d49e3,_0x45a32e){_0x45a32e=_0x45a32e||0xc8;return function(_0x4e3914){if(_0x4e3914){return _0x1d49e3[_0xec91('0x1d')](_0x45a32e)[_0xec91('0x1e')](_0x4e3914);}};}function respondWithFilteredResult(_0x51d515,_0x14cb67){return function(_0x5e2249){if(_0x5e2249){var _0x2b3847=typeof _0x14cb67[_0xec91('0x1f')]==='undefined'&&typeof _0x14cb67['limit']==='undefined';var _0x1e25e2=_0x5e2249[_0xec91('0x20')];var _0x43138c=_0x2b3847?0x0:_0x14cb67['offset'];var _0x5559a9=_0x2b3847?_0x5e2249[_0xec91('0x20')]:_0x14cb67['offset']+_0x14cb67[_0xec91('0x21')];var _0x493d9c;if(_0x5559a9>=_0x1e25e2){_0x5559a9=_0x1e25e2;_0x493d9c=0xc8;}else{_0x493d9c=0xce;}_0x51d515[_0xec91('0x1d')](_0x493d9c);return _0x51d515[_0xec91('0x22')](_0xec91('0x23'),_0x43138c+'-'+_0x5559a9+'/'+_0x1e25e2)[_0xec91('0x1e')](_0x5e2249);}return null;};}function patchUpdates(_0x377ee2){return function(_0x53d26c){try{jsonpatch[_0xec91('0x24')](_0x53d26c,_0x377ee2,!![]);}catch(_0xfd4310){return BPromise['reject'](_0xfd4310);}return _0x53d26c[_0xec91('0x25')]();};}function saveUpdates(_0x586ecd,_0xfa5403){return function(_0x2f0498){if(_0x2f0498){return _0x2f0498['update'](_0x586ecd)[_0xec91('0x26')](function(_0xb50e80){return _0xb50e80;});}return null;};}function removeEntity(_0x4d4d10,_0x13121b){return function(_0x152ce4){if(_0x152ce4){return _0x152ce4[_0xec91('0x27')]()[_0xec91('0x26')](function(){_0x4d4d10[_0xec91('0x1d')](0xcc)[_0xec91('0x28')]();});}};}function handleEntityNotFound(_0x46fbef,_0x2fe1ee){return function(_0x2065f4){if(!_0x2065f4){_0x46fbef['sendStatus'](0x194);}return _0x2065f4;};}function handleError(_0x3c168e,_0x1976da){_0x1976da=_0x1976da||0x1f4;return function(_0x3ca197){logger[_0xec91('0x29')](_0x3ca197[_0xec91('0x2a')]);if(_0x3ca197[_0xec91('0x2b')]){delete _0x3ca197[_0xec91('0x2b')];}_0x3c168e[_0xec91('0x1d')](_0x1976da)[_0xec91('0x2c')](_0x3ca197);};}exports[_0xec91('0x2d')]=function(_0x374fd2,_0x145489){var _0x46d206={},_0x2da4bf={},_0x58e6ec={'count':0x0,'rows':[]};var _0x4f13d4=_[_0xec91('0x2e')](db[_0xec91('0x2f')][_0xec91('0x30')],function(_0x301919){return{'name':_0x301919[_0xec91('0x31')],'type':_0x301919[_0xec91('0x32')][_0xec91('0x33')]};});_0x2da4bf[_0xec91('0x34')]=_['map'](_0x4f13d4,_0xec91('0x2b'));_0x2da4bf[_0xec91('0x35')]=_[_0xec91('0x36')](_0x374fd2[_0xec91('0x35')]);_0x2da4bf['filters']=_[_0xec91('0x37')](_0x2da4bf[_0xec91('0x34')],_0x2da4bf['query']);_0x46d206['attributes']=_['intersection'](_0x2da4bf[_0xec91('0x34')],qs[_0xec91('0x38')](_0x374fd2['query'][_0xec91('0x38')]));_0x46d206[_0xec91('0x39')]=_0x46d206['attributes'][_0xec91('0x3a')]?_0x46d206[_0xec91('0x39')]:_0x2da4bf[_0xec91('0x34')];if(!_0x374fd2['query']['hasOwnProperty']('nolimit')){_0x46d206[_0xec91('0x21')]=qs['limit'](_0x374fd2['query']['limit']);_0x46d206[_0xec91('0x1f')]=qs[_0xec91('0x1f')](_0x374fd2[_0xec91('0x35')][_0xec91('0x1f')]);}_0x46d206[_0xec91('0x3b')]=qs[_0xec91('0x3c')](_0x374fd2[_0xec91('0x35')][_0xec91('0x3c')]);_0x46d206[_0xec91('0x3d')]=qs[_0xec91('0x3e')](_[_0xec91('0x3f')](_0x374fd2[_0xec91('0x35')],_0x2da4bf[_0xec91('0x3e')]),_0x4f13d4);if(_0x374fd2[_0xec91('0x35')]['filter']){_0x46d206[_0xec91('0x3d')]=_['merge'](_0x46d206[_0xec91('0x3d')],{'$or':_[_0xec91('0x2e')](_0x4f13d4,function(_0x602b62){if(_0x602b62[_0xec91('0x32')]!==_0xec91('0x40')){var _0x34fe54={};_0x34fe54[_0x602b62[_0xec91('0x2b')]]={'$like':'%'+_0x374fd2[_0xec91('0x35')][_0xec91('0x41')]+'%'};return _0x34fe54;}})});}_0x46d206=_[_0xec91('0x42')]({},_0x46d206,_0x374fd2[_0xec91('0x43')]);var _0x581441={'where':_0x46d206[_0xec91('0x3d')]};return db[_0xec91('0x2f')][_0xec91('0x20')](_0x581441)[_0xec91('0x26')](function(_0x4420d5){_0x58e6ec[_0xec91('0x20')]=_0x4420d5;if(_0x374fd2[_0xec91('0x35')]['includeAll']){_0x46d206[_0xec91('0x44')]=[{'all':!![]}];}return db[_0xec91('0x2f')][_0xec91('0x45')](_0x46d206);})['then'](function(_0x145c22){_0x58e6ec[_0xec91('0x46')]=_0x145c22;return _0x58e6ec;})[_0xec91('0x26')](respondWithFilteredResult(_0x145489,_0x46d206))[_0xec91('0x47')](handleError(_0x145489,null));};exports[_0xec91('0x48')]=function(_0x75c3c4,_0x3af6cd){var _0x4e9e4a={'raw':!![],'where':{'id':_0x75c3c4[_0xec91('0x49')]['id']}},_0x3fb7d0={};_0x3fb7d0[_0xec91('0x34')]=_[_0xec91('0x36')](db[_0xec91('0x2f')][_0xec91('0x30')]);_0x3fb7d0[_0xec91('0x35')]=_[_0xec91('0x36')](_0x75c3c4[_0xec91('0x35')]);_0x3fb7d0[_0xec91('0x3e')]=_[_0xec91('0x37')](_0x3fb7d0['model'],_0x3fb7d0[_0xec91('0x35')]);_0x4e9e4a[_0xec91('0x39')]=_[_0xec91('0x37')](_0x3fb7d0[_0xec91('0x34')],qs[_0xec91('0x38')](_0x75c3c4['query']['fields']));_0x4e9e4a[_0xec91('0x39')]=_0x4e9e4a[_0xec91('0x39')][_0xec91('0x3a')]?_0x4e9e4a[_0xec91('0x39')]:_0x3fb7d0['model'];if(_0x75c3c4[_0xec91('0x35')][_0xec91('0x4a')]){_0x4e9e4a[_0xec91('0x44')]=[{'all':!![]}];}_0x4e9e4a=_[_0xec91('0x42')]({},_0x4e9e4a,_0x75c3c4[_0xec91('0x43')]);return db[_0xec91('0x2f')]['find'](_0x4e9e4a)[_0xec91('0x26')](handleEntityNotFound(_0x3af6cd,null))[_0xec91('0x26')](respondWithResult(_0x3af6cd,null))['catch'](handleError(_0x3af6cd,null));};exports[_0xec91('0x4b')]=function(_0x3f44c2,_0x3c9513){return db[_0xec91('0x2f')][_0xec91('0x4b')](_0x3f44c2[_0xec91('0x4c')],{})[_0xec91('0x26')](respondWithResult(_0x3c9513,0xc9))['catch'](handleError(_0x3c9513,null));};exports['update']=function(_0x23bda1,_0x339dff){if(_0x23bda1['body']['id']){delete _0x23bda1[_0xec91('0x4c')]['id'];}return db[_0xec91('0x2f')][_0xec91('0x4d')]({'where':{'id':_0x23bda1[_0xec91('0x49')]['id']}})['then'](handleEntityNotFound(_0x339dff,null))['then'](saveUpdates(_0x23bda1[_0xec91('0x4c')],null))[_0xec91('0x26')](respondWithResult(_0x339dff,null))['catch'](handleError(_0x339dff,null));};exports[_0xec91('0x27')]=function(_0x4e0c2f,_0x1cc81d){return db[_0xec91('0x2f')][_0xec91('0x4d')]({'where':{'id':_0x4e0c2f[_0xec91('0x49')]['id']}})[_0xec91('0x26')](handleEntityNotFound(_0x1cc81d,null))[_0xec91('0x26')](removeEntity(_0x1cc81d,null))[_0xec91('0x47')](handleError(_0x1cc81d,null));};exports['describe']=function(_0x27b2bf,_0x26f440){return db['ChatTransferReport'][_0xec91('0x4e')]()['then'](respondWithResult(_0x26f440,null))['catch'](handleError(_0x26f440,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 27bd8de..f476d54 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 _0x0eec=['path','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','bluebird','request-promise'];(function(_0x55415f,_0x5c7014){var _0x5c42ba=function(_0xe01ac7){while(--_0xe01ac7){_0x55415f['push'](_0x55415f['shift']());}};_0x5c42ba(++_0x5c7014);}(_0x0eec,0x69));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc0ee('0x0'));var util=require(_0xc0ee('0x1'));var logger=require('../../config/logger')(_0xc0ee('0x2'));var moment=require('moment');var BPromise=require(_0xc0ee('0x3'));var rp=require(_0xc0ee('0x4'));var fs=require('fs');var path=require(_0xc0ee('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xc0ee('0x6')]=function(_0x14aa90,_0x31cf4a){return _0x14aa90[_0xc0ee('0x7')](_0xc0ee('0x8'),attributes,{'tableName':_0xc0ee('0x9'),'paranoid':![],'indexes':[{'name':_0xc0ee('0xa'),'fields':[_0xc0ee('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4337=['define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatTransferReport.attributes','exports'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0x4337,0xee));var _0x7433=function(_0x37b107,_0x4d7147){_0x37b107=_0x37b107-0x0;var _0x21b907=_0x4337[_0x37b107];return _0x21b907;};'use strict';var _=require('lodash');var util=require(_0x7433('0x0'));var logger=require(_0x7433('0x1'))(_0x7433('0x2'));var moment=require(_0x7433('0x3'));var BPromise=require(_0x7433('0x4'));var rp=require(_0x7433('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7433('0x6'));var config=require('../../config/environment');var attributes=require(_0x7433('0x7'));module[_0x7433('0x8')]=function(_0xe881eb,_0x5a5436){return _0xe881eb[_0x7433('0x9')](_0x7433('0xa'),attributes,{'tableName':_0x7433('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7433('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 34a2dec..398d9f8 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 _0xd772=['result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3b7670,_0x362eb2){var _0x1bf2c7=function(_0x14a9d9){while(--_0x14a9d9){_0x3b7670['push'](_0x3b7670['shift']());}};_0x1bf2c7(++_0x362eb2);}(_0xd772,0x16a));var _0x2d77=function(_0x5b10de,_0x2f8ffe){_0x5b10de=_0x5b10de-0x0;var _0x5e857d=_0xd772[_0x5b10de];return _0x5e857d;};'use strict';var _=require('lodash');var util=require(_0x2d77('0x0'));var moment=require(_0x2d77('0x1'));var BPromise=require(_0x2d77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d77('0x3'))['db'];var utils=require(_0x2d77('0x4'));var logger=require(_0x2d77('0x5'))('rpc');var config=require(_0x2d77('0x6'));var jayson=require(_0x2d77('0x7'));var client=jayson['client'][_0x2d77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb55331,_0x350066,_0x3a1c92){return new BPromise(function(_0x1de630,_0x447a10){return client[_0x2d77('0x9')](_0xb55331,_0x3a1c92)[_0x2d77('0xa')](function(_0x2d685d){logger['info'](_0x2d77('0xb'),_0x350066,_0x2d77('0xc'));logger[_0x2d77('0xd')](_0x2d77('0xe'),_0x350066,'request\x20sent',JSON[_0x2d77('0xf')](_0x2d685d));if(_0x2d685d[_0x2d77('0x10')]){if(_0x2d685d[_0x2d77('0x10')]['code']===0x1f4){logger[_0x2d77('0x10')](_0x2d77('0xb'),_0x350066,_0x2d685d[_0x2d77('0x10')][_0x2d77('0x11')]);return _0x447a10(_0x2d685d[_0x2d77('0x10')][_0x2d77('0x11')]);}logger[_0x2d77('0x10')](_0x2d77('0xb'),_0x350066,_0x2d685d[_0x2d77('0x10')][_0x2d77('0x11')]);return _0x1de630(_0x2d685d[_0x2d77('0x10')]['message']);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x350066,_0x2d77('0xc'));_0x1de630(_0x2d685d[_0x2d77('0x12')]['message']);}})[_0x2d77('0x13')](function(_0x209d12){logger['error'](_0x2d77('0xb'),_0x350066,_0x209d12);_0x447a10(_0x209d12);});});}
\ No newline at end of file
+var _0x1ca1=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x2fd42d,_0x1e20b4){var _0x1dc0c8=function(_0x104b21){while(--_0x104b21){_0x2fd42d['push'](_0x2fd42d['shift']());}};_0x1dc0c8(++_0x1e20b4);}(_0x1ca1,0x150));var _0x11ca=function(_0x50d753,_0x2427b9){_0x50d753=_0x50d753-0x0;var _0xaef6d9=_0x1ca1[_0x50d753];return _0xaef6d9;};'use strict';var _=require(_0x11ca('0x0'));var util=require(_0x11ca('0x1'));var moment=require(_0x11ca('0x2'));var BPromise=require(_0x11ca('0x3'));var rs=require(_0x11ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x11ca('0x6'))(_0x11ca('0x7'));var config=require(_0x11ca('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x11ca('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59fda7,_0xf6dc4d,_0x275158){return new BPromise(function(_0x567c47,_0x27aa8a){return client['request'](_0x59fda7,_0x275158)[_0x11ca('0xa')](function(_0x1c9278){logger['info'](_0x11ca('0xb'),_0xf6dc4d,_0x11ca('0xc'));logger[_0x11ca('0xd')](_0x11ca('0xe'),_0xf6dc4d,'request\x20sent',JSON[_0x11ca('0xf')](_0x1c9278));if(_0x1c9278[_0x11ca('0x10')]){if(_0x1c9278[_0x11ca('0x10')][_0x11ca('0x11')]===0x1f4){logger[_0x11ca('0x10')](_0x11ca('0xb'),_0xf6dc4d,_0x1c9278[_0x11ca('0x10')]['message']);return _0x27aa8a(_0x1c9278['error'][_0x11ca('0x12')]);}logger[_0x11ca('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xf6dc4d,_0x1c9278['error']['message']);return _0x567c47(_0x1c9278[_0x11ca('0x10')][_0x11ca('0x12')]);}else{logger[_0x11ca('0x13')](_0x11ca('0xb'),_0xf6dc4d,'request\x20sent');_0x567c47(_0x1c9278['result']['message']);}})[_0x11ca('0x14')](function(_0x1a4b2b){logger[_0x11ca('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0xf6dc4d,_0x1a4b2b);_0x27aa8a(_0x1a4b2b);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 7249ef6..6e854f2 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 _0xea17=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x21165a,_0x3aab21){var _0x33854b=function(_0x38d844){while(--_0x38d844){_0x21165a['push'](_0x21165a['shift']());}};_0x33854b(++_0x3aab21);}(_0xea17,0x14b));var _0x7ea1=function(_0x54153b,_0x452448){_0x54153b=_0x54153b-0x0;var _0x2a3ea6=_0xea17[_0x54153b];return _0x2a3ea6;};'use strict';var multer=require('multer');var util=require(_0x7ea1('0x0'));var path=require(_0x7ea1('0x1'));var timeout=require(_0x7ea1('0x2'));var express=require(_0x7ea1('0x3'));var router=express['Router']();var fs_extra=require(_0x7ea1('0x4'));var auth=require(_0x7ea1('0x5'));var interaction=require(_0x7ea1('0x6'));var config=require(_0x7ea1('0x7'));var controller=require(_0x7ea1('0x8'));router[_0x7ea1('0x9')]('/',auth[_0x7ea1('0xa')](),controller[_0x7ea1('0xb')]);router[_0x7ea1('0x9')](_0x7ea1('0xc'),auth[_0x7ea1('0xa')](),controller['describe']);router['get']('/:id',auth[_0x7ea1('0xa')](),controller[_0x7ea1('0xd')]);router[_0x7ea1('0xe')]('/',auth[_0x7ea1('0xa')](),controller[_0x7ea1('0xf')]);router[_0x7ea1('0x10')](_0x7ea1('0x11'),auth[_0x7ea1('0xa')](),controller[_0x7ea1('0x12')]);router[_0x7ea1('0x13')](_0x7ea1('0x11'),auth[_0x7ea1('0xa')](),controller[_0x7ea1('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xea57=['isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get'];(function(_0x2fdd67,_0x50aefa){var _0x5e3655=function(_0x4055c1){while(--_0x4055c1){_0x2fdd67['push'](_0x2fdd67['shift']());}};_0x5e3655(++_0x50aefa);}(_0xea57,0x124));var _0x7ea5=function(_0x18eaff,_0x4e3865){_0x18eaff=_0x18eaff-0x0;var _0x2571ff=_0xea57[_0x18eaff];return _0x2571ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7ea5('0x0'));var timeout=require('connect-timeout');var express=require(_0x7ea5('0x1'));var router=express[_0x7ea5('0x2')]();var fs_extra=require(_0x7ea5('0x3'));var auth=require(_0x7ea5('0x4'));var interaction=require(_0x7ea5('0x5'));var config=require('../../config/environment');var controller=require(_0x7ea5('0x6'));router[_0x7ea5('0x7')]('/',auth[_0x7ea5('0x8')](),controller[_0x7ea5('0x9')]);router[_0x7ea5('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x7ea5('0xa')]);router[_0x7ea5('0x7')](_0x7ea5('0xb'),auth[_0x7ea5('0x8')](),controller[_0x7ea5('0xc')]);router[_0x7ea5('0xd')]('/',auth['isAuthenticated'](),controller[_0x7ea5('0xe')]);router[_0x7ea5('0xf')](_0x7ea5('0xb'),auth[_0x7ea5('0x8')](),controller[_0x7ea5('0x10')]);router[_0x7ea5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7ea5('0x12')]);module[_0x7ea5('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index e81a90e..7f0f501 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 _0xb821=['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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','name','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate'];(function(_0x4c3fbc,_0x96541b){var _0x1d33d0=function(_0x2a64fd){while(--_0x2a64fd){_0x4c3fbc['push'](_0x4c3fbc['shift']());}};_0x1d33d0(++_0x96541b);}(_0xb821,0xa7));var _0x1b82=function(_0x2c814b,_0x85ca59){_0x2c814b=_0x2c814b-0x0;var _0xbd4f5a=_0xb821[_0x2c814b];return _0xbd4f5a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1b82('0x0'));module[_0x1b82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1b82('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x3')},'mapKeyOffline':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x3')},'key':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x5')},'customerAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1b82('0x4')]},'animation':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1b82('0xa')](_0x1b82('0xb'),_0x1b82('0xc')),'defaultValue':_0x1b82('0xb')},'header_online':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xd')},'offline_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1b82('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x12')},'placeholderMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xe')},'skipMessageButton':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x1b82('0x16'),_0x1b82('0x17')),'defaultValue':_0x1b82('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x1b82('0x1a'),'required':!![]},'props':{'title':_0x1b82('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1b82('0x1c'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0xf2e556){return this[_0x1b82('0x1d')](_0x1b82('0x1c'),JSON[_0x1b82('0x18')](_0xf2e556));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null},{'type':_0x1b82('0x1e'),'config':{'placeholder':_0x1b82('0x1f')},'props':{'title':_0x1b82('0x1f'),'helpText':_0x1b82('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1b82('0x21')](_0x1b82('0x22'))?JSON[_0x1b82('0x23')](this[_0x1b82('0x21')]('offlineForm')):{};},'set':function(_0x17b3aa){return this[_0x1b82('0x1d')](_0x1b82('0x22'),JSON[_0x1b82('0x18')](_0x17b3aa));}},'token':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return rs[_0x1b82('0x24')]();}},'autoclose':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1b82('0x4')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1b82('0x4')]},'waitingTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x25')},'waitingMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1b82('0x4')]},'notificationTemplate':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return _0x1b82('0x28');}},'notificationSound':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2b')},'messagesAlignment':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2c')},'defaultTitle':{'type':Sequelize[_0x1b82('0x4')]},'customerAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2d')},'systemAvatar':{'type':Sequelize[_0x1b82('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1b82('0x8')],'comment':_0x1b82('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x17d214){if(!_0x17d214)this['setDataValue'](_0x1b82('0x2f'),null);this['setDataValue'](_0x1b82('0x30'),_0x17d214);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x31')},'vidaooNote':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return _0x1b82('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1b82('0x10')]}};
\ No newline at end of file
+var _0x17ba=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x531700,_0xc52598){var _0x4e1068=function(_0x3027f6){while(--_0x3027f6){_0x531700['push'](_0x531700['shift']());}};_0x4e1068(++_0xc52598);}(_0x17ba,0xab));var _0xa17b=function(_0x4303c7,_0x3fc32d){_0x4303c7=_0x4303c7-0x0;var _0x5f2710=_0x17ba[_0x4303c7];return _0x5f2710;};'use strict';var Sequelize=require(_0xa17b('0x0'));var rs=require(_0xa17b('0x1'));module['exports']={'name':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'unique':_0xa17b('0x3')},'description':{'type':Sequelize[_0xa17b('0x2')]},'mapKey':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x4')},'key':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x5')},'customerAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa17b('0x2')]},'animation':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa17b('0xa')](_0xa17b('0xb'),_0xa17b('0xc')),'defaultValue':_0xa17b('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xd')},'start_chat_button':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xf')},'header_offline':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x10')},'download_transcript':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa17b('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0xf')},'skipMessageButton':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x15')},'conditionAgreement':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa17b('0x16')},'ratingType':{'type':Sequelize[_0xa17b('0xa')](_0xa17b('0x17'),'thumb'),'defaultValue':_0xa17b('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa17b('0x11')],'defaultValue':function(){return JSON[_0xa17b('0x18')]({'items':[{'type':_0xa17b('0x19'),'variable':null,'config':{'placeholder':_0xa17b('0x1a'),'type':'text','required':!![]},'props':{'title':_0xa17b('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0xa17b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa17b('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa17b('0x1b'))?JSON[_0xa17b('0x1c')](this[_0xa17b('0x1d')](_0xa17b('0x1b'))):{};},'set':function(_0x3c32a5){return this[_0xa17b('0x1e')]('onlineForm',JSON['stringify'](_0x3c32a5));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa17b('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa17b('0x4'),'type':'email'},'variable':null},{'type':_0xa17b('0x1f'),'config':{'placeholder':_0xa17b('0x20')},'props':{'title':_0xa17b('0x20'),'helpText':_0xa17b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xa17b('0x1d')](_0xa17b('0x22'))?JSON[_0xa17b('0x1c')](this[_0xa17b('0x1d')](_0xa17b('0x22'))):{};},'set':function(_0x2dc1f2){return this[_0xa17b('0x1e')]('offlineForm',JSON['stringify'](_0x2dc1f2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa17b('0x23')]();}},'autoclose':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa17b('0x2')]},'forwardOffline':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa17b('0x2')]},'waitingTitle':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x24')},'offlineMessageBody':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x15')},'sendUnmanaged':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa17b('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa17b('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa17b('0x26');}},'notificationSound':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa17b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x27')},'verticalAlignment':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xa17b('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa17b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':_0xa17b('0x28')},'systemAvatar':{'type':Sequelize[_0xa17b('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa17b('0x8')],'comment':_0xa17b('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x468c92){if(!_0x468c92)this[_0xa17b('0x1e')]('mandatoryDispositionPauseId',null);this[_0xa17b('0x1e')](_0xa17b('0x2a'),_0x468c92);}},'vidaooEscalation':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa17b('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![],'defaultValue':_0xa17b('0x2b')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xa17b('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xa17b('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa17b('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index f31b42b..d96d06b 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 _0xd7ef=['../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','join','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','createdAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','priority','asc','from','contact','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','difference','send','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','offline-chat','remove','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','render','verticalAlignment','color','textColor','color_button','backgroundColor','addApplications','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','path','lodash','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','show','rawAttributes','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','params','describe','addDisposition','ChatWebsiteId','Disposition','filter','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg'];(function(_0x528d0a,_0x221b66){var _0x3482a3=function(_0x3e4a14){while(--_0x3e4a14){_0x528d0a['push'](_0x528d0a['shift']());}};_0x3482a3(++_0x221b66);}(_0xd7ef,0xbe));var _0xfd7e=function(_0x3056d4,_0x540d49){_0x3056d4=_0x3056d4-0x0;var _0xf66ece=_0xd7ef[_0x3056d4];return _0xf66ece;};'use strict';var BPromise=require(_0xfd7e('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfd7e('0x1'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd7e('0x2'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xfd7e('0x3'))['db'];config[_0xfd7e('0x4')]=_[_0xfd7e('0x5')](config[_0xfd7e('0x4')],{'host':_0xfd7e('0x6'),'port':0x18eb});var socket=require(_0xfd7e('0x7'))(new Redis(config[_0xfd7e('0x4')]));require(_0xfd7e('0x8'))[_0xfd7e('0x9')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xfd7e('0xa'));var client=jayson[_0xfd7e('0xb')][_0xfd7e('0xc')]({'port':0x232c});var client9002=jayson[_0xfd7e('0xb')][_0xfd7e('0xc')]({'port':0x232a});var client9003=jayson[_0xfd7e('0xb')][_0xfd7e('0xc')]({'port':0x232b});var client9001=jayson['client'][_0xfd7e('0xc')]({'port':0x2329});function respondWithRpcPromise(_0x34a9ba,_0x4eeffc,_0x2f2408,_0x12409f){return new BPromise(function(_0x315980,_0xb740ae){var _0x1283e4=_0x12409f||client;return _0x1283e4[_0xfd7e('0xd')](_0x34a9ba,_0x2f2408)[_0xfd7e('0xe')](function(_0x3aa27f){logger[_0xfd7e('0xf')](_0xfd7e('0x10'),_0x4eeffc,_0xfd7e('0x11'));logger['debug'](_0xfd7e('0x12'),_0x4eeffc,_0xfd7e('0x11'),JSON[_0xfd7e('0x13')](_0x3aa27f));if(_0x3aa27f[_0xfd7e('0x14')]){if(_0x3aa27f['error'][_0xfd7e('0x15')]===0x1f4){logger[_0xfd7e('0x14')](_0xfd7e('0x10'),_0x4eeffc,_0x3aa27f['error'][_0xfd7e('0x16')]);return _0xb740ae(_0x3aa27f[_0xfd7e('0x14')][_0xfd7e('0x16')]);}logger[_0xfd7e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4eeffc,_0x3aa27f[_0xfd7e('0x14')][_0xfd7e('0x16')]);return _0x315980(_0x3aa27f[_0xfd7e('0x14')][_0xfd7e('0x16')]);}else{logger[_0xfd7e('0xf')](_0xfd7e('0x10'),_0x4eeffc,_0xfd7e('0x11'));_0x315980(_0x3aa27f[_0xfd7e('0x17')][_0xfd7e('0x16')]);}})[_0xfd7e('0x18')](function(_0x33376f){logger[_0xfd7e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4eeffc,_0x33376f);_0xb740ae(_0x33376f);});});}function respondWithStatusCode(_0x2dac76,_0x40545a){_0x40545a=_0x40545a||0xcc;return function(_0xa17e42){if(_0xa17e42){return _0x2dac76[_0xfd7e('0x19')](_0x40545a);}return _0x2dac76[_0xfd7e('0x1a')](_0x40545a)[_0xfd7e('0x1b')]();};}function respondWithResult(_0x56a12c,_0x2b235e){_0x2b235e=_0x2b235e||0xc8;return function(_0x553edd){if(_0x553edd){return _0x56a12c[_0xfd7e('0x1a')](_0x2b235e)[_0xfd7e('0x1c')](_0x553edd);}};}function respondWithFilteredResult(_0x4b854d,_0x1b3d4d){return function(_0x539598){if(_0x539598){var _0x445ce9=typeof _0x1b3d4d['offset']===_0xfd7e('0x1d')&&typeof _0x1b3d4d[_0xfd7e('0x1e')]===_0xfd7e('0x1d');var _0x286908=_0x539598[_0xfd7e('0x1f')];var _0x411320=_0x445ce9?0x0:_0x1b3d4d[_0xfd7e('0x20')];var _0x51631f=_0x445ce9?_0x539598[_0xfd7e('0x1f')]:_0x1b3d4d[_0xfd7e('0x20')]+_0x1b3d4d[_0xfd7e('0x1e')];var _0xdb73b5;if(_0x51631f>=_0x286908){_0x51631f=_0x286908;_0xdb73b5=0xc8;}else{_0xdb73b5=0xce;}_0x4b854d[_0xfd7e('0x1a')](_0xdb73b5);return _0x4b854d[_0xfd7e('0x21')]('Content-Range',_0x411320+'-'+_0x51631f+'/'+_0x286908)[_0xfd7e('0x1c')](_0x539598);}return null;};}function saveUpdates(_0x14dff8){return function(_0x1c265f){if(_0x1c265f){return _0x1c265f[_0xfd7e('0x22')](_0x14dff8)[_0xfd7e('0xe')](function(_0x36c2ba){return _0x36c2ba;});}return null;};}function removeEntity(_0x5d9340){return function(_0x2da789){if(_0x2da789){return _0x2da789['destroy']()[_0xfd7e('0xe')](function(){var _0x1676a3=_0x2da789[_0xfd7e('0x23')]({'plain':!![]});var _0x10a78d=_0xfd7e('0x24');return db[_0xfd7e('0x25')][_0xfd7e('0x26')]({'where':{'type':_0x10a78d,'resourceId':_0x1676a3['id']}})[_0xfd7e('0xe')](function(){return _0x2da789;});})[_0xfd7e('0xe')](function(){_0x5d9340['status'](0xcc)[_0xfd7e('0x1b')]();});}};}function handleEntityNotFound(_0x55ad7c){return function(_0x3a9f99){if(!_0x3a9f99){_0x55ad7c[_0xfd7e('0x19')](0x194);}return _0x3a9f99;};}function handleError(_0x559d2d,_0x34b8c9){_0x34b8c9=_0x34b8c9||0x1f4;return function(_0x3e5327){logger[_0xfd7e('0x14')](_0x3e5327[_0xfd7e('0x27')]);if(_0x3e5327[_0xfd7e('0x28')]){delete _0x3e5327[_0xfd7e('0x28')];}_0x559d2d[_0xfd7e('0x1a')](_0x34b8c9)['send'](_0x3e5327);};}exports[_0xfd7e('0x29')]=function(_0x5f2886,_0xe6fff){var _0x5c77b9={'include':[{'model':db[_0xfd7e('0x2a')],'as':_0xfd7e('0x2b')}]},_0x21fc66={},_0x2bc81a={'count':0x0,'rows':[]};var _0x30eaaf=_[_0xfd7e('0x2c')](db[_0xfd7e('0x2d')]['rawAttributes'],function(_0x525af4){return{'name':_0x525af4[_0xfd7e('0x2e')],'type':_0x525af4[_0xfd7e('0x2f')]['key']};});_0x21fc66['model']=_[_0xfd7e('0x2c')](_0x30eaaf,_0xfd7e('0x28'));_0x21fc66['query']=_[_0xfd7e('0x30')](_0x5f2886['query']);_0x21fc66[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x21fc66[_0xfd7e('0x33')],_0x21fc66['query']);_0x5c77b9[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x21fc66[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x5f2886[_0xfd7e('0x36')]['fields']));_0x5c77b9[_0xfd7e('0x34')]=_0x5c77b9[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x5c77b9[_0xfd7e('0x34')]:_0x21fc66[_0xfd7e('0x33')];if(!_0x5f2886['query'][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x5c77b9['limit']=qs['limit'](_0x5f2886[_0xfd7e('0x36')][_0xfd7e('0x1e')]);_0x5c77b9[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x5f2886[_0xfd7e('0x36')][_0xfd7e('0x20')]);}_0x5c77b9[_0xfd7e('0x3a')]=qs[_0xfd7e('0x3b')](_0x5f2886[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x5c77b9['where']=qs[_0xfd7e('0x31')](_[_0xfd7e('0x3c')](_0x5f2886[_0xfd7e('0x36')],_0x21fc66['filters']),_0x30eaaf);if(_0x5f2886[_0xfd7e('0x36')]['filter']){_0x5c77b9[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x5c77b9[_0xfd7e('0x3d')],{'$or':_[_0xfd7e('0x2c')](_0x30eaaf,function(_0x1f609d){if(_0x1f609d[_0xfd7e('0x2f')]!=='VIRTUAL'){var _0x3fa8dc={};_0x3fa8dc[_0x1f609d[_0xfd7e('0x28')]]={'$like':'%'+_0x5f2886[_0xfd7e('0x36')]['filter']+'%'};return _0x3fa8dc;}})});}_0x5c77b9=_[_0xfd7e('0x3e')]({},_0x5c77b9,_0x5f2886[_0xfd7e('0x3f')]);var _0x331f60={'where':_0x5c77b9[_0xfd7e('0x3d')]};return db[_0xfd7e('0x2d')]['count'](_0x331f60)[_0xfd7e('0xe')](function(_0x564cfe){_0x2bc81a['count']=_0x564cfe;if(_0x5f2886['query'][_0xfd7e('0x40')]){_0x5c77b9[_0xfd7e('0x41')]=[{'all':!![]}];}return db[_0xfd7e('0x2d')][_0xfd7e('0x42')](_0x5c77b9);})[_0xfd7e('0xe')](function(_0x268ced){_0x2bc81a[_0xfd7e('0x43')]=_0x268ced;return _0x2bc81a;})[_0xfd7e('0xe')](respondWithFilteredResult(_0xe6fff,_0x5c77b9))[_0xfd7e('0x18')](handleError(_0xe6fff,null));};exports[_0xfd7e('0x44')]=function(_0x468783,_0x54868d){var _0x3ba999={'raw':![],'where':{'id':_0x468783['params']['id']},'include':[{'model':db[_0xfd7e('0x2a')],'as':'mandatoryDispositionPause'}]},_0x18454b={};_0x18454b['model']=_[_0xfd7e('0x30')](db['ChatWebsite'][_0xfd7e('0x45')]);_0x18454b[_0xfd7e('0x36')]=_[_0xfd7e('0x30')](_0x468783[_0xfd7e('0x36')]);_0x18454b[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x18454b[_0xfd7e('0x33')],_0x18454b[_0xfd7e('0x36')]);_0x3ba999[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x18454b[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x468783[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x3ba999['attributes']=_0x3ba999[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x3ba999[_0xfd7e('0x34')]:_0x18454b[_0xfd7e('0x33')];if(_0x468783[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0x3ba999['include']=[{'all':!![]}];}_0x3ba999=_[_0xfd7e('0x3e')]({},_0x3ba999,_0x468783[_0xfd7e('0x3f')]);return db[_0xfd7e('0x2d')][_0xfd7e('0x46')](_0x3ba999)[_0xfd7e('0xe')](handleEntityNotFound(_0x54868d,null))[_0xfd7e('0xe')](respondWithResult(_0x54868d,null))['catch'](handleError(_0x54868d,null));};exports[_0xfd7e('0x47')]=function(_0x4b655f,_0x3d3709){return db[_0xfd7e('0x2d')]['create'](_0x4b655f[_0xfd7e('0x48')],{})[_0xfd7e('0xe')](function(_0x28a199){var _0x3a8138=_0x4b655f[_0xfd7e('0x49')][_0xfd7e('0x23')]({'plain':!![]});if(!_0x3a8138)throw new Error(_0xfd7e('0x4a'));if(_0x3a8138[_0xfd7e('0x4b')]===_0xfd7e('0x49')){var _0x513dd4=_0x28a199['get']({'plain':!![]});var _0x21bafc='ChatWebsites';return db[_0xfd7e('0x4c')]['find']({'where':{'name':_0x21bafc,'userProfileId':_0x3a8138[_0xfd7e('0x4d')]},'raw':!![]})['then'](function(_0x4e7b17){if(_0x4e7b17&&_0x4e7b17[_0xfd7e('0x4e')]===0x0){return db[_0xfd7e('0x25')]['create']({'name':_0x513dd4['name'],'resourceId':_0x513dd4['id'],'type':_0x4e7b17['name'],'sectionId':_0x4e7b17['id']},{})[_0xfd7e('0xe')](function(){return _0x28a199;});}else{return _0x28a199;}})[_0xfd7e('0x18')](function(_0x55601b){logger[_0xfd7e('0x14')](_0xfd7e('0x4f'),_0x55601b);throw _0x55601b;});}return _0x28a199;})[_0xfd7e('0xe')](respondWithResult(_0x3d3709,0xc9))[_0xfd7e('0x18')](handleError(_0x3d3709,null));};exports[_0xfd7e('0x22')]=function(_0x216264,_0xfb38e){if(_0x216264['body']['id']){delete _0x216264[_0xfd7e('0x48')]['id'];}return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x216264['params']['id']},'include':[{'model':db[_0xfd7e('0x2a')],'as':_0xfd7e('0x2b')}]})[_0xfd7e('0xe')](handleEntityNotFound(_0xfb38e,null))[_0xfd7e('0xe')](saveUpdates(_0x216264['body'],null))[_0xfd7e('0xe')](respondWithResult(_0xfb38e,null))[_0xfd7e('0x18')](handleError(_0xfb38e,null));};exports['destroy']=function(_0x347076,_0x3240a9){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x347076[_0xfd7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x3240a9,null))[_0xfd7e('0xe')](removeEntity(_0x3240a9,null))[_0xfd7e('0x18')](handleError(_0x3240a9,null));};exports[_0xfd7e('0x51')]=function(_0x1d4ffd,_0x2b6808){return db[_0xfd7e('0x2d')][_0xfd7e('0x51')]()[_0xfd7e('0xe')](respondWithResult(_0x2b6808,null))[_0xfd7e('0x18')](handleError(_0x2b6808,null));};exports[_0xfd7e('0x52')]=function(_0x2cfb6c,_0x46f025){if(_0x2cfb6c[_0xfd7e('0x48')]['id']){delete _0x2cfb6c[_0xfd7e('0x48')]['id'];}return db['ChatWebsite'][_0xfd7e('0x46')]({'where':{'id':_0x2cfb6c[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x46f025,null))[_0xfd7e('0xe')](function(_0x400198){if(_0x400198){_0x2cfb6c[_0xfd7e('0x48')][_0xfd7e('0x53')]=_0x400198['id'];return db[_0xfd7e('0x54')][_0xfd7e('0x47')](_0x2cfb6c[_0xfd7e('0x48')]);}})['then'](respondWithResult(_0x46f025,null))[_0xfd7e('0x18')](handleError(_0x46f025,null));};exports['getDispositions']=function(_0x1d34e4,_0x15cac5){var _0xbd331a={'raw':![],'where':{}};var _0x3604e4={};var _0x227922={'count':0x0,'rows':[]};return db[_0xfd7e('0x2d')]['findOne']({'where':{'id':_0x1d34e4[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x15cac5,null))['then'](function(_0xf07ad4){if(_0xf07ad4){_0x3604e4[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db['Disposition'][_0xfd7e('0x45')]);_0x3604e4[_0xfd7e('0x36')]=_[_0xfd7e('0x30')](_0x1d34e4['query']);_0x3604e4['filters']=_[_0xfd7e('0x32')](_0x3604e4['model'],_0x3604e4[_0xfd7e('0x36')]);_0xbd331a['attributes']=_[_0xfd7e('0x32')](_0x3604e4[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0xbd331a['attributes']=_0xbd331a['attributes'][_0xfd7e('0x37')]?_0xbd331a[_0xfd7e('0x34')]:_0x3604e4[_0xfd7e('0x33')];if(!_0x1d34e4['query'][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0xbd331a[_0xfd7e('0x1e')]=qs[_0xfd7e('0x1e')](_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x1e')]);_0xbd331a[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x1d34e4[_0xfd7e('0x36')]['offset']);}_0xbd331a[_0xfd7e('0x3a')]=qs[_0xfd7e('0x3b')](_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0xbd331a[_0xfd7e('0x3d')]=qs['filters'](_[_0xfd7e('0x3c')](_0x1d34e4[_0xfd7e('0x36')],_0x3604e4[_0xfd7e('0x31')]));_0xbd331a[_0xfd7e('0x3d')]['ChatWebsiteId']=_0xf07ad4['id'];if(_0x1d34e4['query']['filter']){_0xbd331a[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0xbd331a['where'],{'$or':_['map'](_0xbd331a[_0xfd7e('0x34')],function(_0xd6ea7f){var _0x51cade={};_0x51cade[_0xd6ea7f]={'$like':'%'+_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x55')]+'%'};return _0x51cade;})});}_0xbd331a=_[_0xfd7e('0x3e')]({},_0xbd331a,_0x1d34e4[_0xfd7e('0x3f')]);return db[_0xfd7e('0x54')][_0xfd7e('0x1f')]({'where':_0xbd331a['where']})['then'](function(_0x1fa5d9){_0x227922[_0xfd7e('0x1f')]=_0x1fa5d9;if(_0x1d34e4[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0xbd331a['include']=[{'all':!![]}];}return db['Disposition'][_0xfd7e('0x42')](_0xbd331a);})['then'](function(_0x20bbae){_0x227922[_0xfd7e('0x43')]=_0x20bbae;return _0x227922;});}})[_0xfd7e('0xe')](respondWithFilteredResult(_0x15cac5,_0xbd331a))[_0xfd7e('0x18')](handleError(_0x15cac5,null));};exports[_0xfd7e('0x56')]=function(_0x3e93a1,_0x12bc93){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x3e93a1[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x12bc93,null))[_0xfd7e('0xe')](function(_0x38138e){if(_0x38138e){return _0x38138e[_0xfd7e('0x56')](_0x3e93a1[_0xfd7e('0x36')]['ids']);}})[_0xfd7e('0xe')](respondWithStatusCode(_0x12bc93,null))['catch'](handleError(_0x12bc93,null));};exports[_0xfd7e('0x57')]=function(_0x311aae,_0x1424dc){if(_0x311aae['body']['id']){delete _0x311aae['body']['id'];}return db['ChatWebsite'][_0xfd7e('0x46')]({'where':{'id':_0x311aae['params']['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x1424dc,null))[_0xfd7e('0xe')](function(_0x50fb28){if(_0x50fb28){_0x311aae[_0xfd7e('0x48')][_0xfd7e('0x53')]=_0x50fb28['id'];return db[_0xfd7e('0x58')][_0xfd7e('0x47')](_0x311aae[_0xfd7e('0x48')]);}})[_0xfd7e('0xe')](respondWithResult(_0x1424dc,null))[_0xfd7e('0x18')](handleError(_0x1424dc,null));};exports[_0xfd7e('0x59')]=function(_0x46ba2a,_0x3b8b0b){var _0x311b41={'raw':![],'where':{}};var _0x486e22={};var _0x366e65={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfd7e('0x5a')]({'where':{'id':_0x46ba2a[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x3b8b0b,null))[_0xfd7e('0xe')](function(_0x4a5f76){if(_0x4a5f76){_0x486e22[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db[_0xfd7e('0x58')][_0xfd7e('0x45')]);_0x486e22['query']=_[_0xfd7e('0x30')](_0x46ba2a[_0xfd7e('0x36')]);_0x486e22['filters']=_[_0xfd7e('0x32')](_0x486e22['model'],_0x486e22[_0xfd7e('0x36')]);_0x311b41[_0xfd7e('0x34')]=_['intersection'](_0x486e22[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x46ba2a[_0xfd7e('0x36')]['fields']));_0x311b41[_0xfd7e('0x34')]=_0x311b41['attributes'][_0xfd7e('0x37')]?_0x311b41[_0xfd7e('0x34')]:_0x486e22[_0xfd7e('0x33')];if(!_0x46ba2a[_0xfd7e('0x36')][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x311b41[_0xfd7e('0x1e')]=qs['limit'](_0x46ba2a[_0xfd7e('0x36')]['limit']);_0x311b41[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x46ba2a[_0xfd7e('0x36')][_0xfd7e('0x20')]);}_0x311b41['order']=qs[_0xfd7e('0x3b')](_0x46ba2a['query'][_0xfd7e('0x3b')]);_0x311b41[_0xfd7e('0x3d')]=qs[_0xfd7e('0x31')](_[_0xfd7e('0x3c')](_0x46ba2a[_0xfd7e('0x36')],_0x486e22['filters']));_0x311b41[_0xfd7e('0x3d')]['ChatWebsiteId']=_0x4a5f76['id'];if(_0x46ba2a[_0xfd7e('0x36')][_0xfd7e('0x55')]){_0x311b41[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x311b41[_0xfd7e('0x3d')],{'$or':_['map'](_0x311b41[_0xfd7e('0x34')],function(_0x21d178){var _0x53e6ee={};_0x53e6ee[_0x21d178]={'$like':'%'+_0x46ba2a[_0xfd7e('0x36')]['filter']+'%'};return _0x53e6ee;})});}_0x311b41=_[_0xfd7e('0x3e')]({},_0x311b41,_0x46ba2a[_0xfd7e('0x3f')]);return db[_0xfd7e('0x58')]['count']({'where':_0x311b41[_0xfd7e('0x3d')]})['then'](function(_0x63fc32){_0x366e65['count']=_0x63fc32;if(_0x46ba2a[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0x311b41[_0xfd7e('0x41')]=[{'all':!![]}];}return db[_0xfd7e('0x58')][_0xfd7e('0x42')](_0x311b41);})[_0xfd7e('0xe')](function(_0xd25ffc){_0x366e65[_0xfd7e('0x43')]=_0xd25ffc;return _0x366e65;});}})[_0xfd7e('0xe')](respondWithFilteredResult(_0x3b8b0b,_0x311b41))[_0xfd7e('0x18')](handleError(_0x3b8b0b,null));};exports[_0xfd7e('0x5b')]=function(_0x4ac263,_0x5a645e){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x4ac263[_0xfd7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x5a645e,null))[_0xfd7e('0xe')](function(_0x2512ca){if(_0x2512ca){return _0x2512ca[_0xfd7e('0x5b')](_0x4ac263[_0xfd7e('0x36')][_0xfd7e('0x5c')]);}})['then'](respondWithStatusCode(_0x5a645e,null))[_0xfd7e('0x18')](handleError(_0x5a645e,null));};exports[_0xfd7e('0x5d')]=function(_0x5aa961,_0x41b36f){_0x5aa961[_0xfd7e('0x48')][_0xfd7e('0x5e')]=_0x5aa961[_0xfd7e('0x5f')][_0xfd7e('0x60')];return db[_0xfd7e('0x2d')]['find']({'where':{'id':_0x5aa961[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x41b36f,null))['then'](saveUpdates(_0x5aa961['body'],null))[_0xfd7e('0xe')](respondWithResult(_0x41b36f,null))[_0xfd7e('0x18')](handleError(_0x41b36f,null));};exports[_0xfd7e('0x61')]=function(_0x1a8495,_0x4116fd){_0x1a8495[_0xfd7e('0x48')][_0xfd7e('0x62')]=_0x1a8495['file'][_0xfd7e('0x60')];return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x1a8495[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x4116fd,null))[_0xfd7e('0xe')](saveUpdates(_0x1a8495[_0xfd7e('0x48')],null))[_0xfd7e('0xe')](respondWithResult(_0x4116fd,null))[_0xfd7e('0x18')](handleError(_0x4116fd,null));};exports[_0xfd7e('0x63')]=function(_0x4be5a5,_0x18a5bd){_0x4be5a5['body'][_0xfd7e('0x64')]=_0x4be5a5[_0xfd7e('0x5f')][_0xfd7e('0x60')];return db['ChatWebsite'][_0xfd7e('0x46')]({'where':{'id':_0x4be5a5[_0xfd7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x18a5bd,null))[_0xfd7e('0xe')](saveUpdates(_0x4be5a5['body'],null))[_0xfd7e('0xe')](respondWithResult(_0x18a5bd,null))[_0xfd7e('0x18')](handleError(_0x18a5bd,null));};exports[_0xfd7e('0x65')]=function(_0x3ccd01,_0x335a44){_0x3ccd01[_0xfd7e('0x48')][_0xfd7e('0x66')]=_0x3ccd01[_0xfd7e('0x5f')][_0xfd7e('0x60')];return db[_0xfd7e('0x2d')]['find']({'where':{'id':_0x3ccd01[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x335a44,null))[_0xfd7e('0xe')](saveUpdates(_0x3ccd01[_0xfd7e('0x48')],null))[_0xfd7e('0xe')](respondWithResult(_0x335a44,null))[_0xfd7e('0x18')](handleError(_0x335a44,null));};exports[_0xfd7e('0x67')]=function(_0x47d5a5,_0x2ec31d){var _0x2fda98=path['join'](config[_0xfd7e('0x68')],_0xfd7e('0x69'));var _0x3e2f23={'where':{'id':_0x47d5a5[_0xfd7e('0x50')]['id']},'attributes':['id',_0xfd7e('0x5e')],'raw':!![]};var _0x3798fa=![];return require(_0xfd7e('0x6a'))[_0xfd7e('0x6b')]()['then'](function(_0x30fa45){if(_0x30fa45){_0x3798fa=_0x30fa45[_0xfd7e('0x6c')];}})[_0xfd7e('0xe')](function(){return db[_0xfd7e('0x2d')]['find'](_0x3e2f23);})[_0xfd7e('0xe')](handleEntityNotFound(_0x2ec31d,null))[_0xfd7e('0xe')](function(_0x26dfaf){if(_0x26dfaf){if(!_[_0xfd7e('0x6d')](_0x26dfaf[_0xfd7e('0x5e')])){if(fs[_0xfd7e('0x6e')](path['join'](config['root'],'server/files/images/logos/',_0x26dfaf[_0xfd7e('0x5e')]))&&_0x3798fa){_0x2fda98=path['join'](config[_0xfd7e('0x68')],_0xfd7e('0x6f'),_0x26dfaf['sitepic']);}}return _0x2ec31d[_0xfd7e('0x70')](_0x2fda98);}})[_0xfd7e('0x18')](handleError(_0x2ec31d,null));};exports[_0xfd7e('0x71')]=function(_0x1afc8a,_0x2df43d){var _0x4ba546=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x73'));var _0x985dd3={'where':{'id':_0x1afc8a['params']['id']},'attributes':['id',_0xfd7e('0x62')],'raw':!![]};return db[_0xfd7e('0x2d')]['find'](_0x985dd3)['then'](handleEntityNotFound(_0x2df43d,null))['then'](function(_0x442553){if(_0x442553){if(!_[_0xfd7e('0x6d')](_0x442553[_0xfd7e('0x62')])){if(fs[_0xfd7e('0x6e')](path[_0xfd7e('0x72')](config['root'],_0xfd7e('0x74'),_0x442553[_0xfd7e('0x62')]))){_0x4ba546=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x74'),_0x442553[_0xfd7e('0x62')]);}}return _0x2df43d[_0xfd7e('0x70')](_0x4ba546);}})[_0xfd7e('0x18')](handleError(_0x2df43d,null));};exports[_0xfd7e('0x75')]=function(_0x187055,_0xbcdbb2){var _0x5d196d=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],'server/files/images/avatars/customer_avatar.png');var _0x248604={'where':{'id':_0x187055[_0xfd7e('0x50')]['id']},'attributes':['id',_0xfd7e('0x64'),_0xfd7e('0x76')],'raw':!![]};return db['ChatWebsite']['find'](_0x248604)['then'](handleEntityNotFound(_0xbcdbb2,null))[_0xfd7e('0xe')](function(_0x28d152){if(_0x28d152){if(!_[_0xfd7e('0x6d')](_0x28d152[_0xfd7e('0x64')])){if(fs[_0xfd7e('0x6e')](path[_0xfd7e('0x72')](config['root'],_0xfd7e('0x74'),_0x28d152['customerAvatar']))&&_0x28d152['showCustomerAvatar']){_0x5d196d=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x74'),_0x28d152[_0xfd7e('0x64')]);}}return _0xbcdbb2[_0xfd7e('0x70')](_0x5d196d);}})[_0xfd7e('0x18')](handleError(_0xbcdbb2,null));};exports[_0xfd7e('0x77')]=function(_0x50bdd7,_0x2cc202){var _0x7d5d90=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x78'));var _0x668826={'where':{'id':_0x50bdd7[_0xfd7e('0x50')]['id']},'attributes':['id',_0xfd7e('0x66')],'raw':!![]};return db['ChatWebsite'][_0xfd7e('0x46')](_0x668826)[_0xfd7e('0xe')](handleEntityNotFound(_0x2cc202,null))[_0xfd7e('0xe')](function(_0x238ecf){if(_0x238ecf){if(!_[_0xfd7e('0x6d')](_0x238ecf[_0xfd7e('0x66')])){if(fs[_0xfd7e('0x6e')](path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],'server/files/images/avatars/',_0x238ecf[_0xfd7e('0x66')]))){_0x7d5d90=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0x74'),_0x238ecf[_0xfd7e('0x66')]);}}return _0x2cc202['download'](_0x7d5d90);}})[_0xfd7e('0x18')](handleError(_0x2cc202,null));};exports[_0xfd7e('0x79')]=function(_0x17f356,_0x27bd7f){var _0x3c615c=require(_0xfd7e('0x7a'));var _0x89867c=new _0x3c615c();var _0xb41d9=_0x89867c[_0xfd7e('0x7b')](_0x17f356['headers'][_0xfd7e('0x7c')])[_0xfd7e('0x7d')]();var _0x358456={'body':_0x17f356[_0xfd7e('0x48')],'channel':_0xfd7e('0x7e')};var _0x235b27=[];var _0x1768c4=[];var _0x1ba4f3={};var _0x130890=![];return db[_0xfd7e('0x7f')][_0xfd7e('0x51')]()[_0xfd7e('0xe')](function(_0x2b490d){if(!_0x2b490d){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x82'));}_0x235b27=_['difference'](_[_0xfd7e('0x30')](_0x2b490d),['createdAt',_0xfd7e('0x83')]);_0x1768c4=_['difference'](_['keys'](_0x2b490d),[_0xfd7e('0x84'),_0xfd7e('0x83'),_0xfd7e('0x85'),_0xfd7e('0x86')]);if(_0x17f356[_0xfd7e('0x48')]['id']){delete _0x17f356[_0xfd7e('0x48')]['id'];}if(_[_0xfd7e('0x6d')](_0x17f356[_0xfd7e('0x48')]['from'])){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x87'));}if(_[_0xfd7e('0x6d')](_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x48')])||_0x17f356[_0xfd7e('0x48')]['body']===''){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x88'));}if(_['isNil'](_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x89')])){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x8a')+_0x1768c4);}if(!_[_0xfd7e('0x8b')](_0x1768c4,_0x17f356[_0xfd7e('0x48')]['mapKey'])){throw new db['Sequelize'][(_0xfd7e('0x81'))](_0xfd7e('0x8c')+_0x1768c4);}_0x1ba4f3[_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x89')]]=_0x17f356[_0xfd7e('0x48')]['from'];})[_0xfd7e('0xe')](function(){return db[_0xfd7e('0x2d')]['find']({'where':{'id':_0x17f356[_0xfd7e('0x50')]['id']},'include':[{'model':db[_0xfd7e('0x8d')],'as':_0xfd7e('0x8e'),'include':[{'model':db[_0xfd7e('0x7f')],'as':_0xfd7e('0x8f'),'where':_0x1ba4f3,'limit':0x1,'order':[[_0xfd7e('0x83'),'DESC']]}]},{'model':db[_0xfd7e('0x90')],'as':_0xfd7e('0x91')}]});})[_0xfd7e('0xe')](handleEntityNotFound(_0x27bd7f,null))['then'](function(_0x18e751){if(_0x18e751&&_0x18e751[_0xfd7e('0x8e')]){_0x358456[_0xfd7e('0x92')]=_0x18e751;_0x358456[_0xfd7e('0x93')]=_0x18e751[_0xfd7e('0x91')];_0x358456[_0xfd7e('0x94')]=_0x18e751[_0xfd7e('0x8e')];_0x358456[_0xfd7e('0x93')]=_['orderBy'](_0x358456[_0xfd7e('0x93')],[_0xfd7e('0x95')],[_0xfd7e('0x96')]);if(_0x358456[_0xfd7e('0x92')][_0xfd7e('0x91')]){delete _0x358456[_0xfd7e('0x92')]['Applications'];}if(_0x358456[_0xfd7e('0x92')][_0xfd7e('0x8e')]&&_0x358456['account'][_0xfd7e('0x8e')]['Contacts'][_0xfd7e('0x37')]){return _0x358456[_0xfd7e('0x92')][_0xfd7e('0x8e')]['Contacts'][0x0];}var _0x993501=_[_0xfd7e('0x5')](_0x17f356[_0xfd7e('0x48')],{'firstName':_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x97')],'ListId':_0x18e751['ListId']});_0x993501[_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x89')]]=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x97')];return db['CmContact'][_0xfd7e('0x47')](_0x993501,{'fields':_0x235b27,'raw':!![]});}})[_0xfd7e('0xe')](handleEntityNotFound(_0x27bd7f,null))[_0xfd7e('0xe')](function(_0x21c803){_0x358456[_0xfd7e('0x98')]=_0x21c803;var _0x40cea7=_0x17f356[_0xfd7e('0x48')]['customerIp'];if(_0x17f356[_0xfd7e('0x99')]['cf-connecting-ip']){_0x40cea7=_0x17f356[_0xfd7e('0x99')]['cf-connecting-ip'];}else if(_0x17f356['headers'][_0xfd7e('0x9a')]){_0x40cea7=_[_0xfd7e('0x9b')](_0x17f356['headers'][_0xfd7e('0x9a')][_0xfd7e('0x9c')](','));}if(_0x21c803){var _0x257805={'ContactId':_0x21c803['id'],'ChatWebsiteId':_0x17f356[_0xfd7e('0x50')]['id'],'from':(_0x21c803[_0xfd7e('0x9d')]||'')+'\x20'+(_0x21c803[_0xfd7e('0x9e')]||''),'customerIp':_0x40cea7,'customerPort':_0x17f356[_0xfd7e('0x99')][_0xfd7e('0x9f')]?_0x17f356['headers'][_0xfd7e('0x9f')]:null,'referer':_0x17f356['body'][_0xfd7e('0xa0')],'browserName':_0xb41d9[_0xfd7e('0xa1')][_0xfd7e('0x28')]&&_0xb41d9[_0xfd7e('0xa1')][_0xfd7e('0xa2')]?util[_0xfd7e('0xa3')](_0xfd7e('0xa4'),_0xb41d9[_0xfd7e('0xa1')][_0xfd7e('0x28')],_0xb41d9[_0xfd7e('0xa1')][_0xfd7e('0xa2')]):'unknown','browserVersion':_0xb41d9['browser'][_0xfd7e('0xa2')]||_0xfd7e('0xa5'),'osName':util['format'](_0xfd7e('0xa4'),_0xb41d9['os'][_0xfd7e('0x28')],_0xb41d9['os']['version']),'osVersion':_0xb41d9['os'][_0xfd7e('0xa2')],'deviceModel':_0xb41d9[_0xfd7e('0xa6')][_0xfd7e('0x33')]&&_0xb41d9[_0xfd7e('0xa6')]['vendor']?util[_0xfd7e('0xa3')](_0xfd7e('0xa7'),_0xb41d9['device'][_0xfd7e('0x33')],_0xb41d9[_0xfd7e('0xa6')][_0xfd7e('0xa8')],_0xb41d9[_0xfd7e('0xa6')]['type']):null,'deviceVendor':_0xb41d9[_0xfd7e('0xa6')][_0xfd7e('0xa8')],'deviceType':_0xb41d9[_0xfd7e('0xa6')]['type'],'formData':JSON['stringify'](_0x17f356[_0xfd7e('0x48')])};var _0x5db71f={'ChatWebsiteId':_0x17f356[_0xfd7e('0x50')]['id'],'closed':![]};if(_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xa9')]){_0x5db71f[_0xfd7e('0xa9')]=_0x17f356['body'][_0xfd7e('0xa9')];return db[_0xfd7e('0xaa')][_0xfd7e('0x46')]({'where':_0x5db71f})['then'](function(_0x59f77d){if(_0x59f77d){return[_0x59f77d,![]];}_0x257805[_0xfd7e('0xa9')]=_0x17f356['body'][_0xfd7e('0xa9')];_0x257805[_0xfd7e('0xab')]=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xab')];return db[_0xfd7e('0xaa')]['create'](_0x257805)[_0xfd7e('0xe')](function(_0x13e762){return[_0x13e762,!![]];});});}_0x5db71f[_0xfd7e('0xac')]=_0x21c803['id'];if(_0x17f356['body']['interaction']&&_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xad')]['id']){_0x5db71f['id']=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xad')]['id'];return db[_0xfd7e('0xaa')][_0xfd7e('0x46')]({'where':_0x5db71f})[_0xfd7e('0xe')](function(_0x5f4d2d){if(_0x5f4d2d){return[_0x5f4d2d,![]];}return db['ChatInteraction'][_0xfd7e('0x47')](_0x257805)['then'](function(_0x5d1c50){return[_0x5d1c50,!![]];});});}return db[_0xfd7e('0xaa')][_0xfd7e('0x47')](_0x257805)['then'](function(_0xa55813){return[_0xa55813,!![]];});}})['spread'](function(_0x28b35c,_0x3c613c){if(_0x28b35c){_0x130890=_0x3c613c;if(!_0x3c613c){var _0x5c2d6b={'from':(_0x358456[_0xfd7e('0x98')]['firstName']||'')+'\x20'+(_0x358456[_0xfd7e('0x98')]['lastName']||'')};if(_0x17f356[_0xfd7e('0x48')]['threadId']&&_0x17f356['body'][_0xfd7e('0xae')]&&_0x17f356['body']['threadId']!=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xae')]){_0x5c2d6b['threadId']=_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xae')];}return _0x28b35c[_0xfd7e('0x22')](_0x5c2d6b);}else{return _0x28b35c;}}})[_0xfd7e('0xe')](function(_0x3b4526){_0x358456['interaction']=_0x3b4526[_0xfd7e('0x23')]({'plain':!![]});_0x358456['interaction'][_0xfd7e('0xaf')]=_0x130890;if(_0x358456[_0xfd7e('0xad')][_0xfd7e('0xaf')]){if(_0x358456['account'][_0xfd7e('0xb0')]){_0x358456[_0xfd7e('0x93')][_0xfd7e('0xb1')]({'id':0x0,'priority':_0x358456[_0xfd7e('0x93')][_0xfd7e('0x37')]+0x1,'app':_0xfd7e('0xb2'),'appdata':_0xfd7e('0xb3'),'interval':_0xfd7e('0xb4')});}}return db[_0xfd7e('0xb5')][_0xfd7e('0x47')]({'body':_0x17f356[_0xfd7e('0x48')][_0xfd7e('0x48')],'ChatWebsiteId':_0x17f356[_0xfd7e('0x50')]['id'],'ChatInteractionId':_0x3b4526['id'],'direction':'in','ContactId':_0x358456[_0xfd7e('0x98')]['id'],'AttachmentId':_0x17f356[_0xfd7e('0x48')][_0xfd7e('0xb6')]});})[_0xfd7e('0xe')](function(_0x3bc153){_0x358456['message']=_0x3bc153;if(_0x358456['interaction']['UserId']){return db[_0xfd7e('0xb7')]['find']({'attributes':['id',_0xfd7e('0x28')],'where':{'id':_0x358456['interaction'][_0xfd7e('0xb8')]}})['then'](function(_0x381fa9){if(_0x381fa9){_0x358456[_0xfd7e('0x93')][_0xfd7e('0xb9')]({'id':0x0,'priority':0x0,'app':_0xfd7e('0xba'),'appdata':_0x381fa9['name']+','+(_0x358456[_0xfd7e('0x92')][_0xfd7e('0xbb')]||0xa),'interval':_0xfd7e('0xb4')});_0x358456[_0xfd7e('0xbc')]=!![];}return respondWithRpcPromise(_0xfd7e('0xbd'),_0xfd7e('0xbe'),_0x358456);});}return respondWithRpcPromise(_0xfd7e('0xbd'),_0xfd7e('0xbe'),_0x358456);})[_0xfd7e('0xe')](function(_0x4a8d09){respondWithRpcPromise(_0xfd7e('0xbf'),_0xfd7e('0xbf'),{'event':_0xfd7e('0x79'),'message':_0x4a8d09},client9002);return _0x4a8d09;})[_0xfd7e('0xe')](respondWithResult(_0x27bd7f,null))[_0xfd7e('0x18')](handleError(_0x27bd7f,null));};exports[_0xfd7e('0xc0')]=function(_0x3b39fa,_0x41a0cf){var _0x24fc7e,_0x184e64,_0x590e99;var _0x422080=[];var _0x3d7d01={};var _0x5693d1=_0x3b39fa[_0xfd7e('0xc1')]||[];var _0xc5ab7d=[];var _0x5a5447;return db[_0xfd7e('0x7f')][_0xfd7e('0x51')]()[_0xfd7e('0xe')](function(_0x1769da){if(!_0x1769da){throw new db[(_0xfd7e('0x80'))][(_0xfd7e('0x81'))](_0xfd7e('0x82'));}_0x422080=_[_0xfd7e('0xc2')](_[_0xfd7e('0x30')](_0x1769da),[_0xfd7e('0x84'),_0xfd7e('0x83'),_0xfd7e('0x85'),_0xfd7e('0x86')]);if(_0x3b39fa['body']['id']){delete _0x3b39fa[_0xfd7e('0x48')]['id'];}if(_[_0xfd7e('0x6d')](_0x3b39fa[_0xfd7e('0x48')]['from'])){throw _0x41a0cf[_0xfd7e('0x1a')](0x1f4)[_0xfd7e('0xc3')](new db['Sequelize'][(_0xfd7e('0x81'))](_0xfd7e('0x87')));}if(_[_0xfd7e('0x6d')](_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x48')])||_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x48')]===''){throw _0x41a0cf[_0xfd7e('0x1a')](0x1f4)['send'](new db[(_0xfd7e('0x80'))]['ValidationError'](_0xfd7e('0x88')));}if(_[_0xfd7e('0x6d')](_0x3b39fa['body'][_0xfd7e('0xc4')])){throw _0x41a0cf[_0xfd7e('0x1a')](0x1f4)[_0xfd7e('0xc3')](new db[(_0xfd7e('0x80'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x422080));}if(!_['includes'](_0x422080,_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0xc4')])){throw _0x41a0cf[_0xfd7e('0x1a')](0x1f4)[_0xfd7e('0xc3')](new db['Sequelize']['ValidationError'](_0xfd7e('0xc5')+_0x422080));}_0x3d7d01[_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0xc4')]]=_0x3b39fa['body'][_0xfd7e('0x97')];})[_0xfd7e('0xe')](function(){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x3b39fa['params']['id']},'include':[{'model':db[_0xfd7e('0x8d')],'as':_0xfd7e('0x8e')},{'model':db[_0xfd7e('0xc6')],'as':_0xfd7e('0xc6')}]});})[_0xfd7e('0xe')](handleEntityNotFound(_0x41a0cf,null))[_0xfd7e('0xe')](function(_0x5d5903){if(_0x5d5903&&_0x5d5903[_0xfd7e('0x8e')]){_0x184e64=_0x5d5903;var _0x5f10f4=_[_0xfd7e('0x5')](_0x3b39fa[_0xfd7e('0x48')],{'firstName':_0x3b39fa['body']['from'],'phone':_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x97')],'ListId':_0x5d5903[_0xfd7e('0x86')]});_0x5f10f4[_0x3b39fa[_0xfd7e('0x48')]['mapKeyOffline']]=_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x97')];return db[_0xfd7e('0x7f')][_0xfd7e('0xc7')]({'where':_0x3d7d01,'defaults':_0x5f10f4});}})[_0xfd7e('0xc8')](function(_0x5b358d){if(_0x5b358d){_0x590e99=_0x5b358d;var _0x3d2c6d=fs['readFileSync'](path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0xc9')),_0xfd7e('0xca'));var _0x42fbc2=ejs['render'](_0x3d2c6d,{'body':_[_0xfd7e('0xcb')](_0x3b39fa[_0xfd7e('0x48')][_0xfd7e('0x48')]),'bodyTitle':_0x184e64['offlineMessageBody']});return db[_0xfd7e('0xcc')][_0xfd7e('0x47')]({'body':_0x42fbc2,'plainBody':htmlToText[_0xfd7e('0xcd')](_0x42fbc2),'ContactId':_0x5b358d['id'],'ChatWebsiteId':_0x184e64['id']});}})['then'](function(_0x1f9680){_0x5a5447=_0x1f9680;if(_0x5693d1[_0xfd7e('0x37')]){var _0x18bcb7=_0x5693d1[_0xfd7e('0x2c')](function(_0x539de4){return{'name':_0x539de4[_0xfd7e('0xce')],'basename':_0x539de4[_0xfd7e('0x60')],'type':_0x539de4[_0xfd7e('0xcf')],'ChatOfflineMessageId':_0x1f9680['id']};});_0xc5ab7d=_0x18bcb7[_0xfd7e('0x2c')](_0x563a63=>{var _0x5436f1={'filename':_0x563a63[_0xfd7e('0x28')],'path':path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0xd0'),_0xfd7e('0xc1'),_0xfd7e('0xd1'),'offline-chat',_0x563a63[_0xfd7e('0xd2')])};return _0x5436f1;});if(!_0x184e64[_0xfd7e('0xd3')]){return db[_0xfd7e('0xd4')][_0xfd7e('0xd5')](function(_0x2f64e1){return db[_0xfd7e('0xd6')]['bulkCreate'](_0x18bcb7,{'transaction':_0x2f64e1});});}}})[_0xfd7e('0xe')](function(){if(_0x5a5447){_0x24fc7e=_0x5a5447;return db[_0xfd7e('0xc6')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfd7e('0xd7')],'as':_0xfd7e('0xd8'),'raw':!![],'include':[{'model':db[_0xfd7e('0xd9')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xfd7e('0xe')](function(_0x3bef4a){if(_0x3bef4a&&_0x3bef4a['Smtp']&&_0x184e64[_0xfd7e('0xda')]&&_0x184e64[_0xfd7e('0xdb')]){var _0x4facf5=_0x3bef4a[_0xfd7e('0xdc')]();return respondWithRpcPromise(_0xfd7e('0xdd'),_0xfd7e('0xde'),{'account':_0x4facf5,'message':{'from':util['format'](_0xfd7e('0xdf'),_0x3bef4a[_0xfd7e('0x28')],_0x3bef4a[_0xfd7e('0xe0')]||_0x3bef4a[_0xfd7e('0xd8')][_0xfd7e('0x49')]),'to':_0x184e64[_0xfd7e('0xdb')],'subject':_0x184e64[_0xfd7e('0xe1')],'html':_0x24fc7e[_0xfd7e('0x48')],'attachments':_0xc5ab7d}},client9003)[_0xfd7e('0xe')](function(){return _0x24fc7e;})[_0xfd7e('0x18')](function(_0x47bc16){logger[_0xfd7e('0x14')](_0x47bc16);});}})['then'](function(){if(_0x184e64&&_0x184e64[_0xfd7e('0xd3')]&&_0x184e64[_0xfd7e('0xe2')]){var _0x5b0c55=[];if(_0x5693d1[_0xfd7e('0x37')]){_0x5b0c55=_0x5693d1['map'](function(_0x346665){return{'name':_0x346665['originalname'],'basename':_0x346665[_0xfd7e('0x60')],'type':_0x346665['mimetype'],'ChatOfflineMessageId':_0x5a5447['id']};});}var _0x262496;if(!_[_0xfd7e('0x6d')](_0x184e64[_0xfd7e('0xe3')])){var _0x417daa=_[_0xfd7e('0x2c')](_0x3b39fa[_0xfd7e('0x48')],function(_0x240dd5){return _0x240dd5;});var _0x2a880c=_[_0xfd7e('0xe4')](_0x417daa)[0x0];var _0xc364c3=_[_0xfd7e('0xe5')](_0x2a880c,function(_0x55b45e){return _0x55b45e;});_0x262496=_0xc364c3[0x1][_0x184e64[_0xfd7e('0xe3')]];}var _0x4e8739={'from':_0x590e99['email'],'firstName':_0x590e99[_0xfd7e('0x9d')],'lastName':_0x590e99[_0xfd7e('0x9e')],'mapKey':_0xfd7e('0xe0'),'message':{'from':_0x590e99[_0xfd7e('0xe0')],'to':_0x184e64['MailAccount'][_0xfd7e('0xe0')],'cc':'','subject':_[_0xfd7e('0x6d')](_0x262496)?_0x184e64[_0xfd7e('0xe1')]:_0x262496,'messageId':'','sentAt':new Date(),'attach':_0x5b0c55[_0xfd7e('0x37')],'attachments':_0x5b0c55,'originChannel':_0xfd7e('0xe6'),'ChatWebsiteId':_0x184e64['id'],'ChatOfflineMessageId':_0x24fc7e['id'],'originTo':_0x184e64['MailAccount'][_0xfd7e('0xe0')]},'body':_0x24fc7e['body']};var _0x480a42={'account':{'id':_0x184e64[_0xfd7e('0xe2')]},'body':_0x4e8739,'log':_0xfd7e('0xe7')};return respondWithRpcPromise(_0xfd7e('0xe7'),'notifyMail',_0x480a42,client9001)[_0xfd7e('0xe')](function(){return _0x24fc7e;})[_0xfd7e('0x18')](function(_0x2d570f){logger[_0xfd7e('0x14')](_0x2d570f);});}return;})[_0xfd7e('0xe')](function(){if(_0x24fc7e){return _0x24fc7e;}})[_0xfd7e('0xe')](respondWithResult(_0x41a0cf,null))[_0xfd7e('0x18')](function(_0x15daa7){logger[_0xfd7e('0x14')]('catch',_0x15daa7);for(var _0x9a7feb of _0x5693d1){var _0x5b7263=path[_0xfd7e('0x72')](config[_0xfd7e('0x68')],_0xfd7e('0xd0'),'files',_0xfd7e('0xd1'),_0xfd7e('0xe8'),_0x9a7feb[_0xfd7e('0x60')]);fs_extra[_0xfd7e('0xe9')](_0x5b7263)[_0xfd7e('0x18')](function(_0x4692d5){logger[_0xfd7e('0x14')]('Could\x20not\x20remove\x20attachment\x20file',_0x5b7263,_0x4692d5);});}});};exports[_0xfd7e('0xea')]=function(_0x15506e,_0x17569d){return db[_0xfd7e('0xaa')][_0xfd7e('0x46')]({'where':{'id':_0x15506e[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x17569d,null))[_0xfd7e('0xe')](function(_0x1c35b4){if(_0x1c35b4){return _0x1c35b4['addInteraction'](_0x15506e['body'][_0xfd7e('0x5c')],_[_0xfd7e('0xeb')](_0x15506e[_0xfd7e('0x48')],['ids','id'])||{});}})[_0xfd7e('0xe')](respondWithResult(_0x17569d,null))[_0xfd7e('0x18')](handleError(_0x17569d,null));};exports[_0xfd7e('0xec')]=function(_0x14c51c,_0x450d1d){var _0x5516f6={'raw':![],'where':{}};var _0x20c65c={};var _0x8707aa={'count':0x0,'rows':[]};return db[_0xfd7e('0x2d')][_0xfd7e('0x5a')]({'where':{'id':_0x14c51c[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x450d1d,null))[_0xfd7e('0xe')](function(_0x39ab89){if(_0x39ab89){_0x20c65c[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db[_0xfd7e('0xaa')]['rawAttributes']);_0x20c65c['query']=_['keys'](_0x14c51c[_0xfd7e('0x36')]);_0x20c65c[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x20c65c[_0xfd7e('0x33')],_0x20c65c[_0xfd7e('0x36')]);_0x5516f6[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x20c65c[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x5516f6[_0xfd7e('0x34')]=_0x5516f6[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x5516f6[_0xfd7e('0x34')]:_0x20c65c[_0xfd7e('0x33')];if(!_0x14c51c[_0xfd7e('0x36')]['hasOwnProperty']('nolimit')){_0x5516f6['limit']=qs[_0xfd7e('0x1e')](_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x1e')]);_0x5516f6[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x20')]);}_0x5516f6[_0xfd7e('0x3a')]=qs[_0xfd7e('0x3b')](_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x5516f6[_0xfd7e('0x3d')]=qs[_0xfd7e('0x31')](_[_0xfd7e('0x3c')](_0x14c51c[_0xfd7e('0x36')],_0x20c65c[_0xfd7e('0x31')]));_0x5516f6[_0xfd7e('0x3d')][_0xfd7e('0x53')]=_0x39ab89['id'];if(_0x14c51c['query'][_0xfd7e('0x55')]){_0x5516f6[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x5516f6['where'],{'$or':_[_0xfd7e('0x2c')](_0x5516f6[_0xfd7e('0x34')],function(_0x4c2a5b){var _0x5287ba={};_0x5287ba[_0x4c2a5b]={'$like':'%'+_0x14c51c['query'][_0xfd7e('0x55')]+'%'};return _0x5287ba;})});}_0x5516f6=_[_0xfd7e('0x3e')]({},_0x5516f6,_0x14c51c[_0xfd7e('0x3f')]);return db[_0xfd7e('0xaa')][_0xfd7e('0x1f')]({'where':_0x5516f6['where']})[_0xfd7e('0xe')](function(_0x52105e){_0x8707aa['count']=_0x52105e;if(_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0x5516f6[_0xfd7e('0x41')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xfd7e('0xb7')],'as':_0xfd7e('0xed'),'attributes':['name',_0xfd7e('0xee'),_0xfd7e('0xef')],'required':![]},{'model':db[_0xfd7e('0xf0')],'as':'Tags','attributes':['id',_0xfd7e('0x28'),'color'],'where':_0x14c51c[_0xfd7e('0x36')]['tag']?{'id':_0x14c51c[_0xfd7e('0x36')][_0xfd7e('0xf1')]}:undefined,'required':_0x14c51c['query']['tag']?!![]:![]}];}return db[_0xfd7e('0xaa')][_0xfd7e('0x42')](_0x5516f6);})[_0xfd7e('0xe')](function(_0x3de199){_0x8707aa[_0xfd7e('0x43')]=_0x3de199;return _0x8707aa;});}})[_0xfd7e('0xe')](respondWithFilteredResult(_0x450d1d,_0x5516f6))['catch'](handleError(_0x450d1d,null));};function iftimePromise(_0x2e1c19,_0x384418){return respondWithRpcPromise(_0xfd7e('0xf2'),'getSnippet',{'command':_0x384418[_0xfd7e('0xf3')]?util[_0xfd7e('0xa3')](_0xfd7e('0xf4'),_0x2e1c19[_0xfd7e('0xf5')],_0x384418[_0xfd7e('0xf3')]):util['format']('iftime\x20%s',_0x2e1c19[_0xfd7e('0xf5')])},client9002)['then'](function(_0x383a64){var _0x2b03ac=_0x383a64&&_0x383a64[_0xfd7e('0xf6')](_0xfd7e('0xf7'))>=0x0?!![]:![];logger[_0xfd7e('0xf')](_0xfd7e('0xf8'),_0x384418['id'],_0x2e1c19['id'],_0x2e1c19[_0xfd7e('0xf5')],_0x2b03ac?_0xfd7e('0xf9'):_0xfd7e('0xfa'),_0x384418[_0xfd7e('0xf3')]?_0x384418[_0xfd7e('0xf3')]:'No\x20timezone');return _0x2b03ac;})[_0xfd7e('0x18')](function(_0x34eee4){logger[_0xfd7e('0x14')](_0xfd7e('0xf8'),_0x384418['id'],_0x2e1c19['id'],_0x2e1c19['interval'],util[_0xfd7e('0xfb')](_0x34eee4,{'showHidden':![],'depth':null}),_0x384418[_0xfd7e('0xf3')]?_0x384418[_0xfd7e('0xf3')]:_0xfd7e('0xfc'));return![];});}exports[_0xfd7e('0xfd')]=function(_0x88ada7,_0x203492){var _0x2188bc=0x0;var _0x1a9e5d=0x0;var _0x3bf1bd=![];var _0x1b09d9;var _0x48128b;return db['ChatWebsite'][_0xfd7e('0x46')]({'where':{'id':_0x88ada7[_0xfd7e('0x50')]['id']},'include':[{'model':db[_0xfd7e('0xfe')],'as':_0xfd7e('0xfe'),'include':[{'model':db[_0xfd7e('0xfe')],'as':'Intervals','attributes':['id',_0xfd7e('0xf5')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x203492,null))[_0xfd7e('0xe')](function(_0x3cd793){if(_0x3cd793){_0x1b09d9=_0x3cd793;return _0x3cd793[_0xfd7e('0xff')]({'raw':!![]});}})[_0xfd7e('0xe')](function(_0x317b5a){if(_0x1b09d9){if(_0x317b5a){_0x48128b=_0x317b5a;}}return require(_0xfd7e('0x6a'))[_0xfd7e('0x6b')]();})['then'](function(_0x134d58){if(_0x134d58){_0x1a9e5d=_0x134d58[_0xfd7e('0x100')];_0x3bf1bd=_0x134d58[_0xfd7e('0x6c')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xfd7e('0xe')](function(_0x3d3722){_0x2188bc=_0x3d3722;if(_0x1a9e5d&&_0x3d3722>_0x1a9e5d){return db[_0xfd7e('0x101')][_0xfd7e('0x5a')]({'where':{'id':0x1}})['then'](function(_0x4b53f1){if(_0x4b53f1){_0x4b53f1['increment'](_0xfd7e('0x102'));}});}})[_0xfd7e('0xe')](function(){if(_0x1b09d9['Interval']&&_0x1b09d9[_0xfd7e('0xfe')][_0xfd7e('0x103')]){var _0x55d480=[];for(var _0x39e546=0x0;_0x39e546<_0x1b09d9[_0xfd7e('0xfe')]['Intervals']['length'];_0x39e546++){var _0x1813f9=_0x1b09d9[_0xfd7e('0xfe')][_0xfd7e('0x103')][_0x39e546][_0xfd7e('0x23')]({'plain':!![]});_0x55d480[_0xfd7e('0xb1')](iftimePromise(_0x1813f9,_0x1b09d9));}return BPromise[_0xfd7e('0x104')](_0x55d480)[_0xfd7e('0xe')](function(_0x2ecba2){return _[_0xfd7e('0x105')](_0x2ecba2);});}else{return!![];}})['then'](function(_0x2400f2){var _0x2f106=fs['readFileSync'](path['join'](config[_0xfd7e('0x68')],_0xfd7e('0x106')),'utf8');var _0x16cc74={'remote':_0x1b09d9[_0xfd7e('0x107')],'query':querystring[_0xfd7e('0x13')](_[_0xfd7e('0x3e')](_0x1b09d9[_0xfd7e('0x23')]({'plain':!![]}),{'customerIp':_0x88ada7[_0xfd7e('0x99')][_0xfd7e('0x9a')]||_0x88ada7['headers'][_0xfd7e('0x108')]||_0x88ada7['connection'][_0xfd7e('0x109')]||_0x88ada7['ip'],'referer':_0x88ada7['headers'][_0xfd7e('0xa0')],'openedInteractions':_0x2188bc,'maxInteractions':_0x1a9e5d,'virtual':_0x3bf1bd[_0xfd7e('0x100')],'online':_0x2400f2,'custom':_0x3bf1bd}))[_0xfd7e('0x10a')](/'/g,'\x5c\x27')};_0x203492[_0xfd7e('0xc3')](ejs['render'](Mustache[_0xfd7e('0x10b')](_0x2f106,_0x16cc74),{'proactiveActions':_0x48128b,'alignment':_0x1b09d9['alignment'],'verticalAlignment':_0x1b09d9[_0xfd7e('0x10c')],'div_color':_0x1b09d9[_0xfd7e('0x10d')],'labelText':_0x1b09d9['labelText'],'text_color':_0x1b09d9[_0xfd7e('0x10e')],'text_button_color':_0x1b09d9['textButtonColor'],'button_color':_0x1b09d9[_0xfd7e('0x10f')],'background_color':_0x1b09d9[_0xfd7e('0x110')],'hideWhenOffline':_0x1b09d9['hideWhenOffline'],'interval':_0x1b09d9['IntervalId']}));})[_0xfd7e('0x18')](handleError(_0x203492,null));};exports[_0xfd7e('0x111')]=function(_0x534da3,_0x332daf){var _0x5f5336=_0x534da3['params']['id'];var _0x531663=_0x534da3[_0xfd7e('0x48')];var _0x35252c=0xc8;var _0x5d9445=null;return db['sequelize'][_0xfd7e('0xd5')]({'isolationLevel':db[_0xfd7e('0xd4')][_0xfd7e('0x112')]['ISOLATION_LEVELS'][_0xfd7e('0x113')]},function(_0x201bba){return db[_0xfd7e('0x2d')]['findOne']({'where':{'id':_0x5f5336},'transaction':_0x201bba})[_0xfd7e('0xe')](function(_0x130cc1){if(_0x130cc1){return db[_0xfd7e('0x90')]['destroy']({'where':{'ChatWebsiteId':_0x5f5336},'transaction':_0x201bba})['then'](function(){var _0x5be76f=_[_0xfd7e('0x2c')](_0x531663,function(_0x4a29c9){_0x4a29c9[_0xfd7e('0x53')]=_0x5f5336;return _0x4a29c9;});return db[_0xfd7e('0x90')][_0xfd7e('0x114')](_0x5be76f,{'transaction':_0x201bba});});}else{_0x35252c=0x194;_0x5d9445=[];}});})[_0xfd7e('0xe')](function(){if(_0x35252c!==0x194){return db[_0xfd7e('0x90')][_0xfd7e('0x115')]({'where':{'ChatWebsiteId':_0x5f5336},'order':'priority'})[_0xfd7e('0xe')](function(_0x5481ac){_0x5d9445=_0x5481ac;});}})['catch'](function(_0x193f23){_0x35252c=0x1f4;logger[_0xfd7e('0x14')](_0x193f23['stack']);if(_0x193f23['name']){delete _0x193f23[_0xfd7e('0x28')];}_0x5d9445=_0x193f23;})['finally'](function(){if(_0x5d9445===null){_0x332daf[_0xfd7e('0x19')](_0x35252c);}else{if(_0x35252c===0x1f4){_0x332daf[_0xfd7e('0x1a')](_0x35252c)[_0xfd7e('0xc3')](_0x5d9445);}else{_0x332daf[_0xfd7e('0x1a')](_0x35252c)['json'](_0x5d9445);}}});};exports['getApplications']=function(_0x2c5305,_0x5ef3a2){var _0x3ad012={};var _0x252662={};var _0x5c74cc;var _0x3c4484;return db['ChatWebsite'][_0xfd7e('0x5a')]({'where':{'id':_0x2c5305['params']['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x5ef3a2,null))[_0xfd7e('0xe')](function(_0x25d55c){if(_0x25d55c){_0x5c74cc=_0x25d55c;_0x252662[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db['ChatApplication'][_0xfd7e('0x45')]);_0x252662[_0xfd7e('0x36')]=_['keys'](_0x2c5305[_0xfd7e('0x36')]);_0x252662[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x252662[_0xfd7e('0x33')],_0x252662[_0xfd7e('0x36')]);_0x3ad012[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x252662[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x2c5305[_0xfd7e('0x36')]['fields']));_0x3ad012[_0xfd7e('0x34')]=_0x3ad012[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x3ad012['attributes']:_0x252662['model'];_0x3ad012['order']=qs[_0xfd7e('0x3b')](_0x2c5305['query'][_0xfd7e('0x3b')]);_0x3ad012[_0xfd7e('0x3d')]=qs['filters'](_[_0xfd7e('0x3c')](_0x2c5305[_0xfd7e('0x36')],_0x252662[_0xfd7e('0x31')]));if(_0x2c5305[_0xfd7e('0x36')][_0xfd7e('0x55')]){_0x3ad012[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x3ad012['where'],{'$or':_[_0xfd7e('0x2c')](_0x3ad012[_0xfd7e('0x34')],function(_0x277a28){var _0x2a595d={};_0x2a595d[_0x277a28]={'$like':'%'+_0x2c5305[_0xfd7e('0x36')][_0xfd7e('0x55')]+'%'};return _0x2a595d;})});}_0x3ad012=_[_0xfd7e('0x3e')]({},_0x3ad012,_0x2c5305[_0xfd7e('0x3f')]);return _0x5c74cc['getApplications'](_0x3ad012);}})[_0xfd7e('0xe')](function(_0x19a959){if(_0x19a959){_0x3c4484=_0x19a959[_0xfd7e('0x37')];if(!_0x2c5305['query'][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x3ad012[_0xfd7e('0x1e')]=qs[_0xfd7e('0x1e')](_0x2c5305['query'][_0xfd7e('0x1e')]);_0x3ad012['offset']=qs[_0xfd7e('0x20')](_0x2c5305[_0xfd7e('0x36')][_0xfd7e('0x20')]);}return _0x5c74cc[_0xfd7e('0x116')](_0x3ad012);}})[_0xfd7e('0xe')](function(_0x1656c1){if(_0x1656c1){return _0x1656c1?{'count':_0x3c4484,'rows':_0x1656c1}:null;}})[_0xfd7e('0xe')](respondWithResult(_0x5ef3a2,null))[_0xfd7e('0x18')](handleError(_0x5ef3a2,null));};exports[_0xfd7e('0x117')]=function(_0x48cea3,_0x366bdf){return db['chatProactiveAction']['find']({'where':{'id':_0x48cea3[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x366bdf,null))['then'](function(_0x4471af){if(_0x4471af){return _0x4471af[_0xfd7e('0x117')](_0x48cea3[_0xfd7e('0x48')][_0xfd7e('0x5c')],_['omit'](_0x48cea3['body'],[_0xfd7e('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x366bdf,null))[_0xfd7e('0x18')](handleError(_0x366bdf,null));};exports['getProactiveActions']=function(_0x3a9bca,_0x7d500a){var _0x4515a7={};var _0x1ca9ec={};var _0xeea8dc;var _0x3bf417;return db[_0xfd7e('0x2d')][_0xfd7e('0x5a')]({'where':{'id':_0x3a9bca[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x7d500a,null))[_0xfd7e('0xe')](function(_0x5d2569){if(_0x5d2569){_0xeea8dc=_0x5d2569;_0x1ca9ec[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db[_0xfd7e('0x118')][_0xfd7e('0x45')]);_0x1ca9ec[_0xfd7e('0x36')]=_[_0xfd7e('0x30')](_0x3a9bca[_0xfd7e('0x36')]);_0x1ca9ec[_0xfd7e('0x31')]=_[_0xfd7e('0x32')](_0x1ca9ec[_0xfd7e('0x33')],_0x1ca9ec[_0xfd7e('0x36')]);_0x4515a7[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x1ca9ec[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x4515a7['attributes']=_0x4515a7[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x4515a7[_0xfd7e('0x34')]:_0x1ca9ec[_0xfd7e('0x33')];_0x4515a7[_0xfd7e('0x3a')]=qs['sort'](_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x4515a7['where']=qs['filters'](_['pick'](_0x3a9bca[_0xfd7e('0x36')],_0x1ca9ec[_0xfd7e('0x31')]));if(_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x55')]){_0x4515a7[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x4515a7['where'],{'$or':_[_0xfd7e('0x2c')](_0x4515a7[_0xfd7e('0x34')],function(_0x141dcb){var _0x4cbf59={};_0x4cbf59[_0x141dcb]={'$like':'%'+_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x55')]+'%'};return _0x4cbf59;})});}_0x4515a7=_[_0xfd7e('0x3e')]({},_0x4515a7,_0x3a9bca['options']);return _0xeea8dc[_0xfd7e('0xff')](_0x4515a7);}})['then'](function(_0x19897b){if(_0x19897b){_0x3bf417=_0x19897b[_0xfd7e('0x37')];if(!_0x3a9bca[_0xfd7e('0x36')][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x4515a7[_0xfd7e('0x1e')]=qs[_0xfd7e('0x1e')](_0x3a9bca['query'][_0xfd7e('0x1e')]);_0x4515a7[_0xfd7e('0x20')]=qs['offset'](_0x3a9bca['query'][_0xfd7e('0x20')]);}return _0xeea8dc[_0xfd7e('0xff')](_0x4515a7);}})[_0xfd7e('0xe')](function(_0x15a1f1){if(_0x15a1f1){return _0x15a1f1?{'count':_0x3bf417,'rows':_0x15a1f1}:null;}})[_0xfd7e('0xe')](respondWithResult(_0x7d500a,null))[_0xfd7e('0x18')](handleError(_0x7d500a,null));};exports[_0xfd7e('0x119')]=function(_0x1e8c77,_0x449dd6){var _0x21341e=_0x1e8c77['query']['online']===_0xfd7e('0x11a')?_0xfd7e('0x11b'):_0xfd7e('0x11c');return db['ChatWebsite'][_0xfd7e('0x46')]({'attributes':['id',_0x21341e],'where':{'id':_0x1e8c77[_0xfd7e('0x50')]['id']}})['then'](handleEntityNotFound(_0x449dd6,null))[_0xfd7e('0xe')](function(_0x4f8896){if(_0x4f8896){var _0x1655ee=_0x4f8896[_0x21341e];var _0x580421=_0x1655ee&&_0x1655ee[_0xfd7e('0x11d')]?_0x1655ee[_0xfd7e('0x11d')]:[];_0x449dd6[_0xfd7e('0xc3')]({'fromKey':_['isNil'](_0x1655ee[_0xfd7e('0x11e')])?undefined:_0x1655ee[_0xfd7e('0x11e')],'count':_0x580421[_0xfd7e('0x37')],'rows':_0x580421});}})[_0xfd7e('0x18')](handleError(_0x449dd6,null));};exports[_0xfd7e('0x11f')]=function(_0x135c49,_0x47dbc0){var _0x209181={'raw':![],'where':{}};var _0x5c8c9c={};var _0x12ddf3={'count':0x0,'rows':[]};return db[_0xfd7e('0x2d')]['findOne']({'where':{'id':_0x135c49['params']['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x47dbc0,null))[_0xfd7e('0xe')](function(_0x211697){if(_0x211697){_0x5c8c9c[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db['ChatOfflineMessage'][_0xfd7e('0x45')]);_0x5c8c9c[_0xfd7e('0x36')]=_['keys'](_0x135c49['query']);_0x5c8c9c['filters']=_['intersection'](_0x5c8c9c[_0xfd7e('0x33')],_0x5c8c9c[_0xfd7e('0x36')]);_0x209181[_0xfd7e('0x34')]=_[_0xfd7e('0x32')](_0x5c8c9c[_0xfd7e('0x33')],qs['fields'](_0x135c49[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x209181[_0xfd7e('0x34')]=_0x209181[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x209181[_0xfd7e('0x34')]:_0x5c8c9c[_0xfd7e('0x33')];if(!_0x135c49['query']['hasOwnProperty'](_0xfd7e('0x39'))){_0x209181['limit']=qs[_0xfd7e('0x1e')](_0x135c49[_0xfd7e('0x36')]['limit']);_0x209181[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x135c49['query'][_0xfd7e('0x20')]);}_0x209181[_0xfd7e('0x3a')]=qs[_0xfd7e('0x3b')](_0x135c49[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x209181['where']=qs[_0xfd7e('0x31')](_[_0xfd7e('0x3c')](_0x135c49[_0xfd7e('0x36')],_0x5c8c9c['filters']));_0x209181[_0xfd7e('0x3d')][_0xfd7e('0x53')]=_0x211697['id'];if(_0x135c49[_0xfd7e('0x36')][_0xfd7e('0x55')]){_0x209181[_0xfd7e('0x3d')]=_[_0xfd7e('0x3e')](_0x209181[_0xfd7e('0x3d')],{'$or':_['map'](_0x209181['attributes'],function(_0x1aa4d5){var _0x5831c7={};_0x5831c7[_0x1aa4d5]={'$like':'%'+_0x135c49['query'][_0xfd7e('0x55')]+'%'};return _0x5831c7;})});}_0x209181=_['merge']({},_0x209181,_0x135c49[_0xfd7e('0x3f')]);return db[_0xfd7e('0xcc')][_0xfd7e('0x1f')]({'where':_0x209181[_0xfd7e('0x3d')]})[_0xfd7e('0xe')](function(_0x1e055d){_0x12ddf3[_0xfd7e('0x1f')]=_0x1e055d;if(_0x135c49[_0xfd7e('0x36')][_0xfd7e('0x40')]){_0x209181['include']=[{'all':!![]}];}else{_0x209181[_0xfd7e('0x41')]=[{'model':db[_0xfd7e('0x7f')],'as':_0xfd7e('0x120'),'required':![]},{'model':db[_0xfd7e('0xd6')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0xfd7e('0x42')](_0x209181);})[_0xfd7e('0xe')](function(_0xc53e6){_0x12ddf3[_0xfd7e('0x43')]=_0xc53e6;return _0x12ddf3;});}})['then'](respondWithFilteredResult(_0x47dbc0,_0x209181))['catch'](handleError(_0x47dbc0,null));};exports[_0xfd7e('0x121')]=function(_0x5dd11b,_0xf1a9a0){return db[_0xfd7e('0x2d')][_0xfd7e('0x46')]({'where':{'id':_0x5dd11b[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0xf1a9a0,null))[_0xfd7e('0xe')](function(_0xdb0336){if(_0xdb0336){return _0xdb0336[_0xfd7e('0x121')](_0x5dd11b[_0xfd7e('0x48')][_0xfd7e('0x5c')],_[_0xfd7e('0xeb')](_0x5dd11b[_0xfd7e('0x48')],['ids','id'])||{})[_0xfd7e('0xc8')](function(_0x4fe4e0){for(var _0x41ad15=0x0;_0x41ad15<_0x5dd11b[_0xfd7e('0x48')][_0xfd7e('0x5c')][_0xfd7e('0x37')];_0x41ad15+=0x1){socket['emit'](_0xfd7e('0x122'),{'UserId':Number(_0x5dd11b[_0xfd7e('0x48')][_0xfd7e('0x5c')][_0x41ad15]),'ChatWebsiteId':Number(_0x5dd11b['params']['id'])});}return _0x4fe4e0;});}})[_0xfd7e('0xe')](respondWithResult(_0xf1a9a0,null))[_0xfd7e('0x18')](handleError(_0xf1a9a0,null));};exports[_0xfd7e('0x123')]=function(_0x3c517f,_0x483877){return db[_0xfd7e('0x2d')]['find']({'where':{'id':_0x3c517f['params']['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x483877,null))[_0xfd7e('0xe')](function(_0x50d56c){if(_0x50d56c){return _0x50d56c['removeAgents'](_0x3c517f['query'][_0xfd7e('0x5c')])[_0xfd7e('0xe')](function(){if(_[_0xfd7e('0x124')](_0x3c517f[_0xfd7e('0x36')][_0xfd7e('0x5c')])){for(var _0x447321=0x0;_0x447321<_0x3c517f['query'][_0xfd7e('0x5c')]['length'];_0x447321+=0x1){socket[_0xfd7e('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x3c517f[_0xfd7e('0x36')][_0xfd7e('0x5c')][_0x447321]),'ChatWebsiteId':Number(_0x3c517f['params']['id'])});}}else{socket['emit'](_0xfd7e('0x126'),{'UserId':Number(_0x3c517f[_0xfd7e('0x36')][_0xfd7e('0x5c')]),'ChatWebsiteId':Number(_0x3c517f[_0xfd7e('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x483877,null))['catch'](handleError(_0x483877,null));};exports[_0xfd7e('0x127')]=function(_0x675392,_0x865818){var _0x59a82d={};var _0x1d372b={};var _0x22a483;var _0x24f1f5;return db[_0xfd7e('0x2d')][_0xfd7e('0x5a')]({'where':{'id':_0x675392[_0xfd7e('0x50')]['id']}})[_0xfd7e('0xe')](handleEntityNotFound(_0x865818,null))['then'](function(_0x1e48de){if(_0x1e48de){_0x22a483=_0x1e48de;_0x1d372b[_0xfd7e('0x33')]=_[_0xfd7e('0x30')](db[_0xfd7e('0xb7')][_0xfd7e('0x45')]);_0x1d372b[_0xfd7e('0x36')]=_[_0xfd7e('0x30')](_0x675392[_0xfd7e('0x36')]);_0x1d372b[_0xfd7e('0x31')]=_['intersection'](_0x1d372b[_0xfd7e('0x33')],_0x1d372b[_0xfd7e('0x36')]);_0x59a82d['attributes']=_['intersection'](_0x1d372b[_0xfd7e('0x33')],qs[_0xfd7e('0x35')](_0x675392[_0xfd7e('0x36')][_0xfd7e('0x35')]));_0x59a82d[_0xfd7e('0x34')]=_0x59a82d[_0xfd7e('0x34')][_0xfd7e('0x37')]?_0x59a82d['attributes']:_0x1d372b[_0xfd7e('0x33')];_0x59a82d[_0xfd7e('0x3a')]=qs['sort'](_0x675392[_0xfd7e('0x36')][_0xfd7e('0x3b')]);_0x59a82d[_0xfd7e('0x3d')]=qs[_0xfd7e('0x31')](_['pick'](_0x675392[_0xfd7e('0x36')],_0x1d372b[_0xfd7e('0x31')]));if(_0x675392[_0xfd7e('0x36')]['filter']){_0x59a82d[_0xfd7e('0x3d')]=_['merge'](_0x59a82d[_0xfd7e('0x3d')],{'$or':_[_0xfd7e('0x2c')](_0x59a82d['attributes'],function(_0x42d08a){var _0x59cc2c={};_0x59cc2c[_0x42d08a]={'$like':'%'+_0x675392[_0xfd7e('0x36')]['filter']+'%'};return _0x59cc2c;})});}_0x59a82d=_['merge']({},_0x59a82d,_0x675392[_0xfd7e('0x3f')]);return _0x22a483[_0xfd7e('0x127')](_0x59a82d);}})[_0xfd7e('0xe')](function(_0x3127b4){if(_0x3127b4){_0x24f1f5=_0x3127b4['length'];if(!_0x675392['query'][_0xfd7e('0x38')](_0xfd7e('0x39'))){_0x59a82d[_0xfd7e('0x1e')]=qs['limit'](_0x675392[_0xfd7e('0x36')][_0xfd7e('0x1e')]);_0x59a82d[_0xfd7e('0x20')]=qs[_0xfd7e('0x20')](_0x675392[_0xfd7e('0x36')]['offset']);}return _0x22a483[_0xfd7e('0x127')](_0x59a82d);}})['then'](function(_0x26a3c7){if(_0x26a3c7){return _0x26a3c7?{'count':_0x24f1f5,'rows':_0x26a3c7}:null;}})['then'](respondWithResult(_0x865818,null))[_0xfd7e('0x18')](handleError(_0x865818,null));};
\ No newline at end of file
+var _0x712e=['READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','mustache','util','path','ejs','fs-extra','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','include','rows','catch','show','params','attributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','order','findAll','removeDispositions','addAnswer','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','notify','setUA','headers','chat','Sequelize','createdAt','difference','updatedAt','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','DESC','ChatApplication','Applications','account','applications','list','orderBy','asc','Contacts','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','agent','forcedOwnership','Start','startRouting','EventManager','files','no\x20available\x20attributes','CompanyId','from','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','originalname','server','attachments','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','mimetype','subjectOffline','toPairsIn','lastName','Chat','MailAccountId','NotifyMailAccount','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','Contact','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','inspect','No\x20timezone','Interval','Intervals','../../config/license/util','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','ISOLATION_LEVELS'];(function(_0xc9011c,_0x312360){var _0x169910=function(_0x5262d5){while(--_0x5262d5){_0xc9011c['push'](_0xc9011c['shift']());}};_0x169910(++_0x312360);}(_0x712e,0x139));var _0xe712=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x712e[_0x2641f9];return _0x585741;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xe712('0x0'));var util=require(_0xe712('0x1'));var path=require(_0xe712('0x2'));var ejs=require(_0xe712('0x3'));var fs=require('fs');var fs_extra=require(_0xe712('0x4'));var _=require('lodash');var querystring=require('querystring');var Redis=require(_0xe712('0x5'));var qs=require(_0xe712('0x6'));var logger=require(_0xe712('0x7'))(_0xe712('0x8'));var config=require('../../config/environment');var db=require(_0xe712('0x9'))['db'];config['redis']=_[_0xe712('0xa')](config['redis'],{'host':_0xe712('0xb'),'port':0x18eb});var socket=require(_0xe712('0xc'))(new Redis(config[_0xe712('0xd')]));require(_0xe712('0xe'))[_0xe712('0xf')](socket);var htmlToText=require(_0xe712('0x10'));var jayson=require(_0xe712('0x11'));var client=jayson[_0xe712('0x12')]['http']({'port':0x232c});var client9002=jayson[_0xe712('0x12')][_0xe712('0x13')]({'port':0x232a});var client9003=jayson[_0xe712('0x12')][_0xe712('0x13')]({'port':0x232b});var client9001=jayson[_0xe712('0x12')][_0xe712('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x59ad51,_0x562fe4,_0x16fcaf,_0xdd6db3){return new BPromise(function(_0x171263,_0x5d58c6){var _0x458117=_0xdd6db3||client;return _0x458117[_0xe712('0x14')](_0x59ad51,_0x16fcaf)[_0xe712('0x15')](function(_0x1a0ff0){logger[_0xe712('0x16')](_0xe712('0x17'),_0x562fe4,'request\x20sent');logger['debug'](_0xe712('0x18'),_0x562fe4,_0xe712('0x19'),JSON[_0xe712('0x1a')](_0x1a0ff0));if(_0x1a0ff0['error']){if(_0x1a0ff0[_0xe712('0x1b')][_0xe712('0x1c')]===0x1f4){logger[_0xe712('0x1b')](_0xe712('0x17'),_0x562fe4,_0x1a0ff0['error'][_0xe712('0x1d')]);return _0x5d58c6(_0x1a0ff0[_0xe712('0x1b')][_0xe712('0x1d')]);}logger[_0xe712('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x562fe4,_0x1a0ff0[_0xe712('0x1b')]['message']);return _0x171263(_0x1a0ff0[_0xe712('0x1b')][_0xe712('0x1d')]);}else{logger[_0xe712('0x16')](_0xe712('0x17'),_0x562fe4,_0xe712('0x19'));_0x171263(_0x1a0ff0['result'][_0xe712('0x1d')]);}})['catch'](function(_0x2acd23){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x562fe4,_0x2acd23);_0x5d58c6(_0x2acd23);});});}function respondWithStatusCode(_0x2d34c3,_0x4a4d14){_0x4a4d14=_0x4a4d14||0xcc;return function(_0x51fe6b){if(_0x51fe6b){return _0x2d34c3[_0xe712('0x1e')](_0x4a4d14);}return _0x2d34c3['status'](_0x4a4d14)['end']();};}function respondWithResult(_0x4fc1da,_0x3b39d3){_0x3b39d3=_0x3b39d3||0xc8;return function(_0x5cc33b){if(_0x5cc33b){return _0x4fc1da[_0xe712('0x1f')](_0x3b39d3)[_0xe712('0x20')](_0x5cc33b);}};}function respondWithFilteredResult(_0x796623,_0x555463){return function(_0x5ed316){if(_0x5ed316){var _0x54a312=typeof _0x555463[_0xe712('0x21')]===_0xe712('0x22')&&typeof _0x555463[_0xe712('0x23')]==='undefined';var _0xeb7e67=_0x5ed316[_0xe712('0x24')];var _0x4ac409=_0x54a312?0x0:_0x555463['offset'];var _0x420ce0=_0x54a312?_0x5ed316['count']:_0x555463[_0xe712('0x21')]+_0x555463['limit'];var _0x46c216;if(_0x420ce0>=_0xeb7e67){_0x420ce0=_0xeb7e67;_0x46c216=0xc8;}else{_0x46c216=0xce;}_0x796623['status'](_0x46c216);return _0x796623['set'](_0xe712('0x25'),_0x4ac409+'-'+_0x420ce0+'/'+_0xeb7e67)['json'](_0x5ed316);}return null;};}function saveUpdates(_0x55c681){return function(_0x5c45d7){if(_0x5c45d7){return _0x5c45d7[_0xe712('0x26')](_0x55c681)[_0xe712('0x15')](function(_0x99e2b2){return _0x99e2b2;});}return null;};}function removeEntity(_0x6bfc45){return function(_0x5efa4f){if(_0x5efa4f){return _0x5efa4f[_0xe712('0x27')]()[_0xe712('0x15')](function(){var _0x1f968b=_0x5efa4f['get']({'plain':!![]});var _0x510281=_0xe712('0x28');return db[_0xe712('0x29')]['destroy']({'where':{'type':_0x510281,'resourceId':_0x1f968b['id']}})[_0xe712('0x15')](function(){return _0x5efa4f;});})[_0xe712('0x15')](function(){_0x6bfc45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e26fa){return function(_0x47bc54){if(!_0x47bc54){_0x4e26fa[_0xe712('0x1e')](0x194);}return _0x47bc54;};}function handleError(_0x13626c,_0x46a01f){_0x46a01f=_0x46a01f||0x1f4;return function(_0x156dd6){logger[_0xe712('0x1b')](_0x156dd6[_0xe712('0x2a')]);if(_0x156dd6[_0xe712('0x2b')]){delete _0x156dd6['name'];}_0x13626c[_0xe712('0x1f')](_0x46a01f)[_0xe712('0x2c')](_0x156dd6);};}exports[_0xe712('0x2d')]=function(_0x263edb,_0x103952){var _0x47788b={'include':[{'model':db['Pause'],'as':_0xe712('0x2e')}]},_0x11ef30={},_0x473552={'count':0x0,'rows':[]};var _0x1bca8b=_[_0xe712('0x2f')](db[_0xe712('0x30')][_0xe712('0x31')],function(_0x379b64){return{'name':_0x379b64[_0xe712('0x32')],'type':_0x379b64[_0xe712('0x33')][_0xe712('0x34')]};});_0x11ef30[_0xe712('0x35')]=_[_0xe712('0x2f')](_0x1bca8b,_0xe712('0x2b'));_0x11ef30[_0xe712('0x36')]=_[_0xe712('0x37')](_0x263edb[_0xe712('0x36')]);_0x11ef30[_0xe712('0x38')]=_[_0xe712('0x39')](_0x11ef30[_0xe712('0x35')],_0x11ef30[_0xe712('0x36')]);_0x47788b['attributes']=_[_0xe712('0x39')](_0x11ef30[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x263edb[_0xe712('0x36')][_0xe712('0x3a')]));_0x47788b['attributes']=_0x47788b['attributes'][_0xe712('0x3b')]?_0x47788b['attributes']:_0x11ef30[_0xe712('0x35')];if(!_0x263edb[_0xe712('0x36')][_0xe712('0x3c')]('nolimit')){_0x47788b[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x263edb[_0xe712('0x36')][_0xe712('0x23')]);_0x47788b['offset']=qs[_0xe712('0x21')](_0x263edb[_0xe712('0x36')][_0xe712('0x21')]);}_0x47788b['order']=qs[_0xe712('0x3d')](_0x263edb[_0xe712('0x36')][_0xe712('0x3d')]);_0x47788b[_0xe712('0x3e')]=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0x263edb[_0xe712('0x36')],_0x11ef30[_0xe712('0x38')]),_0x1bca8b);if(_0x263edb[_0xe712('0x36')]['filter']){_0x47788b[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x47788b[_0xe712('0x3e')],{'$or':_['map'](_0x1bca8b,function(_0x59d140){if(_0x59d140[_0xe712('0x33')]!=='VIRTUAL'){var _0x4f2825={};_0x4f2825[_0x59d140['name']]={'$like':'%'+_0x263edb[_0xe712('0x36')][_0xe712('0x41')]+'%'};return _0x4f2825;}})});}_0x47788b=_[_0xe712('0x40')]({},_0x47788b,_0x263edb[_0xe712('0x42')]);var _0x5cea80={'where':_0x47788b[_0xe712('0x3e')]};return db[_0xe712('0x30')][_0xe712('0x24')](_0x5cea80)[_0xe712('0x15')](function(_0x1f9920){_0x473552[_0xe712('0x24')]=_0x1f9920;if(_0x263edb['query']['includeAll']){_0x47788b[_0xe712('0x43')]=[{'all':!![]}];}return db[_0xe712('0x30')]['findAll'](_0x47788b);})[_0xe712('0x15')](function(_0x552fdd){_0x473552[_0xe712('0x44')]=_0x552fdd;return _0x473552;})['then'](respondWithFilteredResult(_0x103952,_0x47788b))[_0xe712('0x45')](handleError(_0x103952,null));};exports[_0xe712('0x46')]=function(_0x461f55,_0x3c3a17){var _0xeaa9a7={'raw':![],'where':{'id':_0x461f55[_0xe712('0x47')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4224d5={};_0x4224d5[_0xe712('0x35')]=_[_0xe712('0x37')](db[_0xe712('0x30')]['rawAttributes']);_0x4224d5[_0xe712('0x36')]=_['keys'](_0x461f55[_0xe712('0x36')]);_0x4224d5['filters']=_[_0xe712('0x39')](_0x4224d5['model'],_0x4224d5[_0xe712('0x36')]);_0xeaa9a7[_0xe712('0x48')]=_[_0xe712('0x39')](_0x4224d5[_0xe712('0x35')],qs['fields'](_0x461f55['query'][_0xe712('0x3a')]));_0xeaa9a7[_0xe712('0x48')]=_0xeaa9a7['attributes'][_0xe712('0x3b')]?_0xeaa9a7[_0xe712('0x48')]:_0x4224d5[_0xe712('0x35')];if(_0x461f55[_0xe712('0x36')][_0xe712('0x49')]){_0xeaa9a7['include']=[{'all':!![]}];}_0xeaa9a7=_[_0xe712('0x40')]({},_0xeaa9a7,_0x461f55['options']);return db[_0xe712('0x30')][_0xe712('0x4a')](_0xeaa9a7)[_0xe712('0x15')](handleEntityNotFound(_0x3c3a17,null))['then'](respondWithResult(_0x3c3a17,null))['catch'](handleError(_0x3c3a17,null));};exports['create']=function(_0x3f2391,_0x546084){return db[_0xe712('0x30')][_0xe712('0x4b')](_0x3f2391[_0xe712('0x4c')],{})['then'](function(_0x4b1974){var _0x124109=_0x3f2391[_0xe712('0x4d')]['get']({'plain':!![]});if(!_0x124109)throw new Error(_0xe712('0x4e'));if(_0x124109[_0xe712('0x4f')]==='user'){var _0x554406=_0x4b1974[_0xe712('0x50')]({'plain':!![]});var _0x18d209=_0xe712('0x28');return db[_0xe712('0x51')][_0xe712('0x4a')]({'where':{'name':_0x18d209,'userProfileId':_0x124109['userProfileId']},'raw':!![]})[_0xe712('0x15')](function(_0x52f9cf){if(_0x52f9cf&&_0x52f9cf['autoAssociation']===0x0){return db[_0xe712('0x29')][_0xe712('0x4b')]({'name':_0x554406[_0xe712('0x2b')],'resourceId':_0x554406['id'],'type':_0x52f9cf[_0xe712('0x2b')],'sectionId':_0x52f9cf['id']},{})[_0xe712('0x15')](function(){return _0x4b1974;});}else{return _0x4b1974;}})[_0xe712('0x45')](function(_0x4756a3){logger[_0xe712('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4756a3);throw _0x4756a3;});}return _0x4b1974;})[_0xe712('0x15')](respondWithResult(_0x546084,0xc9))['catch'](handleError(_0x546084,null));};exports[_0xe712('0x26')]=function(_0x42410c,_0xad7072){if(_0x42410c[_0xe712('0x4c')]['id']){delete _0x42410c[_0xe712('0x4c')]['id'];}return db[_0xe712('0x30')]['find']({'where':{'id':_0x42410c[_0xe712('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xe712('0x2e')}]})['then'](handleEntityNotFound(_0xad7072,null))[_0xe712('0x15')](saveUpdates(_0x42410c[_0xe712('0x4c')],null))[_0xe712('0x15')](respondWithResult(_0xad7072,null))['catch'](handleError(_0xad7072,null));};exports[_0xe712('0x27')]=function(_0x25bde0,_0x2df776){return db[_0xe712('0x30')]['find']({'where':{'id':_0x25bde0['params']['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x2df776,null))['then'](removeEntity(_0x2df776,null))[_0xe712('0x45')](handleError(_0x2df776,null));};exports[_0xe712('0x52')]=function(_0x4f6ddb,_0x39fcb3){return db['ChatWebsite'][_0xe712('0x52')]()[_0xe712('0x15')](respondWithResult(_0x39fcb3,null))[_0xe712('0x45')](handleError(_0x39fcb3,null));};exports[_0xe712('0x53')]=function(_0x61f6d5,_0x4fa087){if(_0x61f6d5[_0xe712('0x4c')]['id']){delete _0x61f6d5['body']['id'];}return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x61f6d5['params']['id']}})['then'](handleEntityNotFound(_0x4fa087,null))[_0xe712('0x15')](function(_0x21b826){if(_0x21b826){_0x61f6d5['body'][_0xe712('0x54')]=_0x21b826['id'];return db[_0xe712('0x55')][_0xe712('0x4b')](_0x61f6d5[_0xe712('0x4c')]);}})[_0xe712('0x15')](respondWithResult(_0x4fa087,null))[_0xe712('0x45')](handleError(_0x4fa087,null));};exports[_0xe712('0x56')]=function(_0x2229bb,_0x9e4f85){var _0x27f904={'raw':![],'where':{}};var _0x127785={};var _0x15ce46={'count':0x0,'rows':[]};return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x2229bb[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x9e4f85,null))[_0xe712('0x15')](function(_0x11113c){if(_0x11113c){_0x127785[_0xe712('0x35')]=_[_0xe712('0x37')](db['Disposition'][_0xe712('0x31')]);_0x127785[_0xe712('0x36')]=_['keys'](_0x2229bb[_0xe712('0x36')]);_0x127785[_0xe712('0x38')]=_[_0xe712('0x39')](_0x127785[_0xe712('0x35')],_0x127785[_0xe712('0x36')]);_0x27f904['attributes']=_['intersection'](_0x127785[_0xe712('0x35')],qs['fields'](_0x2229bb[_0xe712('0x36')][_0xe712('0x3a')]));_0x27f904[_0xe712('0x48')]=_0x27f904[_0xe712('0x48')][_0xe712('0x3b')]?_0x27f904[_0xe712('0x48')]:_0x127785[_0xe712('0x35')];if(!_0x2229bb['query'][_0xe712('0x3c')](_0xe712('0x58'))){_0x27f904[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x2229bb[_0xe712('0x36')][_0xe712('0x23')]);_0x27f904['offset']=qs[_0xe712('0x21')](_0x2229bb[_0xe712('0x36')][_0xe712('0x21')]);}_0x27f904[_0xe712('0x59')]=qs[_0xe712('0x3d')](_0x2229bb['query'][_0xe712('0x3d')]);_0x27f904[_0xe712('0x3e')]=qs[_0xe712('0x38')](_['pick'](_0x2229bb[_0xe712('0x36')],_0x127785[_0xe712('0x38')]));_0x27f904[_0xe712('0x3e')][_0xe712('0x54')]=_0x11113c['id'];if(_0x2229bb[_0xe712('0x36')]['filter']){_0x27f904[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x27f904[_0xe712('0x3e')],{'$or':_['map'](_0x27f904[_0xe712('0x48')],function(_0x46d647){var _0x382012={};_0x382012[_0x46d647]={'$like':'%'+_0x2229bb[_0xe712('0x36')]['filter']+'%'};return _0x382012;})});}_0x27f904=_['merge']({},_0x27f904,_0x2229bb[_0xe712('0x42')]);return db[_0xe712('0x55')][_0xe712('0x24')]({'where':_0x27f904[_0xe712('0x3e')]})[_0xe712('0x15')](function(_0x516b8d){_0x15ce46[_0xe712('0x24')]=_0x516b8d;if(_0x2229bb[_0xe712('0x36')][_0xe712('0x49')]){_0x27f904[_0xe712('0x43')]=[{'all':!![]}];}return db[_0xe712('0x55')][_0xe712('0x5a')](_0x27f904);})[_0xe712('0x15')](function(_0x10952a){_0x15ce46[_0xe712('0x44')]=_0x10952a;return _0x15ce46;});}})[_0xe712('0x15')](respondWithFilteredResult(_0x9e4f85,_0x27f904))[_0xe712('0x45')](handleError(_0x9e4f85,null));};exports[_0xe712('0x5b')]=function(_0x448348,_0x3536fd){return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x448348[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x3536fd,null))[_0xe712('0x15')](function(_0x51d6c9){if(_0x51d6c9){return _0x51d6c9[_0xe712('0x5b')](_0x448348['query']['ids']);}})[_0xe712('0x15')](respondWithStatusCode(_0x3536fd,null))[_0xe712('0x45')](handleError(_0x3536fd,null));};exports[_0xe712('0x5c')]=function(_0x295702,_0x251533){if(_0x295702['body']['id']){delete _0x295702['body']['id'];}return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x295702[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x251533,null))[_0xe712('0x15')](function(_0x3cf0b9){if(_0x3cf0b9){_0x295702[_0xe712('0x4c')][_0xe712('0x54')]=_0x3cf0b9['id'];return db[_0xe712('0x5d')][_0xe712('0x4b')](_0x295702[_0xe712('0x4c')]);}})[_0xe712('0x15')](respondWithResult(_0x251533,null))[_0xe712('0x45')](handleError(_0x251533,null));};exports['getAnswers']=function(_0x48c121,_0x374e9d){var _0x140ce1={'raw':![],'where':{}};var _0x301e9d={};var _0x8f4250={'count':0x0,'rows':[]};return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x48c121[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x374e9d,null))[_0xe712('0x15')](function(_0x54f3fd){if(_0x54f3fd){_0x301e9d[_0xe712('0x35')]=_[_0xe712('0x37')](db['CannedAnswer'][_0xe712('0x31')]);_0x301e9d[_0xe712('0x36')]=_[_0xe712('0x37')](_0x48c121[_0xe712('0x36')]);_0x301e9d['filters']=_['intersection'](_0x301e9d['model'],_0x301e9d[_0xe712('0x36')]);_0x140ce1[_0xe712('0x48')]=_[_0xe712('0x39')](_0x301e9d['model'],qs[_0xe712('0x3a')](_0x48c121['query'][_0xe712('0x3a')]));_0x140ce1[_0xe712('0x48')]=_0x140ce1[_0xe712('0x48')]['length']?_0x140ce1[_0xe712('0x48')]:_0x301e9d['model'];if(!_0x48c121[_0xe712('0x36')][_0xe712('0x3c')](_0xe712('0x58'))){_0x140ce1['limit']=qs[_0xe712('0x23')](_0x48c121[_0xe712('0x36')][_0xe712('0x23')]);_0x140ce1['offset']=qs['offset'](_0x48c121[_0xe712('0x36')]['offset']);}_0x140ce1['order']=qs[_0xe712('0x3d')](_0x48c121[_0xe712('0x36')][_0xe712('0x3d')]);_0x140ce1['where']=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0x48c121[_0xe712('0x36')],_0x301e9d[_0xe712('0x38')]));_0x140ce1[_0xe712('0x3e')][_0xe712('0x54')]=_0x54f3fd['id'];if(_0x48c121['query']['filter']){_0x140ce1[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x140ce1[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x140ce1[_0xe712('0x48')],function(_0x1be0dc){var _0x579403={};_0x579403[_0x1be0dc]={'$like':'%'+_0x48c121['query'][_0xe712('0x41')]+'%'};return _0x579403;})});}_0x140ce1=_[_0xe712('0x40')]({},_0x140ce1,_0x48c121[_0xe712('0x42')]);return db['CannedAnswer'][_0xe712('0x24')]({'where':_0x140ce1[_0xe712('0x3e')]})[_0xe712('0x15')](function(_0x4434c9){_0x8f4250[_0xe712('0x24')]=_0x4434c9;if(_0x48c121[_0xe712('0x36')]['includeAll']){_0x140ce1[_0xe712('0x43')]=[{'all':!![]}];}return db[_0xe712('0x5d')][_0xe712('0x5a')](_0x140ce1);})[_0xe712('0x15')](function(_0x342364){_0x8f4250[_0xe712('0x44')]=_0x342364;return _0x8f4250;});}})[_0xe712('0x15')](respondWithFilteredResult(_0x374e9d,_0x140ce1))[_0xe712('0x45')](handleError(_0x374e9d,null));};exports[_0xe712('0x5e')]=function(_0x4eba67,_0x1743d8){return db['ChatWebsite']['find']({'where':{'id':_0x4eba67[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x1743d8,null))['then'](function(_0x2f2c3){if(_0x2f2c3){return _0x2f2c3[_0xe712('0x5e')](_0x4eba67[_0xe712('0x36')]['ids']);}})[_0xe712('0x15')](respondWithStatusCode(_0x1743d8,null))['catch'](handleError(_0x1743d8,null));};exports[_0xe712('0x5f')]=function(_0x20a5f2,_0x543643){_0x20a5f2[_0xe712('0x4c')]['sitepic']=_0x20a5f2[_0xe712('0x60')][_0xe712('0x61')];return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x20a5f2[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x543643,null))['then'](saveUpdates(_0x20a5f2[_0xe712('0x4c')],null))[_0xe712('0x15')](respondWithResult(_0x543643,null))['catch'](handleError(_0x543643,null));};exports[_0xe712('0x62')]=function(_0x3932b8,_0x478249){_0x3932b8[_0xe712('0x4c')][_0xe712('0x63')]=_0x3932b8[_0xe712('0x60')][_0xe712('0x61')];return db[_0xe712('0x30')]['find']({'where':{'id':_0x3932b8[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x478249,null))[_0xe712('0x15')](saveUpdates(_0x3932b8[_0xe712('0x4c')],null))[_0xe712('0x15')](respondWithResult(_0x478249,null))[_0xe712('0x45')](handleError(_0x478249,null));};exports['addCustomerAvatar']=function(_0x5df68e,_0x659a24){_0x5df68e['body'][_0xe712('0x64')]=_0x5df68e[_0xe712('0x60')][_0xe712('0x61')];return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x5df68e[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x659a24,null))[_0xe712('0x15')](saveUpdates(_0x5df68e[_0xe712('0x4c')],null))['then'](respondWithResult(_0x659a24,null))[_0xe712('0x45')](handleError(_0x659a24,null));};exports[_0xe712('0x65')]=function(_0x2ec051,_0x3fa562){_0x2ec051[_0xe712('0x4c')][_0xe712('0x66')]=_0x2ec051[_0xe712('0x60')][_0xe712('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x2ec051[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x3fa562,null))[_0xe712('0x15')](saveUpdates(_0x2ec051[_0xe712('0x4c')],null))[_0xe712('0x15')](respondWithResult(_0x3fa562,null))[_0xe712('0x45')](handleError(_0x3fa562,null));};exports['getLogo']=function(_0x242ebf,_0x14953a){var _0xd10202=path['join'](config['root'],_0xe712('0x67'));var _0x5e74a8={'where':{'id':_0x242ebf[_0xe712('0x47')]['id']},'attributes':['id',_0xe712('0x68')],'raw':!![]};var _0xdc52ca=![];return require('../../config/license/util')[_0xe712('0x69')]()['then'](function(_0x2e92c7){if(_0x2e92c7){_0xdc52ca=_0x2e92c7[_0xe712('0x6a')];}})[_0xe712('0x15')](function(){return db['ChatWebsite'][_0xe712('0x4a')](_0x5e74a8);})['then'](handleEntityNotFound(_0x14953a,null))[_0xe712('0x15')](function(_0x423ab3){if(_0x423ab3){if(!_[_0xe712('0x6b')](_0x423ab3[_0xe712('0x68')])){if(fs[_0xe712('0x6c')](path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0x6f'),_0x423ab3['sitepic']))&&_0xdc52ca){_0xd10202=path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0x6f'),_0x423ab3[_0xe712('0x68')]);}}return _0x14953a[_0xe712('0x70')](_0xd10202);}})[_0xe712('0x45')](handleError(_0x14953a,null));};exports[_0xe712('0x71')]=function(_0x41ef32,_0x1072e1){var _0x73e17a=path['join'](config[_0xe712('0x6e')],_0xe712('0x72'));var _0x22149d={'where':{'id':_0x41ef32['params']['id']},'attributes':['id',_0xe712('0x63')],'raw':!![]};return db[_0xe712('0x30')][_0xe712('0x4a')](_0x22149d)[_0xe712('0x15')](handleEntityNotFound(_0x1072e1,null))['then'](function(_0x36569c){if(_0x36569c){if(!_['isNil'](_0x36569c[_0xe712('0x63')])){if(fs[_0xe712('0x6c')](path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0x73'),_0x36569c[_0xe712('0x63')]))){_0x73e17a=path['join'](config[_0xe712('0x6e')],_0xe712('0x73'),_0x36569c['agentAvatar']);}}return _0x1072e1['download'](_0x73e17a);}})[_0xe712('0x45')](handleError(_0x1072e1,null));};exports[_0xe712('0x74')]=function(_0x4b77de,_0x4afe67){var _0x40ae7b=path[_0xe712('0x6d')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x4c9c11={'where':{'id':_0x4b77de[_0xe712('0x47')]['id']},'attributes':['id',_0xe712('0x64'),_0xe712('0x75')],'raw':!![]};return db['ChatWebsite'][_0xe712('0x4a')](_0x4c9c11)[_0xe712('0x15')](handleEntityNotFound(_0x4afe67,null))['then'](function(_0x19fe13){if(_0x19fe13){if(!_[_0xe712('0x6b')](_0x19fe13['customerAvatar'])){if(fs['existsSync'](path[_0xe712('0x6d')](config[_0xe712('0x6e')],'server/files/images/avatars/',_0x19fe13['customerAvatar']))&&_0x19fe13[_0xe712('0x75')]){_0x40ae7b=path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0x73'),_0x19fe13['customerAvatar']);}}return _0x4afe67['download'](_0x40ae7b);}})[_0xe712('0x45')](handleError(_0x4afe67,null));};exports[_0xe712('0x76')]=function(_0x4afa00,_0x4ee7b9){var _0x7fab8b=path[_0xe712('0x6d')](config[_0xe712('0x6e')],'server/files/images/avatars/system_avatar.png');var _0x432624={'where':{'id':_0x4afa00[_0xe712('0x47')]['id']},'attributes':['id',_0xe712('0x66')],'raw':!![]};return db[_0xe712('0x30')]['find'](_0x432624)[_0xe712('0x15')](handleEntityNotFound(_0x4ee7b9,null))[_0xe712('0x15')](function(_0x16c2b4){if(_0x16c2b4){if(!_['isNil'](_0x16c2b4['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0xe712('0x6e')],'server/files/images/avatars/',_0x16c2b4[_0xe712('0x66')]))){_0x7fab8b=path['join'](config[_0xe712('0x6e')],'server/files/images/avatars/',_0x16c2b4[_0xe712('0x66')]);}}return _0x4ee7b9[_0xe712('0x70')](_0x7fab8b);}})[_0xe712('0x45')](handleError(_0x4ee7b9,null));};exports[_0xe712('0x77')]=function(_0x3a6d85,_0x3dbaea){var _0x21b52c=require('user-agent-parser');var _0x3591d5=new _0x21b52c();var _0x3980c6=_0x3591d5[_0xe712('0x78')](_0x3a6d85[_0xe712('0x79')]['user-agent'])['getResult']();var _0x26e9ac={'body':_0x3a6d85[_0xe712('0x4c')],'channel':_0xe712('0x7a')};var _0x40ed98=[];var _0x54d56c=[];var _0x4974cc={};var _0x258b9f=![];return db['CmContact'][_0xe712('0x52')]()['then'](function(_0x22440c){if(!_0x22440c){throw new db[(_0xe712('0x7b'))]['ValidationError']('no\x20available\x20attributes');}_0x40ed98=_['difference'](_[_0xe712('0x37')](_0x22440c),[_0xe712('0x7c'),'updatedAt']);_0x54d56c=_[_0xe712('0x7d')](_[_0xe712('0x37')](_0x22440c),['createdAt',_0xe712('0x7e'),'CompanyId','ListId']);if(_0x3a6d85[_0xe712('0x4c')]['id']){delete _0x3a6d85[_0xe712('0x4c')]['id'];}if(_[_0xe712('0x6b')](_0x3a6d85['body']['from'])){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3a6d85[_0xe712('0x4c')][_0xe712('0x4c')])||_0x3a6d85[_0xe712('0x4c')][_0xe712('0x4c')]===''){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0x80'));}if(_[_0xe712('0x6b')](_0x3a6d85[_0xe712('0x4c')][_0xe712('0x81')])){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0x82')+_0x54d56c);}if(!_[_0xe712('0x83')](_0x54d56c,_0x3a6d85['body'][_0xe712('0x81')])){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0x84')+_0x54d56c);}_0x4974cc[_0x3a6d85[_0xe712('0x4c')]['mapKey']]=_0x3a6d85['body']['from'];})[_0xe712('0x15')](function(){return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x3a6d85[_0xe712('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0xe712('0x85'),'include':[{'model':db[_0xe712('0x86')],'as':'Contacts','where':_0x4974cc,'limit':0x1,'order':[['updatedAt',_0xe712('0x87')]]}]},{'model':db[_0xe712('0x88')],'as':_0xe712('0x89')}]});})[_0xe712('0x15')](handleEntityNotFound(_0x3dbaea,null))[_0xe712('0x15')](function(_0x3375c6){if(_0x3375c6&&_0x3375c6[_0xe712('0x85')]){_0x26e9ac[_0xe712('0x8a')]=_0x3375c6;_0x26e9ac[_0xe712('0x8b')]=_0x3375c6['Applications'];_0x26e9ac[_0xe712('0x8c')]=_0x3375c6['List'];_0x26e9ac['applications']=_[_0xe712('0x8d')](_0x26e9ac[_0xe712('0x8b')],['priority'],[_0xe712('0x8e')]);if(_0x26e9ac['account'][_0xe712('0x89')]){delete _0x26e9ac[_0xe712('0x8a')]['Applications'];}if(_0x26e9ac['account'][_0xe712('0x85')]&&_0x26e9ac[_0xe712('0x8a')][_0xe712('0x85')][_0xe712('0x8f')][_0xe712('0x3b')]){return _0x26e9ac['account'][_0xe712('0x85')][_0xe712('0x8f')][0x0];}var _0x49d3ef=_['defaults'](_0x3a6d85[_0xe712('0x4c')],{'firstName':_0x3a6d85[_0xe712('0x4c')]['from'],'ListId':_0x3375c6[_0xe712('0x90')]});_0x49d3ef[_0x3a6d85[_0xe712('0x4c')][_0xe712('0x81')]]=_0x3a6d85[_0xe712('0x4c')]['from'];return db[_0xe712('0x86')][_0xe712('0x4b')](_0x49d3ef,{'fields':_0x40ed98,'raw':!![]});}})['then'](handleEntityNotFound(_0x3dbaea,null))[_0xe712('0x15')](function(_0x510eef){_0x26e9ac['contact']=_0x510eef;var _0x33570d=_0x3a6d85[_0xe712('0x4c')][_0xe712('0x91')];if(_0x3a6d85[_0xe712('0x79')][_0xe712('0x92')]){_0x33570d=_0x3a6d85[_0xe712('0x79')][_0xe712('0x92')];}else if(_0x3a6d85[_0xe712('0x79')][_0xe712('0x93')]){_0x33570d=_[_0xe712('0x94')](_0x3a6d85['headers']['x-forwarded-for']['split'](','));}if(_0x510eef){var _0x4cee6f={'ContactId':_0x510eef['id'],'ChatWebsiteId':_0x3a6d85[_0xe712('0x47')]['id'],'from':(_0x510eef[_0xe712('0x95')]||'')+'\x20'+(_0x510eef['lastName']||''),'customerIp':_0x33570d,'customerPort':_0x3a6d85['headers'][_0xe712('0x96')]?_0x3a6d85['headers'][_0xe712('0x96')]:null,'referer':_0x3a6d85[_0xe712('0x4c')][_0xe712('0x97')],'browserName':_0x3980c6[_0xe712('0x98')][_0xe712('0x2b')]&&_0x3980c6[_0xe712('0x98')][_0xe712('0x99')]?util[_0xe712('0x9a')](_0xe712('0x9b'),_0x3980c6['browser'][_0xe712('0x2b')],_0x3980c6['browser'][_0xe712('0x99')]):_0xe712('0x9c'),'browserVersion':_0x3980c6[_0xe712('0x98')]['version']||_0xe712('0x9c'),'osName':util['format'](_0xe712('0x9b'),_0x3980c6['os'][_0xe712('0x2b')],_0x3980c6['os'][_0xe712('0x99')]),'osVersion':_0x3980c6['os'][_0xe712('0x99')],'deviceModel':_0x3980c6['device'][_0xe712('0x35')]&&_0x3980c6['device'][_0xe712('0x9d')]?util['format']('%s\x20%s\x20%s',_0x3980c6[_0xe712('0x9e')][_0xe712('0x35')],_0x3980c6[_0xe712('0x9e')]['vendor'],_0x3980c6[_0xe712('0x9e')]['type']):null,'deviceVendor':_0x3980c6[_0xe712('0x9e')][_0xe712('0x9d')],'deviceType':_0x3980c6[_0xe712('0x9e')][_0xe712('0x33')],'formData':JSON[_0xe712('0x1a')](_0x3a6d85['body'])};var _0x507ff6={'ChatWebsiteId':_0x3a6d85[_0xe712('0x47')]['id'],'closed':![]};if(_0x3a6d85[_0xe712('0x4c')][_0xe712('0x9f')]){_0x507ff6[_0xe712('0x9f')]=_0x3a6d85[_0xe712('0x4c')]['threadId'];return db[_0xe712('0xa0')]['find']({'where':_0x507ff6})[_0xe712('0x15')](function(_0x8f361e){if(_0x8f361e){return[_0x8f361e,![]];}_0x4cee6f[_0xe712('0x9f')]=_0x3a6d85[_0xe712('0x4c')]['threadId'];_0x4cee6f[_0xe712('0xa1')]=_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa1')];return db[_0xe712('0xa0')][_0xe712('0x4b')](_0x4cee6f)[_0xe712('0x15')](function(_0xcc4f2f){return[_0xcc4f2f,!![]];});});}_0x507ff6[_0xe712('0xa2')]=_0x510eef['id'];if(_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa3')]&&_0x3a6d85[_0xe712('0x4c')]['interaction']['id']){_0x507ff6['id']=_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa3')]['id'];return db[_0xe712('0xa0')][_0xe712('0x4a')]({'where':_0x507ff6})[_0xe712('0x15')](function(_0x57bb63){if(_0x57bb63){return[_0x57bb63,![]];}return db['ChatInteraction'][_0xe712('0x4b')](_0x4cee6f)['then'](function(_0x58d0ee){return[_0x58d0ee,!![]];});});}return db[_0xe712('0xa0')][_0xe712('0x4b')](_0x4cee6f)[_0xe712('0x15')](function(_0x12ada5){return[_0x12ada5,!![]];});}})[_0xe712('0xa4')](function(_0x5475c9,_0x176d93){if(_0x5475c9){_0x258b9f=_0x176d93;if(!_0x176d93){var _0x340b20={'from':(_0x26e9ac[_0xe712('0xa5')][_0xe712('0x95')]||'')+'\x20'+(_0x26e9ac[_0xe712('0xa5')]['lastName']||'')};if(_0x3a6d85['body'][_0xe712('0x9f')]&&_0x3a6d85[_0xe712('0x4c')]['messageId']&&_0x3a6d85[_0xe712('0x4c')][_0xe712('0x9f')]!=_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa6')]){_0x340b20[_0xe712('0x9f')]=_0x3a6d85[_0xe712('0x4c')][_0xe712('0xa6')];}return _0x5475c9[_0xe712('0x26')](_0x340b20);}else{return _0x5475c9;}}})[_0xe712('0x15')](function(_0x4a40a8){_0x26e9ac[_0xe712('0xa3')]=_0x4a40a8[_0xe712('0x50')]({'plain':!![]});_0x26e9ac['interaction'][_0xe712('0xa7')]=_0x258b9f;if(_0x26e9ac[_0xe712('0xa3')]['created']){if(_0x26e9ac['account'][_0xe712('0xa8')]){_0x26e9ac[_0xe712('0x8b')][_0xe712('0xa9')]({'id':0x0,'priority':_0x26e9ac[_0xe712('0x8b')][_0xe712('0x3b')]+0x1,'app':'close','appdata':_0xe712('0xaa'),'interval':_0xe712('0xab')});}}return db[_0xe712('0xac')][_0xe712('0x4b')]({'body':_0x3a6d85[_0xe712('0x4c')][_0xe712('0x4c')],'ChatWebsiteId':_0x3a6d85[_0xe712('0x47')]['id'],'ChatInteractionId':_0x4a40a8['id'],'direction':'in','ContactId':_0x26e9ac['contact']['id'],'AttachmentId':_0x3a6d85[_0xe712('0x4c')][_0xe712('0xad')]});})[_0xe712('0x15')](function(_0x120131){_0x26e9ac['message']=_0x120131;if(_0x26e9ac[_0xe712('0xa3')]['UserId']){return db[_0xe712('0xae')][_0xe712('0x4a')]({'attributes':['id','name'],'where':{'id':_0x26e9ac[_0xe712('0xa3')][_0xe712('0xaf')]}})[_0xe712('0x15')](function(_0xb44715){if(_0xb44715){_0x26e9ac[_0xe712('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe712('0xb0'),'appdata':_0xb44715[_0xe712('0x2b')]+','+(_0x26e9ac[_0xe712('0x8a')]['waitForTheAssignedAgent']||0xa),'interval':_0xe712('0xab')});_0x26e9ac[_0xe712('0xb1')]=!![];}return respondWithRpcPromise(_0xe712('0xb2'),_0xe712('0xb3'),_0x26e9ac);});}return respondWithRpcPromise(_0xe712('0xb2'),_0xe712('0xb3'),_0x26e9ac);})[_0xe712('0x15')](function(_0xd6aabd){respondWithRpcPromise(_0xe712('0xb4'),_0xe712('0xb4'),{'event':_0xe712('0x77'),'message':_0xd6aabd},client9002);return _0xd6aabd;})[_0xe712('0x15')](respondWithResult(_0x3dbaea,null))[_0xe712('0x45')](handleError(_0x3dbaea,null));};exports['offline']=function(_0x48bdf8,_0x1b9a45){var _0x541595,_0x53c6ab,_0x1bdd69;var _0x1b05b4=[];var _0x43fbf4={};var _0x34737b=_0x48bdf8[_0xe712('0xb5')]||[];var _0x2579a3=[];var _0x42bb0c;return db['CmContact'][_0xe712('0x52')]()[_0xe712('0x15')](function(_0x1625b4){if(!_0x1625b4){throw new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0xb6'));}_0x1b05b4=_[_0xe712('0x7d')](_[_0xe712('0x37')](_0x1625b4),['createdAt',_0xe712('0x7e'),_0xe712('0xb7'),'ListId']);if(_0x48bdf8[_0xe712('0x4c')]['id']){delete _0x48bdf8[_0xe712('0x4c')]['id'];}if(_[_0xe712('0x6b')](_0x48bdf8['body'][_0xe712('0xb8')])){throw _0x1b9a45[_0xe712('0x1f')](0x1f4)[_0xe712('0x2c')](new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0xb9')));}if(_['isNil'](_0x48bdf8['body']['body'])||_0x48bdf8[_0xe712('0x4c')][_0xe712('0x4c')]===''){throw _0x1b9a45[_0xe712('0x1f')](0x1f4)[_0xe712('0x2c')](new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))](_0xe712('0x80')));}if(_[_0xe712('0x6b')](_0x48bdf8[_0xe712('0x4c')][_0xe712('0xba')])){throw _0x1b9a45[_0xe712('0x1f')](0x1f4)[_0xe712('0x2c')](new db['Sequelize']['ValidationError'](_0xe712('0xbb')+_0x1b05b4));}if(!_[_0xe712('0x83')](_0x1b05b4,_0x48bdf8[_0xe712('0x4c')]['mapKeyOffline'])){throw _0x1b9a45[_0xe712('0x1f')](0x1f4)[_0xe712('0x2c')](new db[(_0xe712('0x7b'))][(_0xe712('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b05b4));}_0x43fbf4[_0x48bdf8[_0xe712('0x4c')]['mapKeyOffline']]=_0x48bdf8[_0xe712('0x4c')][_0xe712('0xb8')];})[_0xe712('0x15')](function(){return db['ChatWebsite'][_0xe712('0x4a')]({'where':{'id':_0x48bdf8[_0xe712('0x47')]['id']},'include':[{'model':db[_0xe712('0xbc')],'as':_0xe712('0x85')},{'model':db[_0xe712('0xbd')],'as':_0xe712('0xbd')}]});})[_0xe712('0x15')](handleEntityNotFound(_0x1b9a45,null))[_0xe712('0x15')](function(_0x389b43){if(_0x389b43&&_0x389b43[_0xe712('0x85')]){_0x53c6ab=_0x389b43;var _0x17fab4=_[_0xe712('0xa')](_0x48bdf8['body'],{'firstName':_0x48bdf8[_0xe712('0x4c')]['from'],'phone':_0x48bdf8[_0xe712('0x4c')]['from'],'ListId':_0x389b43['ListId']});_0x17fab4[_0x48bdf8[_0xe712('0x4c')][_0xe712('0xba')]]=_0x48bdf8[_0xe712('0x4c')][_0xe712('0xb8')];return db[_0xe712('0x86')][_0xe712('0xbe')]({'where':_0x43fbf4,'defaults':_0x17fab4});}})[_0xe712('0xa4')](function(_0xd312ab){if(_0xd312ab){_0x1bdd69=_0xd312ab;var _0x432a97=fs[_0xe712('0xbf')](path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0xc0')),_0xe712('0xc1'));var _0x43857b=ejs[_0xe712('0xc2')](_0x432a97,{'body':_[_0xe712('0xc3')](_0x48bdf8[_0xe712('0x4c')][_0xe712('0x4c')]),'bodyTitle':_0x53c6ab['offlineMessageBody']});return db['ChatOfflineMessage'][_0xe712('0x4b')]({'body':_0x43857b,'plainBody':htmlToText['fromString'](_0x43857b),'ContactId':_0xd312ab['id'],'ChatWebsiteId':_0x53c6ab['id']});}})['then'](function(_0x1f88a5){_0x42bb0c=_0x1f88a5;if(_0x34737b[_0xe712('0x3b')]){var _0xca258e=_0x34737b[_0xe712('0x2f')](function(_0x44f598){return{'name':_0x44f598[_0xe712('0xc4')],'basename':_0x44f598[_0xe712('0x61')],'type':_0x44f598['mimetype'],'ChatOfflineMessageId':_0x1f88a5['id']};});_0x2579a3=_0xca258e[_0xe712('0x2f')](_0x42fd3a=>{var _0x107ea9={'filename':_0x42fd3a[_0xe712('0x2b')],'path':path['join'](config[_0xe712('0x6e')],_0xe712('0xc5'),'files',_0xe712('0xc6'),'offline-chat',_0x42fd3a[_0xe712('0xc7')])};return _0x107ea9;});if(!_0x53c6ab['openNewInteraction']){return db[_0xe712('0xc8')][_0xe712('0xc9')](function(_0x211a8a){return db[_0xe712('0xca')][_0xe712('0xcb')](_0xca258e,{'transaction':_0x211a8a});});}}})['then'](function(){if(_0x42bb0c){_0x541595=_0x42bb0c;return db['MailAccount'][_0xe712('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0xe712('0xcc')],'as':_0xe712('0xcd'),'raw':!![],'include':[{'model':db[_0xe712('0xce')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x1f67b2){if(_0x1f67b2&&_0x1f67b2[_0xe712('0xcd')]&&_0x53c6ab[_0xe712('0xcf')]&&_0x53c6ab[_0xe712('0xd0')]){var _0x148121=_0x1f67b2[_0xe712('0xd1')]();return respondWithRpcPromise(_0xe712('0xd2'),_0xe712('0xd3'),{'account':_0x148121,'message':{'from':util['format'](_0xe712('0xd4'),_0x1f67b2[_0xe712('0x2b')],_0x1f67b2[_0xe712('0xd5')]||_0x1f67b2[_0xe712('0xcd')][_0xe712('0x4d')]),'to':_0x53c6ab[_0xe712('0xd0')],'subject':_0x53c6ab[_0xe712('0xd6')],'html':_0x541595[_0xe712('0x4c')],'attachments':_0x2579a3}},client9003)['then'](function(){return _0x541595;})[_0xe712('0x45')](function(_0x45bb5e){logger[_0xe712('0x1b')](_0x45bb5e);});}})[_0xe712('0x15')](function(){if(_0x53c6ab&&_0x53c6ab[_0xe712('0xd7')]&&_0x53c6ab['MailAccountId']){var _0x3ba2cf=[];if(_0x34737b[_0xe712('0x3b')]){_0x3ba2cf=_0x34737b['map'](function(_0x116e8f){return{'name':_0x116e8f[_0xe712('0xc4')],'basename':_0x116e8f['filename'],'type':_0x116e8f[_0xe712('0xd8')],'ChatOfflineMessageId':_0x42bb0c['id']};});}var _0x9e6e79;if(!_['isNil'](_0x53c6ab[_0xe712('0xd9')])){var _0x3d6f9d=_[_0xe712('0x2f')](_0x48bdf8['body'],function(_0x38922f){return _0x38922f;});var _0x4abe12=_[_0xe712('0xda')](_0x3d6f9d)[0x0];var _0x244d1d=_['mapValues'](_0x4abe12,function(_0x140a00){return _0x140a00;});_0x9e6e79=_0x244d1d[0x1][_0x53c6ab[_0xe712('0xd9')]];}var _0x30a95a={'from':_0x1bdd69[_0xe712('0xd5')],'firstName':_0x1bdd69['firstName'],'lastName':_0x1bdd69[_0xe712('0xdb')],'mapKey':'email','message':{'from':_0x1bdd69[_0xe712('0xd5')],'to':_0x53c6ab[_0xe712('0xbd')]['email'],'cc':'','subject':_[_0xe712('0x6b')](_0x9e6e79)?_0x53c6ab[_0xe712('0xd6')]:_0x9e6e79,'messageId':'','sentAt':new Date(),'attach':_0x3ba2cf[_0xe712('0x3b')],'attachments':_0x3ba2cf,'originChannel':_0xe712('0xdc'),'ChatWebsiteId':_0x53c6ab['id'],'ChatOfflineMessageId':_0x541595['id'],'originTo':_0x53c6ab[_0xe712('0xbd')][_0xe712('0xd5')]},'body':_0x541595[_0xe712('0x4c')]};var _0x5c4e76={'account':{'id':_0x53c6ab[_0xe712('0xdd')]},'body':_0x30a95a,'log':_0xe712('0xde')};return respondWithRpcPromise(_0xe712('0xde'),'notifyMail',_0x5c4e76,client9001)[_0xe712('0x15')](function(){return _0x541595;})[_0xe712('0x45')](function(_0x2e35a9){logger['error'](_0x2e35a9);});}return;})[_0xe712('0x15')](function(){if(_0x541595){return _0x541595;}})[_0xe712('0x15')](respondWithResult(_0x1b9a45,null))[_0xe712('0x45')](function(_0x5629aa){logger[_0xe712('0x1b')]('catch',_0x5629aa);for(var _0xa97a2c of _0x34737b){var _0x5dfbdc=path[_0xe712('0x6d')](config[_0xe712('0x6e')],'server','files','attachments',_0xe712('0xdf'),_0xa97a2c['filename']);fs_extra['remove'](_0x5dfbdc)[_0xe712('0x45')](function(_0x18d75c){logger[_0xe712('0x1b')](_0xe712('0xe0'),_0x5dfbdc,_0x18d75c);});}});};exports[_0xe712('0xe1')]=function(_0x46fe65,_0x1a89e5){return db['ChatInteraction']['find']({'where':{'id':_0x46fe65['params']['id']}})['then'](handleEntityNotFound(_0x1a89e5,null))[_0xe712('0x15')](function(_0x53fe6a){if(_0x53fe6a){return _0x53fe6a[_0xe712('0xe1')](_0x46fe65[_0xe712('0x4c')][_0xe712('0xe2')],_[_0xe712('0xe3')](_0x46fe65['body'],['ids','id'])||{});}})[_0xe712('0x15')](respondWithResult(_0x1a89e5,null))['catch'](handleError(_0x1a89e5,null));};exports['getInteractions']=function(_0x5071fd,_0x4c0d4d){var _0x326b01={'raw':![],'where':{}};var _0x3923fd={};var _0x26b9a6={'count':0x0,'rows':[]};return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x5071fd[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x4c0d4d,null))['then'](function(_0x5c04d2){if(_0x5c04d2){_0x3923fd[_0xe712('0x35')]=_['keys'](db[_0xe712('0xa0')]['rawAttributes']);_0x3923fd[_0xe712('0x36')]=_[_0xe712('0x37')](_0x5071fd[_0xe712('0x36')]);_0x3923fd['filters']=_[_0xe712('0x39')](_0x3923fd[_0xe712('0x35')],_0x3923fd[_0xe712('0x36')]);_0x326b01['attributes']=_[_0xe712('0x39')](_0x3923fd[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x5071fd['query'][_0xe712('0x3a')]));_0x326b01['attributes']=_0x326b01[_0xe712('0x48')]['length']?_0x326b01['attributes']:_0x3923fd[_0xe712('0x35')];if(!_0x5071fd[_0xe712('0x36')][_0xe712('0x3c')](_0xe712('0x58'))){_0x326b01[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x5071fd[_0xe712('0x36')][_0xe712('0x23')]);_0x326b01[_0xe712('0x21')]=qs[_0xe712('0x21')](_0x5071fd[_0xe712('0x36')]['offset']);}_0x326b01[_0xe712('0x59')]=qs[_0xe712('0x3d')](_0x5071fd[_0xe712('0x36')][_0xe712('0x3d')]);_0x326b01[_0xe712('0x3e')]=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0x5071fd[_0xe712('0x36')],_0x3923fd[_0xe712('0x38')]));_0x326b01[_0xe712('0x3e')][_0xe712('0x54')]=_0x5c04d2['id'];if(_0x5071fd[_0xe712('0x36')][_0xe712('0x41')]){_0x326b01[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x326b01[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x326b01[_0xe712('0x48')],function(_0x2d3493){var _0x412e44={};_0x412e44[_0x2d3493]={'$like':'%'+_0x5071fd['query']['filter']+'%'};return _0x412e44;})});}_0x326b01=_['merge']({},_0x326b01,_0x5071fd[_0xe712('0x42')]);return db['ChatInteraction'][_0xe712('0x24')]({'where':_0x326b01[_0xe712('0x3e')]})['then'](function(_0x56482a){_0x26b9a6['count']=_0x56482a;if(_0x5071fd['query'][_0xe712('0x49')]){_0x326b01[_0xe712('0x43')]=[{'model':db[_0xe712('0x86')],'as':_0xe712('0xe4'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xe712('0x2b'),_0xe712('0xe5'),_0xe712('0xe6')],'required':![]},{'model':db['Tag'],'as':_0xe712('0xe7'),'attributes':['id',_0xe712('0x2b'),_0xe712('0xe8')],'where':_0x5071fd[_0xe712('0x36')][_0xe712('0xe9')]?{'id':_0x5071fd[_0xe712('0x36')]['tag']}:undefined,'required':_0x5071fd[_0xe712('0x36')][_0xe712('0xe9')]?!![]:![]}];}return db['ChatInteraction'][_0xe712('0x5a')](_0x326b01);})['then'](function(_0x386cb8){_0x26b9a6[_0xe712('0x44')]=_0x386cb8;return _0x26b9a6;});}})[_0xe712('0x15')](respondWithFilteredResult(_0x4c0d4d,_0x326b01))[_0xe712('0x45')](handleError(_0x4c0d4d,null));};function iftimePromise(_0x4d95ae,_0x22e476){return respondWithRpcPromise(_0xe712('0xea'),_0xe712('0xeb'),{'command':_0x22e476[_0xe712('0xec')]?util[_0xe712('0x9a')](_0xe712('0xed'),_0x4d95ae['interval'],_0x22e476[_0xe712('0xec')]):util['format'](_0xe712('0xee'),_0x4d95ae['interval'])},client9002)[_0xe712('0x15')](function(_0x2da482){var _0x40c308=_0x2da482&&_0x2da482[_0xe712('0xef')]('true')>=0x0?!![]:![];logger[_0xe712('0x16')](_0xe712('0xf0'),_0x22e476['id'],_0x4d95ae['id'],_0x4d95ae[_0xe712('0xf1')],_0x40c308?_0xe712('0xf2'):'OFFLINE',_0x22e476['timezone']?_0x22e476[_0xe712('0xec')]:'No\x20timezone');return _0x40c308;})[_0xe712('0x45')](function(_0x40b980){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x22e476['id'],_0x4d95ae['id'],_0x4d95ae['interval'],util[_0xe712('0xf3')](_0x40b980,{'showHidden':![],'depth':null}),_0x22e476[_0xe712('0xec')]?_0x22e476['timezone']:_0xe712('0xf4'));return![];});}exports[_0xe712('0xeb')]=function(_0x469b02,_0x548221){var _0x5bc3e2=0x0;var _0x2ede4b=0x0;var _0x1c8af6=![];var _0x24aef1;var _0x200839;return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x469b02[_0xe712('0x47')]['id']},'include':[{'model':db[_0xe712('0xf5')],'as':_0xe712('0xf5'),'include':[{'model':db[_0xe712('0xf5')],'as':_0xe712('0xf6'),'attributes':['id',_0xe712('0xf1')],'raw':!![]}]}]})[_0xe712('0x15')](handleEntityNotFound(_0x548221,null))[_0xe712('0x15')](function(_0x15ec1d){if(_0x15ec1d){_0x24aef1=_0x15ec1d;return _0x15ec1d['getProactiveActions']({'raw':!![]});}})['then'](function(_0x2276e1){if(_0x24aef1){if(_0x2276e1){_0x200839=_0x2276e1;}}return require(_0xe712('0xf7'))[_0xe712('0x69')]();})['then'](function(_0x16c366){if(_0x16c366){_0x2ede4b=_0x16c366['virtual'];_0x1c8af6=_0x16c366[_0xe712('0x6a')];}})[_0xe712('0x15')](function(){return db[_0xe712('0xa0')][_0xe712('0x24')]({'where':{'closed':![]}});})[_0xe712('0x15')](function(_0x1f2000){_0x5bc3e2=_0x1f2000;if(_0x2ede4b&&_0x1f2000>_0x2ede4b){return db['License'][_0xe712('0x57')]({'where':{'id':0x1}})[_0xe712('0x15')](function(_0xe62424){if(_0xe62424){_0xe62424[_0xe712('0xf8')](_0xe712('0xf9'));}});}})['then'](function(){if(_0x24aef1[_0xe712('0xf5')]&&_0x24aef1[_0xe712('0xf5')][_0xe712('0xf6')]){var _0x4d3f44=[];for(var _0x7ecbd4=0x0;_0x7ecbd4<_0x24aef1['Interval']['Intervals']['length'];_0x7ecbd4++){var _0x4651cb=_0x24aef1['Interval'][_0xe712('0xf6')][_0x7ecbd4][_0xe712('0x50')]({'plain':!![]});_0x4d3f44[_0xe712('0xa9')](iftimePromise(_0x4651cb,_0x24aef1));}return BPromise[_0xe712('0xfa')](_0x4d3f44)['then'](function(_0x1fc8f5){return _[_0xe712('0xfb')](_0x1fc8f5);});}else{return!![];}})['then'](function(_0x326cd0){var _0x18318f=fs[_0xe712('0xbf')](path[_0xe712('0x6d')](config[_0xe712('0x6e')],_0xe712('0xfc')),_0xe712('0xc1'));var _0x56f9bd={'remote':_0x24aef1[_0xe712('0xfd')],'query':querystring[_0xe712('0x1a')](_[_0xe712('0x40')](_0x24aef1[_0xe712('0x50')]({'plain':!![]}),{'customerIp':_0x469b02[_0xe712('0x79')][_0xe712('0x93')]||_0x469b02[_0xe712('0x79')][_0xe712('0xfe')]||_0x469b02['connection'][_0xe712('0xff')]||_0x469b02['ip'],'referer':_0x469b02['headers']['referer'],'openedInteractions':_0x5bc3e2,'maxInteractions':_0x2ede4b,'virtual':_0x1c8af6['virtual'],'online':_0x326cd0,'custom':_0x1c8af6}))[_0xe712('0x100')](/'/g,'\x5c\x27')};_0x548221[_0xe712('0x2c')](ejs[_0xe712('0xc2')](Mustache[_0xe712('0xc2')](_0x18318f,_0x56f9bd),{'proactiveActions':_0x200839,'alignment':_0x24aef1[_0xe712('0x101')],'verticalAlignment':_0x24aef1['verticalAlignment'],'div_color':_0x24aef1[_0xe712('0xe8')],'labelText':_0x24aef1[_0xe712('0x102')],'text_color':_0x24aef1[_0xe712('0x103')],'text_button_color':_0x24aef1[_0xe712('0x104')],'button_color':_0x24aef1[_0xe712('0x105')],'background_color':_0x24aef1[_0xe712('0x106')],'hideWhenOffline':_0x24aef1[_0xe712('0x107')],'interval':_0x24aef1['IntervalId']}));})[_0xe712('0x45')](handleError(_0x548221,null));};exports[_0xe712('0x108')]=function(_0x3c2143,_0x478e6e){var _0x41d159=_0x3c2143[_0xe712('0x47')]['id'];var _0x24d696=_0x3c2143['body'];var _0x5e1c7b=0xc8;var _0x122fbc=null;return db[_0xe712('0xc8')][_0xe712('0xc9')]({'isolationLevel':db['sequelize'][_0xe712('0x109')][_0xe712('0x10a')][_0xe712('0x10b')]},function(_0x4d4338){return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x41d159},'transaction':_0x4d4338})[_0xe712('0x15')](function(_0x95c9bd){if(_0x95c9bd){return db['ChatApplication'][_0xe712('0x27')]({'where':{'ChatWebsiteId':_0x41d159},'transaction':_0x4d4338})['then'](function(){var _0x2f122e=_[_0xe712('0x2f')](_0x24d696,function(_0x4558f3){_0x4558f3['ChatWebsiteId']=_0x41d159;return _0x4558f3;});return db[_0xe712('0x88')]['bulkCreate'](_0x2f122e,{'transaction':_0x4d4338});});}else{_0x5e1c7b=0x194;_0x122fbc=[];}});})[_0xe712('0x15')](function(){if(_0x5e1c7b!==0x194){return db['ChatApplication'][_0xe712('0x10c')]({'where':{'ChatWebsiteId':_0x41d159},'order':_0xe712('0x10d')})['then'](function(_0x2b8f78){_0x122fbc=_0x2b8f78;});}})[_0xe712('0x45')](function(_0x5908a2){_0x5e1c7b=0x1f4;logger[_0xe712('0x1b')](_0x5908a2['stack']);if(_0x5908a2[_0xe712('0x2b')]){delete _0x5908a2[_0xe712('0x2b')];}_0x122fbc=_0x5908a2;})[_0xe712('0x10e')](function(){if(_0x122fbc===null){_0x478e6e['sendStatus'](_0x5e1c7b);}else{if(_0x5e1c7b===0x1f4){_0x478e6e[_0xe712('0x1f')](_0x5e1c7b)['send'](_0x122fbc);}else{_0x478e6e['status'](_0x5e1c7b)[_0xe712('0x20')](_0x122fbc);}}});};exports[_0xe712('0x10f')]=function(_0x365789,_0x2b81ff){var _0x4a9f8c={};var _0x437f86={};var _0x550d4e;var _0x3fab6f;return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x365789[_0xe712('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b81ff,null))['then'](function(_0x55e4c5){if(_0x55e4c5){_0x550d4e=_0x55e4c5;_0x437f86[_0xe712('0x35')]=_[_0xe712('0x37')](db['ChatApplication'][_0xe712('0x31')]);_0x437f86[_0xe712('0x36')]=_[_0xe712('0x37')](_0x365789[_0xe712('0x36')]);_0x437f86[_0xe712('0x38')]=_[_0xe712('0x39')](_0x437f86[_0xe712('0x35')],_0x437f86['query']);_0x4a9f8c[_0xe712('0x48')]=_[_0xe712('0x39')](_0x437f86[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x365789[_0xe712('0x36')][_0xe712('0x3a')]));_0x4a9f8c['attributes']=_0x4a9f8c[_0xe712('0x48')][_0xe712('0x3b')]?_0x4a9f8c['attributes']:_0x437f86[_0xe712('0x35')];_0x4a9f8c[_0xe712('0x59')]=qs[_0xe712('0x3d')](_0x365789['query'][_0xe712('0x3d')]);_0x4a9f8c[_0xe712('0x3e')]=qs[_0xe712('0x38')](_['pick'](_0x365789[_0xe712('0x36')],_0x437f86[_0xe712('0x38')]));if(_0x365789[_0xe712('0x36')][_0xe712('0x41')]){_0x4a9f8c[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x4a9f8c[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x4a9f8c[_0xe712('0x48')],function(_0x39939c){var _0x441503={};_0x441503[_0x39939c]={'$like':'%'+_0x365789['query']['filter']+'%'};return _0x441503;})});}_0x4a9f8c=_['merge']({},_0x4a9f8c,_0x365789[_0xe712('0x42')]);return _0x550d4e['getApplications'](_0x4a9f8c);}})[_0xe712('0x15')](function(_0x33bd87){if(_0x33bd87){_0x3fab6f=_0x33bd87[_0xe712('0x3b')];if(!_0x365789[_0xe712('0x36')]['hasOwnProperty'](_0xe712('0x58'))){_0x4a9f8c[_0xe712('0x23')]=qs['limit'](_0x365789[_0xe712('0x36')][_0xe712('0x23')]);_0x4a9f8c[_0xe712('0x21')]=qs[_0xe712('0x21')](_0x365789[_0xe712('0x36')][_0xe712('0x21')]);}return _0x550d4e[_0xe712('0x10f')](_0x4a9f8c);}})[_0xe712('0x15')](function(_0x19f1d8){if(_0x19f1d8){return _0x19f1d8?{'count':_0x3fab6f,'rows':_0x19f1d8}:null;}})['then'](respondWithResult(_0x2b81ff,null))[_0xe712('0x45')](handleError(_0x2b81ff,null));};exports[_0xe712('0x110')]=function(_0x155623,_0x4b5778){return db[_0xe712('0x111')][_0xe712('0x4a')]({'where':{'id':_0x155623[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x4b5778,null))[_0xe712('0x15')](function(_0x4bb2d5){if(_0x4bb2d5){return _0x4bb2d5[_0xe712('0x110')](_0x155623['body']['ids'],_[_0xe712('0xe3')](_0x155623[_0xe712('0x4c')],[_0xe712('0xe2'),'id'])||{});}})[_0xe712('0x15')](respondWithResult(_0x4b5778,null))['catch'](handleError(_0x4b5778,null));};exports['getProactiveActions']=function(_0xad673a,_0x760b79){var _0x2af08f={};var _0x1b3bc6={};var _0x1afd18;var _0x24c49e;return db[_0xe712('0x30')]['findOne']({'where':{'id':_0xad673a['params']['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x760b79,null))[_0xe712('0x15')](function(_0x1ca987){if(_0x1ca987){_0x1afd18=_0x1ca987;_0x1b3bc6[_0xe712('0x35')]=_[_0xe712('0x37')](db[_0xe712('0x112')][_0xe712('0x31')]);_0x1b3bc6[_0xe712('0x36')]=_[_0xe712('0x37')](_0xad673a[_0xe712('0x36')]);_0x1b3bc6[_0xe712('0x38')]=_['intersection'](_0x1b3bc6[_0xe712('0x35')],_0x1b3bc6['query']);_0x2af08f[_0xe712('0x48')]=_[_0xe712('0x39')](_0x1b3bc6[_0xe712('0x35')],qs[_0xe712('0x3a')](_0xad673a[_0xe712('0x36')]['fields']));_0x2af08f[_0xe712('0x48')]=_0x2af08f[_0xe712('0x48')]['length']?_0x2af08f[_0xe712('0x48')]:_0x1b3bc6[_0xe712('0x35')];_0x2af08f[_0xe712('0x59')]=qs['sort'](_0xad673a[_0xe712('0x36')][_0xe712('0x3d')]);_0x2af08f[_0xe712('0x3e')]=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0xad673a[_0xe712('0x36')],_0x1b3bc6[_0xe712('0x38')]));if(_0xad673a[_0xe712('0x36')]['filter']){_0x2af08f['where']=_[_0xe712('0x40')](_0x2af08f[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x2af08f[_0xe712('0x48')],function(_0x318e0f){var _0x3aaf3b={};_0x3aaf3b[_0x318e0f]={'$like':'%'+_0xad673a[_0xe712('0x36')]['filter']+'%'};return _0x3aaf3b;})});}_0x2af08f=_[_0xe712('0x40')]({},_0x2af08f,_0xad673a['options']);return _0x1afd18[_0xe712('0x113')](_0x2af08f);}})['then'](function(_0x5afc71){if(_0x5afc71){_0x24c49e=_0x5afc71['length'];if(!_0xad673a[_0xe712('0x36')]['hasOwnProperty'](_0xe712('0x58'))){_0x2af08f[_0xe712('0x23')]=qs[_0xe712('0x23')](_0xad673a[_0xe712('0x36')][_0xe712('0x23')]);_0x2af08f[_0xe712('0x21')]=qs[_0xe712('0x21')](_0xad673a[_0xe712('0x36')]['offset']);}return _0x1afd18[_0xe712('0x113')](_0x2af08f);}})['then'](function(_0x415e86){if(_0x415e86){return _0x415e86?{'count':_0x24c49e,'rows':_0x415e86}:null;}})[_0xe712('0x15')](respondWithResult(_0x760b79,null))[_0xe712('0x45')](handleError(_0x760b79,null));};exports[_0xe712('0x114')]=function(_0x43cf90,_0x4aaf04){var _0x5b820b=_0x43cf90[_0xe712('0x36')][_0xe712('0x115')]===_0xe712('0x116')?_0xe712('0x117'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x5b820b],'where':{'id':_0x43cf90['params']['id']}})['then'](handleEntityNotFound(_0x4aaf04,null))[_0xe712('0x15')](function(_0x3504b9){if(_0x3504b9){var _0x11e211=_0x3504b9[_0x5b820b];var _0x3264de=_0x11e211&&_0x11e211[_0xe712('0x118')]?_0x11e211['items']:[];_0x4aaf04[_0xe712('0x2c')]({'fromKey':_[_0xe712('0x6b')](_0x11e211[_0xe712('0x119')])?undefined:_0x11e211[_0xe712('0x119')],'count':_0x3264de[_0xe712('0x3b')],'rows':_0x3264de});}})[_0xe712('0x45')](handleError(_0x4aaf04,null));};exports[_0xe712('0x11a')]=function(_0x69a2ce,_0x34987a){var _0x2aa5c1={'raw':![],'where':{}};var _0x3dc8c7={};var _0x4ae74a={'count':0x0,'rows':[]};return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x69a2ce[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x34987a,null))[_0xe712('0x15')](function(_0x55de51){if(_0x55de51){_0x3dc8c7['model']=_[_0xe712('0x37')](db[_0xe712('0x11b')]['rawAttributes']);_0x3dc8c7[_0xe712('0x36')]=_[_0xe712('0x37')](_0x69a2ce[_0xe712('0x36')]);_0x3dc8c7[_0xe712('0x38')]=_[_0xe712('0x39')](_0x3dc8c7[_0xe712('0x35')],_0x3dc8c7[_0xe712('0x36')]);_0x2aa5c1['attributes']=_[_0xe712('0x39')](_0x3dc8c7[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x69a2ce[_0xe712('0x36')][_0xe712('0x3a')]));_0x2aa5c1['attributes']=_0x2aa5c1[_0xe712('0x48')][_0xe712('0x3b')]?_0x2aa5c1[_0xe712('0x48')]:_0x3dc8c7[_0xe712('0x35')];if(!_0x69a2ce[_0xe712('0x36')][_0xe712('0x3c')](_0xe712('0x58'))){_0x2aa5c1[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x69a2ce[_0xe712('0x36')]['limit']);_0x2aa5c1[_0xe712('0x21')]=qs[_0xe712('0x21')](_0x69a2ce[_0xe712('0x36')][_0xe712('0x21')]);}_0x2aa5c1['order']=qs[_0xe712('0x3d')](_0x69a2ce['query'][_0xe712('0x3d')]);_0x2aa5c1[_0xe712('0x3e')]=qs['filters'](_[_0xe712('0x3f')](_0x69a2ce['query'],_0x3dc8c7[_0xe712('0x38')]));_0x2aa5c1[_0xe712('0x3e')][_0xe712('0x54')]=_0x55de51['id'];if(_0x69a2ce[_0xe712('0x36')][_0xe712('0x41')]){_0x2aa5c1[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x2aa5c1[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x2aa5c1[_0xe712('0x48')],function(_0xaf7e0d){var _0x54bbcf={};_0x54bbcf[_0xaf7e0d]={'$like':'%'+_0x69a2ce[_0xe712('0x36')][_0xe712('0x41')]+'%'};return _0x54bbcf;})});}_0x2aa5c1=_[_0xe712('0x40')]({},_0x2aa5c1,_0x69a2ce[_0xe712('0x42')]);return db['ChatOfflineMessage'][_0xe712('0x24')]({'where':_0x2aa5c1[_0xe712('0x3e')]})[_0xe712('0x15')](function(_0x5ee1d0){_0x4ae74a[_0xe712('0x24')]=_0x5ee1d0;if(_0x69a2ce[_0xe712('0x36')]['includeAll']){_0x2aa5c1[_0xe712('0x43')]=[{'all':!![]}];}else{_0x2aa5c1[_0xe712('0x43')]=[{'model':db['CmContact'],'as':_0xe712('0xe4'),'required':![]},{'model':db[_0xe712('0xca')],'as':_0xe712('0x11c'),'required':![]}];}return db['ChatOfflineMessage'][_0xe712('0x5a')](_0x2aa5c1);})[_0xe712('0x15')](function(_0x5ec669){_0x4ae74a[_0xe712('0x44')]=_0x5ec669;return _0x4ae74a;});}})[_0xe712('0x15')](respondWithFilteredResult(_0x34987a,_0x2aa5c1))[_0xe712('0x45')](handleError(_0x34987a,null));};exports[_0xe712('0x11d')]=function(_0x21ce53,_0x40f95a){return db[_0xe712('0x30')]['find']({'where':{'id':_0x21ce53['params']['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x40f95a,null))[_0xe712('0x15')](function(_0xa4168c){if(_0xa4168c){return _0xa4168c['addAgents'](_0x21ce53['body'][_0xe712('0xe2')],_[_0xe712('0xe3')](_0x21ce53[_0xe712('0x4c')],['ids','id'])||{})[_0xe712('0xa4')](function(_0x23645e){for(var _0x24e2c2=0x0;_0x24e2c2<_0x21ce53['body'][_0xe712('0xe2')][_0xe712('0x3b')];_0x24e2c2+=0x1){socket[_0xe712('0x11e')](_0xe712('0x11f'),{'UserId':Number(_0x21ce53[_0xe712('0x4c')][_0xe712('0xe2')][_0x24e2c2]),'ChatWebsiteId':Number(_0x21ce53[_0xe712('0x47')]['id'])});}return _0x23645e;});}})[_0xe712('0x15')](respondWithResult(_0x40f95a,null))[_0xe712('0x45')](handleError(_0x40f95a,null));};exports[_0xe712('0x120')]=function(_0x375d75,_0x1b1b75){return db[_0xe712('0x30')][_0xe712('0x4a')]({'where':{'id':_0x375d75[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x1b1b75,null))[_0xe712('0x15')](function(_0xdb8ef0){if(_0xdb8ef0){return _0xdb8ef0[_0xe712('0x120')](_0x375d75['query'][_0xe712('0xe2')])[_0xe712('0x15')](function(){if(_[_0xe712('0x121')](_0x375d75['query']['ids'])){for(var _0x5280cb=0x0;_0x5280cb<_0x375d75[_0xe712('0x36')][_0xe712('0xe2')][_0xe712('0x3b')];_0x5280cb+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x375d75['query'][_0xe712('0xe2')][_0x5280cb]),'ChatWebsiteId':Number(_0x375d75[_0xe712('0x47')]['id'])});}}else{socket[_0xe712('0x11e')]('userChatWebsite:remove',{'UserId':Number(_0x375d75[_0xe712('0x36')][_0xe712('0xe2')]),'ChatWebsiteId':Number(_0x375d75[_0xe712('0x47')]['id'])});}});}})[_0xe712('0x15')](respondWithStatusCode(_0x1b1b75,null))[_0xe712('0x45')](handleError(_0x1b1b75,null));};exports['getAgents']=function(_0x2cbd7a,_0x1a43df){var _0x18a845={};var _0x36013d={};var _0x1fbf52;var _0x4d21ef;return db[_0xe712('0x30')][_0xe712('0x57')]({'where':{'id':_0x2cbd7a[_0xe712('0x47')]['id']}})[_0xe712('0x15')](handleEntityNotFound(_0x1a43df,null))[_0xe712('0x15')](function(_0x1b512d){if(_0x1b512d){_0x1fbf52=_0x1b512d;_0x36013d['model']=_['keys'](db['User'][_0xe712('0x31')]);_0x36013d['query']=_[_0xe712('0x37')](_0x2cbd7a[_0xe712('0x36')]);_0x36013d[_0xe712('0x38')]=_[_0xe712('0x39')](_0x36013d[_0xe712('0x35')],_0x36013d[_0xe712('0x36')]);_0x18a845[_0xe712('0x48')]=_[_0xe712('0x39')](_0x36013d[_0xe712('0x35')],qs[_0xe712('0x3a')](_0x2cbd7a[_0xe712('0x36')][_0xe712('0x3a')]));_0x18a845[_0xe712('0x48')]=_0x18a845[_0xe712('0x48')][_0xe712('0x3b')]?_0x18a845[_0xe712('0x48')]:_0x36013d[_0xe712('0x35')];_0x18a845['order']=qs[_0xe712('0x3d')](_0x2cbd7a[_0xe712('0x36')]['sort']);_0x18a845[_0xe712('0x3e')]=qs[_0xe712('0x38')](_[_0xe712('0x3f')](_0x2cbd7a[_0xe712('0x36')],_0x36013d[_0xe712('0x38')]));if(_0x2cbd7a[_0xe712('0x36')][_0xe712('0x41')]){_0x18a845[_0xe712('0x3e')]=_[_0xe712('0x40')](_0x18a845[_0xe712('0x3e')],{'$or':_[_0xe712('0x2f')](_0x18a845['attributes'],function(_0x3240bc){var _0x3b5dbe={};_0x3b5dbe[_0x3240bc]={'$like':'%'+_0x2cbd7a['query'][_0xe712('0x41')]+'%'};return _0x3b5dbe;})});}_0x18a845=_[_0xe712('0x40')]({},_0x18a845,_0x2cbd7a[_0xe712('0x42')]);return _0x1fbf52['getAgents'](_0x18a845);}})[_0xe712('0x15')](function(_0x4e5425){if(_0x4e5425){_0x4d21ef=_0x4e5425[_0xe712('0x3b')];if(!_0x2cbd7a[_0xe712('0x36')][_0xe712('0x3c')](_0xe712('0x58'))){_0x18a845[_0xe712('0x23')]=qs[_0xe712('0x23')](_0x2cbd7a[_0xe712('0x36')][_0xe712('0x23')]);_0x18a845[_0xe712('0x21')]=qs[_0xe712('0x21')](_0x2cbd7a[_0xe712('0x36')][_0xe712('0x21')]);}return _0x1fbf52['getAgents'](_0x18a845);}})['then'](function(_0x1990c0){if(_0x1990c0){return _0x1990c0?{'count':_0x4d21ef,'rows':_0x1990c0}:null;}})[_0xe712('0x15')](respondWithResult(_0x1a43df,null))[_0xe712('0x45')](handleError(_0x1a43df,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 888a37c..34b0dee 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 _0x9c5a=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1bbbfe,_0x3917da){var _0x2ccd29=function(_0xc60402){while(--_0xc60402){_0x1bbbfe['push'](_0x1bbbfe['shift']());}};_0x2ccd29(++_0x3917da);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x489391,_0x58c55e){_0x489391=_0x489391-0x0;var _0x32cb9c=_0x9c5a[_0x489391];return _0x32cb9c;};'use strict';var EventEmitter=require(_0xa9c5('0x0'));var ChatWebsite=require(_0xa9c5('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa9c5('0x2')](0x0);var events={'afterCreate':_0xa9c5('0x3'),'afterUpdate':_0xa9c5('0x4'),'afterDestroy':_0xa9c5('0x5')};function emitEvent(_0x4f5552){return function(_0x2acfaf,_0x3051b1,_0x4e9403){ChatWebsiteEvents[_0xa9c5('0x6')](_0x4f5552+':'+_0x2acfaf['id'],_0x2acfaf);ChatWebsiteEvents['emit'](_0x4f5552,_0x2acfaf);_0x4e9403(null);};}for(var e in events){if(events[_0xa9c5('0x7')](e)){var event=events[e];ChatWebsite[_0xa9c5('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x27bf=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x5411cb,_0x1cd69d){var _0x32727a=function(_0x22a762){while(--_0x22a762){_0x5411cb['push'](_0x5411cb['shift']());}};_0x32727a(++_0x1cd69d);}(_0x27bf,0x117));var _0xf27b=function(_0x294bdb,_0x2ea616){_0x294bdb=_0x294bdb-0x0;var _0x5b9b54=_0x27bf[_0x294bdb];return _0x5b9b54;};'use strict';var EventEmitter=require(_0xf27b('0x0'));var ChatWebsite=require(_0xf27b('0x1'))['db'][_0xf27b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf27b('0x3')](0x0);var events={'afterCreate':_0xf27b('0x4'),'afterUpdate':_0xf27b('0x5'),'afterDestroy':_0xf27b('0x6')};function emitEvent(_0x2ff64c){return function(_0x339bb9,_0x1542e3,_0x2e1396){ChatWebsiteEvents['emit'](_0x2ff64c+':'+_0x339bb9['id'],_0x339bb9);ChatWebsiteEvents[_0xf27b('0x7')](_0x2ff64c,_0x339bb9);_0x2e1396(null);};}for(var e in events){if(events[_0xf27b('0x8')](e)){var event=events[e];ChatWebsite[_0xf27b('0x9')](e,emitEvent(event));}}module[_0xf27b('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 3b1b0f1..0042e5c 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 _0xb6b4=['ChatWebsite','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x2eda54,_0x5a81b5){var _0x5129f6=function(_0x4a2c58){while(--_0x4a2c58){_0x2eda54['push'](_0x2eda54['shift']());}};_0x5129f6(++_0x5a81b5);}(_0xb6b4,0x1e5));var _0x4b6b=function(_0x4c4cd6,_0x14d550){_0x4c4cd6=_0x4c4cd6-0x0;var _0x1cfd0b=_0xb6b4[_0x4c4cd6];return _0x1cfd0b;};'use strict';var _=require('lodash');var util=require(_0x4b6b('0x0'));var logger=require(_0x4b6b('0x1'))(_0x4b6b('0x2'));var moment=require(_0x4b6b('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b6b('0x5'));var config=require(_0x4b6b('0x6'));var attributes=require(_0x4b6b('0x7'));module[_0x4b6b('0x8')]=function(_0x27be97,_0xe9aa6c){return _0x27be97[_0x4b6b('0x9')](_0x4b6b('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b79=['rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','api','moment','bluebird','request-promise','path'];(function(_0x9ae56b,_0x599717){var _0x15a414=function(_0x4d9069){while(--_0x4d9069){_0x9ae56b['push'](_0x9ae56b['shift']());}};_0x15a414(++_0x599717);}(_0x3b79,0x10e));var _0x93b7=function(_0x150c8f,_0x1c20ff){_0x150c8f=_0x150c8f-0x0;var _0x578c39=_0x3b79[_0x150c8f];return _0x578c39;};'use strict';var _=require(_0x93b7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x93b7('0x1'));var moment=require(_0x93b7('0x2'));var BPromise=require(_0x93b7('0x3'));var rp=require(_0x93b7('0x4'));var fs=require('fs');var path=require(_0x93b7('0x5'));var rimraf=require(_0x93b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x93b7('0x7'));module[_0x93b7('0x8')]=function(_0xc87a01,_0x4e45cf){return _0xc87a01[_0x93b7('0x9')](_0x93b7('0xa'),attributes,{'tableName':_0x93b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index cfae919..0929791 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 _0xbfc7=['defaults','redis','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x469558,_0x190c1b){var _0x277ec2=function(_0x1e8e5e){while(--_0x1e8e5e){_0x469558['push'](_0x469558['shift']());}};_0x277ec2(++_0x190c1b);}(_0xbfc7,0x107));var _0x7bfc=function(_0x5ce2ca,_0x5bc6d7){_0x5ce2ca=_0x5ce2ca-0x0;var _0x86fb86=_0xbfc7[_0x5ce2ca];return _0x86fb86;};'use strict';var _=require(_0x7bfc('0x0'));var util=require(_0x7bfc('0x1'));var moment=require(_0x7bfc('0x2'));var BPromise=require(_0x7bfc('0x3'));var rs=require(_0x7bfc('0x4'));var fs=require('fs');var Redis=require(_0x7bfc('0x5'));var db=require(_0x7bfc('0x6'))['db'];var utils=require(_0x7bfc('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x7bfc('0x8'));var jayson=require(_0x7bfc('0x9'));var client=jayson[_0x7bfc('0xa')][_0x7bfc('0xb')]({'port':0x232a});config['redis']=_[_0x7bfc('0xc')](config[_0x7bfc('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7bfc('0xd')]));require(_0x7bfc('0xe'))['register'](socket);function respondWithRpcPromise(_0x1e7dfa,_0x312a65,_0xa86981){return new BPromise(function(_0x181ff3,_0x16b191){return client[_0x7bfc('0xf')](_0x1e7dfa,_0xa86981)[_0x7bfc('0x10')](function(_0x1e3813){logger['info'](_0x7bfc('0x11'),_0x312a65,'request\x20sent');logger[_0x7bfc('0x12')](_0x7bfc('0x13'),_0x312a65,_0x7bfc('0x14'),JSON[_0x7bfc('0x15')](_0x1e3813));if(_0x1e3813['error']){if(_0x1e3813['error']['code']===0x1f4){logger[_0x7bfc('0x16')](_0x7bfc('0x11'),_0x312a65,_0x1e3813[_0x7bfc('0x16')][_0x7bfc('0x17')]);return _0x16b191(_0x1e3813['error'][_0x7bfc('0x17')]);}logger[_0x7bfc('0x16')](_0x7bfc('0x11'),_0x312a65,_0x1e3813[_0x7bfc('0x16')]['message']);return _0x181ff3(_0x1e3813[_0x7bfc('0x16')][_0x7bfc('0x17')]);}else{logger[_0x7bfc('0x18')](_0x7bfc('0x11'),_0x312a65,'request\x20sent');_0x181ff3(_0x1e3813['result'][_0x7bfc('0x17')]);}})['catch'](function(_0xae5c9f){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x312a65,_0xae5c9f);_0x16b191(_0xae5c9f);});});}
\ No newline at end of file
+var _0xd6cb=['lodash','util','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','request\x20sent','catch'];(function(_0x5ba545,_0x95a648){var _0x32d860=function(_0xa943a9){while(--_0xa943a9){_0x5ba545['push'](_0x5ba545['shift']());}};_0x32d860(++_0x95a648);}(_0xd6cb,0x138));var _0xbd6c=function(_0x4f9476,_0x3eadc7){_0x4f9476=_0x4f9476-0x0;var _0x3296a4=_0xd6cb[_0x4f9476];return _0x3296a4;};'use strict';var _=require(_0xbd6c('0x0'));var util=require(_0xbd6c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd6c('0x2'));var logger=require('../../config/logger')(_0xbd6c('0x3'));var config=require('../../config/environment');var jayson=require(_0xbd6c('0x4'));var client=jayson[_0xbd6c('0x5')][_0xbd6c('0x6')]({'port':0x232a});config[_0xbd6c('0x7')]=_['defaults'](config['redis'],{'host':_0xbd6c('0x8'),'port':0x18eb});var socket=require(_0xbd6c('0x9'))(new Redis(config['redis']));require(_0xbd6c('0xa'))[_0xbd6c('0xb')](socket);function respondWithRpcPromise(_0x174199,_0x1fb3b8,_0x52441e){return new BPromise(function(_0x313915,_0x17ad43){return client[_0xbd6c('0xc')](_0x174199,_0x52441e)[_0xbd6c('0xd')](function(_0x57b205){logger[_0xbd6c('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x1fb3b8,'request\x20sent');logger[_0xbd6c('0xf')](_0xbd6c('0x10'),_0x1fb3b8,'request\x20sent',JSON[_0xbd6c('0x11')](_0x57b205));if(_0x57b205[_0xbd6c('0x12')]){if(_0x57b205[_0xbd6c('0x12')][_0xbd6c('0x13')]===0x1f4){logger[_0xbd6c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1fb3b8,_0x57b205[_0xbd6c('0x12')][_0xbd6c('0x14')]);return _0x17ad43(_0x57b205[_0xbd6c('0x12')]['message']);}logger['error'](_0xbd6c('0x15'),_0x1fb3b8,_0x57b205['error'][_0xbd6c('0x14')]);return _0x313915(_0x57b205[_0xbd6c('0x12')][_0xbd6c('0x14')]);}else{logger[_0xbd6c('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x1fb3b8,_0xbd6c('0x16'));_0x313915(_0x57b205['result'][_0xbd6c('0x14')]);}})[_0xbd6c('0x17')](function(_0x8c41be){logger[_0xbd6c('0x12')](_0xbd6c('0x15'),_0x1fb3b8,_0x8c41be);_0x17ad43(_0x8c41be);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 180312a..dea12f9 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 _0xa560=['length','chatWebsite:','save','register'];(function(_0x5beaa1,_0x3a03c1){var _0x4349e3=function(_0x6c0e67){while(--_0x6c0e67){_0x5beaa1['push'](_0x5beaa1['shift']());}};_0x4349e3(++_0x3a03c1);}(_0xa560,0xf2));var _0x0a56=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa560[_0x21a9d9];return _0x46adce;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x0a56('0x0'),'remove','update'];function createListener(_0x436493,_0x235279){return function(_0x3eb5d2){_0x235279['emit'](_0x436493,_0x3eb5d2);};}function removeListener(_0x2e69b7,_0x12e0e1){return function(){ChatWebsiteEvents['removeListener'](_0x2e69b7,_0x12e0e1);};}exports[_0x0a56('0x1')]=function(_0x401f3d){for(var _0x551651=0x0,_0x534e62=events[_0x0a56('0x2')];_0x551651<_0x534e62;_0x551651++){var _0x4ecff7=events[_0x551651];var _0x402351=createListener(_0x0a56('0x3')+_0x4ecff7,_0x401f3d);ChatWebsiteEvents['on'](_0x4ecff7,_0x402351);}};
\ No newline at end of file
+var _0xaf67=['length','save','remove','update','emit','removeListener'];(function(_0x2d0cdd,_0x5b25b4){var _0x30ba3a=function(_0x150a0d){while(--_0x150a0d){_0x2d0cdd['push'](_0x2d0cdd['shift']());}};_0x30ba3a(++_0x5b25b4);}(_0xaf67,0x115));var _0x7af6=function(_0x3d1928,_0x9410ed){_0x3d1928=_0x3d1928-0x0;var _0x1e5a43=_0xaf67[_0x3d1928];return _0x1e5a43;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x7af6('0x0'),_0x7af6('0x1'),_0x7af6('0x2')];function createListener(_0x4d912c,_0x27cc9){return function(_0x134e9e){_0x27cc9[_0x7af6('0x3')](_0x4d912c,_0x134e9e);};}function removeListener(_0x4aa82b,_0x45da4c){return function(){ChatWebsiteEvents[_0x7af6('0x4')](_0x4aa82b,_0x45da4c);};}exports['register']=function(_0x1039ca){for(var _0x3405e4=0x0,_0x5c1788=events[_0x7af6('0x5')];_0x3405e4<_0x5c1788;_0x3405e4++){var _0x57a3e8=events[_0x3405e4];var _0x55696f=createListener('chatWebsite:'+_0x57a3e8,_0x1039ca);ChatWebsiteEvents['on'](_0x57a3e8,_0x55696f);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 2f02297..1bc4d13 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 _0x09d4=['/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','addAnswer','join','root','format','now','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','originalname','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions'];(function(_0x142040,_0x45796b){var _0x16beea=function(_0xce294a){while(--_0xce294a){_0x142040['push'](_0x142040['shift']());}};_0x16beea(++_0x45796b);}(_0x09d4,0x18d));var _0x409d=function(_0x10d056,_0x4fa586){_0x10d056=_0x10d056-0x0;var _0x243a79=_0x09d4[_0x10d056];return _0x243a79;};'use strict';var multer=require(_0x409d('0x0'));var util=require('util');var path=require(_0x409d('0x1'));var timeout=require(_0x409d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x409d('0x3'));var interaction=require(_0x409d('0x4'));var config=require(_0x409d('0x5'));var controller=require(_0x409d('0x6'));router[_0x409d('0x7')]('/',auth[_0x409d('0x8')](),controller[_0x409d('0x9')]);router['get']('/describe',auth[_0x409d('0x8')](),controller[_0x409d('0xa')]);router['get'](_0x409d('0xb'),auth[_0x409d('0x8')](),controller['show']);router[_0x409d('0x7')](_0x409d('0xc'),auth[_0x409d('0x8')](),controller[_0x409d('0xd')]);router[_0x409d('0x7')]('/:id/canned_answers',auth[_0x409d('0x8')](),controller[_0x409d('0xe')]);router[_0x409d('0x7')](_0x409d('0xf'),controller[_0x409d('0x10')]);router['get'](_0x409d('0x11'),controller[_0x409d('0x12')]);router[_0x409d('0x7')](_0x409d('0x13'),controller['getCustomerAvatar']);router['get'](_0x409d('0x14'),controller['getSystemAvatar']);router['get'](_0x409d('0x15'),auth[_0x409d('0x8')](),controller[_0x409d('0x16')]);router[_0x409d('0x7')](_0x409d('0x17'),controller[_0x409d('0x18')]);router[_0x409d('0x7')](_0x409d('0x19'),auth[_0x409d('0x8')](),controller[_0x409d('0x1a')]);router[_0x409d('0x7')](_0x409d('0x1b'),auth[_0x409d('0x8')](),controller[_0x409d('0x1c')]);router['get'](_0x409d('0x1d'),controller[_0x409d('0x1e')]);router['get'](_0x409d('0x1f'),auth[_0x409d('0x8')](),controller[_0x409d('0x20')]);router[_0x409d('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x409d('0x21')]);router[_0x409d('0x22')]('/',auth[_0x409d('0x8')](),controller['create']);router[_0x409d('0x22')](_0x409d('0xc'),auth[_0x409d('0x8')](),controller[_0x409d('0x23')]);router[_0x409d('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x409d('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54d315,_0x17b99a,_0x107cdc){_0x107cdc(null,path[_0x409d('0x25')](config[_0x409d('0x26')],'server/files/images/logos/'));},'filename':function(_0x329c42,_0x26a963,_0x52ac49){_0x52ac49(null,util[_0x409d('0x27')]('%s-%s',Date[_0x409d('0x28')](),_0x26a963['originalname']));}})});router[_0x409d('0x22')](_0x409d('0xf'),upload[_0x409d('0x29')](_0x409d('0x2a')),controller[_0x409d('0x2b')]);var upload=multer({'storage':multer[_0x409d('0x2c')]({'destination':function(_0x17ca64,_0x47ced7,_0x433217){_0x433217(null,path['join'](config[_0x409d('0x26')],_0x409d('0x2d')));},'filename':function(_0x41b991,_0x202c69,_0x1adb8e){_0x1adb8e(null,util['format'](_0x409d('0x2e'),Date[_0x409d('0x28')](),_0x202c69[_0x409d('0x2f')]));}})});router[_0x409d('0x22')]('/:id/avatar',upload['single'](_0x409d('0x2a')),controller[_0x409d('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ef34a,_0x41b34e,_0x1d68c6){_0x1d68c6(null,path[_0x409d('0x25')](config[_0x409d('0x26')],'server/files/images/avatars/'));},'filename':function(_0x5ad8fa,_0xb9dfca,_0xda716a){_0xda716a(null,util[_0x409d('0x27')](_0x409d('0x2e'),Date[_0x409d('0x28')](),_0xb9dfca[_0x409d('0x2f')]));}})});router[_0x409d('0x22')](_0x409d('0x13'),upload[_0x409d('0x29')](_0x409d('0x2a')),controller[_0x409d('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x470320,_0x5257c4,_0x5c4be6){_0x5c4be6(null,path[_0x409d('0x25')](config[_0x409d('0x26')],'server/files/images/avatars/'));},'filename':function(_0x14dbda,_0x294976,_0x4dd6ad){_0x4dd6ad(null,util[_0x409d('0x27')](_0x409d('0x2e'),Date['now'](),_0x294976[_0x409d('0x2f')]));}})});router['post']('/:id/system_avatar',upload[_0x409d('0x29')](_0x409d('0x2a')),controller[_0x409d('0x32')]);router[_0x409d('0x22')](_0x409d('0x33'),controller[_0x409d('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x409d('0x2c')]({'destination':function(_0x575951,_0x2b1a60,_0xe306f1){const _0x97d3e5=path[_0x409d('0x25')](config[_0x409d('0x26')],_0x409d('0x35'),'attachments',_0x409d('0x36'));fs_extra['ensureDir'](_0x97d3e5,function(){_0xe306f1(null,_0x97d3e5);});},'filename':function(_0x4a45f7,_0x572eb4,_0x293de8){const _0x4ecfae=_0x572eb4[_0x409d('0x2f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3d459a=path[_0x409d('0x37')](_0x4ecfae);const _0x654ba3=Date['now']()+'-'+_0x4ecfae['replace'](_0x3d459a,'')+_0x3d459a;_0x293de8(null,_0x654ba3);}})});router[_0x409d('0x22')](_0x409d('0x38'),offlineUploadMulter[_0x409d('0x39')](),controller[_0x409d('0x3a')]);router[_0x409d('0x22')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x409d('0x3b')]);router[_0x409d('0x22')](_0x409d('0x19'),auth[_0x409d('0x8')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0x409d('0x8')](),controller[_0x409d('0x3c')]);router[_0x409d('0x22')](_0x409d('0x3d'),auth[_0x409d('0x8')](),controller[_0x409d('0x3e')]);router[_0x409d('0x3f')]('/:id',auth[_0x409d('0x8')](),controller[_0x409d('0x40')]);router[_0x409d('0x41')]('/:id',auth[_0x409d('0x8')](),controller[_0x409d('0x42')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x409d('0x43')]);router['delete'](_0x409d('0x44'),auth[_0x409d('0x8')](),controller[_0x409d('0x45')]);router[_0x409d('0x41')]('/:id/users',auth[_0x409d('0x8')](),controller[_0x409d('0x46')]);module['exports']=router;
\ No newline at end of file
+var _0xeb25=['/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','format','now','originalname','file','addLogo','%s-%s','addAvatar','join','server/files/images/avatars/','single','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','/:id/interactions','addInteraction','addApplications','addAgents','put','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','get','index','isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar'];(function(_0x572ebe,_0x447911){var _0x17e98d=function(_0x183431){while(--_0x183431){_0x572ebe['push'](_0x572ebe['shift']());}};_0x17e98d(++_0x447911);}(_0xeb25,0xff));var _0x5eb2=function(_0x52ac80,_0x903b6a){_0x52ac80=_0x52ac80-0x0;var _0x4f86bb=_0xeb25[_0x52ac80];return _0x4f86bb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5eb2('0x0'));var express=require(_0x5eb2('0x1'));var router=express[_0x5eb2('0x2')]();var fs_extra=require(_0x5eb2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5eb2('0x4'));var config=require('../../config/environment');var controller=require(_0x5eb2('0x5'));router[_0x5eb2('0x6')]('/',auth['isAuthenticated'](),controller[_0x5eb2('0x7')]);router[_0x5eb2('0x6')]('/describe',auth[_0x5eb2('0x8')](),controller['describe']);router[_0x5eb2('0x6')](_0x5eb2('0x9'),auth[_0x5eb2('0x8')](),controller['show']);router[_0x5eb2('0x6')](_0x5eb2('0xa'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0xb')]);router[_0x5eb2('0x6')](_0x5eb2('0xc'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0xd')]);router[_0x5eb2('0x6')](_0x5eb2('0xe'),controller['getLogo']);router[_0x5eb2('0x6')](_0x5eb2('0xf'),controller[_0x5eb2('0x10')]);router[_0x5eb2('0x6')](_0x5eb2('0x11'),controller['getCustomerAvatar']);router[_0x5eb2('0x6')](_0x5eb2('0x12'),controller[_0x5eb2('0x13')]);router['get']('/:id/interactions',auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x14')]);router['get']('/:id/snippet',controller[_0x5eb2('0x15')]);router[_0x5eb2('0x6')](_0x5eb2('0x16'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x17')]);router['get'](_0x5eb2('0x18'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x19')]);router['get'](_0x5eb2('0x1a'),controller[_0x5eb2('0x1b')]);router[_0x5eb2('0x6')](_0x5eb2('0x1c'),auth['isAuthenticated'](),controller[_0x5eb2('0x1d')]);router[_0x5eb2('0x6')]('/:id/users',auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x1e')]);router[_0x5eb2('0x1f')]('/',auth['isAuthenticated'](),controller[_0x5eb2('0x20')]);router[_0x5eb2('0x1f')](_0x5eb2('0xa'),auth['isAuthenticated'](),controller[_0x5eb2('0x21')]);router[_0x5eb2('0x1f')](_0x5eb2('0xc'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x22')]);var upload=multer({'storage':multer[_0x5eb2('0x23')]({'destination':function(_0x4a194d,_0x2adeae,_0x353542){_0x353542(null,path['join'](config[_0x5eb2('0x24')],'server/files/images/logos/'));},'filename':function(_0x5c3d7b,_0x84bc18,_0xc35bac){_0xc35bac(null,util[_0x5eb2('0x25')]('%s-%s',Date[_0x5eb2('0x26')](),_0x84bc18[_0x5eb2('0x27')]));}})});router[_0x5eb2('0x1f')]('/:id/logo',upload['single'](_0x5eb2('0x28')),controller[_0x5eb2('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfbcd54,_0x2fb37d,_0x5b8a80){_0x5b8a80(null,path['join'](config[_0x5eb2('0x24')],'server/files/images/avatars/'));},'filename':function(_0xc0f4e1,_0x531a41,_0x374d13){_0x374d13(null,util[_0x5eb2('0x25')](_0x5eb2('0x2a'),Date[_0x5eb2('0x26')](),_0x531a41[_0x5eb2('0x27')]));}})});router['post']('/:id/avatar',upload['single'](_0x5eb2('0x28')),controller[_0x5eb2('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x17569d,_0x18b683,_0x42e0ac){_0x42e0ac(null,path[_0x5eb2('0x2c')](config[_0x5eb2('0x24')],_0x5eb2('0x2d')));},'filename':function(_0x209062,_0x178663,_0x1164e2){_0x1164e2(null,util[_0x5eb2('0x25')](_0x5eb2('0x2a'),Date['now'](),_0x178663[_0x5eb2('0x27')]));}})});router[_0x5eb2('0x1f')](_0x5eb2('0x11'),upload[_0x5eb2('0x2e')]('file'),controller[_0x5eb2('0x2f')]);var upload=multer({'storage':multer[_0x5eb2('0x23')]({'destination':function(_0xf3aed,_0x388b1b,_0x520315){_0x520315(null,path['join'](config[_0x5eb2('0x24')],_0x5eb2('0x2d')));},'filename':function(_0x5cf902,_0x269e00,_0xb855f6){_0xb855f6(null,util[_0x5eb2('0x25')](_0x5eb2('0x2a'),Date[_0x5eb2('0x26')](),_0x269e00['originalname']));}})});router['post']('/:id/system_avatar',upload[_0x5eb2('0x2e')](_0x5eb2('0x28')),controller[_0x5eb2('0x30')]);router['post'](_0x5eb2('0x31'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x5eb2('0x23')]({'destination':function(_0x19fc89,_0x49be7a,_0x4ff9d7){const _0x46addb=path['join'](config[_0x5eb2('0x24')],_0x5eb2('0x32'),_0x5eb2('0x33'),_0x5eb2('0x34'));fs_extra['ensureDir'](_0x46addb,function(){_0x4ff9d7(null,_0x46addb);});},'filename':function(_0x388eb2,_0x20e90f,_0x4e3d7d){const _0x53a7ef=_0x20e90f[_0x5eb2('0x27')][_0x5eb2('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xcebe5a=path[_0x5eb2('0x36')](_0x53a7ef);const _0x210074=Date[_0x5eb2('0x26')]()+'-'+_0x53a7ef['replace'](_0xcebe5a,'')+_0xcebe5a;_0x4e3d7d(null,_0x210074);}})});router[_0x5eb2('0x1f')](_0x5eb2('0x37'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0x5eb2('0x38'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x39')]);router[_0x5eb2('0x1f')](_0x5eb2('0x16'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x3a')]);router[_0x5eb2('0x1f')](_0x5eb2('0x18'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x3b')]);router[_0x5eb2('0x3c')](_0x5eb2('0x9'),auth[_0x5eb2('0x8')](),controller['update']);router[_0x5eb2('0x3d')](_0x5eb2('0x9'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x3e')]);router['delete'](_0x5eb2('0xa'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x3f')]);router[_0x5eb2('0x3d')](_0x5eb2('0xc'),auth['isAuthenticated'](),controller[_0x5eb2('0x40')]);router[_0x5eb2('0x3d')](_0x5eb2('0x41'),auth[_0x5eb2('0x8')](),controller[_0x5eb2('0x42')]);module[_0x5eb2('0x43')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 4303f29..6707e67 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 _0x6212=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','../components/auth/service','../config/environment','Router','env'];(function(_0x4671ab,_0x55caec){var _0x4f0532=function(_0x1bac46){while(--_0x1bac46){_0x4671ab['push'](_0x4671ab['shift']());}};_0x4f0532(++_0x55caec);}(_0x6212,0x1b6));var _0x2621=function(_0x85b890,_0x591e74){_0x85b890=_0x85b890-0x0;var _0x5f8d20=_0x6212[_0x85b890];return _0x5f8d20;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x2621('0x0'));var config=require(_0x2621('0x1'));var router=express[_0x2621('0x2')]();var isProduction=config[_0x2621('0x3')]===_0x2621('0x4')||![];function clientSideLogs(_0x33f4c5,_0x2932d0,_0x399e72){var _0x588229=_0x33f4c5[_0x2621('0x5')][_0x2621('0x6')](_0x2621('0x7'));if(!_0x588229){throw new Error(_0x2621('0x8'));}return beaverLogger[_0x2621('0x9')]({'uri':_0x2621('0xa'),'logger':_0x588229,'enableCors':!isProduction})(_0x33f4c5,_0x2932d0,_0x399e72);}router[_0x2621('0xb')](auth[_0x2621('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x1672=['expressEndpoint','exports','beaver-logger/server','express','../components/auth/service','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x1672,0x16d));var _0x2167=function(_0x60bdc5,_0x4e2dda){_0x60bdc5=_0x60bdc5-0x0;var _0x154eaa=_0x1672[_0x60bdc5];return _0x154eaa;};var beaverLogger=require(_0x2167('0x0'));var express=require(_0x2167('0x1'));var auth=require(_0x2167('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x2167('0x3')]===_0x2167('0x4')||![];function clientSideLogs(_0x398fa9,_0x2bc8eb,_0x56a949){var _0x3dfc32=_0x398fa9[_0x2167('0x5')][_0x2167('0x6')](_0x2167('0x7'));if(!_0x3dfc32){throw new Error(_0x2167('0x8'));}return beaverLogger[_0x2167('0x9')]({'uri':'/client-logs','logger':_0x3dfc32,'enableCors':!isProduction})(_0x398fa9,_0x2bc8eb,_0x56a949);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x2167('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 822b317..43c219b 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 _0x031f=['sequelize','exports','ENUM','Google','MicrosoftAzure','Outlook365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x031f,0x12b));var _0xf031=function(_0xdb553d,_0x51b7a8){_0xdb553d=_0xdb553d-0x0;var _0x44fe66=_0x031f[_0xdb553d];return _0x44fe66;};'use strict';var Sequelize=require(_0xf031('0x0'));module[_0xf031('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf031('0x2')]('AmazonAWS',_0xf031('0x3'),_0xf031('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf031('0x2')](_0xf031('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xf031('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0xf031('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0xf031('0x8')},'data4':{'type':Sequelize[_0xf031('0x6')],'comment':_0xf031('0x9')},'data5':{'type':Sequelize[_0xf031('0xa')],'comment':_0xf031('0xb')},'data6':{'type':Sequelize[_0xf031('0xa')],'comment':_0xf031('0xc')},'data7':{'type':Sequelize[_0xf031('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x65c6=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x7d2272,_0x41f365){var _0x5bc56e=function(_0x3974af){while(--_0x3974af){_0x7d2272['push'](_0x7d2272['shift']());}};_0x5bc56e(++_0x41f365);}(_0x65c6,0x16e));var _0x665c=function(_0x8e6be,_0x24f0bf){_0x8e6be=_0x8e6be-0x0;var _0x4849bc=_0x65c6[_0x8e6be];return _0x4849bc;};'use strict';var Sequelize=require(_0x665c('0x0'));module[_0x665c('0x1')]={'name':{'type':Sequelize[_0x665c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x665c('0x3'),_0x665c('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x665c('0x5')](_0x665c('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x665c('0x2')],'comment':_0x665c('0x7')},'data2':{'type':Sequelize[_0x665c('0x2')],'comment':_0x665c('0x8')},'data3':{'type':Sequelize[_0x665c('0x2')],'comment':_0x665c('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x665c('0xa')},'data5':{'type':Sequelize[_0x665c('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x665c('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x665c('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index d62cb7d..87fae33 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 _0x3863=['end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','rawAttributes','includeAll','find','create','Name\x20parameter\x20not\x20specified','values','includes','body','join','params','encryptString','findOne','user','get','state','parse','from','base64','toString','ascii','oauth2Claims','del','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus'];(function(_0xcd804,_0x4f052f){var _0xbc87d6=function(_0x838488){while(--_0x838488){_0xcd804['push'](_0xcd804['shift']());}};_0xbc87d6(++_0x4f052f);}(_0x3863,0x100));var _0x3386=function(_0x99e049,_0x1326b8){_0x99e049=_0x99e049-0x0;var _0xeab9c8=_0x3863[_0x99e049];return _0xeab9c8;};'use strict';var _=require(_0x3386('0x0'));var Redis=require('ioredis');var qs=require(_0x3386('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x3386('0x2'));var logger=require(_0x3386('0x3'))(_0x3386('0x4'));var db=require(_0x3386('0x5'))['db'];var oauth=require(_0x3386('0x6'));config[_0x3386('0x7')]=_['defaults'](config[_0x3386('0x7')],{'host':_0x3386('0x8'),'port':0x18eb});var socket=require(_0x3386('0x9'))(new Redis(config[_0x3386('0x7')]));var redis=new Redis(config[_0x3386('0x7')]);function respondWithStatusCode(_0x2b8168,_0x4524d0){_0x4524d0=_0x4524d0||0xcc;return function(_0x135646){if(_0x135646){return _0x2b8168[_0x3386('0xa')](_0x4524d0);}return _0x2b8168['status'](_0x4524d0)[_0x3386('0xb')]();};}function respondWithResult(_0x505388,_0x4a5ba4){_0x4a5ba4=_0x4a5ba4||0xc8;return function(_0xae392c){if(_0xae392c){return _0x505388[_0x3386('0xc')](_0x4a5ba4)[_0x3386('0xd')](_0xae392c);}};}function respondWithFilteredResult(_0xbade23,_0x21fe6f){return function(_0x31c507){if(_0x31c507){var _0x548198=typeof _0x21fe6f[_0x3386('0xe')]===_0x3386('0xf')&&typeof _0x21fe6f['limit']===_0x3386('0xf');var _0x21de78=_0x31c507[_0x3386('0x10')];var _0x4981c0=_0x548198?0x0:_0x21fe6f[_0x3386('0xe')];var _0x33b074=_0x548198?_0x31c507[_0x3386('0x10')]:_0x21fe6f[_0x3386('0xe')]+_0x21fe6f[_0x3386('0x11')];var _0x17743b;if(_0x33b074>=_0x21de78){_0x33b074=_0x21de78;_0x17743b=0xc8;}else{_0x17743b=0xce;}_0xbade23[_0x3386('0xc')](_0x17743b);return _0xbade23[_0x3386('0x12')](_0x3386('0x13'),_0x4981c0+'-'+_0x33b074+'/'+_0x21de78)['json'](_0x31c507);}return null;};}function saveUpdates(_0x6f89e9){return function(_0x5a8cf0){if(_0x5a8cf0){return _0x5a8cf0[_0x3386('0x14')](_0x6f89e9)[_0x3386('0x15')](function(_0xc65613){return _0xc65613;});}return null;};}function removeEntity(_0x25a9fe){return function(_0x53d7ba){if(_0x53d7ba){return _0x53d7ba[_0x3386('0x16')]()['then'](function(){_0x25a9fe[_0x3386('0xc')](0xcc)[_0x3386('0xb')]();});}};}function handleEntityNotFound(_0x6a9e7c){return function(_0x251bde){if(!_0x251bde){_0x6a9e7c[_0x3386('0xa')](0x194);}return _0x251bde;};}function handleError(_0x188b1d,_0x1f1a12){_0x1f1a12=_0x1f1a12||0x1f4;return function(_0x543e9c){logger[_0x3386('0x17')](_0x543e9c[_0x3386('0x18')]);if(_0x543e9c[_0x3386('0x19')]){delete _0x543e9c[_0x3386('0x19')];}_0x188b1d[_0x3386('0xc')](_0x1f1a12)[_0x3386('0x1a')](_0x543e9c);};}function maskClientSecret(_0x50d357){return _[_0x3386('0x1b')](_0x50d357[_0x3386('0x1c')](0x0,0x3),0x14,'*');}exports['index']=function(_0x140e23,_0x1d55af){var _0x4c1ea1={},_0x10807a={},_0x1e2e18={'count':0x0,'rows':[]};var _0x3cba1e=_[_0x3386('0x1d')](db[_0x3386('0x1e')]['rawAttributes'],function(_0x29519c){return{'name':_0x29519c['fieldName'],'type':_0x29519c['type'][_0x3386('0x1f')]};});_0x10807a['model']=_[_0x3386('0x1d')](_0x3cba1e,_0x3386('0x19'));_0x10807a['query']=_[_0x3386('0x20')](_0x140e23[_0x3386('0x21')]);_0x10807a[_0x3386('0x22')]=_['intersection'](_0x10807a[_0x3386('0x23')],_0x10807a['query']);_0x4c1ea1[_0x3386('0x24')]=_[_0x3386('0x25')](_0x10807a['model'],qs[_0x3386('0x26')](_0x140e23[_0x3386('0x21')]['fields']));_0x4c1ea1[_0x3386('0x24')]=_0x4c1ea1[_0x3386('0x24')][_0x3386('0x27')]?_0x4c1ea1[_0x3386('0x24')]:_0x10807a[_0x3386('0x23')];if(!_0x140e23[_0x3386('0x21')][_0x3386('0x28')](_0x3386('0x29'))){_0x4c1ea1['limit']=qs['limit'](_0x140e23[_0x3386('0x21')][_0x3386('0x11')]);_0x4c1ea1[_0x3386('0xe')]=qs['offset'](_0x140e23[_0x3386('0x21')][_0x3386('0xe')]);}_0x4c1ea1['order']=qs[_0x3386('0x2a')](_0x140e23[_0x3386('0x21')][_0x3386('0x2a')]);_0x4c1ea1[_0x3386('0x2b')]=qs['filters'](_['pick'](_0x140e23['query'],_0x10807a['filters']),_0x3cba1e);if(_0x140e23[_0x3386('0x21')]['filter']){_0x4c1ea1[_0x3386('0x2b')]=_[_0x3386('0x2c')](_0x4c1ea1['where'],{'$or':_[_0x3386('0x1d')](_0x3cba1e,function(_0x43e038){if(_0x43e038['type']!==_0x3386('0x2d')){var _0x754059={};_0x754059[_0x43e038['name']]={'$like':'%'+_0x140e23[_0x3386('0x21')]['filter']+'%'};return _0x754059;}})});}_0x4c1ea1=_[_0x3386('0x2c')]({},_0x4c1ea1,_0x140e23[_0x3386('0x2e')]);var _0x5b701a={'where':_0x4c1ea1['where']};return db[_0x3386('0x1e')]['count'](_0x5b701a)[_0x3386('0x15')](function(_0x2e9e66){_0x1e2e18['count']=_0x2e9e66;if(_0x140e23[_0x3386('0x21')]['includeAll']){_0x4c1ea1[_0x3386('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0x3386('0x30')](_0x4c1ea1);})['then'](function(_0x2381e9){_0x1e2e18[_0x3386('0x31')]=_['map'](_0x2381e9,function(_0x4d0bba){if(_0x4d0bba[_0x3386('0x32')]===_0x3386('0x33')){var _0x49e50f=encryptor[_0x3386('0x34')](_0x4d0bba['data3']);_0x4d0bba[_0x3386('0x35')]=maskClientSecret(_0x49e50f);}return _0x4d0bba;});return _0x1e2e18;})['then'](respondWithFilteredResult(_0x1d55af,_0x4c1ea1))[_0x3386('0x36')](handleError(_0x1d55af,null));};exports[_0x3386('0x37')]=function(_0x14b0e8,_0x5c859b){var _0x2066cd={'raw':!![],'where':{'id':_0x14b0e8['params']['id']}},_0x58941e={};_0x58941e[_0x3386('0x23')]=_[_0x3386('0x20')](db['CloudProvider'][_0x3386('0x38')]);_0x58941e['query']=_['keys'](_0x14b0e8[_0x3386('0x21')]);_0x58941e[_0x3386('0x22')]=_[_0x3386('0x25')](_0x58941e[_0x3386('0x23')],_0x58941e[_0x3386('0x21')]);_0x2066cd['attributes']=_['intersection'](_0x58941e['model'],qs[_0x3386('0x26')](_0x14b0e8[_0x3386('0x21')][_0x3386('0x26')]));_0x2066cd[_0x3386('0x24')]=_0x2066cd[_0x3386('0x24')]['length']?_0x2066cd[_0x3386('0x24')]:_0x58941e[_0x3386('0x23')];if(_0x14b0e8['query'][_0x3386('0x39')]){_0x2066cd[_0x3386('0x2f')]=[{'all':!![]}];}_0x2066cd=_[_0x3386('0x2c')]({},_0x2066cd,_0x14b0e8[_0x3386('0x2e')]);return db[_0x3386('0x1e')][_0x3386('0x3a')](_0x2066cd)[_0x3386('0x15')](handleEntityNotFound(_0x5c859b,null))[_0x3386('0x15')](function(_0x4533e1){if(_0x4533e1[_0x3386('0x32')]==='MicrosoftAzure'){var _0x25f63c=encryptor[_0x3386('0x34')](_0x4533e1[_0x3386('0x35')]);_0x4533e1[_0x3386('0x35')]=maskClientSecret(_0x25f63c);}return _0x4533e1;})[_0x3386('0x15')](respondWithResult(_0x5c859b,null))['catch'](handleError(_0x5c859b,null));};exports[_0x3386('0x3b')]=function(_0x393494,_0x2a2be7){if(!_0x393494['body']['name'])throw new Error(_0x3386('0x3c'));if(!_0x393494['body'][_0x3386('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x44cc1f=db[_0x3386('0x1e')][_0x3386('0x38')][_0x3386('0x32')][_0x3386('0x3d')];if(!_0x44cc1f[_0x3386('0x3e')](_0x393494[_0x3386('0x3f')][_0x3386('0x32')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x44cc1f[_0x3386('0x40')](',\x20'));if(_0x393494[_0x3386('0x3f')][_0x3386('0x32')]===_0x3386('0x33')&&_0x393494['body'][_0x3386('0x35')]){_0x393494[_0x3386('0x3f')][_0x3386('0x35')]=encryptor['encryptString'](_0x393494[_0x3386('0x3f')][_0x3386('0x35')]);}return db[_0x3386('0x1e')]['create'](_0x393494[_0x3386('0x3f')],{})['then'](respondWithResult(_0x2a2be7,0xc9))['catch'](handleError(_0x2a2be7,null));};exports[_0x3386('0x14')]=function(_0x1a3e0f,_0xa22cf1){if(_0x1a3e0f[_0x3386('0x3f')]['id']){delete _0x1a3e0f['body']['id'];}return db[_0x3386('0x1e')][_0x3386('0x3a')]({'where':{'id':_0x1a3e0f[_0x3386('0x41')]['id']}})['then'](handleEntityNotFound(_0xa22cf1,null))[_0x3386('0x15')](function(_0x2892cd){if(_0x2892cd[_0x3386('0x32')]===_0x3386('0x33')&&_0x1a3e0f['body'][_0x3386('0x35')]){_0x1a3e0f['body']['data3']=encryptor[_0x3386('0x42')](_0x1a3e0f[_0x3386('0x3f')]['data3']);}return _0x2892cd;})[_0x3386('0x15')](saveUpdates(_0x1a3e0f[_0x3386('0x3f')],null))['then'](respondWithResult(_0xa22cf1,null))[_0x3386('0x36')](handleError(_0xa22cf1,null));};exports[_0x3386('0x16')]=function(_0x3fc9bd,_0x2d9398){return db[_0x3386('0x1e')][_0x3386('0x3a')]({'where':{'id':_0x3fc9bd['params']['id']}})[_0x3386('0x15')](handleEntityNotFound(_0x2d9398,null))[_0x3386('0x15')](removeEntity(_0x2d9398,null))[_0x3386('0x36')](handleError(_0x2d9398,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3ef017,_0xe909dc){return db['CloudProvider'][_0x3386('0x43')]({'where':{'id':_0x3ef017[_0x3386('0x41')]['id']},'raw':!![]})['then'](function(_0x2c1392){if(!_0x2c1392)return _0xe909dc[_0x3386('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2c1392,_0x3ef017[_0x3386('0x44')]['id'])};})[_0x3386('0x15')](respondWithResult(_0xe909dc,null))[_0x3386('0x36')](handleError(_0xe909dc,null));};exports['oauth2MicrosoftCallback']=function(_0x1e964a,_0x419b3b){var _0x2cec13=_0x1e964a[_0x3386('0x3f')];var _0xf61b99;var _0x12197f;if(_0x2cec13['error'])throw _0x2cec13;redis[_0x3386('0x45')](_0x2cec13[_0x3386('0x46')])['then'](function(_0x23c267){if(!_0x23c267)throw new Error('Invalid\x20state\x20parameter');_0xf61b99=JSON[_0x3386('0x47')](_0x23c267);var _0x1d9e23=Buffer[_0x3386('0x48')](_0x2cec13[_0x3386('0x46')],_0x3386('0x49'))[_0x3386('0x4a')](_0x3386('0x4b'));_0x12197f=JSON[_0x3386('0x47')](_0x1d9e23);if(!oauth['isValidIdToken'](_0x2cec13['id_token'],_0xf61b99[_0x3386('0x4c')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x3386('0x4d')](_0x2cec13['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x2cec13['code'],_0xf61b99);})[_0x3386('0x15')](function(_0x2c00ec){_0xf61b99[_0x3386('0x4e')]=_0x2c00ec[_0x3386('0x4f')];_0xf61b99['data6']=_0x2c00ec[_0x3386('0x50')];return db[_0x3386('0x1e')]['update']({'data5':_0xf61b99['data5'],'data6':_0xf61b99[_0x3386('0x51')]},{'where':{'id':_0xf61b99['id']}});})[_0x3386('0x15')](function(){oauth[_0x3386('0x52')](_0xf61b99);socket[_0x3386('0x53')](_0x3386('0x54'),{'id':_0x12197f['id']});return;})[_0x3386('0x15')](respondWithStatusCode(_0x419b3b,null))['catch'](function(_0x2a8eef){if(_0x12197f){socket[_0x3386('0x53')](_0x3386('0x55'),{'id':_0x12197f['id']});}if(!_0xf61b99){logger[_0x3386('0x17')](_0x3386('0x56'),_0x2a8eef);return _0x419b3b['status'](0x1f4)['send'](_0x2a8eef[_0x3386('0x57')]);}logger[_0x3386('0x17')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0xf61b99['id'],JSON[_0x3386('0x58')](_0x2a8eef));});};
\ No newline at end of file
+var _0x1d42=['find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','name','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','filter','where','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','params','merge'];(function(_0x2ec53e,_0x59038e){var _0x3a42d0=function(_0x8dfc05){while(--_0x8dfc05){_0x2ec53e['push'](_0x2ec53e['shift']());}};_0x3a42d0(++_0x59038e);}(_0x1d42,0xda));var _0x21d4=function(_0x248c51,_0xdf9962){_0x248c51=_0x248c51-0x0;var _0x28c4ce=_0x1d42[_0x248c51];return _0x28c4ce;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x21d4('0x0'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x21d4('0x1'))(_0x21d4('0x2'));var db=require(_0x21d4('0x3'))['db'];var oauth=require(_0x21d4('0x4'));config[_0x21d4('0x5')]=_['defaults'](config[_0x21d4('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x21d4('0x6'))(new Redis(config['redis']));var redis=new Redis(config[_0x21d4('0x5')]);function respondWithStatusCode(_0x4dd82c,_0x12b625){_0x12b625=_0x12b625||0xcc;return function(_0x554808){if(_0x554808){return _0x4dd82c[_0x21d4('0x7')](_0x12b625);}return _0x4dd82c[_0x21d4('0x8')](_0x12b625)[_0x21d4('0x9')]();};}function respondWithResult(_0x4aa27e,_0x11b9b5){_0x11b9b5=_0x11b9b5||0xc8;return function(_0x1fb3e6){if(_0x1fb3e6){return _0x4aa27e['status'](_0x11b9b5)[_0x21d4('0xa')](_0x1fb3e6);}};}function respondWithFilteredResult(_0x3180ad,_0xd33ff0){return function(_0x1352d5){if(_0x1352d5){var _0x2197ce=typeof _0xd33ff0[_0x21d4('0xb')]===_0x21d4('0xc')&&typeof _0xd33ff0[_0x21d4('0xd')]===_0x21d4('0xc');var _0x5a42ab=_0x1352d5[_0x21d4('0xe')];var _0x1acbc9=_0x2197ce?0x0:_0xd33ff0[_0x21d4('0xb')];var _0xdf2a9f=_0x2197ce?_0x1352d5['count']:_0xd33ff0[_0x21d4('0xb')]+_0xd33ff0[_0x21d4('0xd')];var _0x248e6b;if(_0xdf2a9f>=_0x5a42ab){_0xdf2a9f=_0x5a42ab;_0x248e6b=0xc8;}else{_0x248e6b=0xce;}_0x3180ad[_0x21d4('0x8')](_0x248e6b);return _0x3180ad[_0x21d4('0xf')](_0x21d4('0x10'),_0x1acbc9+'-'+_0xdf2a9f+'/'+_0x5a42ab)[_0x21d4('0xa')](_0x1352d5);}return null;};}function saveUpdates(_0x12d914){return function(_0x4b3621){if(_0x4b3621){return _0x4b3621['update'](_0x12d914)[_0x21d4('0x11')](function(_0x1294c7){return _0x1294c7;});}return null;};}function removeEntity(_0x39eeef){return function(_0x3b2543){if(_0x3b2543){return _0x3b2543[_0x21d4('0x12')]()[_0x21d4('0x11')](function(){_0x39eeef[_0x21d4('0x8')](0xcc)[_0x21d4('0x9')]();});}};}function handleEntityNotFound(_0x50a3d2){return function(_0x4e8ea6){if(!_0x4e8ea6){_0x50a3d2[_0x21d4('0x7')](0x194);}return _0x4e8ea6;};}function handleError(_0x6ccece,_0x5df756){_0x5df756=_0x5df756||0x1f4;return function(_0x4ac815){logger[_0x21d4('0x13')](_0x4ac815['stack']);if(_0x4ac815[_0x21d4('0x14')]){delete _0x4ac815[_0x21d4('0x14')];}_0x6ccece[_0x21d4('0x8')](_0x5df756)['send'](_0x4ac815);};}function maskClientSecret(_0x3b2953){return _[_0x21d4('0x15')](_0x3b2953['slice'](0x0,0x3),0x14,'*');}exports[_0x21d4('0x16')]=function(_0x3a6988,_0x3e3413){var _0x21008e={},_0x508270={},_0x356c9b={'count':0x0,'rows':[]};var _0x2ab8bd=_['map'](db[_0x21d4('0x17')][_0x21d4('0x18')],function(_0x270e08){return{'name':_0x270e08[_0x21d4('0x19')],'type':_0x270e08[_0x21d4('0x1a')][_0x21d4('0x1b')]};});_0x508270[_0x21d4('0x1c')]=_[_0x21d4('0x1d')](_0x2ab8bd,_0x21d4('0x14'));_0x508270[_0x21d4('0x1e')]=_[_0x21d4('0x1f')](_0x3a6988[_0x21d4('0x1e')]);_0x508270[_0x21d4('0x20')]=_['intersection'](_0x508270[_0x21d4('0x1c')],_0x508270[_0x21d4('0x1e')]);_0x21008e['attributes']=_[_0x21d4('0x21')](_0x508270[_0x21d4('0x1c')],qs['fields'](_0x3a6988[_0x21d4('0x1e')][_0x21d4('0x22')]));_0x21008e[_0x21d4('0x23')]=_0x21008e['attributes'][_0x21d4('0x24')]?_0x21008e['attributes']:_0x508270[_0x21d4('0x1c')];if(!_0x3a6988['query']['hasOwnProperty'](_0x21d4('0x25'))){_0x21008e[_0x21d4('0xd')]=qs['limit'](_0x3a6988['query'][_0x21d4('0xd')]);_0x21008e['offset']=qs['offset'](_0x3a6988[_0x21d4('0x1e')]['offset']);}_0x21008e['order']=qs[_0x21d4('0x26')](_0x3a6988['query'][_0x21d4('0x26')]);_0x21008e['where']=qs[_0x21d4('0x20')](_['pick'](_0x3a6988['query'],_0x508270['filters']),_0x2ab8bd);if(_0x3a6988['query'][_0x21d4('0x27')]){_0x21008e[_0x21d4('0x28')]=_['merge'](_0x21008e[_0x21d4('0x28')],{'$or':_[_0x21d4('0x1d')](_0x2ab8bd,function(_0x5d1fa6){if(_0x5d1fa6[_0x21d4('0x1a')]!=='VIRTUAL'){var _0x1a1072={};_0x1a1072[_0x5d1fa6[_0x21d4('0x14')]]={'$like':'%'+_0x3a6988[_0x21d4('0x1e')][_0x21d4('0x27')]+'%'};return _0x1a1072;}})});}_0x21008e=_['merge']({},_0x21008e,_0x3a6988[_0x21d4('0x29')]);var _0x5bf825={'where':_0x21008e['where']};return db[_0x21d4('0x17')]['count'](_0x5bf825)[_0x21d4('0x11')](function(_0x37c632){_0x356c9b[_0x21d4('0xe')]=_0x37c632;if(_0x3a6988['query'][_0x21d4('0x2a')]){_0x21008e[_0x21d4('0x2b')]=[{'all':!![]}];}return db[_0x21d4('0x17')]['findAll'](_0x21008e);})[_0x21d4('0x11')](function(_0x13025b){_0x356c9b[_0x21d4('0x2c')]=_[_0x21d4('0x1d')](_0x13025b,function(_0x3b3f85){if(_0x3b3f85[_0x21d4('0x2d')]===_0x21d4('0x2e')){var _0x19f2ea=encryptor[_0x21d4('0x2f')](_0x3b3f85[_0x21d4('0x30')]);_0x3b3f85[_0x21d4('0x30')]=maskClientSecret(_0x19f2ea);}return _0x3b3f85;});return _0x356c9b;})['then'](respondWithFilteredResult(_0x3e3413,_0x21008e))[_0x21d4('0x31')](handleError(_0x3e3413,null));};exports['show']=function(_0x8b3d45,_0x2812f2){var _0x3fc718={'raw':!![],'where':{'id':_0x8b3d45[_0x21d4('0x32')]['id']}},_0x5005fa={};_0x5005fa[_0x21d4('0x1c')]=_[_0x21d4('0x1f')](db[_0x21d4('0x17')][_0x21d4('0x18')]);_0x5005fa[_0x21d4('0x1e')]=_['keys'](_0x8b3d45['query']);_0x5005fa[_0x21d4('0x20')]=_[_0x21d4('0x21')](_0x5005fa['model'],_0x5005fa[_0x21d4('0x1e')]);_0x3fc718[_0x21d4('0x23')]=_['intersection'](_0x5005fa['model'],qs[_0x21d4('0x22')](_0x8b3d45[_0x21d4('0x1e')][_0x21d4('0x22')]));_0x3fc718['attributes']=_0x3fc718[_0x21d4('0x23')]['length']?_0x3fc718[_0x21d4('0x23')]:_0x5005fa[_0x21d4('0x1c')];if(_0x8b3d45[_0x21d4('0x1e')][_0x21d4('0x2a')]){_0x3fc718[_0x21d4('0x2b')]=[{'all':!![]}];}_0x3fc718=_[_0x21d4('0x33')]({},_0x3fc718,_0x8b3d45['options']);return db['CloudProvider'][_0x21d4('0x34')](_0x3fc718)[_0x21d4('0x11')](handleEntityNotFound(_0x2812f2,null))[_0x21d4('0x11')](function(_0x5d8871){if(_0x5d8871['service']===_0x21d4('0x2e')){var _0x4745c8=encryptor[_0x21d4('0x2f')](_0x5d8871[_0x21d4('0x30')]);_0x5d8871['data3']=maskClientSecret(_0x4745c8);}return _0x5d8871;})[_0x21d4('0x11')](respondWithResult(_0x2812f2,null))['catch'](handleError(_0x2812f2,null));};exports['create']=function(_0x3d9f45,_0x1c1d00){if(!_0x3d9f45[_0x21d4('0x35')][_0x21d4('0x14')])throw new Error(_0x21d4('0x36'));if(!_0x3d9f45['body'][_0x21d4('0x2d')])throw new Error(_0x21d4('0x37'));var _0x592cb4=db[_0x21d4('0x17')][_0x21d4('0x18')]['service']['values'];if(!_0x592cb4[_0x21d4('0x38')](_0x3d9f45['body'][_0x21d4('0x2d')]))throw new Error(_0x21d4('0x39')+_0x592cb4[_0x21d4('0x3a')](',\x20'));if(_0x3d9f45['body'][_0x21d4('0x2d')]==='MicrosoftAzure'&&_0x3d9f45[_0x21d4('0x35')][_0x21d4('0x30')]){_0x3d9f45[_0x21d4('0x35')][_0x21d4('0x30')]=encryptor[_0x21d4('0x3b')](_0x3d9f45[_0x21d4('0x35')][_0x21d4('0x30')]);}return db[_0x21d4('0x17')][_0x21d4('0x3c')](_0x3d9f45[_0x21d4('0x35')],{})[_0x21d4('0x11')](respondWithResult(_0x1c1d00,0xc9))[_0x21d4('0x31')](handleError(_0x1c1d00,null));};exports[_0x21d4('0x3d')]=function(_0x1621c5,_0x587f74){if(_0x1621c5['body']['id']){delete _0x1621c5[_0x21d4('0x35')]['id'];}return db[_0x21d4('0x17')]['find']({'where':{'id':_0x1621c5['params']['id']}})[_0x21d4('0x11')](handleEntityNotFound(_0x587f74,null))['then'](function(_0x35f576){if(_0x35f576[_0x21d4('0x2d')]===_0x21d4('0x2e')&&_0x1621c5[_0x21d4('0x35')]['data3']){_0x1621c5['body'][_0x21d4('0x30')]=encryptor['encryptString'](_0x1621c5[_0x21d4('0x35')][_0x21d4('0x30')]);}return _0x35f576;})['then'](saveUpdates(_0x1621c5['body'],null))[_0x21d4('0x11')](respondWithResult(_0x587f74,null))[_0x21d4('0x31')](handleError(_0x587f74,null));};exports[_0x21d4('0x12')]=function(_0x483a7b,_0x51375f){return db[_0x21d4('0x17')][_0x21d4('0x34')]({'where':{'id':_0x483a7b[_0x21d4('0x32')]['id']}})[_0x21d4('0x11')](handleEntityNotFound(_0x51375f,null))[_0x21d4('0x11')](removeEntity(_0x51375f,null))[_0x21d4('0x31')](handleError(_0x51375f,null));};exports[_0x21d4('0x3e')]=function(_0x1f835c,_0x3313a0){return db[_0x21d4('0x17')][_0x21d4('0x3f')]({'where':{'id':_0x1f835c[_0x21d4('0x32')]['id']},'raw':!![]})[_0x21d4('0x11')](function(_0x3cb43a){if(!_0x3cb43a)return _0x3313a0[_0x21d4('0x7')](0x194);return{'url':oauth[_0x21d4('0x40')](_0x3cb43a,_0x1f835c[_0x21d4('0x41')]['id'])};})['then'](respondWithResult(_0x3313a0,null))[_0x21d4('0x31')](handleError(_0x3313a0,null));};exports[_0x21d4('0x42')]=function(_0x55f67e,_0x5f16ed){var _0x18a9a3=_0x55f67e[_0x21d4('0x35')];var _0x4f3b1a;var _0x4ba9be;if(_0x18a9a3['error'])throw _0x18a9a3;redis[_0x21d4('0x43')](_0x18a9a3[_0x21d4('0x44')])[_0x21d4('0x11')](function(_0x15a0d7){if(!_0x15a0d7)throw new Error(_0x21d4('0x45'));_0x4f3b1a=JSON[_0x21d4('0x46')](_0x15a0d7);var _0x43e601=Buffer[_0x21d4('0x47')](_0x18a9a3['state'],_0x21d4('0x48'))[_0x21d4('0x49')](_0x21d4('0x4a'));_0x4ba9be=JSON[_0x21d4('0x46')](_0x43e601);if(!oauth[_0x21d4('0x4b')](_0x18a9a3[_0x21d4('0x4c')],_0x4f3b1a[_0x21d4('0x4d')]))throw new Error(_0x21d4('0x4e'));redis[_0x21d4('0x4f')](_0x18a9a3[_0x21d4('0x44')]);return oauth['getOauth2MicrosoftAccessToken'](_0x18a9a3['code'],_0x4f3b1a);})['then'](function(_0x32c4c6){_0x4f3b1a[_0x21d4('0x50')]=_0x32c4c6[_0x21d4('0x51')];_0x4f3b1a[_0x21d4('0x52')]=_0x32c4c6['refresh_token'];return db['CloudProvider'][_0x21d4('0x3d')]({'data5':_0x4f3b1a[_0x21d4('0x50')],'data6':_0x4f3b1a[_0x21d4('0x52')]},{'where':{'id':_0x4f3b1a['id']}});})[_0x21d4('0x11')](function(){oauth['startRefreshInterval'](_0x4f3b1a);socket[_0x21d4('0x53')](_0x21d4('0x54'),{'id':_0x4ba9be['id']});return;})[_0x21d4('0x11')](respondWithStatusCode(_0x5f16ed,null))['catch'](function(_0xf1f072){if(_0x4ba9be){socket[_0x21d4('0x53')](_0x21d4('0x55'),{'id':_0x4ba9be['id']});}if(!_0x4f3b1a){logger[_0x21d4('0x13')](_0x21d4('0x56'),_0xf1f072);return _0x5f16ed[_0x21d4('0x8')](0x1f4)[_0x21d4('0x57')](_0xf1f072['message']);}logger['error'](_0x21d4('0x58'),_0x4f3b1a['id'],JSON[_0x21d4('0x59')](_0xf1f072));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 55ce5a5..72b5ddb 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 _0x2c19=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x5b7a60,_0x3e3d52){var _0x503ea9=function(_0xfc63e7){while(--_0xfc63e7){_0x5b7a60['push'](_0x5b7a60['shift']());}};_0x503ea9(++_0x3e3d52);}(_0x2c19,0x99));var _0x92c1=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2c19[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x92c1('0x0'));var util=require(_0x92c1('0x1'));var logger=require(_0x92c1('0x2'))(_0x92c1('0x3'));var moment=require(_0x92c1('0x4'));var BPromise=require(_0x92c1('0x5'));var rp=require(_0x92c1('0x6'));var fs=require('fs');var path=require(_0x92c1('0x7'));var rimraf=require(_0x92c1('0x8'));var config=require(_0x92c1('0x9'));var attributes=require(_0x92c1('0xa'));module[_0x92c1('0xb')]=function(_0x106870,_0xc1ff2){return _0x106870[_0x92c1('0xc')](_0x92c1('0xd'),attributes,{'tableName':_0x92c1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9459=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers'];(function(_0x49af06,_0x29490b){var _0x4fbb7d=function(_0x3c3317){while(--_0x3c3317){_0x49af06['push'](_0x49af06['shift']());}};_0x4fbb7d(++_0x29490b);}(_0x9459,0x179));var _0x9945=function(_0x2424d5,_0x3ca3cc){_0x2424d5=_0x2424d5-0x0;var _0x35b0d8=_0x9459[_0x2424d5];return _0x35b0d8;};'use strict';var _=require(_0x9945('0x0'));var util=require(_0x9945('0x1'));var logger=require(_0x9945('0x2'))(_0x9945('0x3'));var moment=require('moment');var BPromise=require(_0x9945('0x4'));var rp=require(_0x9945('0x5'));var fs=require('fs');var path=require(_0x9945('0x6'));var rimraf=require(_0x9945('0x7'));var config=require(_0x9945('0x8'));var attributes=require(_0x9945('0x9'));module[_0x9945('0xa')]=function(_0x2321c2,_0x47108d){return _0x2321c2[_0x9945('0xb')]('CloudProvider',attributes,{'tableName':_0x9945('0xc'),'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 20b322c..08d178c 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 _0x0023=['jsonwebtoken','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/schedule/cloud-provider','redis','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','key','oauth2Claims','oauth2/','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','POST','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x0023,0x1a9));var _0x3002=function(_0x5e9b8a,_0x15fc70){_0x5e9b8a=_0x5e9b8a-0x0;var _0xffd6d6=_0x0023[_0x5e9b8a];return _0xffd6d6;};'use strict';var _=require('lodash');var crypto=require(_0x3002('0x0'));var jwt=require(_0x3002('0x1'));var moment=require('moment');var Redis=require(_0x3002('0x2'));var rp=require(_0x3002('0x3'));var util=require('util');var encryptor=require(_0x3002('0x4'));var config=require(_0x3002('0x5'));var logger=require('../../config/logger')('api');var schedule=require(_0x3002('0x6'));var db=require('../../mysqldb')['db'];config[_0x3002('0x7')]=_['defaults'](config[_0x3002('0x7')],{'host':_0x3002('0x8'),'port':0x18eb});var redis=new Redis(config[_0x3002('0x7')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x3002('0x9'),_0x3002('0xa'),_0x3002('0xb'),_0x3002('0xc'),_0x3002('0xd'),_0x3002('0xe'),_0x3002('0xf')],'Dynamics365':[_0x3002('0x9'),_0x3002('0xc')]};var MICROSOFT_AUTH_ENDPOINT=_0x3002('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x3002('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x59d955){var _0x13add0=_[_0x3002('0x12')](AZURE_AUTH_SCOPES[_0x59d955[_0x3002('0x13')]]);if(_0x59d955[_0x3002('0x13')]===_0x3002('0x14'))_0x13add0['push'](_0x59d955[_0x3002('0x15')]+_0x3002('0x16'));return _0x13add0[_0x3002('0x17')]('\x20');}function getAccessTokenScope(_0x34a196){if(_0x34a196[_0x3002('0x13')]===_0x3002('0x18'))return _0x3002('0xd');if(_0x34a196[_0x3002('0x13')]===_0x3002('0x14'))return _0x34a196[_0x3002('0x15')]+_0x3002('0x16');}function generateMicrosoftAuthorizationUrl(_0x8b5bc5,_0x31dfa8){var _0x18a962=MICROSOFT_AUTH_URL[_0x3002('0x19')](_0x3002('0x1a'),_0x8b5bc5[_0x3002('0x1b')]);var _0x5daa4a=['code',_0x3002('0x1c')];var _0x4cf589=Buffer[_0x3002('0x1d')](JSON[_0x3002('0x1e')]({'id':_0x31dfa8}))[_0x3002('0x1f')](_0x3002('0x20'));var _0x354fbf=crypto['randomBytes'](0x10)[_0x3002('0x1f')]('hex');var _0x558cd2=getAuthorizationScopes(_0x8b5bc5);var _0x55c917=[{'key':'client_id','value':_0x8b5bc5[_0x3002('0x21')]},{'key':_0x3002('0x22'),'value':encodeURIComponent(_0x5daa4a[_0x3002('0x17')]('\x20'))},{'key':_0x3002('0x23'),'value':_0x8b5bc5['data4']},{'key':_0x3002('0x24'),'value':_0x3002('0x25')},{'key':_0x3002('0x26'),'value':encodeURIComponent(_0x558cd2)},{'key':_0x3002('0x27'),'value':_0x4cf589},{'key':_0x3002('0x28'),'value':_0x354fbf},{'key':_0x3002('0x29'),'value':_0x3002('0x2a')}];var _0x3d57c9=_0x18a962+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x55c917,function(_0x5991ee){return _0x5991ee[_0x3002('0x2b')]+'='+_0x5991ee['value'];})['join']('&');_0x8b5bc5[_0x3002('0x2c')]={'issuer':_0x18a962[_0x3002('0x19')](_0x3002('0x2d'),''),'audience':_0x8b5bc5[_0x3002('0x21')],'state':_0x4cf589,'nonce':_0x354fbf};redis['set'](_0x4cf589,JSON[_0x3002('0x1e')](_0x8b5bc5));return _0x3d57c9;}function isValidIdToken(_0x48ac92,_0x3d72cb){try{var _0x3d752a=jwt['decode'](_0x48ac92,{'complete':!![]});var _0x5b6bad=_0x3d752a['payload'];if(_0x5b6bad['iss']!==_0x3d72cb[_0x3002('0x2e')])return![];if(_0x5b6bad[_0x3002('0x2f')]!==_0x3d72cb[_0x3002('0x30')])return![];if(_0x5b6bad[_0x3002('0x28')]!==_0x3d72cb['nonce'])return![];if(moment()[_0x3002('0x31')](moment[_0x3002('0x32')](_0x5b6bad[_0x3002('0x33')])))return![];return!![];}catch(_0x13250d){throw _0x13250d;}}function refreshOauth2MicrosoftAccessToken(_0x2b89f0){return Promise[_0x3002('0x34')]()[_0x3002('0x35')](function(){if(_0x2b89f0['data3'])return _0x2b89f0;return db[_0x3002('0x36')][_0x3002('0x37')]({'where':{'id':_0x2b89f0['id']},'raw':!![]});})[_0x3002('0x35')](function(_0x834f32){var _0x19cdec={'grant_type':_0x3002('0x38'),'refresh_token':_0x834f32[_0x3002('0x39')],'scope':getAccessTokenScope(_0x834f32),'redirect_uri':_0x834f32[_0x3002('0x3a')],'client_id':_0x834f32[_0x3002('0x21')],'client_secret':encryptor['decryptString'](_0x834f32['data3'])};var _0x2b6133={'method':_0x3002('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x3002('0x19')]('{TENANT_ID}',_0x834f32[_0x3002('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x19cdec,'json':!![]};return rp(_0x2b6133);})['then'](function(_0x269c4b){_0x2b89f0['data5']=_0x269c4b['access_token'];_0x2b89f0['data6']=_0x269c4b[_0x3002('0x38')];return db[_0x3002('0x36')][_0x3002('0x3c')]({'data5':_0x2b89f0['data5'],'data6':_0x2b89f0[_0x3002('0x39')]},{'where':{'id':_0x2b89f0['id']}});})['then'](function(){return _0x2b89f0;})[_0x3002('0x3d')](function(_0xa6d8ad){logger[_0x3002('0x3e')](_0x3002('0x3f'),_0x2b89f0['id'],_0xa6d8ad);});}function getOauth2MicrosoftAccessToken(_0x54c927,_0xc15f29){var _0x22ba17={'grant_type':_0x3002('0x40'),'code':_0x54c927,'scope':getAccessTokenScope(_0xc15f29),'redirect_uri':_0xc15f29['data4'],'client_id':_0xc15f29[_0x3002('0x21')],'client_secret':encryptor[_0x3002('0x41')](_0xc15f29['data3'])};var _0x4dfe56={'method':_0x3002('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x3002('0x19')](_0x3002('0x1a'),_0xc15f29[_0x3002('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x22ba17,'json':!![]};return rp(_0x4dfe56);}function startRefreshInterval(_0x442ea1){var _0x31720d=schedule[_0x3002('0x42')];if(_0x31720d[_0x442ea1['id']])clearInterval(_0x31720d[_0x442ea1['id']]);_0x31720d[_0x442ea1['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x442ea1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x31720d;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3002('0x35')](function(_0x66e5af){var _0x4fa940=_0x66e5af[_0x3002('0x12')](function(_0x2b7b83){return refreshOauth2MicrosoftAccessToken(_0x2b7b83)[_0x3002('0x35')](function(_0x4e4bb3){startRefreshInterval(_0x4e4bb3);});});return Promise[_0x3002('0x43')](_0x4fa940);})[_0x3002('0x3d')](function(_0x375a1d){var _0x6e9023=_0x375a1d?util[_0x3002('0x44')](_0x375a1d,{'showHidden':![],'depth':null}):'';logger[_0x3002('0x3e')](_0x3002('0x45'),_0x6e9023);});}module[_0x3002('0x46')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x90b8=['stringify','toString','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','state','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','issuer','nonce','unix','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data2','data5','update','error','authorization_code','bind','intervals','findAll','map','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','data7','/.default','join','Dynamics365','replace','{TENANT_ID}','code','id_token','from'];(function(_0x28d204,_0x702528){var _0xadf793=function(_0x290712){while(--_0x290712){_0x28d204['push'](_0x28d204['shift']());}};_0xadf793(++_0x702528);}(_0x90b8,0xc1));var _0x890b=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x90b8[_0x534c8f];return _0x5a57f5;};'use strict';var _=require(_0x890b('0x0'));var crypto=require(_0x890b('0x1'));var jwt=require(_0x890b('0x2'));var moment=require(_0x890b('0x3'));var Redis=require(_0x890b('0x4'));var rp=require(_0x890b('0x5'));var util=require(_0x890b('0x6'));var encryptor=require(_0x890b('0x7'));var config=require('../../config/environment');var logger=require(_0x890b('0x8'))(_0x890b('0x9'));var schedule=require(_0x890b('0xa'));var db=require(_0x890b('0xb'))['db'];config[_0x890b('0xc')]=_[_0x890b('0xd')](config[_0x890b('0xc')],{'host':_0x890b('0xe'),'port':0x18eb});var redis=new Redis(config[_0x890b('0xc')]);var MICROSOFT_AUTH_URL=_0x890b('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x890b('0x10'),'profile','email',_0x890b('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x890b('0x12'),_0x890b('0x13')],'Dynamics365':[_0x890b('0x10'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x890b('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x890b('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x27c77d){var _0x783733=_['map'](AZURE_AUTH_SCOPES[_0x27c77d['type']]);if(_0x27c77d[_0x890b('0x16')]==='Dynamics365')_0x783733['push'](_0x27c77d[_0x890b('0x17')]+_0x890b('0x18'));return _0x783733[_0x890b('0x19')]('\x20');}function getAccessTokenScope(_0x382c1c){if(_0x382c1c[_0x890b('0x16')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x382c1c[_0x890b('0x16')]===_0x890b('0x1a'))return _0x382c1c['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x51a625,_0x59f506){var _0x5cb888=MICROSOFT_AUTH_URL[_0x890b('0x1b')](_0x890b('0x1c'),_0x51a625['data2']);var _0x5ae072=[_0x890b('0x1d'),_0x890b('0x1e')];var _0x1d7cc9=Buffer[_0x890b('0x1f')](JSON[_0x890b('0x20')]({'id':_0x59f506}))[_0x890b('0x21')]('base64');var _0x4df824=crypto['randomBytes'](0x10)['toString'](_0x890b('0x22'));var _0x1807f0=getAuthorizationScopes(_0x51a625);var _0x37f336=[{'key':_0x890b('0x23'),'value':_0x51a625[_0x890b('0x24')]},{'key':_0x890b('0x25'),'value':encodeURIComponent(_0x5ae072[_0x890b('0x19')]('\x20'))},{'key':_0x890b('0x26'),'value':_0x51a625[_0x890b('0x27')]},{'key':_0x890b('0x28'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x1807f0)},{'key':_0x890b('0x29'),'value':_0x1d7cc9},{'key':'nonce','value':_0x4df824},{'key':_0x890b('0x2a'),'value':_0x890b('0x2b')}];var _0x21fa79=_0x5cb888+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x37f336,function(_0x1341ff){return _0x1341ff[_0x890b('0x2c')]+'='+_0x1341ff[_0x890b('0x2d')];})[_0x890b('0x19')]('&');_0x51a625[_0x890b('0x2e')]={'issuer':_0x5cb888[_0x890b('0x1b')](_0x890b('0x2f'),''),'audience':_0x51a625[_0x890b('0x24')],'state':_0x1d7cc9,'nonce':_0x4df824};redis['set'](_0x1d7cc9,JSON['stringify'](_0x51a625));return _0x21fa79;}function isValidIdToken(_0x17473e,_0x215c34){try{var _0x18c489=jwt[_0x890b('0x30')](_0x17473e,{'complete':!![]});var _0x11efcd=_0x18c489[_0x890b('0x31')];if(_0x11efcd['iss']!==_0x215c34[_0x890b('0x32')])return![];if(_0x11efcd['aud']!==_0x215c34['audience'])return![];if(_0x11efcd[_0x890b('0x33')]!==_0x215c34[_0x890b('0x33')])return![];if(moment()['isAfter'](moment[_0x890b('0x34')](_0x11efcd['exp'])))return![];return!![];}catch(_0x203d95){throw _0x203d95;}}function refreshOauth2MicrosoftAccessToken(_0x1c57c8){return Promise[_0x890b('0x35')]()[_0x890b('0x36')](function(){if(_0x1c57c8[_0x890b('0x37')])return _0x1c57c8;return db[_0x890b('0x38')]['findOne']({'where':{'id':_0x1c57c8['id']},'raw':!![]});})[_0x890b('0x36')](function(_0x3766bb){var _0x10cf3a={'grant_type':_0x890b('0x39'),'refresh_token':_0x3766bb[_0x890b('0x3a')],'scope':getAccessTokenScope(_0x3766bb),'redirect_uri':_0x3766bb[_0x890b('0x27')],'client_id':_0x3766bb['data1'],'client_secret':encryptor[_0x890b('0x3b')](_0x3766bb['data3'])};var _0x48c6b5={'method':_0x890b('0x3c'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3766bb[_0x890b('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x10cf3a,'json':!![]};return rp(_0x48c6b5);})[_0x890b('0x36')](function(_0x553d93){_0x1c57c8[_0x890b('0x3e')]=_0x553d93['access_token'];_0x1c57c8[_0x890b('0x3a')]=_0x553d93['refresh_token'];return db['CloudProvider'][_0x890b('0x3f')]({'data5':_0x1c57c8[_0x890b('0x3e')],'data6':_0x1c57c8['data6']},{'where':{'id':_0x1c57c8['id']}});})[_0x890b('0x36')](function(){return _0x1c57c8;})['catch'](function(_0x1e58f3){logger[_0x890b('0x40')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x1c57c8['id'],_0x1e58f3);});}function getOauth2MicrosoftAccessToken(_0x56b1f8,_0x2390a3){var _0x14a48a={'grant_type':_0x890b('0x41'),'code':_0x56b1f8,'scope':getAccessTokenScope(_0x2390a3),'redirect_uri':_0x2390a3[_0x890b('0x27')],'client_id':_0x2390a3[_0x890b('0x24')],'client_secret':encryptor[_0x890b('0x3b')](_0x2390a3['data3'])};var _0x2da4fd={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x890b('0x1b')](_0x890b('0x1c'),_0x2390a3[_0x890b('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x14a48a,'json':!![]};return rp(_0x2da4fd);}function startRefreshInterval(_0x18b077){var _0x20e41d=schedule['intervals'];if(_0x20e41d[_0x18b077['id']])clearInterval(_0x20e41d[_0x18b077['id']]);_0x20e41d[_0x18b077['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x890b('0x42')](this,{'id':_0x18b077['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x890b('0x43')]=_0x20e41d;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x890b('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xb290b){var _0x2ccae0=_0xb290b[_0x890b('0x45')](function(_0x5e306b){return refreshOauth2MicrosoftAccessToken(_0x5e306b)[_0x890b('0x36')](function(_0x20bdd3){startRefreshInterval(_0x20bdd3);});});return Promise[_0x890b('0x46')](_0x2ccae0);})[_0x890b('0x47')](function(_0x561a2f){var _0x25b781=_0x561a2f?util[_0x890b('0x48')](_0x561a2f,{'showHidden':![],'depth':null}):'';logger['error'](_0x890b('0x49'),_0x25b781);});}module[_0x890b('0x4a')]={'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 0bbb3c6..ab6f6b2 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 _0xb19a=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x43b96b,_0x3bc895){var _0x3f6e99=function(_0x339fc4){while(--_0x339fc4){_0x43b96b['push'](_0x43b96b['shift']());}};_0x3f6e99(++_0x3bc895);}(_0xb19a,0xd0));var _0xab19=function(_0x116420,_0x5106ae){_0x116420=_0x116420-0x0;var _0x1824de=_0xb19a[_0x116420];return _0x1824de;};'use strict';var _=require(_0xab19('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab19('0x2'))['db'];var utils=require(_0xab19('0x3'));var logger=require(_0xab19('0x4'))(_0xab19('0x5'));var config=require(_0xab19('0x6'));var jayson=require(_0xab19('0x7'));var client=jayson[_0xab19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9d5c1d,_0x131291,_0x59d282){return new BPromise(function(_0x300038,_0x479d0b){return client[_0xab19('0x9')](_0x9d5c1d,_0x59d282)[_0xab19('0xa')](function(_0x2c6a67){logger[_0xab19('0xb')](_0xab19('0xc'),_0x131291,_0xab19('0xd'));logger[_0xab19('0xe')](_0xab19('0xf'),_0x131291,_0xab19('0xd'),JSON[_0xab19('0x10')](_0x2c6a67));if(_0x2c6a67[_0xab19('0x11')]){if(_0x2c6a67[_0xab19('0x11')]['code']===0x1f4){logger['error'](_0xab19('0xc'),_0x131291,_0x2c6a67['error'][_0xab19('0x12')]);return _0x479d0b(_0x2c6a67[_0xab19('0x11')][_0xab19('0x12')]);}logger[_0xab19('0x11')](_0xab19('0xc'),_0x131291,_0x2c6a67[_0xab19('0x11')][_0xab19('0x12')]);return _0x300038(_0x2c6a67['error'][_0xab19('0x12')]);}else{logger[_0xab19('0xb')]('CloudProvider,\x20%s,\x20%s',_0x131291,_0xab19('0xd'));_0x300038(_0x2c6a67[_0xab19('0x13')]['message']);}})['catch'](function(_0x2284b8){logger[_0xab19('0x11')](_0xab19('0xc'),_0x131291,_0x2284b8);_0x479d0b(_0x2284b8);});});}
\ No newline at end of file
+var _0xacc6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch'];(function(_0x5e2d0d,_0x566431){var _0x6241b2=function(_0x2dcffe){while(--_0x2dcffe){_0x5e2d0d['push'](_0x5e2d0d['shift']());}};_0x6241b2(++_0x566431);}(_0xacc6,0x150));var _0x6acc=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0xacc6[_0x5cc8];return _0x450661;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require(_0x6acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require(_0x6acc('0x7'))('rpc');var config=require(_0x6acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7f3a,_0x41edfd,_0x48b1a8){return new BPromise(function(_0x1f95e8,_0x538730){return client[_0x6acc('0xb')](_0x5e7f3a,_0x48b1a8)[_0x6acc('0xc')](function(_0x4d6b7f){logger[_0x6acc('0xd')]('CloudProvider,\x20%s,\x20%s',_0x41edfd,_0x6acc('0xe'));logger[_0x6acc('0xf')](_0x6acc('0x10'),_0x41edfd,_0x6acc('0xe'),JSON[_0x6acc('0x11')](_0x4d6b7f));if(_0x4d6b7f[_0x6acc('0x12')]){if(_0x4d6b7f['error'][_0x6acc('0x13')]===0x1f4){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x538730(_0x4d6b7f['error']['message']);}logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x1f95e8(_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);}else{logger[_0x6acc('0xd')](_0x6acc('0x14'),_0x41edfd,_0x6acc('0xe'));_0x1f95e8(_0x4d6b7f[_0x6acc('0x16')][_0x6acc('0x15')]);}})[_0x6acc('0x17')](function(_0x31c4c2){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x31c4c2);_0x538730(_0x31c4c2);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 2f13201..c80ad59 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x200fdb,_0x1d483e){var _0x1262bd=function(_0x4197f4){while(--_0x4197f4){_0x200fdb['push'](_0x200fdb['shift']());}};_0x1262bd(++_0x1d483e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0x1261,0x144));var _0x1126=function(_0x4b9a62,_0x528ba3){_0x4b9a62=_0x4b9a62-0x0;var _0x45c582=_0x1261[_0x4b9a62];return _0x45c582;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index ffae7fc..26e9bce 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 _0x2dd4=['STRING','name'];(function(_0x2a4503,_0x3c241a){var _0x1da7c0=function(_0x49c341){while(--_0x49c341){_0x2a4503['push'](_0x2a4503['shift']());}};_0x1da7c0(++_0x3c241a);}(_0x2dd4,0x173));var _0x42dd=function(_0x4d6c7b,_0x1b177b){_0x4d6c7b=_0x4d6c7b-0x0;var _0x41ed71=_0x2dd4[_0x4d6c7b];return _0x41ed71;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x42dd('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x42dd('0x1')]},'companyId':{'type':Sequelize[_0x42dd('0x1')]},'website':{'type':Sequelize[_0x42dd('0x1')]},'phone':{'type':Sequelize[_0x42dd('0x1')]},'fax':{'type':Sequelize[_0x42dd('0x1')]},'type':{'type':Sequelize[_0x42dd('0x1')]},'street':{'type':Sequelize[_0x42dd('0x1')]},'postalCode':{'type':Sequelize[_0x42dd('0x1')]},'city':{'type':Sequelize[_0x42dd('0x1')]},'country':{'type':Sequelize[_0x42dd('0x1')]},'email':{'type':Sequelize[_0x42dd('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x42dd('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x42dd('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb49d=['exports','STRING','sequelize'];(function(_0x3d9055,_0x5a0411){var _0x5e38b1=function(_0x31d6f9){while(--_0x31d6f9){_0x3d9055['push'](_0x3d9055['shift']());}};_0x5e38b1(++_0x5a0411);}(_0xb49d,0x182));var _0xdb49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb49d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdb49('0x0'));module[_0xdb49('0x1')]={'name':{'type':Sequelize[_0xdb49('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xdb49('0x2')]},'companyId':{'type':Sequelize[_0xdb49('0x2')]},'website':{'type':Sequelize[_0xdb49('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xdb49('0x2')]},'type':{'type':Sequelize[_0xdb49('0x2')]},'street':{'type':Sequelize[_0xdb49('0x2')]},'postalCode':{'type':Sequelize[_0xdb49('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xdb49('0x2')]},'email':{'type':Sequelize[_0xdb49('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xdb49('0x2')]},'sStreet':{'type':Sequelize[_0xdb49('0x2')]},'sPostalCode':{'type':Sequelize[_0xdb49('0x2')]},'sCity':{'type':Sequelize[_0xdb49('0x2')]},'sCountry':{'type':Sequelize[_0xdb49('0x2')]},'description':{'type':Sequelize[_0xdb49('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 800915a..ee419fb 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 _0xc851=['apply','save','then','destroy','get','Companies','UserProfileResource','end','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','map','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xc851,0x1dd));var _0x1c85=function(_0x3e3fb2,_0x27181a){_0x3e3fb2=_0x3e3fb2-0x0;var _0x106b06=_0xc851[_0x3e3fb2];return _0x106b06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c85('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c85('0x1'));var rp=require(_0x1c85('0x2'));var moment=require('moment');var BPromise=require(_0x1c85('0x3'));var Mustache=require(_0x1c85('0x4'));var util=require(_0x1c85('0x5'));var path=require(_0x1c85('0x6'));var sox=require('sox');var csv=require(_0x1c85('0x7'));var ejs=require(_0x1c85('0x8'));var fs=require('fs');var fs_extra=require(_0x1c85('0x9'));var _=require('lodash');var squel=require(_0x1c85('0xa'));var crypto=require(_0x1c85('0xb'));var jsforce=require(_0x1c85('0xc'));var deskjs=require(_0x1c85('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1c85('0xe'));var Papa=require(_0x1c85('0xf'));var Redis=require('ioredis');var authService=require(_0x1c85('0x10'));var qs=require(_0x1c85('0x11'));var as=require(_0x1c85('0x12'));var hardwareService=require(_0x1c85('0x13'));var logger=require(_0x1c85('0x14'))(_0x1c85('0x15'));var utils=require('../../config/utils');var config=require(_0x1c85('0x16'));var licenseUtil=require(_0x1c85('0x17'));var db=require(_0x1c85('0x18'))['db'];function respondWithStatusCode(_0x399ef8,_0x38cd6b){_0x38cd6b=_0x38cd6b||0xcc;return function(_0x380278){if(_0x380278){return _0x399ef8[_0x1c85('0x19')](_0x38cd6b);}return _0x399ef8['status'](_0x38cd6b)['end']();};}function respondWithResult(_0x17ca35,_0x234fc6){_0x234fc6=_0x234fc6||0xc8;return function(_0x52cd95){if(_0x52cd95){return _0x17ca35['status'](_0x234fc6)[_0x1c85('0x1a')](_0x52cd95);}};}function respondWithFilteredResult(_0x553f32,_0x28257d){return function(_0x164f02){if(_0x164f02){var _0x5126e7=typeof _0x28257d[_0x1c85('0x1b')]===_0x1c85('0x1c')&&typeof _0x28257d[_0x1c85('0x1d')]===_0x1c85('0x1c');var _0x405aa1=_0x164f02['count'];var _0x5a2f72=_0x5126e7?0x0:_0x28257d[_0x1c85('0x1b')];var _0x49d82b=_0x5126e7?_0x164f02[_0x1c85('0x1e')]:_0x28257d[_0x1c85('0x1b')]+_0x28257d[_0x1c85('0x1d')];var _0x90baa7;if(_0x49d82b>=_0x405aa1){_0x49d82b=_0x405aa1;_0x90baa7=0xc8;}else{_0x90baa7=0xce;}_0x553f32[_0x1c85('0x1f')](_0x90baa7);return _0x553f32['set'](_0x1c85('0x20'),_0x5a2f72+'-'+_0x49d82b+'/'+_0x405aa1)[_0x1c85('0x1a')](_0x164f02);}return null;};}function patchUpdates(_0x58d5a6){return function(_0x41d77a){try{jsonpatch[_0x1c85('0x21')](_0x41d77a,_0x58d5a6,!![]);}catch(_0x46c356){return BPromise['reject'](_0x46c356);}return _0x41d77a[_0x1c85('0x22')]();};}function saveUpdates(_0x5040ef,_0xd6ed4d){return function(_0x508a2f){if(_0x508a2f){return _0x508a2f['update'](_0x5040ef)[_0x1c85('0x23')](function(_0x1d2792){return _0x1d2792;});}return null;};}function removeEntity(_0x5ecb88,_0x3a7038){return function(_0x1c9af4){if(_0x1c9af4){return _0x1c9af4[_0x1c85('0x24')]()[_0x1c85('0x23')](function(){var _0x2a2459=_0x1c9af4[_0x1c85('0x25')]({'plain':!![]});var _0x6876ba=_0x1c85('0x26');return db[_0x1c85('0x27')][_0x1c85('0x24')]({'where':{'type':_0x6876ba,'resourceId':_0x2a2459['id']}})[_0x1c85('0x23')](function(){return _0x1c9af4;});})[_0x1c85('0x23')](function(){_0x5ecb88[_0x1c85('0x1f')](0xcc)[_0x1c85('0x28')]();});}};}function handleEntityNotFound(_0x2204bb,_0x2b5513){return function(_0xb0d0a0){if(!_0xb0d0a0){_0x2204bb[_0x1c85('0x19')](0x194);}return _0xb0d0a0;};}function handleError(_0x4edb02,_0x28d6a2){_0x28d6a2=_0x28d6a2||0x1f4;return function(_0x524d4c){logger['error'](_0x524d4c['stack']);if(_0x524d4c['name']){delete _0x524d4c['name'];}_0x4edb02[_0x1c85('0x1f')](_0x28d6a2)['send'](_0x524d4c);};}exports[_0x1c85('0x29')]=function(_0x4563d5,_0x2998ab){var _0x4fd7f5={},_0x58002a={},_0x2a937f={'count':0x0,'rows':[]};return db[_0x1c85('0x2a')][_0x1c85('0x2b')]()['then'](function(_0x6b5db6){_0x58002a[_0x1c85('0x2c')]=_['keys'](_0x6b5db6);_0x58002a[_0x1c85('0x2d')]=_[_0x1c85('0x2e')](_0x4563d5[_0x1c85('0x2d')]);_0x58002a[_0x1c85('0x2f')]=_[_0x1c85('0x30')](_0x58002a[_0x1c85('0x2c')],_0x58002a[_0x1c85('0x2d')]);_0x4fd7f5[_0x1c85('0x31')]=_['intersection'](_0x58002a['model'],qs[_0x1c85('0x32')](_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x32')]));_0x4fd7f5[_0x1c85('0x31')]=_0x4fd7f5[_0x1c85('0x31')][_0x1c85('0x33')]?_0x4fd7f5[_0x1c85('0x31')]:_0x58002a[_0x1c85('0x2c')];if(!_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x34')](_0x1c85('0x35'))){_0x4fd7f5[_0x1c85('0x1d')]=qs['limit'](_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x1d')]);_0x4fd7f5[_0x1c85('0x1b')]=qs[_0x1c85('0x1b')](_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x1b')]);}_0x4fd7f5[_0x1c85('0x36')]=qs['sort'](_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x37')]);_0x4fd7f5[_0x1c85('0x38')]=qs[_0x1c85('0x2f')](_[_0x1c85('0x39')](_0x4563d5[_0x1c85('0x2d')],_0x58002a['filters']),_0x6b5db6);if(_0x4563d5[_0x1c85('0x2d')]['filter']){_0x4fd7f5[_0x1c85('0x38')]=_['merge'](_0x4fd7f5[_0x1c85('0x38')],{'$or':_['map'](_0x4fd7f5['attributes'],function(_0x574fbc){var _0x2558b5={};_0x2558b5[_0x574fbc]={'$like':'%'+_0x4563d5['query'][_0x1c85('0x3a')]+'%'};return _0x2558b5;})});}_0x4fd7f5=_[_0x1c85('0x3b')]({},_0x4fd7f5,_0x4563d5[_0x1c85('0x3c')]);var _0x4dcc64={'where':_0x4fd7f5[_0x1c85('0x38')]};return db[_0x1c85('0x2a')][_0x1c85('0x1e')](_0x4dcc64)['then'](function(_0x20347c){_0x2a937f[_0x1c85('0x1e')]=_0x20347c;if(_0x4563d5[_0x1c85('0x2d')][_0x1c85('0x3d')]){_0x4fd7f5['include']=[{'all':!![]}];}return db[_0x1c85('0x2a')][_0x1c85('0x3e')](_0x4fd7f5);})['then'](function(_0xf49ea1){_0x2a937f['rows']=_0xf49ea1;return _0x2a937f;})[_0x1c85('0x23')](respondWithFilteredResult(_0x2998ab,_0x4fd7f5))[_0x1c85('0x3f')](handleError(_0x2998ab,null));})[_0x1c85('0x3f')](handleError(_0x2998ab,null));};exports[_0x1c85('0x40')]=function(_0x4f8165,_0x9f90fa){var _0x34416b={'raw':![],'where':{'id':_0x4f8165[_0x1c85('0x41')]['id']}},_0x2af227={};_0x2af227[_0x1c85('0x2c')]=_[_0x1c85('0x2e')](db[_0x1c85('0x2a')][_0x1c85('0x42')]);_0x2af227[_0x1c85('0x2d')]=_[_0x1c85('0x2e')](_0x4f8165[_0x1c85('0x2d')]);_0x2af227[_0x1c85('0x2f')]=_[_0x1c85('0x30')](_0x2af227[_0x1c85('0x2c')],_0x2af227[_0x1c85('0x2d')]);_0x34416b['attributes']=_[_0x1c85('0x30')](_0x2af227['model'],qs[_0x1c85('0x32')](_0x4f8165[_0x1c85('0x2d')][_0x1c85('0x32')]));_0x34416b[_0x1c85('0x31')]=_0x34416b[_0x1c85('0x31')]['length']?_0x34416b['attributes']:_0x2af227['model'];if(_0x4f8165['query'][_0x1c85('0x3d')]){_0x34416b[_0x1c85('0x43')]=[{'all':!![]}];}_0x34416b=_[_0x1c85('0x3b')]({},_0x34416b,_0x4f8165['options']);return db['CmCompany'][_0x1c85('0x44')](_0x34416b)[_0x1c85('0x23')](handleEntityNotFound(_0x9f90fa,null))[_0x1c85('0x23')](respondWithResult(_0x9f90fa,null))['catch'](handleError(_0x9f90fa,null));};exports['create']=function(_0x37d96c,_0x11de0e){return db[_0x1c85('0x2a')][_0x1c85('0x45')](_0x37d96c[_0x1c85('0x46')],{})[_0x1c85('0x23')](function(_0x2ea559){var _0x868ee7=_0x37d96c[_0x1c85('0x47')][_0x1c85('0x25')]({'plain':!![]});if(!_0x868ee7)throw new Error(_0x1c85('0x48'));if(_0x868ee7[_0x1c85('0x49')]==='user'){var _0x2f39e9=_0x2ea559[_0x1c85('0x25')]({'plain':!![]});var _0x1b4c76=_0x1c85('0x26');return db['UserProfileSection'][_0x1c85('0x44')]({'where':{'name':_0x1b4c76,'userProfileId':_0x868ee7['userProfileId']},'raw':!![]})[_0x1c85('0x23')](function(_0xb63c){if(_0xb63c&&_0xb63c[_0x1c85('0x4a')]===0x0){return db[_0x1c85('0x27')]['create']({'name':_0x2f39e9[_0x1c85('0x4b')],'resourceId':_0x2f39e9['id'],'type':_0xb63c[_0x1c85('0x4b')],'sectionId':_0xb63c['id']},{})[_0x1c85('0x23')](function(){return _0x2ea559;});}else{return _0x2ea559;}})[_0x1c85('0x3f')](function(_0x57141d){logger[_0x1c85('0x4c')](_0x1c85('0x4d'),_0x57141d);throw _0x57141d;});}return _0x2ea559;})[_0x1c85('0x23')](respondWithResult(_0x11de0e,0xc9))['catch'](handleError(_0x11de0e,null));};exports['update']=function(_0x5b2462,_0x5d503b){if(_0x5b2462[_0x1c85('0x46')]['id']){delete _0x5b2462['body']['id'];}return db[_0x1c85('0x2a')][_0x1c85('0x44')]({'where':{'id':_0x5b2462[_0x1c85('0x41')]['id']}})[_0x1c85('0x23')](handleEntityNotFound(_0x5d503b,null))[_0x1c85('0x23')](saveUpdates(_0x5b2462[_0x1c85('0x46')],null))[_0x1c85('0x23')](respondWithResult(_0x5d503b,null))[_0x1c85('0x3f')](handleError(_0x5d503b,null));};exports[_0x1c85('0x24')]=function(_0x111fef,_0x4d7588){return db[_0x1c85('0x2a')][_0x1c85('0x44')]({'where':{'id':_0x111fef[_0x1c85('0x41')]['id']}})[_0x1c85('0x23')](handleEntityNotFound(_0x4d7588,null))['then'](removeEntity(_0x4d7588,null))[_0x1c85('0x3f')](handleError(_0x4d7588,null));};exports[_0x1c85('0x2b')]=function(_0x18a861,_0x8654b5){return db['CmCompany'][_0x1c85('0x2b')]()[_0x1c85('0x23')](respondWithResult(_0x8654b5,null))['catch'](handleError(_0x8654b5,null));};exports[_0x1c85('0x4e')]=function(_0x11cde9,_0x27adb3,_0x10e009){return db[_0x1c85('0x4f')][_0x1c85('0x44')]({'where':{'id':_0x11cde9[_0x1c85('0x41')]['id']}})[_0x1c85('0x23')](handleEntityNotFound(_0x27adb3,null))[_0x1c85('0x23')](function(_0x3ac78c){if(_0x3ac78c){return _0x3ac78c[_0x1c85('0x4e')](_0x11cde9[_0x1c85('0x46')][_0x1c85('0x50')],_[_0x1c85('0x51')](_0x11cde9[_0x1c85('0x46')],[_0x1c85('0x50'),'id'])||{});}})['then'](respondWithResult(_0x27adb3,null))[_0x1c85('0x3f')](handleError(_0x27adb3,null));};exports[_0x1c85('0x52')]=function(_0x35b46b,_0x441de9,_0x4191b0){var _0x590f58={};var _0xbca4b9={};var _0x271997;var _0x3c6d1c;return db[_0x1c85('0x2a')][_0x1c85('0x53')]({'where':{'id':_0x35b46b[_0x1c85('0x41')]['id']}})['then'](handleEntityNotFound(_0x441de9,null))[_0x1c85('0x23')](function(_0x38273e){if(_0x38273e){_0x271997=_0x38273e;_0xbca4b9[_0x1c85('0x2c')]=_['keys'](db[_0x1c85('0x4f')][_0x1c85('0x42')]);_0xbca4b9['query']=_[_0x1c85('0x2e')](_0x35b46b['query']);_0xbca4b9[_0x1c85('0x2f')]=_[_0x1c85('0x30')](_0xbca4b9[_0x1c85('0x2c')],_0xbca4b9[_0x1c85('0x2d')]);_0x590f58[_0x1c85('0x31')]=_[_0x1c85('0x30')](_0xbca4b9[_0x1c85('0x2c')],qs[_0x1c85('0x32')](_0x35b46b[_0x1c85('0x2d')]['fields']));_0x590f58['attributes']=_0x590f58[_0x1c85('0x31')][_0x1c85('0x33')]?_0x590f58[_0x1c85('0x31')]:_0xbca4b9[_0x1c85('0x2c')];_0x590f58[_0x1c85('0x36')]=qs['sort'](_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x37')]);_0x590f58[_0x1c85('0x38')]=qs[_0x1c85('0x2f')](_['pick'](_0x35b46b[_0x1c85('0x2d')],_0xbca4b9[_0x1c85('0x2f')]));if(_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x3a')]){_0x590f58[_0x1c85('0x38')]=_['merge'](_0x590f58[_0x1c85('0x38')],{'$or':_[_0x1c85('0x54')](_0x590f58[_0x1c85('0x31')],function(_0x4d62e1){var _0x32e46e={};_0x32e46e[_0x4d62e1]={'$like':'%'+_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x3a')]+'%'};return _0x32e46e;})});}_0x590f58=_[_0x1c85('0x3b')]({},_0x590f58,_0x35b46b[_0x1c85('0x3c')]);return _0x271997[_0x1c85('0x52')](_0x590f58);}})['then'](function(_0xd5341e){if(_0xd5341e){_0x3c6d1c=_0xd5341e[_0x1c85('0x33')];if(!_0x35b46b['query'][_0x1c85('0x34')](_0x1c85('0x35'))){_0x590f58[_0x1c85('0x1d')]=qs[_0x1c85('0x1d')](_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x1d')]);_0x590f58[_0x1c85('0x1b')]=qs[_0x1c85('0x1b')](_0x35b46b[_0x1c85('0x2d')][_0x1c85('0x1b')]);}return _0x271997[_0x1c85('0x52')](_0x590f58);}})['then'](function(_0x4ce57f){if(_0x4ce57f){return _0x4ce57f?{'count':_0x3c6d1c,'rows':_0x4ce57f}:null;}})[_0x1c85('0x23')](respondWithResult(_0x441de9,null))['catch'](handleError(_0x441de9,null));};
\ No newline at end of file
+var _0x8f21=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','merge','map','options','where','includeAll','include','findAll','catch','show','rawAttributes','filters','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','autoAssociation','body','params','omit','getContacts','CmContact','length','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x5decec,_0x4e5761){var _0x35e1b4=function(_0x27066d){while(--_0x27066d){_0x5decec['push'](_0x5decec['shift']());}};_0x35e1b4(++_0x4e5761);}(_0x8f21,0xf4));var _0x18f2=function(_0x3d5b4c,_0x577b6e){_0x3d5b4c=_0x3d5b4c-0x0;var _0x1ba703=_0x8f21[_0x3d5b4c];return _0x1ba703;};'use strict';var emlformat=require(_0x18f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18f2('0x1'));var jsonpatch=require(_0x18f2('0x2'));var rp=require(_0x18f2('0x3'));var moment=require(_0x18f2('0x4'));var BPromise=require(_0x18f2('0x5'));var Mustache=require('mustache');var util=require(_0x18f2('0x6'));var path=require(_0x18f2('0x7'));var sox=require(_0x18f2('0x8'));var csv=require('to-csv');var ejs=require(_0x18f2('0x9'));var fs=require('fs');var fs_extra=require(_0x18f2('0xa'));var _=require(_0x18f2('0xb'));var squel=require('squel');var crypto=require(_0x18f2('0xc'));var jsforce=require(_0x18f2('0xd'));var deskjs=require(_0x18f2('0xe'));var toCsv=require(_0x18f2('0xf'));var querystring=require(_0x18f2('0x10'));var Papa=require(_0x18f2('0x11'));var Redis=require(_0x18f2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x18f2('0x13'));var as=require(_0x18f2('0x14'));var hardwareService=require(_0x18f2('0x15'));var logger=require(_0x18f2('0x16'))(_0x18f2('0x17'));var utils=require(_0x18f2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x18f2('0x19'));var db=require(_0x18f2('0x1a'))['db'];function respondWithStatusCode(_0x294953,_0x4b5328){_0x4b5328=_0x4b5328||0xcc;return function(_0x413667){if(_0x413667){return _0x294953[_0x18f2('0x1b')](_0x4b5328);}return _0x294953[_0x18f2('0x1c')](_0x4b5328)[_0x18f2('0x1d')]();};}function respondWithResult(_0x88c5fa,_0x432f26){_0x432f26=_0x432f26||0xc8;return function(_0x5e5d91){if(_0x5e5d91){return _0x88c5fa[_0x18f2('0x1c')](_0x432f26)[_0x18f2('0x1e')](_0x5e5d91);}};}function respondWithFilteredResult(_0x2be753,_0x59253a){return function(_0x584c4d){if(_0x584c4d){var _0xa8f2e8=typeof _0x59253a[_0x18f2('0x1f')]===_0x18f2('0x20')&&typeof _0x59253a[_0x18f2('0x21')]===_0x18f2('0x20');var _0x35ac7e=_0x584c4d[_0x18f2('0x22')];var _0x422f39=_0xa8f2e8?0x0:_0x59253a['offset'];var _0x2181b4=_0xa8f2e8?_0x584c4d['count']:_0x59253a['offset']+_0x59253a[_0x18f2('0x21')];var _0x56dbb1;if(_0x2181b4>=_0x35ac7e){_0x2181b4=_0x35ac7e;_0x56dbb1=0xc8;}else{_0x56dbb1=0xce;}_0x2be753['status'](_0x56dbb1);return _0x2be753['set'](_0x18f2('0x23'),_0x422f39+'-'+_0x2181b4+'/'+_0x35ac7e)[_0x18f2('0x1e')](_0x584c4d);}return null;};}function patchUpdates(_0xe78219){return function(_0x158c5c){try{jsonpatch[_0x18f2('0x24')](_0x158c5c,_0xe78219,!![]);}catch(_0x5e529e){return BPromise['reject'](_0x5e529e);}return _0x158c5c[_0x18f2('0x25')]();};}function saveUpdates(_0x3fd77e,_0x568d81){return function(_0xbcde0d){if(_0xbcde0d){return _0xbcde0d[_0x18f2('0x26')](_0x3fd77e)[_0x18f2('0x27')](function(_0x243076){return _0x243076;});}return null;};}function removeEntity(_0x590b76,_0x2171f7){return function(_0x1450b0){if(_0x1450b0){return _0x1450b0[_0x18f2('0x28')]()['then'](function(){var _0x36a743=_0x1450b0['get']({'plain':!![]});var _0x347b5b='Companies';return db[_0x18f2('0x29')][_0x18f2('0x28')]({'where':{'type':_0x347b5b,'resourceId':_0x36a743['id']}})[_0x18f2('0x27')](function(){return _0x1450b0;});})[_0x18f2('0x27')](function(){_0x590b76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xcc1249,_0xbb7518){return function(_0xaea3f0){if(!_0xaea3f0){_0xcc1249[_0x18f2('0x1b')](0x194);}return _0xaea3f0;};}function handleError(_0xb15f25,_0x37be74){_0x37be74=_0x37be74||0x1f4;return function(_0xbda91e){logger[_0x18f2('0x2a')](_0xbda91e[_0x18f2('0x2b')]);if(_0xbda91e[_0x18f2('0x2c')]){delete _0xbda91e['name'];}_0xb15f25[_0x18f2('0x1c')](_0x37be74)[_0x18f2('0x2d')](_0xbda91e);};}exports[_0x18f2('0x2e')]=function(_0x50b788,_0x469961){var _0x215db7={},_0xdb9d27={},_0x217dac={'count':0x0,'rows':[]};return db[_0x18f2('0x2f')][_0x18f2('0x30')]()[_0x18f2('0x27')](function(_0x4c35a7){_0xdb9d27[_0x18f2('0x31')]=_[_0x18f2('0x32')](_0x4c35a7);_0xdb9d27[_0x18f2('0x33')]=_[_0x18f2('0x32')](_0x50b788[_0x18f2('0x33')]);_0xdb9d27['filters']=_[_0x18f2('0x34')](_0xdb9d27[_0x18f2('0x31')],_0xdb9d27[_0x18f2('0x33')]);_0x215db7[_0x18f2('0x35')]=_['intersection'](_0xdb9d27[_0x18f2('0x31')],qs['fields'](_0x50b788[_0x18f2('0x33')]['fields']));_0x215db7[_0x18f2('0x35')]=_0x215db7[_0x18f2('0x35')]['length']?_0x215db7['attributes']:_0xdb9d27[_0x18f2('0x31')];if(!_0x50b788['query'][_0x18f2('0x36')](_0x18f2('0x37'))){_0x215db7[_0x18f2('0x21')]=qs[_0x18f2('0x21')](_0x50b788['query'][_0x18f2('0x21')]);_0x215db7[_0x18f2('0x1f')]=qs[_0x18f2('0x1f')](_0x50b788[_0x18f2('0x33')]['offset']);}_0x215db7[_0x18f2('0x38')]=qs[_0x18f2('0x39')](_0x50b788[_0x18f2('0x33')][_0x18f2('0x39')]);_0x215db7['where']=qs['filters'](_['pick'](_0x50b788[_0x18f2('0x33')],_0xdb9d27['filters']),_0x4c35a7);if(_0x50b788['query'][_0x18f2('0x3a')]){_0x215db7['where']=_[_0x18f2('0x3b')](_0x215db7['where'],{'$or':_[_0x18f2('0x3c')](_0x215db7['attributes'],function(_0xb30e6c){var _0xc8e028={};_0xc8e028[_0xb30e6c]={'$like':'%'+_0x50b788[_0x18f2('0x33')][_0x18f2('0x3a')]+'%'};return _0xc8e028;})});}_0x215db7=_[_0x18f2('0x3b')]({},_0x215db7,_0x50b788[_0x18f2('0x3d')]);var _0x3e380e={'where':_0x215db7[_0x18f2('0x3e')]};return db[_0x18f2('0x2f')][_0x18f2('0x22')](_0x3e380e)[_0x18f2('0x27')](function(_0x2a3a1b){_0x217dac['count']=_0x2a3a1b;if(_0x50b788[_0x18f2('0x33')][_0x18f2('0x3f')]){_0x215db7[_0x18f2('0x40')]=[{'all':!![]}];}return db[_0x18f2('0x2f')][_0x18f2('0x41')](_0x215db7);})[_0x18f2('0x27')](function(_0x40b12b){_0x217dac['rows']=_0x40b12b;return _0x217dac;})['then'](respondWithFilteredResult(_0x469961,_0x215db7))[_0x18f2('0x42')](handleError(_0x469961,null));})['catch'](handleError(_0x469961,null));};exports[_0x18f2('0x43')]=function(_0x186049,_0x3147ce){var _0x311e73={'raw':![],'where':{'id':_0x186049['params']['id']}},_0x47a8a9={};_0x47a8a9[_0x18f2('0x31')]=_[_0x18f2('0x32')](db[_0x18f2('0x2f')][_0x18f2('0x44')]);_0x47a8a9[_0x18f2('0x33')]=_[_0x18f2('0x32')](_0x186049[_0x18f2('0x33')]);_0x47a8a9[_0x18f2('0x45')]=_['intersection'](_0x47a8a9[_0x18f2('0x31')],_0x47a8a9[_0x18f2('0x33')]);_0x311e73[_0x18f2('0x35')]=_[_0x18f2('0x34')](_0x47a8a9['model'],qs[_0x18f2('0x46')](_0x186049[_0x18f2('0x33')][_0x18f2('0x46')]));_0x311e73[_0x18f2('0x35')]=_0x311e73[_0x18f2('0x35')]['length']?_0x311e73['attributes']:_0x47a8a9[_0x18f2('0x31')];if(_0x186049['query'][_0x18f2('0x3f')]){_0x311e73[_0x18f2('0x40')]=[{'all':!![]}];}_0x311e73=_[_0x18f2('0x3b')]({},_0x311e73,_0x186049['options']);return db[_0x18f2('0x2f')][_0x18f2('0x47')](_0x311e73)[_0x18f2('0x27')](handleEntityNotFound(_0x3147ce,null))['then'](respondWithResult(_0x3147ce,null))[_0x18f2('0x42')](handleError(_0x3147ce,null));};exports[_0x18f2('0x48')]=function(_0x51cfd8,_0x32dc7a){return db[_0x18f2('0x2f')][_0x18f2('0x48')](_0x51cfd8['body'],{})[_0x18f2('0x27')](function(_0x1c716e){var _0xfd6172=_0x51cfd8[_0x18f2('0x49')][_0x18f2('0x4a')]({'plain':!![]});if(!_0xfd6172)throw new Error(_0x18f2('0x4b'));if(_0xfd6172[_0x18f2('0x4c')]===_0x18f2('0x49')){var _0x620511=_0x1c716e['get']({'plain':!![]});var _0x51a742=_0x18f2('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x51a742,'userProfileId':_0xfd6172['userProfileId']},'raw':!![]})[_0x18f2('0x27')](function(_0x955bf3){if(_0x955bf3&&_0x955bf3[_0x18f2('0x4e')]===0x0){return db['UserProfileResource'][_0x18f2('0x48')]({'name':_0x620511[_0x18f2('0x2c')],'resourceId':_0x620511['id'],'type':_0x955bf3[_0x18f2('0x2c')],'sectionId':_0x955bf3['id']},{})[_0x18f2('0x27')](function(){return _0x1c716e;});}else{return _0x1c716e;}})['catch'](function(_0x521253){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x521253);throw _0x521253;});}return _0x1c716e;})['then'](respondWithResult(_0x32dc7a,0xc9))[_0x18f2('0x42')](handleError(_0x32dc7a,null));};exports['update']=function(_0x4194a9,_0x1f7c26){if(_0x4194a9[_0x18f2('0x4f')]['id']){delete _0x4194a9[_0x18f2('0x4f')]['id'];}return db[_0x18f2('0x2f')][_0x18f2('0x47')]({'where':{'id':_0x4194a9['params']['id']}})[_0x18f2('0x27')](handleEntityNotFound(_0x1f7c26,null))[_0x18f2('0x27')](saveUpdates(_0x4194a9[_0x18f2('0x4f')],null))[_0x18f2('0x27')](respondWithResult(_0x1f7c26,null))['catch'](handleError(_0x1f7c26,null));};exports['destroy']=function(_0x4945e2,_0x585bc1){return db[_0x18f2('0x2f')][_0x18f2('0x47')]({'where':{'id':_0x4945e2[_0x18f2('0x50')]['id']}})[_0x18f2('0x27')](handleEntityNotFound(_0x585bc1,null))['then'](removeEntity(_0x585bc1,null))['catch'](handleError(_0x585bc1,null));};exports['describe']=function(_0x38fc2f,_0x4e2954){return db[_0x18f2('0x2f')]['describe']()[_0x18f2('0x27')](respondWithResult(_0x4e2954,null))['catch'](handleError(_0x4e2954,null));};exports['addContacts']=function(_0x4745bd,_0x3d7dc7,_0x56fedd){return db['CmContact'][_0x18f2('0x47')]({'where':{'id':_0x4745bd[_0x18f2('0x50')]['id']}})[_0x18f2('0x27')](handleEntityNotFound(_0x3d7dc7,null))[_0x18f2('0x27')](function(_0x5c1463){if(_0x5c1463){return _0x5c1463['addContacts'](_0x4745bd[_0x18f2('0x4f')]['ids'],_[_0x18f2('0x51')](_0x4745bd[_0x18f2('0x4f')],['ids','id'])||{});}})[_0x18f2('0x27')](respondWithResult(_0x3d7dc7,null))[_0x18f2('0x42')](handleError(_0x3d7dc7,null));};exports[_0x18f2('0x52')]=function(_0x5dcb4e,_0x47e902,_0x521a6d){var _0x17e914={};var _0x315904={};var _0x5f2097;var _0x252013;return db[_0x18f2('0x2f')]['findOne']({'where':{'id':_0x5dcb4e[_0x18f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x47e902,null))[_0x18f2('0x27')](function(_0x1ca138){if(_0x1ca138){_0x5f2097=_0x1ca138;_0x315904['model']=_[_0x18f2('0x32')](db[_0x18f2('0x53')][_0x18f2('0x44')]);_0x315904[_0x18f2('0x33')]=_['keys'](_0x5dcb4e[_0x18f2('0x33')]);_0x315904[_0x18f2('0x45')]=_[_0x18f2('0x34')](_0x315904[_0x18f2('0x31')],_0x315904[_0x18f2('0x33')]);_0x17e914[_0x18f2('0x35')]=_[_0x18f2('0x34')](_0x315904[_0x18f2('0x31')],qs[_0x18f2('0x46')](_0x5dcb4e[_0x18f2('0x33')][_0x18f2('0x46')]));_0x17e914['attributes']=_0x17e914[_0x18f2('0x35')][_0x18f2('0x54')]?_0x17e914[_0x18f2('0x35')]:_0x315904['model'];_0x17e914[_0x18f2('0x38')]=qs[_0x18f2('0x39')](_0x5dcb4e[_0x18f2('0x33')][_0x18f2('0x39')]);_0x17e914[_0x18f2('0x3e')]=qs['filters'](_[_0x18f2('0x55')](_0x5dcb4e[_0x18f2('0x33')],_0x315904[_0x18f2('0x45')]));if(_0x5dcb4e['query'][_0x18f2('0x3a')]){_0x17e914[_0x18f2('0x3e')]=_[_0x18f2('0x3b')](_0x17e914[_0x18f2('0x3e')],{'$or':_['map'](_0x17e914[_0x18f2('0x35')],function(_0x4aeab0){var _0x5ea041={};_0x5ea041[_0x4aeab0]={'$like':'%'+_0x5dcb4e[_0x18f2('0x33')][_0x18f2('0x3a')]+'%'};return _0x5ea041;})});}_0x17e914=_[_0x18f2('0x3b')]({},_0x17e914,_0x5dcb4e[_0x18f2('0x3d')]);return _0x5f2097[_0x18f2('0x52')](_0x17e914);}})[_0x18f2('0x27')](function(_0x58800e){if(_0x58800e){_0x252013=_0x58800e[_0x18f2('0x54')];if(!_0x5dcb4e['query'][_0x18f2('0x36')]('nolimit')){_0x17e914[_0x18f2('0x21')]=qs[_0x18f2('0x21')](_0x5dcb4e['query'][_0x18f2('0x21')]);_0x17e914[_0x18f2('0x1f')]=qs['offset'](_0x5dcb4e[_0x18f2('0x33')]['offset']);}return _0x5f2097[_0x18f2('0x52')](_0x17e914);}})[_0x18f2('0x27')](function(_0x6dec1){if(_0x6dec1){return _0x6dec1?{'count':_0x252013,'rows':_0x6dec1}:null;}})[_0x18f2('0x27')](respondWithResult(_0x47e902,null))[_0x18f2('0x42')](handleError(_0x47e902,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index c467f85..2f52d4c 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 _0xfccd=['moment','bluebird','request-promise','path','rimraf','define','CmCompany','api'];(function(_0x454899,_0x56d202){var _0x4d576d=function(_0xedb633){while(--_0xedb633){_0x454899['push'](_0x454899['shift']());}};_0x4d576d(++_0x56d202);}(_0xfccd,0x7f));var _0xdfcc=function(_0x5608df,_0xff2326){_0x5608df=_0x5608df-0x0;var _0x4c2e63=_0xfccd[_0x5608df];return _0x4c2e63;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdfcc('0x0'));var moment=require(_0xdfcc('0x1'));var BPromise=require(_0xdfcc('0x2'));var rp=require(_0xdfcc('0x3'));var fs=require('fs');var path=require(_0xdfcc('0x4'));var rimraf=require(_0xdfcc('0x5'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0xabf87e,_0x5bd5b5){return _0xabf87e[_0xdfcc('0x6')](_0xdfcc('0x7'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2165=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies'];(function(_0x19f19f,_0x150e93){var _0x3b9368=function(_0x34b7d2){while(--_0x34b7d2){_0x19f19f['push'](_0x19f19f['shift']());}};_0x3b9368(++_0x150e93);}(_0x2165,0x179));var _0x5216=function(_0x4d6a8f,_0x565271){_0x4d6a8f=_0x4d6a8f-0x0;var _0x537980=_0x2165[_0x4d6a8f];return _0x537980;};'use strict';var _=require(_0x5216('0x0'));var util=require(_0x5216('0x1'));var logger=require(_0x5216('0x2'))(_0x5216('0x3'));var moment=require(_0x5216('0x4'));var BPromise=require(_0x5216('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5216('0x6'));var rimraf=require(_0x5216('0x7'));var config=require(_0x5216('0x8'));var attributes=require(_0x5216('0x9'));module[_0x5216('0xa')]=function(_0x42f2e4,_0x22f91d){return _0x42f2e4['define'](_0x5216('0xb'),attributes,{'tableName':_0x5216('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 12445e6..be845c0 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 _0x2cfa=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x7582fc,_0x3fecff){var _0x29395d=function(_0x1af409){while(--_0x1af409){_0x7582fc['push'](_0x7582fc['shift']());}};_0x29395d(++_0x3fecff);}(_0x2cfa,0x96));var _0xa2cf=function(_0x558fe9,_0x1ca3f7){_0x558fe9=_0x558fe9-0x0;var _0x554d2a=_0x2cfa[_0x558fe9];return _0x554d2a;};'use strict';var _=require(_0xa2cf('0x0'));var util=require(_0xa2cf('0x1'));var moment=require('moment');var BPromise=require(_0xa2cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2cf('0x3'))['db'];var utils=require(_0xa2cf('0x4'));var logger=require(_0xa2cf('0x5'))(_0xa2cf('0x6'));var config=require(_0xa2cf('0x7'));var jayson=require(_0xa2cf('0x8'));var client=jayson[_0xa2cf('0x9')][_0xa2cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249459,_0x2b8007,_0x1795c7){return new BPromise(function(_0x3fa342,_0x58e058){return client[_0xa2cf('0xb')](_0x249459,_0x1795c7)['then'](function(_0x12e7df){logger[_0xa2cf('0xc')](_0xa2cf('0xd'),_0x2b8007,'request\x20sent');logger[_0xa2cf('0xe')](_0xa2cf('0xf'),_0x2b8007,_0xa2cf('0x10'),JSON['stringify'](_0x12e7df));if(_0x12e7df[_0xa2cf('0x11')]){if(_0x12e7df[_0xa2cf('0x11')][_0xa2cf('0x12')]===0x1f4){logger[_0xa2cf('0x11')](_0xa2cf('0xd'),_0x2b8007,_0x12e7df[_0xa2cf('0x11')]['message']);return _0x58e058(_0x12e7df['error'][_0xa2cf('0x13')]);}logger[_0xa2cf('0x11')](_0xa2cf('0xd'),_0x2b8007,_0x12e7df[_0xa2cf('0x11')][_0xa2cf('0x13')]);return _0x3fa342(_0x12e7df[_0xa2cf('0x11')][_0xa2cf('0x13')]);}else{logger[_0xa2cf('0xc')](_0xa2cf('0xd'),_0x2b8007,_0xa2cf('0x10'));_0x3fa342(_0x12e7df[_0xa2cf('0x14')][_0xa2cf('0x13')]);}})[_0xa2cf('0x15')](function(_0x346c5d){logger[_0xa2cf('0x11')]('CmCompany,\x20%s,\x20%s',_0x2b8007,_0x346c5d);_0x58e058(_0x346c5d);});});}
\ No newline at end of file
+var _0xbeb6=['debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x4b66c6,_0x53ae84){var _0x530b50=function(_0x467c72){while(--_0x467c72){_0x4b66c6['push'](_0x4b66c6['shift']());}};_0x530b50(++_0x53ae84);}(_0xbeb6,0xcb));var _0x6beb=function(_0x5dc085,_0x35dfd2){_0x5dc085=_0x5dc085-0x0;var _0x2c79db=_0xbeb6[_0x5dc085];return _0x2c79db;};'use strict';var _=require(_0x6beb('0x0'));var util=require(_0x6beb('0x1'));var moment=require('moment');var BPromise=require(_0x6beb('0x2'));var rs=require(_0x6beb('0x3'));var fs=require('fs');var Redis=require(_0x6beb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6beb('0x5'))(_0x6beb('0x6'));var config=require('../../config/environment');var jayson=require(_0x6beb('0x7'));var client=jayson['client'][_0x6beb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29832c,_0x4f705d,_0x1b6135){return new BPromise(function(_0x16ab5a,_0x47ecb8){return client['request'](_0x29832c,_0x1b6135)[_0x6beb('0x9')](function(_0x435a70){logger[_0x6beb('0xa')](_0x6beb('0xb'),_0x4f705d,_0x6beb('0xc'));logger[_0x6beb('0xd')](_0x6beb('0xe'),_0x4f705d,_0x6beb('0xc'),JSON['stringify'](_0x435a70));if(_0x435a70['error']){if(_0x435a70[_0x6beb('0xf')][_0x6beb('0x10')]===0x1f4){logger[_0x6beb('0xf')](_0x6beb('0xb'),_0x4f705d,_0x435a70[_0x6beb('0xf')][_0x6beb('0x11')]);return _0x47ecb8(_0x435a70[_0x6beb('0xf')][_0x6beb('0x11')]);}logger[_0x6beb('0xf')](_0x6beb('0xb'),_0x4f705d,_0x435a70[_0x6beb('0xf')][_0x6beb('0x11')]);return _0x16ab5a(_0x435a70[_0x6beb('0xf')]['message']);}else{logger[_0x6beb('0xa')]('CmCompany,\x20%s,\x20%s',_0x4f705d,'request\x20sent');_0x16ab5a(_0x435a70['result'][_0x6beb('0x11')]);}})['catch'](function(_0x3607b9){logger['error'](_0x6beb('0xb'),_0x4f705d,_0x3607b9);_0x47ecb8(_0x3607b9);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 1287214..6f962f4 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 _0xe849=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','getContacts','post','create','/:id/contacts','addContacts','exports','multer'];(function(_0x142ad1,_0x1e31f7){var _0x32e5f1=function(_0x504a08){while(--_0x504a08){_0x142ad1['push'](_0x142ad1['shift']());}};_0x32e5f1(++_0x1e31f7);}(_0xe849,0x12b));var _0x9e84=function(_0x32d017,_0x1aaf95){_0x32d017=_0x32d017-0x0;var _0x4823c1=_0xe849[_0x32d017];return _0x4823c1;};'use strict';var multer=require(_0x9e84('0x0'));var util=require(_0x9e84('0x1'));var path=require(_0x9e84('0x2'));var timeout=require(_0x9e84('0x3'));var express=require(_0x9e84('0x4'));var router=express[_0x9e84('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9e84('0x6'));var interaction=require(_0x9e84('0x7'));var config=require(_0x9e84('0x8'));var controller=require(_0x9e84('0x9'));router[_0x9e84('0xa')]('/',auth[_0x9e84('0xb')](),controller['index']);router[_0x9e84('0xa')](_0x9e84('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9e84('0xa')](_0x9e84('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/contacts',auth[_0x9e84('0xb')](),controller[_0x9e84('0xe')]);router[_0x9e84('0xf')]('/',auth['isAuthenticated'](),controller[_0x9e84('0x10')]);router[_0x9e84('0xf')](_0x9e84('0x11'),auth[_0x9e84('0xb')](),controller[_0x9e84('0x12')]);router['put']('/:id',auth[_0x9e84('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9e84('0x13')]=router;
\ No newline at end of file
+var _0x18a2=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','get','/:id','post','/:id/contacts','addContacts','put','update','delete','exports','multer','util'];(function(_0x34359d,_0x1c0e86){var _0x59474f=function(_0x9c5ecf){while(--_0x9c5ecf){_0x34359d['push'](_0x34359d['shift']());}};_0x59474f(++_0x1c0e86);}(_0x18a2,0xf5));var _0x218a=function(_0x2bba7d,_0x2daffe){_0x2bba7d=_0x2bba7d-0x0;var _0x6b823=_0x18a2[_0x2bba7d];return _0x6b823;};'use strict';var multer=require(_0x218a('0x0'));var util=require(_0x218a('0x1'));var path=require(_0x218a('0x2'));var timeout=require(_0x218a('0x3'));var express=require(_0x218a('0x4'));var router=express['Router']();var fs_extra=require(_0x218a('0x5'));var auth=require(_0x218a('0x6'));var interaction=require(_0x218a('0x7'));var config=require('../../config/environment');var controller=require(_0x218a('0x8'));router['get']('/',auth[_0x218a('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x218a('0xa')](_0x218a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x218a('0xa')]('/:id/contacts',auth[_0x218a('0x9')](),controller['getContacts']);router[_0x218a('0xc')]('/',auth[_0x218a('0x9')](),controller['create']);router[_0x218a('0xc')](_0x218a('0xd'),auth[_0x218a('0x9')](),controller[_0x218a('0xe')]);router[_0x218a('0xf')](_0x218a('0xb'),auth[_0x218a('0x9')](),controller[_0x218a('0x10')]);router[_0x218a('0x11')]('/:id',auth[_0x218a('0x9')](),controller['destroy']);module[_0x218a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index cc4efee..e19e7f6 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 _0xe1fa=['sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xe1fa,0x150));var _0xae1f=function(_0x2ce7,_0x42de64){_0x2ce7=_0x2ce7-0x0;var _0x3465bf=_0xe1fa[_0x2ce7];return _0x3465bf;};'use strict';var _=require('lodash');var Sequelize=require(_0xae1f('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xae1f('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xae1f('0x1')]},'postalCode':{'type':Sequelize[_0xae1f('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xae1f('0x1')]},'description':{'type':Sequelize[_0xae1f('0x2')]},'phone':{'type':Sequelize[_0xae1f('0x1')]},'mobile':{'type':Sequelize[_0xae1f('0x1')]},'fax':{'type':Sequelize[_0xae1f('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xae1f('0x1')]},'facebook':{'type':Sequelize[_0xae1f('0x1')]},'fb_data':{'type':Sequelize[_0xae1f('0x1')]},'twitter':{'type':Sequelize[_0xae1f('0x1')]},'skype':{'type':Sequelize[_0xae1f('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xae1f('0x1')]},'line':{'type':Sequelize[_0xae1f('0x1')]},'wechat':{'type':Sequelize[_0xae1f('0x1')]},'telegram':{'type':Sequelize[_0xae1f('0x1')]},'UserId':{'type':Sequelize[_0xae1f('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xae1f('0x1')]},'priority':{'type':Sequelize[_0xae1f('0x3')](0x2)[_0xae1f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xae1f('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x58f2=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE'];(function(_0x1bab3c,_0x12d584){var _0x495cf0=function(_0x580b79){while(--_0x580b79){_0x1bab3c['push'](_0x1bab3c['shift']());}};_0x495cf0(++_0x12d584);}(_0x58f2,0x181));var _0x258f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x258f('0x0'));var Sequelize=require(_0x258f('0x1'));module[_0x258f('0x2')]={'firstName':{'type':Sequelize[_0x258f('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x258f('0x3')]},'street':{'type':Sequelize[_0x258f('0x3')]},'postalCode':{'type':Sequelize[_0x258f('0x3')]},'city':{'type':Sequelize[_0x258f('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x258f('0x3')]},'description':{'type':Sequelize[_0x258f('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x258f('0x3')]},'fax':{'type':Sequelize[_0x258f('0x3')]},'email':{'type':Sequelize[_0x258f('0x3')]},'url':{'type':Sequelize[_0x258f('0x3')]},'facebook':{'type':Sequelize[_0x258f('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x258f('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x258f('0x3')]},'line':{'type':Sequelize[_0x258f('0x3')]},'wechat':{'type':Sequelize[_0x258f('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x258f('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x258f('0x3')]},'priority':{'type':Sequelize[_0x258f('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x258f('0x6')],'defaultValue':Sequelize[_0x258f('0x7')]},'dialTimezone':{'type':Sequelize[_0x258f('0x3')]},'utcOffset':{'type':Sequelize[_0x258f('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 87df2b9..81f8628 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
'];(function(_0x3a6136,_0x1940db){var _0x2941a3=function(_0x49e5b7){while(--_0x49e5b7){_0x3a6136['push'](_0x3a6136['shift']());}};_0x2941a3(++_0x1940db);}(_0xe246,0x1dc));var _0x6e24=function(_0x554902,_0x2b5ca9){_0x554902=_0x554902-0x0;var _0x1a50fb=_0xe246[_0x554902];return _0x1a50fb;};'use strict';var _=require(_0x6e24('0x0'));var moment=require(_0x6e24('0x1'));var random=require(_0x6e24('0x2'));var fs=require('fs');var path=require(_0x6e24('0x3'));var util=require('util');var tnef=require(_0x6e24('0x4'));var logger=require(_0x6e24('0x5'))(_0x6e24('0x6'));var config=require(_0x6e24('0x7'));function getAddress(_0x1a550b){var _0x15ebdb=_['head'](_0x1a550b[_0x6e24('0x8')]);return _0x15ebdb&&_0x15ebdb['address']?_0x15ebdb['address']:_0x6e24('0x9')+random['generate'](0x6)+_0x6e24('0xa');}function getFirstName(_0x3a78f6){var _0x4822fa=_['head'](_0x3a78f6[_0x6e24('0x8')]);if(_0x4822fa&&_0x4822fa['name']){if(_0x4822fa[_0x6e24('0xb')]==_0x4822fa[_0x6e24('0xc')]){return _0x4822fa['name'][_0x6e24('0xd')](0x0,_0x4822fa[_0x6e24('0xb')][_0x6e24('0xe')]('@'));}var _0x17764d=_0x4822fa[_0x6e24('0xb')][_0x6e24('0xf')](/\s+/);return _0x17764d[_0x6e24('0x10')]>0x1?_0x17764d[_0x6e24('0x11')](0x0,-0x1)[_0x6e24('0x12')]('\x20'):_0x4822fa['name'];}return _0x6e24('0x13');}function getLastName(_0x555395){var _0x14fcfb=_['head'](_0x555395[_0x6e24('0x8')]);if(_0x14fcfb&&_0x14fcfb[_0x6e24('0xb')]){var _0x5928d9=_0x14fcfb[_0x6e24('0xb')][_0x6e24('0xf')](/\s+/);return _0x5928d9[_0x6e24('0x10')]>0x1?_0x5928d9[_0x6e24('0x14')]():'';}return'';}function getMails(_0x461b01,_0x230bd4){var _0x25adab='';for(var _0x4910f9=0x0;_0x4910f9<_0x230bd4[_0x6e24('0x8')][_0x6e24('0x10')];_0x4910f9+=0x1){if(_0x230bd4[_0x6e24('0x8')][_0x4910f9][_0x6e24('0xc')]!==_0x461b01){if(!_[_0x6e24('0x15')](_0x25adab)){_0x25adab+=',';}_0x25adab+=_0x230bd4[_0x6e24('0x8')][_0x4910f9][_0x6e24('0xb')]||_0x230bd4['value'][_0x4910f9][_0x6e24('0xc')]||'';_0x25adab+='\x20<';_0x25adab+=_0x230bd4[_0x6e24('0x8')][_0x4910f9][_0x6e24('0xc')]?_0x230bd4[_0x6e24('0x8')][_0x4910f9][_0x6e24('0xc')]:_0x6e24('0x9')+random[_0x6e24('0x16')](0x6)+_0x6e24('0xa');_0x25adab+='>';}}return _0x25adab;}function parseEmail(_0x3f48a5,_0x4648f9,_0x4ca8c1){if(_0x4648f9[_0x6e24('0x17')]){var _0x5988cc=/