From c523a8f291e4abdbce22d246b37dc02d12ce1851 Mon Sep 17 00:00:00 2001
From: support
Date: Wed, 23 Mar 2022 16:47:01 +0000
Subject: [PATCH] Built motion from commit e2d94e19.|2.6.7
---
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/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/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/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/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/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/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1189 files changed, 1189 insertions(+), 1189 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f49674e..d7a97fd 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-03-23T16:22:31.519Z",
+ "time": "2022-03-23T16:38:54.059Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index a2fca33..8830c69 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-23T16:22:31.519Z",
+ "time": "2022-03-23T16:38:54.059Z",
"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 8c62db2..acda025 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 _0x4f4c=['STRING','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x2be6e0,_0x5deab6){var _0x3ffa1b=function(_0x3bd2e8){while(--_0x3bd2e8){_0x2be6e0['push'](_0x2be6e0['shift']());}};_0x3ffa1b(++_0x5deab6);}(_0x4f4c,0x1f3));var _0xc4f4=function(_0x7140aa,_0x495b9b){_0x7140aa=_0x7140aa-0x0;var _0x6b0a41=_0x4f4c[_0x7140aa];return _0x6b0a41;};'use strict';var Sequelize=require(_0xc4f4('0x0'));module[_0xc4f4('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x36966c){return this[_0xc4f4('0x2')](_0xc4f4('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xc4f4('0x4'),_0xc4f4('0x5'),'motionbar',_0xc4f4('0x6'),_0xc4f4('0x7'),_0xc4f4('0x8'),_0xc4f4('0x9'),'script']],'msg':_0xc4f4('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc4f4('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xc4f4('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xc4f4('0xd')},'data4':{'type':Sequelize[_0xc4f4('0xe')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xc4f4('0xf')},'data6':{'type':Sequelize[_0xc4f4('0xe')],'comments':_0xc4f4('0x10')},'data7':{'type':Sequelize[_0xc4f4('0x11')],'comments':_0xc4f4('0x12')}};
\ No newline at end of file
+var _0xf682=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','urlForward','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)]'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0xf682,0x1a4));var _0x2f68=function(_0x2b309e,_0x2b5bb3){_0x2b309e=_0x2b309e-0x0;var _0x11d36a=_0xf682[_0x2b309e];return _0x11d36a;};'use strict';var Sequelize=require('sequelize');module[_0x2f68('0x0')]={'name':{'type':Sequelize[_0x2f68('0x1')],'get':function(_0x5d0565){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x2f68('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2f68('0x3'),_0x2f68('0x4'),_0x2f68('0x5'),_0x2f68('0x6'),_0x2f68('0x7'),'browser',_0x2f68('0x8'),_0x2f68('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x2f68('0xa')},'data1':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comment':_0x2f68('0xb')},'data2':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comment':_0x2f68('0xc')},'data3':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comment':_0x2f68('0xd')},'data4':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comments':_0x2f68('0xe')},'data5':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comments':_0x2f68('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x2f68('0x10')},'data7':{'type':Sequelize[_0x2f68('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 641bc7d..3378558 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 _0x5c11=['Action','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','send','body','catch'];(function(_0xf6e73a,_0x4c2776){var _0x364816=function(_0x223d6f){while(--_0x223d6f){_0xf6e73a['push'](_0xf6e73a['shift']());}};_0x364816(++_0x4c2776);}(_0x5c11,0x162));var _0x15c1=function(_0x33875d,_0xf2f624){_0x33875d=_0x33875d-0x0;var _0x477086=_0x5c11[_0x33875d];return _0x477086;};'use strict';var emlformat=require(_0x15c1('0x0'));var rimraf=require(_0x15c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15c1('0x2'));var rp=require(_0x15c1('0x3'));var moment=require(_0x15c1('0x4'));var BPromise=require(_0x15c1('0x5'));var Mustache=require(_0x15c1('0x6'));var util=require('util');var path=require(_0x15c1('0x7'));var sox=require(_0x15c1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15c1('0x9'));var squel=require(_0x15c1('0xa'));var crypto=require(_0x15c1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15c1('0xc'));var toCsv=require(_0x15c1('0xd'));var querystring=require(_0x15c1('0xe'));var Papa=require(_0x15c1('0xf'));var Redis=require(_0x15c1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x15c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15c1('0x12'));var utils=require(_0x15c1('0x13'));var config=require(_0x15c1('0x14'));var licenseUtil=require(_0x15c1('0x15'));var db=require(_0x15c1('0x16'))['db'];function respondWithStatusCode(_0x1977c4,_0x247740){_0x247740=_0x247740||0xcc;return function(_0xf828af){if(_0xf828af){return _0x1977c4[_0x15c1('0x17')](_0x247740);}return _0x1977c4[_0x15c1('0x18')](_0x247740)[_0x15c1('0x19')]();};}function respondWithResult(_0x105e31,_0x2b021f){_0x2b021f=_0x2b021f||0xc8;return function(_0x32bb71){if(_0x32bb71){return _0x105e31[_0x15c1('0x18')](_0x2b021f)[_0x15c1('0x1a')](_0x32bb71);}};}function respondWithFilteredResult(_0x5c7ae0,_0xdda389){return function(_0x46621e){if(_0x46621e){var _0x4495cd=typeof _0xdda389[_0x15c1('0x1b')]===_0x15c1('0x1c')&&typeof _0xdda389[_0x15c1('0x1d')]===_0x15c1('0x1c');var _0x4d6067=_0x46621e[_0x15c1('0x1e')];var _0x35b52a=_0x4495cd?0x0:_0xdda389[_0x15c1('0x1b')];var _0x143e3b=_0x4495cd?_0x46621e['count']:_0xdda389[_0x15c1('0x1b')]+_0xdda389[_0x15c1('0x1d')];var _0x4bbcc7;if(_0x143e3b>=_0x4d6067){_0x143e3b=_0x4d6067;_0x4bbcc7=0xc8;}else{_0x4bbcc7=0xce;}_0x5c7ae0[_0x15c1('0x18')](_0x4bbcc7);return _0x5c7ae0['set']('Content-Range',_0x35b52a+'-'+_0x143e3b+'/'+_0x4d6067)['json'](_0x46621e);}return null;};}function patchUpdates(_0xf9c651){return function(_0x4941e9){try{jsonpatch[_0x15c1('0x1f')](_0x4941e9,_0xf9c651,!![]);}catch(_0x45f8c6){return BPromise[_0x15c1('0x20')](_0x45f8c6);}return _0x4941e9[_0x15c1('0x21')]();};}function saveUpdates(_0x185126,_0x4d3832){return function(_0x14325e){if(_0x14325e){return _0x14325e[_0x15c1('0x22')](_0x185126)[_0x15c1('0x23')](function(_0xa8fc3b){return _0xa8fc3b;});}return null;};}function removeEntity(_0x584896,_0x2998ac){return function(_0x5597f6){if(_0x5597f6){return _0x5597f6[_0x15c1('0x24')]()['then'](function(){_0x584896[_0x15c1('0x18')](0xcc)[_0x15c1('0x19')]();});}};}function handleEntityNotFound(_0x3880fd,_0x34ea23){return function(_0x55bfd9){if(!_0x55bfd9){_0x3880fd[_0x15c1('0x17')](0x194);}return _0x55bfd9;};}function handleError(_0x4957dd,_0x2cc93d){_0x2cc93d=_0x2cc93d||0x1f4;return function(_0x423941){logger[_0x15c1('0x25')](_0x423941[_0x15c1('0x26')]);if(_0x423941['name']){delete _0x423941['name'];}_0x4957dd[_0x15c1('0x18')](_0x2cc93d)[_0x15c1('0x27')](_0x423941);};}exports[_0x15c1('0x22')]=function(_0x473279,_0x42dfa8){if(_0x473279[_0x15c1('0x28')]['id']){delete _0x473279[_0x15c1('0x28')]['id'];}return db['Action']['find']({'where':{'id':_0x473279['params']['id']}})[_0x15c1('0x23')](handleEntityNotFound(_0x42dfa8,null))[_0x15c1('0x23')](saveUpdates(_0x473279[_0x15c1('0x28')],null))[_0x15c1('0x23')](respondWithResult(_0x42dfa8,null))[_0x15c1('0x29')](handleError(_0x42dfa8,null));};exports['destroy']=function(_0x2d1983,_0x10c995){return db[_0x15c1('0x2a')][_0x15c1('0x2b')]({'where':{'id':_0x2d1983['params']['id']}})[_0x15c1('0x23')](handleEntityNotFound(_0x10c995,null))[_0x15c1('0x23')](removeEntity(_0x10c995,null))[_0x15c1('0x29')](handleError(_0x10c995,null));};
\ No newline at end of file
+var _0xfbbe=['count','offset','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','body','find','params','catch','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit'];(function(_0x3eb3ea,_0x410c83){var _0x80c20c=function(_0x33a3bf){while(--_0x33a3bf){_0x3eb3ea['push'](_0x3eb3ea['shift']());}};_0x80c20c(++_0x410c83);}(_0xfbbe,0x196));var _0xefbb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfbbe[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefbb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefbb('0x1'));var rp=require(_0xefbb('0x2'));var moment=require(_0xefbb('0x3'));var BPromise=require(_0xefbb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xefbb('0x5'));var sox=require(_0xefbb('0x6'));var csv=require(_0xefbb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xefbb('0x8'));var crypto=require('crypto');var jsforce=require(_0xefbb('0x9'));var deskjs=require(_0xefbb('0xa'));var toCsv=require(_0xefbb('0x7'));var querystring=require(_0xefbb('0xb'));var Papa=require(_0xefbb('0xc'));var Redis=require(_0xefbb('0xd'));var authService=require(_0xefbb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xefbb('0xf'));var hardwareService=require(_0xefbb('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xefbb('0x11'));var config=require(_0xefbb('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xefbb('0x13'))['db'];function respondWithStatusCode(_0x5d993d,_0x1abade){_0x1abade=_0x1abade||0xcc;return function(_0x4c5e95){if(_0x4c5e95){return _0x5d993d[_0xefbb('0x14')](_0x1abade);}return _0x5d993d['status'](_0x1abade)['end']();};}function respondWithResult(_0x5f5cf9,_0x58136d){_0x58136d=_0x58136d||0xc8;return function(_0x206cce){if(_0x206cce){return _0x5f5cf9[_0xefbb('0x15')](_0x58136d)['json'](_0x206cce);}};}function respondWithFilteredResult(_0x325a57,_0x197251){return function(_0x1de17c){if(_0x1de17c){var _0x121b0b=typeof _0x197251['offset']===_0xefbb('0x16')&&typeof _0x197251[_0xefbb('0x17')]==='undefined';var _0x14995f=_0x1de17c[_0xefbb('0x18')];var _0x3cd3b2=_0x121b0b?0x0:_0x197251[_0xefbb('0x19')];var _0x32cf1a=_0x121b0b?_0x1de17c[_0xefbb('0x18')]:_0x197251[_0xefbb('0x19')]+_0x197251[_0xefbb('0x17')];var _0x4b59eb;if(_0x32cf1a>=_0x14995f){_0x32cf1a=_0x14995f;_0x4b59eb=0xc8;}else{_0x4b59eb=0xce;}_0x325a57['status'](_0x4b59eb);return _0x325a57[_0xefbb('0x1a')](_0xefbb('0x1b'),_0x3cd3b2+'-'+_0x32cf1a+'/'+_0x14995f)[_0xefbb('0x1c')](_0x1de17c);}return null;};}function patchUpdates(_0x3f27cc){return function(_0xe5af47){try{jsonpatch[_0xefbb('0x1d')](_0xe5af47,_0x3f27cc,!![]);}catch(_0x1754c2){return BPromise[_0xefbb('0x1e')](_0x1754c2);}return _0xe5af47[_0xefbb('0x1f')]();};}function saveUpdates(_0x3d7a41,_0x14a9c2){return function(_0x7c0779){if(_0x7c0779){return _0x7c0779[_0xefbb('0x20')](_0x3d7a41)[_0xefbb('0x21')](function(_0x4a892c){return _0x4a892c;});}return null;};}function removeEntity(_0x56a4fa,_0xce8a90){return function(_0x33edc2){if(_0x33edc2){return _0x33edc2['destroy']()[_0xefbb('0x21')](function(){_0x56a4fa[_0xefbb('0x15')](0xcc)[_0xefbb('0x22')]();});}};}function handleEntityNotFound(_0x5398ee,_0x1a9455){return function(_0x598825){if(!_0x598825){_0x5398ee[_0xefbb('0x14')](0x194);}return _0x598825;};}function handleError(_0x3021eb,_0x18f4c0){_0x18f4c0=_0x18f4c0||0x1f4;return function(_0x1d9162){logger[_0xefbb('0x23')](_0x1d9162['stack']);if(_0x1d9162[_0xefbb('0x24')]){delete _0x1d9162['name'];}_0x3021eb[_0xefbb('0x15')](_0x18f4c0)[_0xefbb('0x25')](_0x1d9162);};}exports['update']=function(_0x3b13b5,_0x3e9fbc){if(_0x3b13b5[_0xefbb('0x26')]['id']){delete _0x3b13b5[_0xefbb('0x26')]['id'];}return db['Action'][_0xefbb('0x27')]({'where':{'id':_0x3b13b5[_0xefbb('0x28')]['id']}})[_0xefbb('0x21')](handleEntityNotFound(_0x3e9fbc,null))['then'](saveUpdates(_0x3b13b5['body'],null))[_0xefbb('0x21')](respondWithResult(_0x3e9fbc,null))[_0xefbb('0x29')](handleError(_0x3e9fbc,null));};exports[_0xefbb('0x2a')]=function(_0x365f44,_0x5b630d){return db['Action'][_0xefbb('0x27')]({'where':{'id':_0x365f44['params']['id']}})[_0xefbb('0x21')](handleEntityNotFound(_0x5b630d,null))[_0xefbb('0x21')](removeEntity(_0x5b630d,null))[_0xefbb('0x29')](handleError(_0x5b630d,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 3fa298d..1d8cc04 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 _0x291d=['./action.attributes','exports','tools_actions','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x124811,_0x3968ff){var _0xe73d91=function(_0x46b792){while(--_0x46b792){_0x124811['push'](_0x124811['shift']());}};_0xe73d91(++_0x3968ff);}(_0x291d,0x1d1));var _0xd291=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x291d[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require(_0xd291('0x0'));var logger=require(_0xd291('0x1'))(_0xd291('0x2'));var moment=require(_0xd291('0x3'));var BPromise=require('bluebird');var rp=require(_0xd291('0x4'));var fs=require('fs');var path=require(_0xd291('0x5'));var rimraf=require(_0xd291('0x6'));var config=require(_0xd291('0x7'));var attributes=require(_0xd291('0x8'));module[_0xd291('0x9')]=function(_0x251ae8,_0x271aff){return _0x251ae8['define']('Action',attributes,{'tableName':_0xd291('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x416b=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x4ce241,_0x3c80d8){var _0x4c0567=function(_0x48be5a){while(--_0x48be5a){_0x4ce241['push'](_0x4ce241['shift']());}};_0x4c0567(++_0x3c80d8);}(_0x416b,0x1c8));var _0xb416=function(_0x2c1ac1,_0x3dfb07){_0x2c1ac1=_0x2c1ac1-0x0;var _0x240e2d=_0x416b[_0x2c1ac1];return _0x240e2d;};'use strict';var _=require(_0xb416('0x0'));var util=require(_0xb416('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb416('0x2'));var BPromise=require('bluebird');var rp=require(_0xb416('0x3'));var fs=require('fs');var path=require(_0xb416('0x4'));var rimraf=require(_0xb416('0x5'));var config=require(_0xb416('0x6'));var attributes=require(_0xb416('0x7'));module[_0xb416('0x8')]=function(_0x386517,_0x35bf96){return _0x386517[_0xb416('0x9')](_0xb416('0xa'),attributes,{'tableName':_0xb416('0xb'),'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 a3ae935..c69cc47 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0xf494,0x1c6));var _0x4f49=function(_0x3fe4a2,_0x40d6b7){_0x3fe4a2=_0x3fe4a2-0x0;var _0x3d9747=_0xf494[_0x3fe4a2];return _0x3d9747;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x53ec,0x192));var _0xc53e=function(_0x27787d,_0x3c832a){_0x27787d=_0x27787d-0x0;var _0x2ec19c=_0x53ec[_0x27787d];return _0x2ec19c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 3b3d28a..898e2b1 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 _0x0b20=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','destroy'];(function(_0x5f0df8,_0x25e88d){var _0x284b13=function(_0x3a1ec9){while(--_0x3a1ec9){_0x5f0df8['push'](_0x5f0df8['shift']());}};_0x284b13(++_0x25e88d);}(_0x0b20,0x151));var _0x00b2=function(_0x339d18,_0x2ce5cb){_0x339d18=_0x339d18-0x0;var _0x5be285=_0x0b20[_0x339d18];return _0x5be285;};'use strict';var multer=require('multer');var util=require(_0x00b2('0x0'));var path=require(_0x00b2('0x1'));var timeout=require(_0x00b2('0x2'));var express=require(_0x00b2('0x3'));var router=express[_0x00b2('0x4')]();var fs_extra=require(_0x00b2('0x5'));var auth=require(_0x00b2('0x6'));var interaction=require(_0x00b2('0x7'));var config=require(_0x00b2('0x8'));var controller=require(_0x00b2('0x9'));router[_0x00b2('0xa')]('/:id',auth[_0x00b2('0xb')](),controller[_0x00b2('0xc')]);router[_0x00b2('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x00b2('0xe')]);module[_0x00b2('0xf')]=router;
\ No newline at end of file
+var _0x0fe7=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x0fe7,0x108));var _0x70fe=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0fe7[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x70fe('0x0'));var util=require(_0x70fe('0x1'));var path=require(_0x70fe('0x2'));var timeout=require(_0x70fe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x70fe('0x4'));var interaction=require(_0x70fe('0x5'));var config=require(_0x70fe('0x6'));var controller=require(_0x70fe('0x7'));router[_0x70fe('0x8')](_0x70fe('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x70fe('0xa')](_0x70fe('0x9'),auth[_0x70fe('0xb')](),controller[_0x70fe('0xc')]);module[_0x70fe('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index dd26c1d..b6935a1 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x46ed,0x168));var _0xd46e=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x46ed[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0xd92880,_0xbf75a6){var _0x12f128=function(_0x4b313c){while(--_0x4b313c){_0xd92880['push'](_0xd92880['shift']());}};_0x12f128(++_0xbf75a6);}(_0x53ec,0x192));var _0xc53e=function(_0x213aac,_0x30117f){_0x213aac=_0x213aac-0x0;var _0x20bc6f=_0x53ec[_0x213aac];return _0x20bc6f;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 720cb43..ae81fc3 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 _0x838a=['VIRTUAL','options','AnalyticCustomReport','include','findAll','rows','show','params','includeAll','find','create','body','user','get','role','Reports','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','AVG(%s)','getFields','ValidationErrorItem','DESC','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','runReport','SEC_TO_TIME(%s)','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','destroy','then','CustomReports','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x512b7e,_0x1903a0){var _0x5c8530=function(_0x217c82){while(--_0x217c82){_0x512b7e['push'](_0x512b7e['shift']());}};_0x5c8530(++_0x1903a0);}(_0x838a,0x65));var _0xa838=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x838a[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa838('0x0'));var jsonpatch=require(_0xa838('0x1'));var rp=require(_0xa838('0x2'));var moment=require(_0xa838('0x3'));var BPromise=require(_0xa838('0x4'));var Mustache=require(_0xa838('0x5'));var util=require(_0xa838('0x6'));var path=require(_0xa838('0x7'));var sox=require(_0xa838('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa838('0x9'));var _=require(_0xa838('0xa'));var squel=require(_0xa838('0xb'));var crypto=require(_0xa838('0xc'));var jsforce=require(_0xa838('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa838('0xe'));var Papa=require('papaparse');var Redis=require(_0xa838('0xf'));var authService=require(_0xa838('0x10'));var qs=require(_0xa838('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa838('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa838('0x13'));var db=require(_0xa838('0x14'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x2780d8,_0x3838c1){_0x3838c1=_0x3838c1||0xcc;return function(_0x5b0769){if(_0x5b0769){return _0x2780d8[_0xa838('0x15')](_0x3838c1);}return _0x2780d8[_0xa838('0x16')](_0x3838c1)[_0xa838('0x17')]();};}function respondWithResult(_0x5c8972,_0x3a4a20){_0x3a4a20=_0x3a4a20||0xc8;return function(_0x8544ba){if(_0x8544ba){return _0x5c8972[_0xa838('0x16')](_0x3a4a20)['json'](_0x8544ba);}};}function respondWithFilteredResult(_0x3b6bdc,_0x4083aa){return function(_0x16bad2){if(_0x16bad2){var _0x16d074=typeof _0x4083aa[_0xa838('0x18')]==='undefined'&&typeof _0x4083aa[_0xa838('0x19')]===_0xa838('0x1a');var _0x2e566c=_0x16bad2['count'];var _0x388097=_0x16d074?0x0:_0x4083aa[_0xa838('0x18')];var _0x1e1e29=_0x16d074?_0x16bad2[_0xa838('0x1b')]:_0x4083aa[_0xa838('0x18')]+_0x4083aa[_0xa838('0x19')];var _0xa85514;if(_0x1e1e29>=_0x2e566c){_0x1e1e29=_0x2e566c;_0xa85514=0xc8;}else{_0xa85514=0xce;}_0x3b6bdc[_0xa838('0x16')](_0xa85514);return _0x3b6bdc[_0xa838('0x1c')](_0xa838('0x1d'),_0x388097+'-'+_0x1e1e29+'/'+_0x2e566c)[_0xa838('0x1e')](_0x16bad2);}return null;};}function patchUpdates(_0x4fbe38){return function(_0x1fbf7a){try{jsonpatch[_0xa838('0x1f')](_0x1fbf7a,_0x4fbe38,!![]);}catch(_0x14e518){return BPromise['reject'](_0x14e518);}return _0x1fbf7a['save']();};}function saveUpdates(_0x145943,_0x40633a){return function(_0x279f8e){if(_0x279f8e){return _0x279f8e[_0xa838('0x20')](_0x145943)['then'](function(_0x4a5b1e){return _0x4a5b1e;});}return null;};}function removeEntity(_0x436aa3,_0x510211){return function(_0x4648d7){if(_0x4648d7){return _0x4648d7[_0xa838('0x21')]()[_0xa838('0x22')](function(){var _0x36e1a1=_0x4648d7['get']({'plain':!![]});var _0x263b0c=_0xa838('0x23');return db[_0xa838('0x24')][_0xa838('0x21')]({'where':{'type':_0x263b0c,'resourceId':_0x36e1a1['id']}})[_0xa838('0x22')](function(){return _0x4648d7;});})[_0xa838('0x22')](function(){_0x436aa3[_0xa838('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5263d1,_0x48066c){return function(_0x5badc3){if(!_0x5badc3){_0x5263d1[_0xa838('0x15')](0x194);}return _0x5badc3;};}function handleError(_0xaece71,_0x52809d){_0x52809d=_0x52809d||0x1f4;return function(_0x205087){logger[_0xa838('0x25')](_0x205087['stack']);if(_0x205087[_0xa838('0x26')]){delete _0x205087['name'];}_0xaece71['status'](_0x52809d)[_0xa838('0x27')](_0x205087);};}exports[_0xa838('0x28')]=function(_0x36a238,_0x118272){var _0x38c167={},_0x4753a4={},_0x22da7d={'count':0x0,'rows':[]};var _0x13f1d2=_[_0xa838('0x29')](db['AnalyticCustomReport'][_0xa838('0x2a')],function(_0x265c2d){return{'name':_0x265c2d[_0xa838('0x2b')],'type':_0x265c2d[_0xa838('0x2c')]['key']};});_0x4753a4[_0xa838('0x2d')]=_[_0xa838('0x29')](_0x13f1d2,_0xa838('0x26'));_0x4753a4['query']=_[_0xa838('0x2e')](_0x36a238[_0xa838('0x2f')]);_0x4753a4[_0xa838('0x30')]=_[_0xa838('0x31')](_0x4753a4['model'],_0x4753a4[_0xa838('0x2f')]);_0x38c167[_0xa838('0x32')]=_[_0xa838('0x31')](_0x4753a4['model'],qs[_0xa838('0x33')](_0x36a238[_0xa838('0x2f')][_0xa838('0x33')]));_0x38c167[_0xa838('0x32')]=_0x38c167[_0xa838('0x32')][_0xa838('0x34')]?_0x38c167[_0xa838('0x32')]:_0x4753a4[_0xa838('0x2d')];if(!_0x36a238[_0xa838('0x2f')]['hasOwnProperty'](_0xa838('0x35'))){_0x38c167[_0xa838('0x19')]=qs[_0xa838('0x19')](_0x36a238[_0xa838('0x2f')]['limit']);_0x38c167[_0xa838('0x18')]=qs[_0xa838('0x18')](_0x36a238[_0xa838('0x2f')][_0xa838('0x18')]);}_0x38c167[_0xa838('0x36')]=qs[_0xa838('0x37')](_0x36a238['query']['sort']);_0x38c167[_0xa838('0x38')]=qs['filters'](_[_0xa838('0x39')](_0x36a238[_0xa838('0x2f')],_0x4753a4[_0xa838('0x30')]),_0x13f1d2);if(_0x36a238[_0xa838('0x2f')][_0xa838('0x3a')]){_0x38c167[_0xa838('0x38')]=_[_0xa838('0x3b')](_0x38c167[_0xa838('0x38')],{'$or':_['map'](_0x13f1d2,function(_0x5d4211){if(_0x5d4211['type']!==_0xa838('0x3c')){var _0x3bfd54={};_0x3bfd54[_0x5d4211[_0xa838('0x26')]]={'$like':'%'+_0x36a238[_0xa838('0x2f')][_0xa838('0x3a')]+'%'};return _0x3bfd54;}})});}_0x38c167=_[_0xa838('0x3b')]({},_0x38c167,_0x36a238[_0xa838('0x3d')]);var _0x539be8={'where':_0x38c167[_0xa838('0x38')]};return db[_0xa838('0x3e')][_0xa838('0x1b')](_0x539be8)[_0xa838('0x22')](function(_0x1c5a40){_0x22da7d[_0xa838('0x1b')]=_0x1c5a40;if(_0x36a238['query']['includeAll']){_0x38c167[_0xa838('0x3f')]=[{'all':!![]}];}return db[_0xa838('0x3e')][_0xa838('0x40')](_0x38c167);})[_0xa838('0x22')](function(_0x44b3ae){_0x22da7d[_0xa838('0x41')]=_0x44b3ae;return _0x22da7d;})[_0xa838('0x22')](respondWithFilteredResult(_0x118272,_0x38c167))['catch'](handleError(_0x118272,null));};exports[_0xa838('0x42')]=function(_0x18bb5e,_0x20f50a){var _0x7f044c={'raw':![],'where':{'id':_0x18bb5e[_0xa838('0x43')]['id']}},_0x55fb14={};_0x55fb14[_0xa838('0x2d')]=_['keys'](db[_0xa838('0x3e')][_0xa838('0x2a')]);_0x55fb14['query']=_['keys'](_0x18bb5e[_0xa838('0x2f')]);_0x55fb14[_0xa838('0x30')]=_[_0xa838('0x31')](_0x55fb14[_0xa838('0x2d')],_0x55fb14[_0xa838('0x2f')]);_0x7f044c[_0xa838('0x32')]=_[_0xa838('0x31')](_0x55fb14['model'],qs[_0xa838('0x33')](_0x18bb5e[_0xa838('0x2f')][_0xa838('0x33')]));_0x7f044c[_0xa838('0x32')]=_0x7f044c[_0xa838('0x32')][_0xa838('0x34')]?_0x7f044c['attributes']:_0x55fb14[_0xa838('0x2d')];if(_0x18bb5e[_0xa838('0x2f')][_0xa838('0x44')]){_0x7f044c['include']=[{'all':!![]}];}_0x7f044c=_[_0xa838('0x3b')]({},_0x7f044c,_0x18bb5e[_0xa838('0x3d')]);return db[_0xa838('0x3e')][_0xa838('0x45')](_0x7f044c)[_0xa838('0x22')](handleEntityNotFound(_0x20f50a,null))['then'](respondWithResult(_0x20f50a,null))['catch'](handleError(_0x20f50a,null));};exports['create']=function(_0x26cc26,_0x265833){return db[_0xa838('0x3e')][_0xa838('0x46')](_0x26cc26[_0xa838('0x47')],{})[_0xa838('0x22')](function(_0x25db58){var _0x2c6c2d=_0x26cc26[_0xa838('0x48')][_0xa838('0x49')]({'plain':!![]});if(!_0x2c6c2d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c6c2d[_0xa838('0x4a')]==='user'){var _0x2e21d9=_0x25db58['get']({'plain':!![]});var _0x597a1f=_0xa838('0x4b');return db[_0xa838('0x4c')]['find']({'where':{'name':_0x597a1f,'userProfileId':_0x2c6c2d[_0xa838('0x4d')]},'raw':!![]})['then'](function(_0x18ad18){if(_0x18ad18&&_0x18ad18[_0xa838('0x4e')]===0x0){return db[_0xa838('0x24')][_0xa838('0x46')]({'name':_0x2e21d9[_0xa838('0x26')],'resourceId':_0x2e21d9['id'],'type':_0xa838('0x23'),'sectionId':_0x18ad18['id']},{})['then'](function(){return _0x25db58;});}else{return _0x25db58;}})[_0xa838('0x4f')](function(_0x364bd0){logger[_0xa838('0x25')](_0xa838('0x50'),_0x364bd0);throw _0x364bd0;});}return _0x25db58;})[_0xa838('0x22')](respondWithResult(_0x265833,0xc9))[_0xa838('0x4f')](handleError(_0x265833,null));};exports[_0xa838('0x20')]=function(_0x70511f,_0x21cf67){if(_0x70511f['body']['id']){delete _0x70511f['body']['id'];}return db[_0xa838('0x3e')][_0xa838('0x45')]({'where':{'id':_0x70511f[_0xa838('0x43')]['id']}})['then'](handleEntityNotFound(_0x21cf67,null))['then'](saveUpdates(_0x70511f[_0xa838('0x47')],null))['then'](respondWithResult(_0x21cf67,null))[_0xa838('0x4f')](handleError(_0x21cf67,null));};exports[_0xa838('0x21')]=function(_0x4a0317,_0x5b7858){return db[_0xa838('0x3e')]['find']({'where':{'id':_0x4a0317[_0xa838('0x43')]['id']}})[_0xa838('0x22')](handleEntityNotFound(_0x5b7858,null))[_0xa838('0x22')](removeEntity(_0x5b7858,null))[_0xa838('0x4f')](handleError(_0x5b7858,null));};exports[_0xa838('0x51')]=function(_0x5e7c57,_0x1d9560){var _0x5194f0=0xa;var _0x129afb=[_0xa838('0x52'),_0xa838('0x53'),_0xa838('0x54'),_0xa838('0x55')];var _0x2dd0ab={'SUM':_0xa838('0x56'),'COUNT':_0xa838('0x57'),'COUNT DISTINCT':_0xa838('0x58'),'MAX':_0xa838('0x59'),'MIN':_0xa838('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa838('0x5b'),'GROUP_CONCAT ASC':_0xa838('0x5c'),'GROUP_CONCAT DESC':_0xa838('0x5d')};var _0x3a0443={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa838('0x5e'),'HOUR':_0xa838('0x5f'),'ROUND':_0xa838('0x60'),'UNIX_TIMESTAMP':_0xa838('0x61')};var _0x3986c3=function(_0x5c587d){return!_[_0xa838('0x62')]([_0xa838('0x63'),_0xa838('0x64'),_0xa838('0x65'),_0xa838('0x66')],_0x5c587d);};var _0x1c6ced=function(_0x31ab5f){if(!_0x31ab5f||!_0x31ab5f[_0xa838('0x67')]['length']){return'';}for(var _0x51f3a2='(',_0x2e59b8=0x0;_0x2e59b8<_0x31ab5f[_0xa838('0x67')][_0xa838('0x34')];_0x2e59b8+=0x1){_0x2e59b8>0x0&&(_0x51f3a2+='\x20'+_0x31ab5f[_0xa838('0x68')]+'\x20');_0x51f3a2+=_0x31ab5f[_0xa838('0x67')][_0x2e59b8][_0xa838('0x69')]?_0x1c6ced(_0x31ab5f[_0xa838('0x67')][_0x2e59b8]['group']):_0x31ab5f['rules'][_0x2e59b8][_0xa838('0x6a')]+'\x20'+_0x31ab5f['rules'][_0x2e59b8][_0xa838('0x6b')]+(_0x3986c3(_0x31ab5f[_0xa838('0x67')][_0x2e59b8][_0xa838('0x6b')])?'\x20'+_0x31ab5f[_0xa838('0x67')][_0x2e59b8][_0xa838('0x6c')]:'');}return _0x51f3a2+')';};var _0x4997a2={'where':{'id':_0x5e7c57['params']['id']}},_0x32fc10,_0x22c2f4,_0x50f1ce,_0x56bf5d,_0x2cbae3;_0x4997a2=_[_0xa838('0x3b')]({},_0x4997a2,_0x5e7c57['options']);return db[_0xa838('0x3e')][_0xa838('0x45')](_0x4997a2)['then'](function(_0x3e0030){if(_0x3e0030){_0x32fc10=_0x3e0030;return _0x3e0030['getFields']();}return null;})[_0xa838('0x22')](function(_0x16a921){if(_0x16a921){if(!_0x16a921[_0xa838('0x34')]){throw new db[(_0xa838('0x6d'))]['ValidationErrorItem'](_0xa838('0x6e'),0x193);}_0x22c2f4=_0x16a921;return db[_0xa838('0x6f')][_0xa838('0x40')]({'raw':!![]});}return null;})['then'](function(_0x2f45da){if(_0x2f45da){_0x50f1ce=_[_0xa838('0x70')](_0x2f45da,'id');var _0x4eb0be;var _0x298dd1=squel[_0xa838('0x71')]();_0x298dd1[_0xa838('0x72')](_0x32fc10[_0xa838('0x73')]);for(var _0x14ab38=0x0;_0x14ab38<_0x22c2f4[_0xa838('0x34')];_0x14ab38+=0x1){_0x4eb0be=_0x22c2f4[_0x14ab38][_0xa838('0x74')]?_0x50f1ce[_0x22c2f4[_0x14ab38][_0xa838('0x74')]][_0xa838('0x75')]:_0x22c2f4[_0x14ab38][_0xa838('0x6a')];_0x4eb0be=_0x22c2f4[_0x14ab38][_0xa838('0x76')]?_[_0xa838('0x77')](_0x2dd0ab[_0x22c2f4[_0x14ab38][_0xa838('0x76')]],'%s',_0x4eb0be):_0x4eb0be;_0x4eb0be=_0x22c2f4[_0x14ab38][_0xa838('0x78')]?_[_0xa838('0x77')](_0x3a0443[_0x22c2f4[_0x14ab38][_0xa838('0x78')]],'%s',_0x4eb0be):_0x4eb0be;if(_0x22c2f4[_0x14ab38]['groupBy']){_0x298dd1['group'](_0x4eb0be);}_0x22c2f4[_0x14ab38][_0xa838('0x79')]&&_0x298dd1[_0xa838('0x36')](_0x4eb0be,_0x22c2f4[_0x14ab38][_0xa838('0x79')]==='DESC'?![]:!![]);_0x298dd1[_0xa838('0x6a')](_0x4eb0be,_0x22c2f4[_0x14ab38][_0xa838('0x7a')]||_0x4eb0be);}if(_0x32fc10[_0xa838('0x7b')]){_0x32fc10[_0xa838('0x7b')]=JSON[_0xa838('0x7c')](_0x32fc10[_0xa838('0x7b')]);for(var _0x396a32=0x0;_0x396a32<_0x32fc10['joins'][_0xa838('0x34')];_0x396a32+=0x1){if(_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x2c')]&&_[_0xa838('0x62')](_0x129afb,_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x2c')])&&_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x7d')]&&_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x7e')]&&_0x32fc10[_0xa838('0x7b')][_0x396a32]['foreignKey']){_0x298dd1[_0x32fc10['joins'][_0x396a32][_0xa838('0x2c')]](_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x7e')],null,util[_0xa838('0x78')](_0xa838('0x7f'),_0x32fc10[_0xa838('0x73')],_0x32fc10['joins'][_0x396a32][_0xa838('0x7d')],_0x32fc10['joins'][_0x396a32]['foreignTable'],_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x80')]));}}}if(_0x32fc10[_0xa838('0x81')]){_0x32fc10[_0xa838('0x81')]=JSON['parse'](_0x32fc10[_0xa838('0x81')]);_0x298dd1[_0xa838('0x38')](_0x1c6ced(_0x32fc10[_0xa838('0x81')][_0xa838('0x69')]));}_0x2cbae3=_0x298dd1[_0xa838('0x82')]();_0x298dd1['limit'](_0x5194f0);_0x298dd1[_0xa838('0x18')](0x0);logger[_0xa838('0x83')](_0xa838('0x84'),_0x298dd1[_0xa838('0x85')]());return dbH[_0xa838('0x86')]['query'](_0x298dd1[_0xa838('0x85')](),{'type':dbH['sequelize'][_0xa838('0x87')][_0xa838('0x88')]});}})[_0xa838('0x22')](respondWithResult(_0x1d9560,null))['catch'](handleError(_0x1d9560,null));};function runReport(_0x587e68,_0x459e2a,_0x86d35){var _0xe67b0a=_0x459e2a[_0xa838('0x26')];var _0x7740da=0xa;var _0xba040b=[_0xa838('0x52'),_0xa838('0x53'),_0xa838('0x54'),_0xa838('0x55')];var _0x2e050b={'SUM':_0xa838('0x56'),'COUNT':_0xa838('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa838('0x59'),'MIN':_0xa838('0x5a'),'AVG':_0xa838('0x89'),'GROUP_CONCAT':_0xa838('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa838('0x5d')};var _0x17412f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa838('0x5e'),'HOUR':_0xa838('0x5f'),'ROUND':_0xa838('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d400c=function(_0x314561){return!_[_0xa838('0x62')]([_0xa838('0x63'),_0xa838('0x64'),_0xa838('0x65'),_0xa838('0x66')],_0x314561);};var _0x550c08=function(_0x37df24){if(!_0x37df24||!_0x37df24[_0xa838('0x67')][_0xa838('0x34')]){return'';}for(var _0x3c25bf='(',_0x4959d2=0x0;_0x4959d2<_0x37df24['rules'][_0xa838('0x34')];_0x4959d2+=0x1){_0x4959d2>0x0&&(_0x3c25bf+='\x20'+_0x37df24['operator']+'\x20');_0x3c25bf+=_0x37df24[_0xa838('0x67')][_0x4959d2]['group']?_0x550c08(_0x37df24[_0xa838('0x67')][_0x4959d2][_0xa838('0x69')]):_0x37df24[_0xa838('0x67')][_0x4959d2][_0xa838('0x6a')]+'\x20'+_0x37df24[_0xa838('0x67')][_0x4959d2][_0xa838('0x6b')]+(_0x2d400c(_0x37df24[_0xa838('0x67')][_0x4959d2][_0xa838('0x6b')])?'\x20'+_0x37df24[_0xa838('0x67')][_0x4959d2]['value']:'');}return _0x3c25bf+')';};var _0x5d6bc4={'where':{'id':_0x587e68['id']}},_0xa1ddec,_0x1c3e49,_0x48f364,_0x210e2f,_0x533fc8;_0x5d6bc4=_['merge']({},_0x5d6bc4,_0x86d35);return db[_0xa838('0x3e')][_0xa838('0x45')](_0x5d6bc4)[_0xa838('0x22')](function(_0x460b09){if(_0x460b09){_0xa1ddec=_0x460b09;return _0x460b09[_0xa838('0x8a')]();}return null;})[_0xa838('0x22')](function(_0xbbf8c8){if(_0xbbf8c8){if(!_0xbbf8c8['length']){throw new db[(_0xa838('0x6d'))][(_0xa838('0x8b'))](_0xa838('0x6e'),0x193);}_0x1c3e49=_0xbbf8c8;return db[_0xa838('0x6f')][_0xa838('0x40')]({'raw':!![]});}return null;})[_0xa838('0x22')](function(_0x10a45e){if(_0x10a45e){_0x48f364=_['keyBy'](_0x10a45e,'id');var _0x36da60;var _0x22e7e6=squel['select']();_0x22e7e6[_0xa838('0x72')](_0xa1ddec[_0xa838('0x73')]);for(var _0x1a4c83=0x0;_0x1a4c83<_0x1c3e49[_0xa838('0x34')];_0x1a4c83+=0x1){_0x36da60=_0x1c3e49[_0x1a4c83]['MetricId']?_0x48f364[_0x1c3e49[_0x1a4c83]['MetricId']]['metric']:_0x1c3e49[_0x1a4c83]['field'];_0x36da60=_0x1c3e49[_0x1a4c83]['function']?_['replace'](_0x2e050b[_0x1c3e49[_0x1a4c83]['function']],'%s',_0x36da60):_0x36da60;_0x36da60=_0x1c3e49[_0x1a4c83][_0xa838('0x78')]?_['replace'](_0x17412f[_0x1c3e49[_0x1a4c83][_0xa838('0x78')]],'%s',_0x36da60):_0x36da60;if(_0x1c3e49[_0x1a4c83]['groupBy']){_0x22e7e6['group'](_0x36da60);}_0x1c3e49[_0x1a4c83]['orderBy']&&_0x22e7e6['order'](_0x36da60,_0x1c3e49[_0x1a4c83][_0xa838('0x79')]===_0xa838('0x8c')?![]:!![]);_0x22e7e6['field'](_0x36da60,_0x1c3e49[_0x1a4c83][_0xa838('0x7a')]||_0x36da60);}if(_0xa1ddec['joins']){_0xa1ddec['joins']=JSON[_0xa838('0x7c')](_0xa1ddec[_0xa838('0x7b')]);for(var _0x29d547=0x0;_0x29d547<_0xa1ddec[_0xa838('0x7b')][_0xa838('0x34')];_0x29d547+=0x1){if(_0xa1ddec[_0xa838('0x7b')][_0x29d547][_0xa838('0x2c')]&&_[_0xa838('0x62')](_0xba040b,_0xa1ddec[_0xa838('0x7b')][_0x29d547][_0xa838('0x2c')])&&_0xa1ddec['joins'][_0x29d547][_0xa838('0x7d')]&&_0xa1ddec['joins'][_0x29d547][_0xa838('0x7e')]&&_0xa1ddec[_0xa838('0x7b')][_0x29d547]['foreignKey']){_0x22e7e6[_0xa1ddec['joins'][_0x29d547]['type']](_0xa1ddec['joins'][_0x29d547][_0xa838('0x7e')],null,util['format'](_0xa838('0x7f'),_0xa1ddec[_0xa838('0x73')],_0xa1ddec['joins'][_0x29d547][_0xa838('0x7d')],_0xa1ddec['joins'][_0x29d547][_0xa838('0x7e')],_0xa1ddec[_0xa838('0x7b')][_0x29d547][_0xa838('0x80')]));}}}if(_0xa1ddec[_0xa838('0x81')]){_0xa1ddec[_0xa838('0x81')]=JSON[_0xa838('0x7c')](_0xa1ddec['conditions']);_0x22e7e6[_0xa838('0x38')](_0x550c08(_0xa1ddec[_0xa838('0x81')][_0xa838('0x69')]));}_0x533fc8=_0x22e7e6['clone']();_0x22e7e6['limit'](_0x7740da);_0x22e7e6[_0xa838('0x18')](0x0);return;}})[_0xa838('0x22')](function(){if(_0x459e2a[_0xa838('0x8d')]===_0xa838('0x8e')){return null;}var _0x11f6ba=_[_0xa838('0x3b')](_0x459e2a,{'name':_0x459e2a[_0xa838('0x8f')]||_0x459e2a[_0xa838('0x26')]||_0xa1ddec[_0xa838('0x26')],'basename':_0xe67b0a,'savename':util[_0xa838('0x78')](_0xa838('0x90'),_0x459e2a['name']||_0xa1ddec['name'],require('randomstring')['generate'](0x4),_0x459e2a['output']||_0xa838('0x91')),'reportId':_0xa1ddec['id'],'reportType':_0xa838('0x92')});return db[_0xa838('0x93')][_0xa838('0x46')](_0x11f6ba,{'raw':!![]});})[_0xa838('0x22')](function(_0x246aae){if(_0xa1ddec['table']===_0xa838('0x94')){_0x533fc8[_0xa838('0x38')](_0xa1ddec[_0xa838('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x459e2a[_0xa838('0x95')],_0x459e2a[_0xa838('0x96')]);}else{_0x533fc8[_0xa838('0x38')](_0xa1ddec[_0xa838('0x73')]+_0xa838('0x97'),_0x459e2a['startDate'],_0x459e2a[_0xa838('0x96')]);}if(_0x246aae){logger[_0xa838('0x98')](_0xa838('0x99'),_0x533fc8['toString']());require(_0xa838('0x9a'))[_0xa838('0x9b')](path[_0xa838('0x52')](__dirname,'../../components/export/',_0x246aae[_0xa838('0x8d')]),[_0x246aae['id'],_0x533fc8[_0xa838('0x85')](),path[_0xa838('0x52')](__dirname,_0xa838('0x9c'),_0x246aae[_0xa838('0x9d')]),_0xe67b0a]);return _0x246aae;}else{var _0x539a48=squel[_0xa838('0x71')]();_0x539a48[_0xa838('0x72')]('('+_0x533fc8[_0xa838('0x85')]()+')','countTable');_0x539a48['field'](_0xa838('0x9e'),_0xa838('0x1b'));_0x533fc8['limit'](_0x459e2a[_0xa838('0x19')]||_0x7740da);_0x533fc8[_0xa838('0x18')](_0x459e2a[_0xa838('0x18')]||0x0);return dbH['sequelize']['query'](_0x539a48[_0xa838('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xa838('0x88')]})[_0xa838('0x22')](function(_0x2d389e){if(!_0x2d389e[_0xa838('0x34')]){_0x210e2f=0x0;}else{_0x210e2f=_0x2d389e[0x0][_0xa838('0x1b')]||0x0;}return dbH[_0xa838('0x86')][_0xa838('0x2f')](_0x533fc8[_0xa838('0x85')](),{'type':dbH[_0xa838('0x86')]['QueryTypes'][_0xa838('0x88')]});})[_0xa838('0x22')](function(_0x4bbc83){return{'rows':_0x4bbc83||[],'count':_0x210e2f};});}});}exports['run']=function(_0x59dad4,_0xa283e4){return runReport(_0x59dad4[_0xa838('0x43')],_0x59dad4[_0xa838('0x2f')],_0x59dad4[_0xa838('0x3d')])['then'](respondWithResult(_0xa283e4,null))[_0xa838('0x4f')](handleError(_0xa283e4,null));};exports[_0xa838('0x9f')]=runReport;exports['query']=function(_0x5c1351,_0x1fcce8){var _0x36c6ec=0xa;var _0xe2e32b=[_0xa838('0x52'),'left_join','right_join',_0xa838('0x55')];var _0x348c05={'SUM':_0xa838('0x56'),'COUNT':_0xa838('0x57'),'COUNT DISTINCT':_0xa838('0x58'),'MAX':_0xa838('0x59'),'MIN':_0xa838('0x5a'),'AVG':_0xa838('0x89'),'GROUP_CONCAT':_0xa838('0x5b'),'GROUP_CONCAT ASC':_0xa838('0x5c'),'GROUP_CONCAT DESC':_0xa838('0x5d')};var _0x5d8893={'SEC_TO_TIME':_0xa838('0xa0'),'DATE':_0xa838('0x5e'),'HOUR':_0xa838('0x5f'),'ROUND':_0xa838('0x60'),'UNIX_TIMESTAMP':_0xa838('0x61')};var _0x34ecfd=function(_0x3081ee){return!_[_0xa838('0x62')]([_0xa838('0x63'),_0xa838('0x64'),_0xa838('0x65'),_0xa838('0x66')],_0x3081ee);};var _0xc40fba=function(_0x3c6b89){if(!_0x3c6b89||!_0x3c6b89['rules'][_0xa838('0x34')]){return'';}for(var _0x2f1abc='(',_0x2ada56=0x0;_0x2ada56<_0x3c6b89['rules'][_0xa838('0x34')];_0x2ada56+=0x1){_0x2ada56>0x0&&(_0x2f1abc+='\x20'+_0x3c6b89['operator']+'\x20');_0x2f1abc+=_0x3c6b89['rules'][_0x2ada56]['group']?_0xc40fba(_0x3c6b89[_0xa838('0x67')][_0x2ada56]['group']):_0x3c6b89[_0xa838('0x67')][_0x2ada56]['field']+'\x20'+_0x3c6b89[_0xa838('0x67')][_0x2ada56][_0xa838('0x6b')]+(_0x34ecfd(_0x3c6b89[_0xa838('0x67')][_0x2ada56]['condition'])?'\x20'+_0x3c6b89['rules'][_0x2ada56][_0xa838('0x6c')]:'');}return _0x2f1abc+')';};var _0x2ff7f6={'where':{'id':_0x5c1351[_0xa838('0x43')]['id']}},_0x3dc755,_0x17089b,_0x4379f8,_0x4137a6,_0x2750e4;_0x2ff7f6=_['merge']({},_0x2ff7f6,_0x5c1351[_0xa838('0x3d')]);return db['AnalyticCustomReport'][_0xa838('0x45')](_0x2ff7f6)[_0xa838('0x22')](function(_0x4fe118){if(_0x4fe118){_0x3dc755=_0x4fe118;return _0x4fe118[_0xa838('0x8a')]();}return null;})[_0xa838('0x22')](function(_0x56d1e1){if(_0x56d1e1){if(!_0x56d1e1[_0xa838('0x34')]){throw new db[(_0xa838('0x6d'))][(_0xa838('0x8b'))](_0xa838('0x6e'),0x193);}_0x17089b=_0x56d1e1;return db[_0xa838('0x6f')][_0xa838('0x40')]({'raw':!![]});}return null;})[_0xa838('0x22')](function(_0x4f826e){if(_0x4f826e){_0x4379f8=_['keyBy'](_0x4f826e,'id');var _0x2d323f;var _0x51f6ea=squel['select']();_0x51f6ea[_0xa838('0x72')](_0x3dc755[_0xa838('0x73')]);for(var _0x197bfa=0x0;_0x197bfa<_0x17089b[_0xa838('0x34')];_0x197bfa+=0x1){_0x2d323f=_0x17089b[_0x197bfa][_0xa838('0x74')]?_0x4379f8[_0x17089b[_0x197bfa][_0xa838('0x74')]]['metric']:_0x17089b[_0x197bfa][_0xa838('0x6a')];_0x2d323f=_0x17089b[_0x197bfa][_0xa838('0x76')]?_[_0xa838('0x77')](_0x348c05[_0x17089b[_0x197bfa]['function']],'%s',_0x2d323f):_0x2d323f;_0x2d323f=_0x17089b[_0x197bfa][_0xa838('0x78')]?_[_0xa838('0x77')](_0x5d8893[_0x17089b[_0x197bfa][_0xa838('0x78')]],'%s',_0x2d323f):_0x2d323f;if(_0x17089b[_0x197bfa]['groupBy']){_0x51f6ea[_0xa838('0x69')](_0x2d323f);}_0x17089b[_0x197bfa][_0xa838('0x79')]&&_0x51f6ea[_0xa838('0x36')](_0x2d323f,_0x17089b[_0x197bfa][_0xa838('0x79')]==='DESC'?![]:!![]);_0x51f6ea[_0xa838('0x6a')](_0x2d323f,_0x17089b[_0x197bfa][_0xa838('0x7a')]||_0x2d323f);}if(_0x3dc755['joins']){_0x3dc755[_0xa838('0x7b')]=JSON[_0xa838('0x7c')](_0x3dc755[_0xa838('0x7b')]);for(var _0x46051b=0x0;_0x46051b<_0x3dc755[_0xa838('0x7b')][_0xa838('0x34')];_0x46051b+=0x1){if(_0x3dc755['joins'][_0x46051b][_0xa838('0x2c')]&&_[_0xa838('0x62')](_0xe2e32b,_0x3dc755['joins'][_0x46051b][_0xa838('0x2c')])&&_0x3dc755['joins'][_0x46051b][_0xa838('0x7d')]&&_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x7e')]&&_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x80')]){_0x51f6ea[_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x2c')]](_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x7e')],null,util[_0xa838('0x78')](_0xa838('0x7f'),_0x3dc755[_0xa838('0x73')],_0x3dc755[_0xa838('0x7b')][_0x46051b]['parentKey'],_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x7e')],_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x80')]));}}}if(_0x3dc755[_0xa838('0x81')]){_0x3dc755[_0xa838('0x81')]=JSON['parse'](_0x3dc755[_0xa838('0x81')]);_0x51f6ea[_0xa838('0x38')](_0xc40fba(_0x3dc755[_0xa838('0x81')][_0xa838('0x69')]));}_0x2750e4=_0x51f6ea[_0xa838('0x82')]();_0x51f6ea[_0xa838('0x19')](_0x36c6ec);_0x51f6ea[_0xa838('0x18')](0x0);logger['debug'](_0xa838('0x84'),_0x51f6ea[_0xa838('0x85')]());return dbH['sequelize'][_0xa838('0x2f')](_0x51f6ea[_0xa838('0x85')](),{'type':dbH[_0xa838('0x86')][_0xa838('0x87')][_0xa838('0x88')]});}})[_0xa838('0x22')](function(){return{'sql':_0x2750e4['toString']()};})['then'](respondWithResult(_0x1fcce8,null))[_0xa838('0x4f')](handleError(_0x1fcce8,null));};
\ No newline at end of file
+var _0x7ad6=['apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','stack','send','map','AnalyticCustomReport','rawAttributes','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','cross_join','COUNT(%s)','DATE(%s)','IS\x20NULL','IS\x20EMPTY','condition','value','Please\x20insert\x20at\x20least\x20one\x20field','parse','output','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','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','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7ad6,0x87));var _0x67ad=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x7ad6[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x67ad('0x0'));var rimraf=require(_0x67ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x67ad('0x2'));var rp=require(_0x67ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x67ad('0x4'));var path=require(_0x67ad('0x5'));var sox=require(_0x67ad('0x6'));var csv=require(_0x67ad('0x7'));var ejs=require(_0x67ad('0x8'));var fs=require('fs');var fs_extra=require(_0x67ad('0x9'));var _=require('lodash');var squel=require(_0x67ad('0xa'));var crypto=require('crypto');var jsforce=require(_0x67ad('0xb'));var deskjs=require(_0x67ad('0xc'));var toCsv=require(_0x67ad('0x7'));var querystring=require(_0x67ad('0xd'));var Papa=require(_0x67ad('0xe'));var Redis=require('ioredis');var authService=require(_0x67ad('0xf'));var qs=require(_0x67ad('0x10'));var as=require(_0x67ad('0x11'));var hardwareService=require(_0x67ad('0x12'));var logger=require(_0x67ad('0x13'))(_0x67ad('0x14'));var utils=require('../../config/utils');var config=require(_0x67ad('0x15'));var licenseUtil=require(_0x67ad('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0x67ad('0x17'))['dbH'];function respondWithStatusCode(_0x5c1e4d,_0x59c681){_0x59c681=_0x59c681||0xcc;return function(_0x4cb3b8){if(_0x4cb3b8){return _0x5c1e4d[_0x67ad('0x18')](_0x59c681);}return _0x5c1e4d[_0x67ad('0x19')](_0x59c681)[_0x67ad('0x1a')]();};}function respondWithResult(_0x44d62c,_0x52fe52){_0x52fe52=_0x52fe52||0xc8;return function(_0x2fac05){if(_0x2fac05){return _0x44d62c[_0x67ad('0x19')](_0x52fe52)[_0x67ad('0x1b')](_0x2fac05);}};}function respondWithFilteredResult(_0x5c788d,_0x13f898){return function(_0x137898){if(_0x137898){var _0x1607b1=typeof _0x13f898[_0x67ad('0x1c')]===_0x67ad('0x1d')&&typeof _0x13f898[_0x67ad('0x1e')]===_0x67ad('0x1d');var _0x9ae8bc=_0x137898[_0x67ad('0x1f')];var _0x4421f8=_0x1607b1?0x0:_0x13f898['offset'];var _0x25017b=_0x1607b1?_0x137898[_0x67ad('0x1f')]:_0x13f898[_0x67ad('0x1c')]+_0x13f898[_0x67ad('0x1e')];var _0x152bf5;if(_0x25017b>=_0x9ae8bc){_0x25017b=_0x9ae8bc;_0x152bf5=0xc8;}else{_0x152bf5=0xce;}_0x5c788d[_0x67ad('0x19')](_0x152bf5);return _0x5c788d['set'](_0x67ad('0x20'),_0x4421f8+'-'+_0x25017b+'/'+_0x9ae8bc)[_0x67ad('0x1b')](_0x137898);}return null;};}function patchUpdates(_0x461f4b){return function(_0x40ca72){try{jsonpatch[_0x67ad('0x21')](_0x40ca72,_0x461f4b,!![]);}catch(_0x4fae4c){return BPromise[_0x67ad('0x22')](_0x4fae4c);}return _0x40ca72[_0x67ad('0x23')]();};}function saveUpdates(_0xa1e13,_0x5db539){return function(_0x3123bc){if(_0x3123bc){return _0x3123bc['update'](_0xa1e13)[_0x67ad('0x24')](function(_0x2986ce){return _0x2986ce;});}return null;};}function removeEntity(_0x46e430,_0x33dac9){return function(_0x25cc35){if(_0x25cc35){return _0x25cc35[_0x67ad('0x25')]()['then'](function(){var _0x1e8cf=_0x25cc35[_0x67ad('0x26')]({'plain':!![]});var _0x514242=_0x67ad('0x27');return db[_0x67ad('0x28')][_0x67ad('0x25')]({'where':{'type':_0x514242,'resourceId':_0x1e8cf['id']}})[_0x67ad('0x24')](function(){return _0x25cc35;});})['then'](function(){_0x46e430['status'](0xcc)[_0x67ad('0x1a')]();});}};}function handleEntityNotFound(_0x4c5949,_0x1d886e){return function(_0x45d6ee){if(!_0x45d6ee){_0x4c5949[_0x67ad('0x18')](0x194);}return _0x45d6ee;};}function handleError(_0x10552f,_0x5d672c){_0x5d672c=_0x5d672c||0x1f4;return function(_0x266a58){logger[_0x67ad('0x29')](_0x266a58[_0x67ad('0x2a')]);if(_0x266a58['name']){delete _0x266a58['name'];}_0x10552f['status'](_0x5d672c)[_0x67ad('0x2b')](_0x266a58);};}exports['index']=function(_0x17f362,_0x156be9){var _0x3a49d8={},_0x546fd8={},_0x37984e={'count':0x0,'rows':[]};var _0x46267e=_[_0x67ad('0x2c')](db[_0x67ad('0x2d')][_0x67ad('0x2e')],function(_0x1df735){return{'name':_0x1df735['fieldName'],'type':_0x1df735[_0x67ad('0x2f')][_0x67ad('0x30')]};});_0x546fd8['model']=_[_0x67ad('0x2c')](_0x46267e,_0x67ad('0x31'));_0x546fd8['query']=_['keys'](_0x17f362[_0x67ad('0x32')]);_0x546fd8[_0x67ad('0x33')]=_[_0x67ad('0x34')](_0x546fd8[_0x67ad('0x35')],_0x546fd8[_0x67ad('0x32')]);_0x3a49d8[_0x67ad('0x36')]=_[_0x67ad('0x34')](_0x546fd8[_0x67ad('0x35')],qs[_0x67ad('0x37')](_0x17f362['query'][_0x67ad('0x37')]));_0x3a49d8[_0x67ad('0x36')]=_0x3a49d8[_0x67ad('0x36')][_0x67ad('0x38')]?_0x3a49d8[_0x67ad('0x36')]:_0x546fd8[_0x67ad('0x35')];if(!_0x17f362[_0x67ad('0x32')][_0x67ad('0x39')](_0x67ad('0x3a'))){_0x3a49d8[_0x67ad('0x1e')]=qs[_0x67ad('0x1e')](_0x17f362[_0x67ad('0x32')]['limit']);_0x3a49d8['offset']=qs[_0x67ad('0x1c')](_0x17f362[_0x67ad('0x32')][_0x67ad('0x1c')]);}_0x3a49d8['order']=qs[_0x67ad('0x3b')](_0x17f362[_0x67ad('0x32')][_0x67ad('0x3b')]);_0x3a49d8['where']=qs[_0x67ad('0x33')](_[_0x67ad('0x3c')](_0x17f362[_0x67ad('0x32')],_0x546fd8['filters']),_0x46267e);if(_0x17f362[_0x67ad('0x32')][_0x67ad('0x3d')]){_0x3a49d8['where']=_['merge'](_0x3a49d8[_0x67ad('0x3e')],{'$or':_[_0x67ad('0x2c')](_0x46267e,function(_0x5e1dea){if(_0x5e1dea['type']!==_0x67ad('0x3f')){var _0x509e2b={};_0x509e2b[_0x5e1dea[_0x67ad('0x31')]]={'$like':'%'+_0x17f362[_0x67ad('0x32')][_0x67ad('0x3d')]+'%'};return _0x509e2b;}})});}_0x3a49d8=_[_0x67ad('0x40')]({},_0x3a49d8,_0x17f362['options']);var _0x28a343={'where':_0x3a49d8['where']};return db[_0x67ad('0x2d')][_0x67ad('0x1f')](_0x28a343)[_0x67ad('0x24')](function(_0xb8f0cd){_0x37984e[_0x67ad('0x1f')]=_0xb8f0cd;if(_0x17f362[_0x67ad('0x32')][_0x67ad('0x41')]){_0x3a49d8[_0x67ad('0x42')]=[{'all':!![]}];}return db[_0x67ad('0x2d')][_0x67ad('0x43')](_0x3a49d8);})['then'](function(_0x376281){_0x37984e[_0x67ad('0x44')]=_0x376281;return _0x37984e;})[_0x67ad('0x24')](respondWithFilteredResult(_0x156be9,_0x3a49d8))[_0x67ad('0x45')](handleError(_0x156be9,null));};exports[_0x67ad('0x46')]=function(_0x109ccb,_0x4833e3){var _0x257087={'raw':![],'where':{'id':_0x109ccb[_0x67ad('0x47')]['id']}},_0x107ef3={};_0x107ef3[_0x67ad('0x35')]=_[_0x67ad('0x48')](db['AnalyticCustomReport'][_0x67ad('0x2e')]);_0x107ef3[_0x67ad('0x32')]=_[_0x67ad('0x48')](_0x109ccb[_0x67ad('0x32')]);_0x107ef3['filters']=_[_0x67ad('0x34')](_0x107ef3[_0x67ad('0x35')],_0x107ef3['query']);_0x257087[_0x67ad('0x36')]=_['intersection'](_0x107ef3[_0x67ad('0x35')],qs[_0x67ad('0x37')](_0x109ccb[_0x67ad('0x32')][_0x67ad('0x37')]));_0x257087[_0x67ad('0x36')]=_0x257087[_0x67ad('0x36')][_0x67ad('0x38')]?_0x257087[_0x67ad('0x36')]:_0x107ef3[_0x67ad('0x35')];if(_0x109ccb[_0x67ad('0x32')]['includeAll']){_0x257087[_0x67ad('0x42')]=[{'all':!![]}];}_0x257087=_['merge']({},_0x257087,_0x109ccb[_0x67ad('0x49')]);return db[_0x67ad('0x2d')][_0x67ad('0x4a')](_0x257087)[_0x67ad('0x24')](handleEntityNotFound(_0x4833e3,null))[_0x67ad('0x24')](respondWithResult(_0x4833e3,null))[_0x67ad('0x45')](handleError(_0x4833e3,null));};exports[_0x67ad('0x4b')]=function(_0x22d90c,_0x54cd53){return db[_0x67ad('0x2d')][_0x67ad('0x4b')](_0x22d90c['body'],{})[_0x67ad('0x24')](function(_0x1cc999){var _0x4d6306=_0x22d90c[_0x67ad('0x4c')][_0x67ad('0x26')]({'plain':!![]});if(!_0x4d6306)throw new Error(_0x67ad('0x4d'));if(_0x4d6306[_0x67ad('0x4e')]===_0x67ad('0x4c')){var _0xea9158=_0x1cc999[_0x67ad('0x26')]({'plain':!![]});var _0x334082=_0x67ad('0x4f');return db[_0x67ad('0x50')]['find']({'where':{'name':_0x334082,'userProfileId':_0x4d6306[_0x67ad('0x51')]},'raw':!![]})[_0x67ad('0x24')](function(_0x9f35a0){if(_0x9f35a0&&_0x9f35a0['autoAssociation']===0x0){return db[_0x67ad('0x28')][_0x67ad('0x4b')]({'name':_0xea9158[_0x67ad('0x31')],'resourceId':_0xea9158['id'],'type':'CustomReports','sectionId':_0x9f35a0['id']},{})[_0x67ad('0x24')](function(){return _0x1cc999;});}else{return _0x1cc999;}})[_0x67ad('0x45')](function(_0x16202b){logger['error'](_0x67ad('0x52'),_0x16202b);throw _0x16202b;});}return _0x1cc999;})['then'](respondWithResult(_0x54cd53,0xc9))['catch'](handleError(_0x54cd53,null));};exports[_0x67ad('0x53')]=function(_0x21d096,_0x4a6e92){if(_0x21d096[_0x67ad('0x54')]['id']){delete _0x21d096['body']['id'];}return db[_0x67ad('0x2d')]['find']({'where':{'id':_0x21d096['params']['id']}})[_0x67ad('0x24')](handleEntityNotFound(_0x4a6e92,null))[_0x67ad('0x24')](saveUpdates(_0x21d096[_0x67ad('0x54')],null))['then'](respondWithResult(_0x4a6e92,null))[_0x67ad('0x45')](handleError(_0x4a6e92,null));};exports[_0x67ad('0x25')]=function(_0x29f980,_0x34512c){return db[_0x67ad('0x2d')][_0x67ad('0x4a')]({'where':{'id':_0x29f980[_0x67ad('0x47')]['id']}})[_0x67ad('0x24')](handleEntityNotFound(_0x34512c,null))[_0x67ad('0x24')](removeEntity(_0x34512c,null))[_0x67ad('0x45')](handleError(_0x34512c,null));};exports['preview']=function(_0x4ae8ed,_0x3ea737){var _0x57a667=0xa;var _0xf5b561=['join',_0x67ad('0x55'),_0x67ad('0x56'),'cross_join'];var _0x10bd0e={'SUM':_0x67ad('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x67ad('0x58'),'MAX':_0x67ad('0x59'),'MIN':_0x67ad('0x5a'),'AVG':_0x67ad('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb710e2={'SEC_TO_TIME':_0x67ad('0x5c'),'DATE':'DATE(%s)','HOUR':_0x67ad('0x5d'),'ROUND':_0x67ad('0x5e'),'UNIX_TIMESTAMP':_0x67ad('0x5f')};var _0x40336e=function(_0x44473f){return!_[_0x67ad('0x60')](['IS\x20NULL',_0x67ad('0x61'),'IS\x20EMPTY',_0x67ad('0x62')],_0x44473f);};var _0x2a9607=function(_0x31d5b1){if(!_0x31d5b1||!_0x31d5b1[_0x67ad('0x63')][_0x67ad('0x38')]){return'';}for(var _0x499599='(',_0x50690c=0x0;_0x50690c<_0x31d5b1[_0x67ad('0x63')][_0x67ad('0x38')];_0x50690c+=0x1){_0x50690c>0x0&&(_0x499599+='\x20'+_0x31d5b1[_0x67ad('0x64')]+'\x20');_0x499599+=_0x31d5b1[_0x67ad('0x63')][_0x50690c][_0x67ad('0x65')]?_0x2a9607(_0x31d5b1['rules'][_0x50690c]['group']):_0x31d5b1['rules'][_0x50690c][_0x67ad('0x66')]+'\x20'+_0x31d5b1[_0x67ad('0x63')][_0x50690c]['condition']+(_0x40336e(_0x31d5b1[_0x67ad('0x63')][_0x50690c]['condition'])?'\x20'+_0x31d5b1[_0x67ad('0x63')][_0x50690c]['value']:'');}return _0x499599+')';};var _0x5a6f24={'where':{'id':_0x4ae8ed[_0x67ad('0x47')]['id']}},_0xa51e5f,_0x50d114,_0x15875a,_0x52fb6b,_0x3c05fe;_0x5a6f24=_['merge']({},_0x5a6f24,_0x4ae8ed[_0x67ad('0x49')]);return db['AnalyticCustomReport'][_0x67ad('0x4a')](_0x5a6f24)[_0x67ad('0x24')](function(_0x395cb2){if(_0x395cb2){_0xa51e5f=_0x395cb2;return _0x395cb2[_0x67ad('0x67')]();}return null;})[_0x67ad('0x24')](function(_0x190bd6){if(_0x190bd6){if(!_0x190bd6[_0x67ad('0x38')]){throw new db[(_0x67ad('0x68'))][(_0x67ad('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x50d114=_0x190bd6;return db[_0x67ad('0x6a')][_0x67ad('0x43')]({'raw':!![]});}return null;})['then'](function(_0x7bd6f7){if(_0x7bd6f7){_0x15875a=_[_0x67ad('0x6b')](_0x7bd6f7,'id');var _0x3f7dde;var _0x7ae296=squel[_0x67ad('0x6c')]();_0x7ae296[_0x67ad('0x6d')](_0xa51e5f[_0x67ad('0x6e')]);for(var _0x14ccec=0x0;_0x14ccec<_0x50d114['length'];_0x14ccec+=0x1){_0x3f7dde=_0x50d114[_0x14ccec][_0x67ad('0x6f')]?_0x15875a[_0x50d114[_0x14ccec]['MetricId']][_0x67ad('0x70')]:_0x50d114[_0x14ccec]['field'];_0x3f7dde=_0x50d114[_0x14ccec]['function']?_[_0x67ad('0x71')](_0x10bd0e[_0x50d114[_0x14ccec][_0x67ad('0x72')]],'%s',_0x3f7dde):_0x3f7dde;_0x3f7dde=_0x50d114[_0x14ccec]['format']?_[_0x67ad('0x71')](_0xb710e2[_0x50d114[_0x14ccec][_0x67ad('0x73')]],'%s',_0x3f7dde):_0x3f7dde;if(_0x50d114[_0x14ccec][_0x67ad('0x74')]){_0x7ae296[_0x67ad('0x65')](_0x3f7dde);}_0x50d114[_0x14ccec][_0x67ad('0x75')]&&_0x7ae296[_0x67ad('0x76')](_0x3f7dde,_0x50d114[_0x14ccec][_0x67ad('0x75')]===_0x67ad('0x77')?![]:!![]);_0x7ae296[_0x67ad('0x66')](_0x3f7dde,_0x50d114[_0x14ccec][_0x67ad('0x78')]||_0x3f7dde);}if(_0xa51e5f[_0x67ad('0x79')]){_0xa51e5f['joins']=JSON['parse'](_0xa51e5f['joins']);for(var _0x1753ef=0x0;_0x1753ef<_0xa51e5f['joins'][_0x67ad('0x38')];_0x1753ef+=0x1){if(_0xa51e5f['joins'][_0x1753ef][_0x67ad('0x2f')]&&_[_0x67ad('0x60')](_0xf5b561,_0xa51e5f['joins'][_0x1753ef][_0x67ad('0x2f')])&&_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7a')]&&_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7b')]&&_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7c')]){_0x7ae296[_0xa51e5f[_0x67ad('0x79')][_0x1753ef]['type']](_0xa51e5f['joins'][_0x1753ef][_0x67ad('0x7b')],null,util[_0x67ad('0x73')](_0x67ad('0x7d'),_0xa51e5f[_0x67ad('0x6e')],_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7a')],_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7b')],_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7c')]));}}}if(_0xa51e5f[_0x67ad('0x7e')]){_0xa51e5f['conditions']=JSON['parse'](_0xa51e5f[_0x67ad('0x7e')]);_0x7ae296[_0x67ad('0x3e')](_0x2a9607(_0xa51e5f[_0x67ad('0x7e')][_0x67ad('0x65')]));}_0x3c05fe=_0x7ae296[_0x67ad('0x7f')]();_0x7ae296[_0x67ad('0x1e')](_0x57a667);_0x7ae296['offset'](0x0);logger[_0x67ad('0x80')](_0x67ad('0x81'),_0x7ae296['toString']());return dbH[_0x67ad('0x82')][_0x67ad('0x32')](_0x7ae296['toString'](),{'type':dbH[_0x67ad('0x82')][_0x67ad('0x83')][_0x67ad('0x84')]});}})['then'](respondWithResult(_0x3ea737,null))[_0x67ad('0x45')](handleError(_0x3ea737,null));};function runReport(_0x128fb7,_0x4c171d,_0x137591){var _0x395820=_0x4c171d[_0x67ad('0x31')];var _0x415c59=0xa;var _0x1fb8cf=[_0x67ad('0x85'),_0x67ad('0x55'),_0x67ad('0x56'),_0x67ad('0x86')];var _0x12dcf7={'SUM':_0x67ad('0x57'),'COUNT':_0x67ad('0x87'),'COUNT DISTINCT':_0x67ad('0x58'),'MAX':'MAX(%s)','MIN':_0x67ad('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x291168={'SEC_TO_TIME':_0x67ad('0x5c'),'DATE':_0x67ad('0x88'),'HOUR':'HOUR(%s)','ROUND':_0x67ad('0x5e'),'UNIX_TIMESTAMP':_0x67ad('0x5f')};var _0x5e1f28=function(_0xc605a7){return!_['includes']([_0x67ad('0x89'),_0x67ad('0x61'),_0x67ad('0x8a'),_0x67ad('0x62')],_0xc605a7);};var _0x397578=function(_0x587274){if(!_0x587274||!_0x587274[_0x67ad('0x63')][_0x67ad('0x38')]){return'';}for(var _0x1eded6='(',_0x47c91d=0x0;_0x47c91d<_0x587274[_0x67ad('0x63')]['length'];_0x47c91d+=0x1){_0x47c91d>0x0&&(_0x1eded6+='\x20'+_0x587274[_0x67ad('0x64')]+'\x20');_0x1eded6+=_0x587274[_0x67ad('0x63')][_0x47c91d]['group']?_0x397578(_0x587274[_0x67ad('0x63')][_0x47c91d]['group']):_0x587274['rules'][_0x47c91d][_0x67ad('0x66')]+'\x20'+_0x587274[_0x67ad('0x63')][_0x47c91d][_0x67ad('0x8b')]+(_0x5e1f28(_0x587274[_0x67ad('0x63')][_0x47c91d][_0x67ad('0x8b')])?'\x20'+_0x587274['rules'][_0x47c91d][_0x67ad('0x8c')]:'');}return _0x1eded6+')';};var _0x571e5a={'where':{'id':_0x128fb7['id']}},_0x237d53,_0x5f100f,_0x1ad01f,_0x4ddf4d,_0x4cc3cf;_0x571e5a=_[_0x67ad('0x40')]({},_0x571e5a,_0x137591);return db[_0x67ad('0x2d')]['find'](_0x571e5a)[_0x67ad('0x24')](function(_0x15fb70){if(_0x15fb70){_0x237d53=_0x15fb70;return _0x15fb70[_0x67ad('0x67')]();}return null;})['then'](function(_0x2d2a42){if(_0x2d2a42){if(!_0x2d2a42[_0x67ad('0x38')]){throw new db[(_0x67ad('0x68'))]['ValidationErrorItem'](_0x67ad('0x8d'),0x193);}_0x5f100f=_0x2d2a42;return db[_0x67ad('0x6a')][_0x67ad('0x43')]({'raw':!![]});}return null;})[_0x67ad('0x24')](function(_0x838839){if(_0x838839){_0x1ad01f=_['keyBy'](_0x838839,'id');var _0x4dfe99;var _0x567e0c=squel['select']();_0x567e0c[_0x67ad('0x6d')](_0x237d53[_0x67ad('0x6e')]);for(var _0x59eca9=0x0;_0x59eca9<_0x5f100f[_0x67ad('0x38')];_0x59eca9+=0x1){_0x4dfe99=_0x5f100f[_0x59eca9][_0x67ad('0x6f')]?_0x1ad01f[_0x5f100f[_0x59eca9][_0x67ad('0x6f')]][_0x67ad('0x70')]:_0x5f100f[_0x59eca9][_0x67ad('0x66')];_0x4dfe99=_0x5f100f[_0x59eca9][_0x67ad('0x72')]?_[_0x67ad('0x71')](_0x12dcf7[_0x5f100f[_0x59eca9][_0x67ad('0x72')]],'%s',_0x4dfe99):_0x4dfe99;_0x4dfe99=_0x5f100f[_0x59eca9][_0x67ad('0x73')]?_['replace'](_0x291168[_0x5f100f[_0x59eca9][_0x67ad('0x73')]],'%s',_0x4dfe99):_0x4dfe99;if(_0x5f100f[_0x59eca9]['groupBy']){_0x567e0c[_0x67ad('0x65')](_0x4dfe99);}_0x5f100f[_0x59eca9]['orderBy']&&_0x567e0c[_0x67ad('0x76')](_0x4dfe99,_0x5f100f[_0x59eca9][_0x67ad('0x75')]===_0x67ad('0x77')?![]:!![]);_0x567e0c[_0x67ad('0x66')](_0x4dfe99,_0x5f100f[_0x59eca9][_0x67ad('0x78')]||_0x4dfe99);}if(_0x237d53[_0x67ad('0x79')]){_0x237d53[_0x67ad('0x79')]=JSON['parse'](_0x237d53[_0x67ad('0x79')]);for(var _0x44450a=0x0;_0x44450a<_0x237d53[_0x67ad('0x79')][_0x67ad('0x38')];_0x44450a+=0x1){if(_0x237d53['joins'][_0x44450a][_0x67ad('0x2f')]&&_[_0x67ad('0x60')](_0x1fb8cf,_0x237d53['joins'][_0x44450a][_0x67ad('0x2f')])&&_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7a')]&&_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7b')]&&_0x237d53[_0x67ad('0x79')][_0x44450a]['foreignKey']){_0x567e0c[_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x2f')]](_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7b')],null,util[_0x67ad('0x73')]('%s.%s\x20=\x20%s.%s',_0x237d53[_0x67ad('0x6e')],_0x237d53['joins'][_0x44450a][_0x67ad('0x7a')],_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7b')],_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7c')]));}}}if(_0x237d53[_0x67ad('0x7e')]){_0x237d53[_0x67ad('0x7e')]=JSON[_0x67ad('0x8e')](_0x237d53[_0x67ad('0x7e')]);_0x567e0c[_0x67ad('0x3e')](_0x397578(_0x237d53[_0x67ad('0x7e')][_0x67ad('0x65')]));}_0x4cc3cf=_0x567e0c[_0x67ad('0x7f')]();_0x567e0c[_0x67ad('0x1e')](_0x415c59);_0x567e0c['offset'](0x0);return;}})['then'](function(){if(_0x4c171d[_0x67ad('0x8f')]==='web'){return null;}var _0x2fab60=_[_0x67ad('0x40')](_0x4c171d,{'name':_0x4c171d['fullPath']||_0x4c171d[_0x67ad('0x31')]||_0x237d53['name'],'basename':_0x395820,'savename':util[_0x67ad('0x73')](_0x67ad('0x90'),_0x4c171d[_0x67ad('0x31')]||_0x237d53[_0x67ad('0x31')],require(_0x67ad('0x91'))[_0x67ad('0x92')](0x4),_0x4c171d[_0x67ad('0x8f')]||_0x67ad('0x93')),'reportId':_0x237d53['id'],'reportType':_0x67ad('0x94')});return db[_0x67ad('0x95')][_0x67ad('0x4b')](_0x2fab60,{'raw':!![]});})[_0x67ad('0x24')](function(_0x33d532){if(_0x237d53[_0x67ad('0x6e')]===_0x67ad('0x96')){_0x4cc3cf[_0x67ad('0x3e')](_0x237d53[_0x67ad('0x6e')]+_0x67ad('0x97'),_0x4c171d['startDate'],_0x4c171d['endDate']);}else{_0x4cc3cf[_0x67ad('0x3e')](_0x237d53[_0x67ad('0x6e')]+_0x67ad('0x98'),_0x4c171d[_0x67ad('0x99')],_0x4c171d[_0x67ad('0x9a')]);}if(_0x33d532){logger['info'](_0x67ad('0x9b'),_0x4cc3cf[_0x67ad('0x9c')]());require(_0x67ad('0x9d'))[_0x67ad('0x9e')](path[_0x67ad('0x85')](__dirname,_0x67ad('0x9f'),_0x33d532[_0x67ad('0x8f')]),[_0x33d532['id'],_0x4cc3cf['toString'](),path[_0x67ad('0x85')](__dirname,_0x67ad('0xa0'),_0x33d532['savename']),_0x395820]);return _0x33d532;}else{var _0xbfc68d=squel[_0x67ad('0x6c')]();_0xbfc68d[_0x67ad('0x6d')]('('+_0x4cc3cf[_0x67ad('0x9c')]()+')',_0x67ad('0xa1'));_0xbfc68d[_0x67ad('0x66')](_0x67ad('0xa2'),_0x67ad('0x1f'));_0x4cc3cf[_0x67ad('0x1e')](_0x4c171d['limit']||_0x415c59);_0x4cc3cf[_0x67ad('0x1c')](_0x4c171d[_0x67ad('0x1c')]||0x0);return dbH['sequelize'][_0x67ad('0x32')](_0xbfc68d[_0x67ad('0x9c')](),{'type':dbH[_0x67ad('0x82')][_0x67ad('0x83')][_0x67ad('0x84')]})['then'](function(_0x4fc368){if(!_0x4fc368[_0x67ad('0x38')]){_0x4ddf4d=0x0;}else{_0x4ddf4d=_0x4fc368[0x0][_0x67ad('0x1f')]||0x0;}return dbH[_0x67ad('0x82')][_0x67ad('0x32')](_0x4cc3cf[_0x67ad('0x9c')](),{'type':dbH[_0x67ad('0x82')][_0x67ad('0x83')]['SELECT']});})[_0x67ad('0x24')](function(_0x3d4a5f){return{'rows':_0x3d4a5f||[],'count':_0x4ddf4d};});}});}exports[_0x67ad('0xa3')]=function(_0x3e38ae,_0x116964){return runReport(_0x3e38ae[_0x67ad('0x47')],_0x3e38ae[_0x67ad('0x32')],_0x3e38ae[_0x67ad('0x49')])['then'](respondWithResult(_0x116964,null))['catch'](handleError(_0x116964,null));};exports[_0x67ad('0xa4')]=runReport;exports[_0x67ad('0x32')]=function(_0x348d71,_0x3a7215){var _0x5bc976=0xa;var _0x2a8f56=[_0x67ad('0x85'),'left_join',_0x67ad('0x56'),_0x67ad('0x86')];var _0x5e4c42={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x67ad('0x58'),'MAX':_0x67ad('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x67ad('0xa5'),'GROUP_CONCAT ASC':_0x67ad('0xa6'),'GROUP_CONCAT DESC':_0x67ad('0xa7')};var _0x1517a3={'SEC_TO_TIME':_0x67ad('0x5c'),'DATE':_0x67ad('0x88'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x67ad('0x5f')};var _0x426f67=function(_0x376114){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x67ad('0x8a'),'IS\x20NOT\x20EMPTY'],_0x376114);};var _0x1a8742=function(_0x13e335){if(!_0x13e335||!_0x13e335[_0x67ad('0x63')][_0x67ad('0x38')]){return'';}for(var _0x5cd6da='(',_0x494309=0x0;_0x494309<_0x13e335[_0x67ad('0x63')][_0x67ad('0x38')];_0x494309+=0x1){_0x494309>0x0&&(_0x5cd6da+='\x20'+_0x13e335['operator']+'\x20');_0x5cd6da+=_0x13e335[_0x67ad('0x63')][_0x494309][_0x67ad('0x65')]?_0x1a8742(_0x13e335[_0x67ad('0x63')][_0x494309][_0x67ad('0x65')]):_0x13e335[_0x67ad('0x63')][_0x494309]['field']+'\x20'+_0x13e335[_0x67ad('0x63')][_0x494309][_0x67ad('0x8b')]+(_0x426f67(_0x13e335[_0x67ad('0x63')][_0x494309][_0x67ad('0x8b')])?'\x20'+_0x13e335['rules'][_0x494309][_0x67ad('0x8c')]:'');}return _0x5cd6da+')';};var _0x136710={'where':{'id':_0x348d71[_0x67ad('0x47')]['id']}},_0x7cb0b9,_0x42e283,_0x4077eb,_0x2d10ed,_0x21e0c2;_0x136710=_['merge']({},_0x136710,_0x348d71[_0x67ad('0x49')]);return db[_0x67ad('0x2d')][_0x67ad('0x4a')](_0x136710)[_0x67ad('0x24')](function(_0x4fa83a){if(_0x4fa83a){_0x7cb0b9=_0x4fa83a;return _0x4fa83a[_0x67ad('0x67')]();}return null;})[_0x67ad('0x24')](function(_0x1ce1a0){if(_0x1ce1a0){if(!_0x1ce1a0[_0x67ad('0x38')]){throw new db[(_0x67ad('0x68'))]['ValidationErrorItem'](_0x67ad('0x8d'),0x193);}_0x42e283=_0x1ce1a0;return db[_0x67ad('0x6a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x503bdd){if(_0x503bdd){_0x4077eb=_['keyBy'](_0x503bdd,'id');var _0x3a04b0;var _0x486a28=squel[_0x67ad('0x6c')]();_0x486a28[_0x67ad('0x6d')](_0x7cb0b9[_0x67ad('0x6e')]);for(var _0x373cac=0x0;_0x373cac<_0x42e283[_0x67ad('0x38')];_0x373cac+=0x1){_0x3a04b0=_0x42e283[_0x373cac][_0x67ad('0x6f')]?_0x4077eb[_0x42e283[_0x373cac][_0x67ad('0x6f')]][_0x67ad('0x70')]:_0x42e283[_0x373cac][_0x67ad('0x66')];_0x3a04b0=_0x42e283[_0x373cac][_0x67ad('0x72')]?_[_0x67ad('0x71')](_0x5e4c42[_0x42e283[_0x373cac][_0x67ad('0x72')]],'%s',_0x3a04b0):_0x3a04b0;_0x3a04b0=_0x42e283[_0x373cac][_0x67ad('0x73')]?_[_0x67ad('0x71')](_0x1517a3[_0x42e283[_0x373cac]['format']],'%s',_0x3a04b0):_0x3a04b0;if(_0x42e283[_0x373cac]['groupBy']){_0x486a28['group'](_0x3a04b0);}_0x42e283[_0x373cac][_0x67ad('0x75')]&&_0x486a28[_0x67ad('0x76')](_0x3a04b0,_0x42e283[_0x373cac]['orderBy']===_0x67ad('0x77')?![]:!![]);_0x486a28['field'](_0x3a04b0,_0x42e283[_0x373cac][_0x67ad('0x78')]||_0x3a04b0);}if(_0x7cb0b9[_0x67ad('0x79')]){_0x7cb0b9[_0x67ad('0x79')]=JSON[_0x67ad('0x8e')](_0x7cb0b9[_0x67ad('0x79')]);for(var _0x2c8a5a=0x0;_0x2c8a5a<_0x7cb0b9[_0x67ad('0x79')][_0x67ad('0x38')];_0x2c8a5a+=0x1){if(_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a][_0x67ad('0x2f')]&&_['includes'](_0x2a8f56,_0x7cb0b9['joins'][_0x2c8a5a][_0x67ad('0x2f')])&&_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a][_0x67ad('0x7a')]&&_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a]['foreignTable']&&_0x7cb0b9['joins'][_0x2c8a5a][_0x67ad('0x7c')]){_0x486a28[_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a]['type']](_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a]['foreignTable'],null,util['format'](_0x67ad('0x7d'),_0x7cb0b9[_0x67ad('0x6e')],_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a][_0x67ad('0x7a')],_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a]['foreignTable'],_0x7cb0b9['joins'][_0x2c8a5a]['foreignKey']));}}}if(_0x7cb0b9[_0x67ad('0x7e')]){_0x7cb0b9[_0x67ad('0x7e')]=JSON[_0x67ad('0x8e')](_0x7cb0b9[_0x67ad('0x7e')]);_0x486a28[_0x67ad('0x3e')](_0x1a8742(_0x7cb0b9[_0x67ad('0x7e')][_0x67ad('0x65')]));}_0x21e0c2=_0x486a28['clone']();_0x486a28['limit'](_0x5bc976);_0x486a28[_0x67ad('0x1c')](0x0);logger[_0x67ad('0x80')]('Limited\x20Query:',_0x486a28[_0x67ad('0x9c')]());return dbH[_0x67ad('0x82')]['query'](_0x486a28[_0x67ad('0x9c')](),{'type':dbH[_0x67ad('0x82')][_0x67ad('0x83')][_0x67ad('0x84')]});}})['then'](function(){return{'sql':_0x21e0c2[_0x67ad('0x9c')]()};})[_0x67ad('0x24')](respondWithResult(_0x3a7215,null))['catch'](handleError(_0x3a7215,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 48910bd..6b4ff3e 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 _0x9af4=['util','../../config/logger','api','bluebird','path','rimraf','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9af4,0xdb));var _0x49af=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9af4[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x49af('0x0'));var util=require(_0x49af('0x1'));var logger=require(_0x49af('0x2'))(_0x49af('0x3'));var moment=require('moment');var BPromise=require(_0x49af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49af('0x5'));var rimraf=require(_0x49af('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x49af('0x7')]=function(_0x222442,_0xef3ca2){return _0x222442[_0x49af('0x8')](_0x49af('0x9'),attributes,{'tableName':_0x49af('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6655=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x46d409,_0x2850c0){var _0x1bdf97=function(_0x1abfd4){while(--_0x1abfd4){_0x46d409['push'](_0x46d409['shift']());}};_0x1bdf97(++_0x2850c0);}(_0x6655,0x18a));var _0x5665=function(_0xcb813d,_0x204798){_0xcb813d=_0xcb813d-0x0;var _0x259ee8=_0x6655[_0xcb813d];return _0x259ee8;};'use strict';var _=require(_0x5665('0x0'));var util=require(_0x5665('0x1'));var logger=require(_0x5665('0x2'))(_0x5665('0x3'));var moment=require(_0x5665('0x4'));var BPromise=require(_0x5665('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5665('0x6'));var rimraf=require(_0x5665('0x7'));var config=require(_0x5665('0x8'));var attributes=require(_0x5665('0x9'));module[_0x5665('0xa')]=function(_0xa822d,_0x2560e4){return _0xa822d[_0x5665('0xb')](_0x5665('0xc'),attributes,{'tableName':_0x5665('0xd'),'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 55b678e..20d0922 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 _0xacb6=['jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x24f9b2,_0x5c9bc1){var _0x51d726=function(_0xcf75f1){while(--_0xcf75f1){_0x24f9b2['push'](_0x24f9b2['shift']());}};_0x51d726(++_0x5c9bc1);}(_0xacb6,0x1c6));var _0x6acb=function(_0x2223eb,_0x3ffd7b){_0x2223eb=_0x2223eb-0x0;var _0x25ebb0=_0xacb6[_0x2223eb];return _0x25ebb0;};'use strict';var _=require('lodash');var util=require(_0x6acb('0x0'));var moment=require('moment');var BPromise=require(_0x6acb('0x1'));var rs=require(_0x6acb('0x2'));var fs=require('fs');var Redis=require(_0x6acb('0x3'));var db=require(_0x6acb('0x4'))['db'];var utils=require(_0x6acb('0x5'));var logger=require(_0x6acb('0x6'))('rpc');var config=require(_0x6acb('0x7'));var jayson=require(_0x6acb('0x8'));var client=jayson[_0x6acb('0x9')][_0x6acb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ae588,_0x147a5e,_0x399be5){return new BPromise(function(_0x359b1e,_0x32f375){return client[_0x6acb('0xb')](_0x5ae588,_0x399be5)[_0x6acb('0xc')](function(_0x2246a4){logger['info'](_0x6acb('0xd'),_0x147a5e,'request\x20sent');logger[_0x6acb('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x147a5e,_0x6acb('0xf'),JSON[_0x6acb('0x10')](_0x2246a4));if(_0x2246a4['error']){if(_0x2246a4['error'][_0x6acb('0x11')]===0x1f4){logger[_0x6acb('0x12')](_0x6acb('0xd'),_0x147a5e,_0x2246a4[_0x6acb('0x12')][_0x6acb('0x13')]);return _0x32f375(_0x2246a4['error'][_0x6acb('0x13')]);}logger['error'](_0x6acb('0xd'),_0x147a5e,_0x2246a4[_0x6acb('0x12')][_0x6acb('0x13')]);return _0x359b1e(_0x2246a4[_0x6acb('0x12')][_0x6acb('0x13')]);}else{logger['info'](_0x6acb('0xd'),_0x147a5e,_0x6acb('0xf'));_0x359b1e(_0x2246a4[_0x6acb('0x14')][_0x6acb('0x13')]);}})[_0x6acb('0x15')](function(_0x2fdfc8){logger['error'](_0x6acb('0xd'),_0x147a5e,_0x2fdfc8);_0x32f375(_0x2fdfc8);});});}
\ No newline at end of file
+var _0xd203=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util'];(function(_0x3a9eb1,_0xcb21e9){var _0x36c0e1=function(_0x227f4c){while(--_0x227f4c){_0x3a9eb1['push'](_0x3a9eb1['shift']());}};_0x36c0e1(++_0xcb21e9);}(_0xd203,0xee));var _0x3d20=function(_0x2e1e83,_0xb2934f){_0x2e1e83=_0x2e1e83-0x0;var _0xd19d0b=_0xd203[_0x2e1e83];return _0xd19d0b;};'use strict';var _=require(_0x3d20('0x0'));var util=require(_0x3d20('0x1'));var moment=require(_0x3d20('0x2'));var BPromise=require(_0x3d20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d20('0x4'));var db=require(_0x3d20('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d20('0x6'))(_0x3d20('0x7'));var config=require(_0x3d20('0x8'));var jayson=require(_0x3d20('0x9'));var client=jayson[_0x3d20('0xa')][_0x3d20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cc59b,_0x1af0e7,_0x144175){return new BPromise(function(_0x518625,_0x50810a){return client['request'](_0x3cc59b,_0x144175)[_0x3d20('0xc')](function(_0x38f48f){logger[_0x3d20('0xd')](_0x3d20('0xe'),_0x1af0e7,_0x3d20('0xf'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1af0e7,'request\x20sent',JSON['stringify'](_0x38f48f));if(_0x38f48f[_0x3d20('0x10')]){if(_0x38f48f[_0x3d20('0x10')][_0x3d20('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1af0e7,_0x38f48f[_0x3d20('0x10')][_0x3d20('0x12')]);return _0x50810a(_0x38f48f[_0x3d20('0x10')][_0x3d20('0x12')]);}logger[_0x3d20('0x10')](_0x3d20('0xe'),_0x1af0e7,_0x38f48f['error']['message']);return _0x518625(_0x38f48f[_0x3d20('0x10')][_0x3d20('0x12')]);}else{logger[_0x3d20('0xd')](_0x3d20('0xe'),_0x1af0e7,'request\x20sent');_0x518625(_0x38f48f['result'][_0x3d20('0x12')]);}})[_0x3d20('0x13')](function(_0x48c7ad){logger[_0x3d20('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1af0e7,_0x48c7ad);_0x50810a(_0x48c7ad);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 0145e3d..d2f26fb 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 _0x6cf3=['isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6cf3,0x1ed));var _0x36cf=function(_0x32ad0b,_0x1bff04){_0x32ad0b=_0x32ad0b-0x0;var _0x4467bf=_0x6cf3[_0x32ad0b];return _0x4467bf;};'use strict';var multer=require(_0x36cf('0x0'));var util=require(_0x36cf('0x1'));var path=require(_0x36cf('0x2'));var timeout=require(_0x36cf('0x3'));var express=require(_0x36cf('0x4'));var router=express['Router']();var fs_extra=require(_0x36cf('0x5'));var auth=require(_0x36cf('0x6'));var interaction=require(_0x36cf('0x7'));var config=require(_0x36cf('0x8'));var controller=require(_0x36cf('0x9'));router[_0x36cf('0xa')]('/',auth[_0x36cf('0xb')](),controller[_0x36cf('0xc')]);router[_0x36cf('0xa')](_0x36cf('0xd'),auth[_0x36cf('0xb')](),controller[_0x36cf('0xe')]);router['get'](_0x36cf('0xf'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x10')]);router[_0x36cf('0xa')](_0x36cf('0x11'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x12')]);router[_0x36cf('0xa')](_0x36cf('0x13'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x14')]);router[_0x36cf('0x15')]('/',auth[_0x36cf('0xb')](),controller[_0x36cf('0x16')]);router[_0x36cf('0x17')](_0x36cf('0xd'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x18')]);router[_0x36cf('0x19')](_0x36cf('0xd'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x1a')]);module[_0x36cf('0x1b')]=router;
\ No newline at end of file
+var _0xd6ef=['../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/preview','isAuthenticated','/:id/run','/:id/query','query','post','create','put','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2cf3f9,_0x64c2d6){var _0x38de13=function(_0x534436){while(--_0x534436){_0x2cf3f9['push'](_0x2cf3f9['shift']());}};_0x38de13(++_0x64c2d6);}(_0xd6ef,0xbf));var _0xfd6e=function(_0x42e34c,_0x133d3f){_0x42e34c=_0x42e34c-0x0;var _0x23bd03=_0xd6ef[_0x42e34c];return _0x23bd03;};'use strict';var multer=require(_0xfd6e('0x0'));var util=require(_0xfd6e('0x1'));var path=require(_0xfd6e('0x2'));var timeout=require(_0xfd6e('0x3'));var express=require('express');var router=express[_0xfd6e('0x4')]();var fs_extra=require(_0xfd6e('0x5'));var auth=require(_0xfd6e('0x6'));var interaction=require(_0xfd6e('0x7'));var config=require(_0xfd6e('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xfd6e('0x9')]('/',auth['isAuthenticated'](),controller[_0xfd6e('0xa')]);router[_0xfd6e('0x9')](_0xfd6e('0xb'),auth['isAuthenticated'](),controller[_0xfd6e('0xc')]);router[_0xfd6e('0x9')](_0xfd6e('0xd'),auth[_0xfd6e('0xe')](),controller['preview']);router[_0xfd6e('0x9')](_0xfd6e('0xf'),auth[_0xfd6e('0xe')](),controller['run']);router['get'](_0xfd6e('0x10'),auth[_0xfd6e('0xe')](),controller[_0xfd6e('0x11')]);router[_0xfd6e('0x12')]('/',auth['isAuthenticated'](),controller[_0xfd6e('0x13')]);router[_0xfd6e('0x14')](_0xfd6e('0xb'),auth[_0xfd6e('0xe')](),controller['update']);router[_0xfd6e('0x15')](_0xfd6e('0xb'),auth[_0xfd6e('0xe')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 10798d5..3a81b3a 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x46ed,0x168));var _0xd46e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x46ed[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x2675,0x75));var _0x5267=function(_0x3f2397,_0x154b0b){_0x3f2397=_0x3f2397-0x0;var _0x3d4ed5=_0x2675[_0x3f2397];return _0x3d4ed5;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 17cd07a..dd7299f 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 _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%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)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6d38[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
+var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x44d64f,_0x5bb5f8){var _0x54b51a=function(_0x59e6c0){while(--_0x59e6c0){_0x44d64f['push'](_0x44d64f['shift']());}};_0x54b51a(++_0x5bb5f8);}(_0x31f0,0xb7));var _0x031f=function(_0x572736,_0x35e723){_0x572736=_0x572736-0x0;var _0x231515=_0x31f0[_0x572736];return _0x231515;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5bb6ce0..08ec9e6 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 _0x2902=['bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x2902,0x1dd));var _0x2290=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x2902[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var logger=require(_0x2290('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2290('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2290('0x4'));var rimraf=require(_0x2290('0x5'));var config=require(_0x2290('0x6'));var attributes=require(_0x2290('0x7'));module[_0x2290('0x8')]=function(_0x207bc2,_0x5a9e24){return _0x207bc2[_0x2290('0x9')](_0x2290('0xa'),attributes,{'tableName':_0x2290('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fad=['request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','../../config/logger','api','moment','bluebird'];(function(_0xbbbeae,_0x4a414a){var _0x1cb9c9=function(_0x4db7d0){while(--_0x4db7d0){_0xbbbeae['push'](_0xbbbeae['shift']());}};_0x1cb9c9(++_0x4a414a);}(_0x0fad,0x167));var _0xd0fa=function(_0x2b9ac8,_0xf820cb){_0x2b9ac8=_0x2b9ac8-0x0;var _0x3ceea9=_0x0fad[_0x2b9ac8];return _0x3ceea9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd0fa('0x0'))(_0xd0fa('0x1'));var moment=require(_0xd0fa('0x2'));var BPromise=require(_0xd0fa('0x3'));var rp=require(_0xd0fa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0fa('0x5'));var config=require(_0xd0fa('0x6'));var attributes=require(_0xd0fa('0x7'));module[_0xd0fa('0x8')]=function(_0x236218,_0x536205){return _0x236218[_0xd0fa('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0xd0fa('0xa'),'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 f8f9135..e3a41c5 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 _0xf873=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x4db86d,_0x1c4512){var _0x26f506=function(_0x5d40e9){while(--_0x5d40e9){_0x4db86d['push'](_0x4db86d['shift']());}};_0x26f506(++_0x1c4512);}(_0xf873,0x1e2));var _0x3f87=function(_0x44880f,_0x35ddf5){_0x44880f=_0x44880f-0x0;var _0x40d152=_0xf873[_0x44880f];return _0x40d152;};'use strict';var _=require(_0x3f87('0x0'));var util=require(_0x3f87('0x1'));var moment=require(_0x3f87('0x2'));var BPromise=require(_0x3f87('0x3'));var rs=require(_0x3f87('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f87('0x5'))['db'];var utils=require(_0x3f87('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3f87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3f87('0x8')][_0x3f87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23a1af,_0x1ad826,_0x313447){return new BPromise(function(_0x524307,_0x3f7057){return client[_0x3f87('0xa')](_0x23a1af,_0x313447)['then'](function(_0x51d73b){logger['info'](_0x3f87('0xb'),_0x1ad826,'request\x20sent');logger[_0x3f87('0xc')](_0x3f87('0xd'),_0x1ad826,_0x3f87('0xe'),JSON[_0x3f87('0xf')](_0x51d73b));if(_0x51d73b['error']){if(_0x51d73b[_0x3f87('0x10')]['code']===0x1f4){logger[_0x3f87('0x10')](_0x3f87('0xb'),_0x1ad826,_0x51d73b[_0x3f87('0x10')][_0x3f87('0x11')]);return _0x3f7057(_0x51d73b[_0x3f87('0x10')][_0x3f87('0x11')]);}logger[_0x3f87('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ad826,_0x51d73b[_0x3f87('0x10')][_0x3f87('0x11')]);return _0x524307(_0x51d73b[_0x3f87('0x10')][_0x3f87('0x11')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ad826,_0x3f87('0xe'));_0x524307(_0x51d73b[_0x3f87('0x12')][_0x3f87('0x11')]);}})[_0x3f87('0x13')](function(_0x4564d1){logger[_0x3f87('0x10')](_0x3f87('0xb'),_0x1ad826,_0x4564d1);_0x3f7057(_0x4564d1);});});}
\ No newline at end of file
+var _0x5a11=['stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x336030,_0x4086ea){var _0x2b203b=function(_0x10b0ad){while(--_0x10b0ad){_0x336030['push'](_0x336030['shift']());}};_0x2b203b(++_0x4086ea);}(_0x5a11,0x67));var _0x15a1=function(_0x1e498d,_0x454bd2){_0x1e498d=_0x1e498d-0x0;var _0x514ccb=_0x5a11[_0x1e498d];return _0x514ccb;};'use strict';var _=require('lodash');var util=require(_0x15a1('0x0'));var moment=require('moment');var BPromise=require(_0x15a1('0x1'));var rs=require(_0x15a1('0x2'));var fs=require('fs');var Redis=require(_0x15a1('0x3'));var db=require(_0x15a1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x15a1('0x5'))(_0x15a1('0x6'));var config=require(_0x15a1('0x7'));var jayson=require(_0x15a1('0x8'));var client=jayson[_0x15a1('0x9')][_0x15a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1386ba,_0x50a11e,_0x2b1334){return new BPromise(function(_0x424062,_0x1b280c){return client[_0x15a1('0xb')](_0x1386ba,_0x2b1334)[_0x15a1('0xc')](function(_0x45d7f7){logger['info'](_0x15a1('0xd'),_0x50a11e,_0x15a1('0xe'));logger[_0x15a1('0xf')](_0x15a1('0x10'),_0x50a11e,'request\x20sent',JSON[_0x15a1('0x11')](_0x45d7f7));if(_0x45d7f7[_0x15a1('0x12')]){if(_0x45d7f7[_0x15a1('0x12')][_0x15a1('0x13')]===0x1f4){logger[_0x15a1('0x12')](_0x15a1('0xd'),_0x50a11e,_0x45d7f7[_0x15a1('0x12')][_0x15a1('0x14')]);return _0x1b280c(_0x45d7f7[_0x15a1('0x12')][_0x15a1('0x14')]);}logger[_0x15a1('0x12')](_0x15a1('0xd'),_0x50a11e,_0x45d7f7[_0x15a1('0x12')]['message']);return _0x424062(_0x45d7f7['error'][_0x15a1('0x14')]);}else{logger[_0x15a1('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x50a11e,_0x15a1('0xe'));_0x424062(_0x45d7f7[_0x15a1('0x16')][_0x15a1('0x14')]);}})[_0x15a1('0x17')](function(_0x507b18){logger[_0x15a1('0x12')](_0x15a1('0xd'),_0x50a11e,_0x507b18);_0x1b280c(_0x507b18);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 36890a9..6918eab 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 _0x1048=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','put'];(function(_0x236487,_0x39046f){var _0x1c64cc=function(_0x5e1bfb){while(--_0x5e1bfb){_0x236487['push'](_0x236487['shift']());}};_0x1c64cc(++_0x39046f);}(_0x1048,0x18a));var _0x8104=function(_0xca9e14,_0x1de326){_0xca9e14=_0xca9e14-0x0;var _0x5097af=_0x1048[_0xca9e14];return _0x5097af;};'use strict';var multer=require(_0x8104('0x0'));var util=require(_0x8104('0x1'));var path=require(_0x8104('0x2'));var timeout=require(_0x8104('0x3'));var express=require(_0x8104('0x4'));var router=express[_0x8104('0x5')]();var fs_extra=require(_0x8104('0x6'));var auth=require(_0x8104('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x8104('0x8')]('/',auth['isAuthenticated'](),controller[_0x8104('0x9')]);router[_0x8104('0x8')](_0x8104('0xa'),auth[_0x8104('0xb')](),controller[_0x8104('0xc')]);router[_0x8104('0x8')](_0x8104('0xd'),auth[_0x8104('0xb')](),controller[_0x8104('0xe')]);router[_0x8104('0x8')](_0x8104('0xf'),auth[_0x8104('0xb')](),controller['run']);router[_0x8104('0x8')](_0x8104('0x10'),auth['isAuthenticated'](),controller[_0x8104('0x11')]);router[_0x8104('0x12')]('/',auth[_0x8104('0xb')](),controller['create']);router[_0x8104('0x13')](_0x8104('0xa'),auth[_0x8104('0xb')](),controller[_0x8104('0x14')]);router[_0x8104('0x15')](_0x8104('0xa'),auth['isAuthenticated'](),controller[_0x8104('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x1879=['isAuthenticated','query','create','update','delete','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','show','/:id/preview','/:id/run','run','/:id/query'];(function(_0x5c456c,_0x5bfc13){var _0x1ba369=function(_0x22ec0c){while(--_0x22ec0c){_0x5c456c['push'](_0x5c456c['shift']());}};_0x1ba369(++_0x5bfc13);}(_0x1879,0x10a));var _0x9187=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0x1879[_0x178f52];return _0x556f99;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9187('0x0'));var express=require(_0x9187('0x1'));var router=express[_0x9187('0x2')]();var fs_extra=require(_0x9187('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9187('0x4'));var config=require(_0x9187('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9187('0x6')]);router[_0x9187('0x7')](_0x9187('0x8'),auth['isAuthenticated'](),controller[_0x9187('0x9')]);router[_0x9187('0x7')](_0x9187('0xa'),auth['isAuthenticated'](),controller['preview']);router[_0x9187('0x7')](_0x9187('0xb'),auth['isAuthenticated'](),controller[_0x9187('0xc')]);router[_0x9187('0x7')](_0x9187('0xd'),auth[_0x9187('0xe')](),controller[_0x9187('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9187('0x10')]);router['put'](_0x9187('0x8'),auth['isAuthenticated'](),controller[_0x9187('0x11')]);router[_0x9187('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9187('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 3117e8e..c4c30fd 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 _0x7d3f=['manual','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE'];(function(_0x48dd48,_0x3e0163){var _0x55040e=function(_0x5ccaaa){while(--_0x5ccaaa){_0x48dd48['push'](_0x48dd48['shift']());}};_0x55040e(++_0x3e0163);}(_0x7d3f,0xb6));var _0xf7d3=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x7d3f[_0x51b1a5];return _0x15c738;};'use strict';var Sequelize=require(_0xf7d3('0x0'));var moment=require(_0xf7d3('0x1'));module[_0xf7d3('0x2')]={'name':{'type':Sequelize[_0xf7d3('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xf7d3('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xf7d3('0x4')](_0xf7d3('0x5'),'pdf',_0xf7d3('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xf7d3('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf7d3('0x7')]},'endDate':{'type':Sequelize[_0xf7d3('0x7')]},'status':{'type':Sequelize[_0xf7d3('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xf7d3('0x4')](_0xf7d3('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0xf7d3('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xf7d3('0x9')]},'reportType':{'type':Sequelize[_0xf7d3('0x3')]}};
\ No newline at end of file
+var _0x1a6f=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','sequelize','moment','exports'];(function(_0x239303,_0x587017){var _0x59a5ea=function(_0x5e1b09){while(--_0x5e1b09){_0x239303['push'](_0x239303['shift']());}};_0x59a5ea(++_0x587017);}(_0x1a6f,0xc3));var _0xf1a6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1a6f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf1a6('0x0'));var moment=require(_0xf1a6('0x1'));module[_0xf1a6('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xf1a6('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xf1a6('0x4')](_0xf1a6('0x5'),_0xf1a6('0x6'),_0xf1a6('0x7')),'allowNull':![],'defaultValue':_0xf1a6('0x5')},'savename':{'type':Sequelize[_0xf1a6('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf1a6('0x8')]},'endDate':{'type':Sequelize[_0xf1a6('0x8')]},'status':{'type':Sequelize[_0xf1a6('0x3')],'defaultValue':_0xf1a6('0x9')},'type':{'type':Sequelize[_0xf1a6('0x4')](_0xf1a6('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0xf1a6('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 0afeb51..36730ea 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 _0x2f54=['then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','join','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','server/files/reports','format','%s.%s','basename','toLowerCase','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2f54,0x157));var _0x42f5=function(_0x3a6d3e,_0x4f0ac5){_0x3a6d3e=_0x3a6d3e-0x0;var _0x735896=_0x2f54[_0x3a6d3e];return _0x735896;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x42f5('0x0'));var zipdir=require(_0x42f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42f5('0x2'));var moment=require(_0x42f5('0x3'));var BPromise=require(_0x42f5('0x4'));var Mustache=require(_0x42f5('0x5'));var util=require(_0x42f5('0x6'));var path=require(_0x42f5('0x7'));var sox=require('sox');var csv=require(_0x42f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42f5('0x9'));var squel=require(_0x42f5('0xa'));var crypto=require('crypto');var jsforce=require(_0x42f5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x42f5('0x8'));var querystring=require(_0x42f5('0xc'));var Papa=require(_0x42f5('0xd'));var Redis=require(_0x42f5('0xe'));var authService=require(_0x42f5('0xf'));var qs=require(_0x42f5('0x10'));var as=require(_0x42f5('0x11'));var hardwareService=require(_0x42f5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x42f5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x42f5('0x14'));var db=require(_0x42f5('0x15'))['db'];function respondWithStatusCode(_0x1ca799,_0x38efad){_0x38efad=_0x38efad||0xcc;return function(_0x51f130){if(_0x51f130){return _0x1ca799['sendStatus'](_0x38efad);}return _0x1ca799[_0x42f5('0x16')](_0x38efad)['end']();};}function respondWithResult(_0xac2b72,_0x19d545){_0x19d545=_0x19d545||0xc8;return function(_0x1f4bb1){if(_0x1f4bb1){return _0xac2b72[_0x42f5('0x16')](_0x19d545)[_0x42f5('0x17')](_0x1f4bb1);}};}function respondWithFilteredResult(_0x786d86,_0x5a011c){return function(_0x256eeb){if(_0x256eeb){var _0x4d0bbd=typeof _0x5a011c[_0x42f5('0x18')]===_0x42f5('0x19')&&typeof _0x5a011c[_0x42f5('0x1a')]===_0x42f5('0x19');var _0x17365c=_0x256eeb[_0x42f5('0x1b')];var _0x5768e0=_0x4d0bbd?0x0:_0x5a011c[_0x42f5('0x18')];var _0x20fb90=_0x4d0bbd?_0x256eeb[_0x42f5('0x1b')]:_0x5a011c[_0x42f5('0x18')]+_0x5a011c[_0x42f5('0x1a')];var _0x593040;if(_0x20fb90>=_0x17365c){_0x20fb90=_0x17365c;_0x593040=0xc8;}else{_0x593040=0xce;}_0x786d86[_0x42f5('0x16')](_0x593040);return _0x786d86[_0x42f5('0x1c')](_0x42f5('0x1d'),_0x5768e0+'-'+_0x20fb90+'/'+_0x17365c)[_0x42f5('0x17')](_0x256eeb);}return null;};}function patchUpdates(_0x52141a){return function(_0x1e117d){try{jsonpatch[_0x42f5('0x1e')](_0x1e117d,_0x52141a,!![]);}catch(_0x50e18d){return BPromise[_0x42f5('0x1f')](_0x50e18d);}return _0x1e117d['save']();};}function saveUpdates(_0x18e85f,_0xde6e71){return function(_0x5d81d4){if(_0x5d81d4){return _0x5d81d4[_0x42f5('0x20')](_0x18e85f)[_0x42f5('0x21')](function(_0x2803d6){return _0x2803d6;});}return null;};}function removeEntity(_0x5579e4,_0x3b1bde){return function(_0x5d290f){if(_0x5d290f){return _0x5d290f[_0x42f5('0x22')]()[_0x42f5('0x21')](function(){var _0x1005f3=_0x5d290f[_0x42f5('0x23')]({'plain':!![]});var _0x4f2200=_0x42f5('0x24');return db[_0x42f5('0x25')][_0x42f5('0x22')]({'where':{'type':_0x4f2200,'resourceId':_0x1005f3['id']}})[_0x42f5('0x21')](function(){return _0x5d290f;});})[_0x42f5('0x21')](function(){_0x5579e4[_0x42f5('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xddec5,_0x58b71f){return function(_0x50e89f){if(!_0x50e89f){_0xddec5[_0x42f5('0x26')](0x194);}return _0x50e89f;};}function handleError(_0x30fc80,_0x3ef488){_0x3ef488=_0x3ef488||0x1f4;return function(_0x4eb028){logger[_0x42f5('0x27')](_0x4eb028[_0x42f5('0x28')]);if(_0x4eb028[_0x42f5('0x29')]){delete _0x4eb028[_0x42f5('0x29')];}_0x30fc80[_0x42f5('0x16')](_0x3ef488)[_0x42f5('0x2a')](_0x4eb028);};}exports[_0x42f5('0x2b')]=function(_0x482784,_0x494f58){var _0x45a8eb={},_0x32a56e={},_0x3a5186={'count':0x0,'rows':[]};var _0x1c7d43=_[_0x42f5('0x2c')](db[_0x42f5('0x2d')][_0x42f5('0x2e')],function(_0x139808){return{'name':_0x139808[_0x42f5('0x2f')],'type':_0x139808[_0x42f5('0x30')]['key']};});_0x32a56e['model']=_[_0x42f5('0x2c')](_0x1c7d43,_0x42f5('0x29'));_0x32a56e[_0x42f5('0x31')]=_[_0x42f5('0x32')](_0x482784[_0x42f5('0x31')]);_0x32a56e[_0x42f5('0x33')]=_['intersection'](_0x32a56e['model'],_0x32a56e['query']);_0x45a8eb[_0x42f5('0x34')]=_[_0x42f5('0x35')](_0x32a56e[_0x42f5('0x36')],qs[_0x42f5('0x37')](_0x482784[_0x42f5('0x31')][_0x42f5('0x37')]));_0x45a8eb[_0x42f5('0x34')]=_0x45a8eb[_0x42f5('0x34')][_0x42f5('0x38')]?_0x45a8eb[_0x42f5('0x34')]:_0x32a56e[_0x42f5('0x36')];if(!_0x482784['query'][_0x42f5('0x39')]('nolimit')){_0x45a8eb[_0x42f5('0x1a')]=qs[_0x42f5('0x1a')](_0x482784['query']['limit']);_0x45a8eb[_0x42f5('0x18')]=qs[_0x42f5('0x18')](_0x482784[_0x42f5('0x31')][_0x42f5('0x18')]);}_0x45a8eb[_0x42f5('0x3a')]=qs[_0x42f5('0x3b')](_0x482784[_0x42f5('0x31')][_0x42f5('0x3b')]);_0x45a8eb[_0x42f5('0x3c')]=qs[_0x42f5('0x33')](_['pick'](_0x482784[_0x42f5('0x31')],_0x32a56e[_0x42f5('0x33')]),_0x1c7d43);if(_0x482784[_0x42f5('0x31')]['filter']){_0x45a8eb[_0x42f5('0x3c')]=_[_0x42f5('0x3d')](_0x45a8eb[_0x42f5('0x3c')],{'$or':_[_0x42f5('0x2c')](_0x1c7d43,function(_0x19fe92){if(_0x19fe92[_0x42f5('0x30')]!==_0x42f5('0x3e')){var _0x2d977c={};_0x2d977c[_0x19fe92[_0x42f5('0x29')]]={'$like':'%'+_0x482784['query'][_0x42f5('0x3f')]+'%'};return _0x2d977c;}})});}_0x45a8eb=_[_0x42f5('0x3d')]({},_0x45a8eb,_0x482784[_0x42f5('0x40')]);var _0x3ca407={'where':_0x45a8eb[_0x42f5('0x3c')]};return db[_0x42f5('0x2d')][_0x42f5('0x1b')](_0x3ca407)['then'](function(_0x438feb){_0x3a5186[_0x42f5('0x1b')]=_0x438feb;if(_0x482784[_0x42f5('0x31')]['includeAll']){_0x45a8eb['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x42f5('0x41')](_0x45a8eb);})[_0x42f5('0x21')](function(_0x5a2380){_0x3a5186[_0x42f5('0x42')]=_0x5a2380;return _0x3a5186;})[_0x42f5('0x21')](respondWithFilteredResult(_0x494f58,_0x45a8eb))[_0x42f5('0x43')](handleError(_0x494f58,null));};exports[_0x42f5('0x44')]=function(_0x45d34f,_0x430156){var _0x1fb383={'raw':!![],'where':{'id':_0x45d34f[_0x42f5('0x45')]['id']}},_0x2159f0={};_0x2159f0['model']=_[_0x42f5('0x32')](db['AnalyticExtractedReport'][_0x42f5('0x2e')]);_0x2159f0[_0x42f5('0x31')]=_['keys'](_0x45d34f['query']);_0x2159f0[_0x42f5('0x33')]=_[_0x42f5('0x35')](_0x2159f0['model'],_0x2159f0[_0x42f5('0x31')]);_0x1fb383[_0x42f5('0x34')]=_[_0x42f5('0x35')](_0x2159f0[_0x42f5('0x36')],qs[_0x42f5('0x37')](_0x45d34f['query'][_0x42f5('0x37')]));_0x1fb383[_0x42f5('0x34')]=_0x1fb383[_0x42f5('0x34')][_0x42f5('0x38')]?_0x1fb383[_0x42f5('0x34')]:_0x2159f0[_0x42f5('0x36')];if(_0x45d34f['query'][_0x42f5('0x46')]){_0x1fb383['include']=[{'all':!![]}];}_0x1fb383=_[_0x42f5('0x3d')]({},_0x1fb383,_0x45d34f[_0x42f5('0x40')]);return db[_0x42f5('0x2d')][_0x42f5('0x47')](_0x1fb383)[_0x42f5('0x21')](handleEntityNotFound(_0x430156,null))[_0x42f5('0x21')](respondWithResult(_0x430156,null))['catch'](handleError(_0x430156,null));};exports['create']=function(_0x29262d,_0x378e9c){return db[_0x42f5('0x2d')][_0x42f5('0x48')](_0x29262d[_0x42f5('0x49')],{})[_0x42f5('0x21')](function(_0x251991){var _0x22735c=_0x29262d[_0x42f5('0x4a')][_0x42f5('0x23')]({'plain':!![]});if(!_0x22735c)throw new Error(_0x42f5('0x4b'));if(_0x22735c[_0x42f5('0x4c')]==='user'){var _0x56cab5=_0x251991['get']({'plain':!![]});var _0x17c7b9=_0x42f5('0x24');return db[_0x42f5('0x4d')][_0x42f5('0x47')]({'where':{'name':_0x17c7b9,'userProfileId':_0x22735c[_0x42f5('0x4e')]},'raw':!![]})[_0x42f5('0x21')](function(_0x5646ec){if(_0x5646ec&&_0x5646ec[_0x42f5('0x4f')]===0x0){return db[_0x42f5('0x25')][_0x42f5('0x48')]({'name':_0x56cab5[_0x42f5('0x29')],'resourceId':_0x56cab5['id'],'type':_0x5646ec[_0x42f5('0x29')],'sectionId':_0x5646ec['id']},{})[_0x42f5('0x21')](function(){return _0x251991;});}else{return _0x251991;}})[_0x42f5('0x43')](function(_0xc70407){logger['error'](_0x42f5('0x50'),_0xc70407);throw _0xc70407;});}return _0x251991;})[_0x42f5('0x21')](respondWithResult(_0x378e9c,0xc9))[_0x42f5('0x43')](handleError(_0x378e9c,null));};exports[_0x42f5('0x20')]=function(_0x132a03,_0x151ad9){if(_0x132a03[_0x42f5('0x49')]['id']){delete _0x132a03['body']['id'];}return db['AnalyticExtractedReport'][_0x42f5('0x47')]({'where':{'id':_0x132a03[_0x42f5('0x45')]['id']}})[_0x42f5('0x21')](handleEntityNotFound(_0x151ad9,null))[_0x42f5('0x21')](saveUpdates(_0x132a03[_0x42f5('0x49')],null))[_0x42f5('0x21')](respondWithResult(_0x151ad9,null))[_0x42f5('0x43')](handleError(_0x151ad9,null));};exports[_0x42f5('0x22')]=function(_0xd33633,_0x2df301){return db[_0x42f5('0x2d')][_0x42f5('0x47')]({'where':{'id':_0xd33633[_0x42f5('0x45')]['id']}})[_0x42f5('0x21')](handleEntityNotFound(_0x2df301,null))['then'](removeEntity(_0x2df301,null))['catch'](handleError(_0x2df301,null));};exports[_0x42f5('0x51')]=function(_0x32ccbc,_0x5a0b42,_0xa9c807){return db[_0x42f5('0x2d')][_0x42f5('0x47')]({'where':{'id':_0x32ccbc[_0x42f5('0x45')]['id']},'attributes':[_0x42f5('0x29'),'basename',_0x42f5('0x52'),_0x42f5('0x53')],'raw':!![]})[_0x42f5('0x21')](handleEntityNotFound(_0x5a0b42,null))[_0x42f5('0x21')](function(_0x41bcef){if(_0x41bcef){if(!fs['existsSync'](path[_0x42f5('0x54')](config['root'],'server/files/reports',_0x41bcef[_0x42f5('0x52')]))){throw new db['Sequelize'][(_0x42f5('0x55'))](_0x42f5('0x56'));}if(_0x32ccbc[_0x42f5('0x31')][_0x42f5('0x57')]){return _0x5a0b42[_0x42f5('0x26')](0xc8);}return _0x5a0b42[_0x42f5('0x51')](path[_0x42f5('0x54')](config[_0x42f5('0x58')],_0x42f5('0x59'),_0x41bcef[_0x42f5('0x52')]),util[_0x42f5('0x5a')](_0x42f5('0x5b'),_0x41bcef[_0x42f5('0x5c')]||_0x41bcef[_0x42f5('0x29')],_0x41bcef['output'][_0x42f5('0x5d')]()));}})[_0x42f5('0x43')](handleError(_0x5a0b42,null));};
\ No newline at end of file
+var _0x1a3f=['%s.%s','toLowerCase','eml-format','zip-dir','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','download','basename','output','existsSync','join','root','savename','Sequelize','ValidationError','format'];(function(_0xbe08b3,_0x418fa1){var _0x198f71=function(_0x586f18){while(--_0x586f18){_0xbe08b3['push'](_0xbe08b3['shift']());}};_0x198f71(++_0x418fa1);}(_0x1a3f,0x110));var _0xf1a3=function(_0x680ace,_0xb396b5){_0x680ace=_0x680ace-0x0;var _0x4e73bd=_0x1a3f[_0x680ace];return _0x4e73bd;};'use strict';var emlformat=require(_0xf1a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf1a3('0x2'));var Mustache=require(_0xf1a3('0x3'));var util=require(_0xf1a3('0x4'));var path=require(_0xf1a3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1a3('0x6'));var fs=require('fs');var fs_extra=require(_0xf1a3('0x7'));var _=require(_0xf1a3('0x8'));var squel=require(_0xf1a3('0x9'));var crypto=require(_0xf1a3('0xa'));var jsforce=require(_0xf1a3('0xb'));var deskjs=require(_0xf1a3('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf1a3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf1a3('0xe'));var as=require(_0xf1a3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf1a3('0x10'));var licenseUtil=require(_0xf1a3('0x11'));var db=require(_0xf1a3('0x12'))['db'];function respondWithStatusCode(_0x3bc06a,_0x24bfa7){_0x24bfa7=_0x24bfa7||0xcc;return function(_0x4915f5){if(_0x4915f5){return _0x3bc06a[_0xf1a3('0x13')](_0x24bfa7);}return _0x3bc06a[_0xf1a3('0x14')](_0x24bfa7)[_0xf1a3('0x15')]();};}function respondWithResult(_0x13701d,_0x342351){_0x342351=_0x342351||0xc8;return function(_0x840b58){if(_0x840b58){return _0x13701d['status'](_0x342351)[_0xf1a3('0x16')](_0x840b58);}};}function respondWithFilteredResult(_0x1e7dfd,_0x2ea520){return function(_0x112067){if(_0x112067){var _0x285272=typeof _0x2ea520[_0xf1a3('0x17')]===_0xf1a3('0x18')&&typeof _0x2ea520[_0xf1a3('0x19')]==='undefined';var _0x14d5da=_0x112067[_0xf1a3('0x1a')];var _0x4c6924=_0x285272?0x0:_0x2ea520[_0xf1a3('0x17')];var _0x5cd2c2=_0x285272?_0x112067['count']:_0x2ea520[_0xf1a3('0x17')]+_0x2ea520['limit'];var _0x5c8946;if(_0x5cd2c2>=_0x14d5da){_0x5cd2c2=_0x14d5da;_0x5c8946=0xc8;}else{_0x5c8946=0xce;}_0x1e7dfd[_0xf1a3('0x14')](_0x5c8946);return _0x1e7dfd[_0xf1a3('0x1b')](_0xf1a3('0x1c'),_0x4c6924+'-'+_0x5cd2c2+'/'+_0x14d5da)[_0xf1a3('0x16')](_0x112067);}return null;};}function patchUpdates(_0x258522){return function(_0x1bc3a7){try{jsonpatch[_0xf1a3('0x1d')](_0x1bc3a7,_0x258522,!![]);}catch(_0x4a7ed9){return BPromise['reject'](_0x4a7ed9);}return _0x1bc3a7['save']();};}function saveUpdates(_0x2303ff,_0xa7d329){return function(_0xdf862a){if(_0xdf862a){return _0xdf862a['update'](_0x2303ff)[_0xf1a3('0x1e')](function(_0x5cb78d){return _0x5cb78d;});}return null;};}function removeEntity(_0x541b5a,_0xb7b615){return function(_0x570755){if(_0x570755){return _0x570755[_0xf1a3('0x1f')]()['then'](function(){var _0x53aacc=_0x570755[_0xf1a3('0x20')]({'plain':!![]});var _0x25847c=_0xf1a3('0x21');return db[_0xf1a3('0x22')][_0xf1a3('0x1f')]({'where':{'type':_0x25847c,'resourceId':_0x53aacc['id']}})[_0xf1a3('0x1e')](function(){return _0x570755;});})[_0xf1a3('0x1e')](function(){_0x541b5a['status'](0xcc)[_0xf1a3('0x15')]();});}};}function handleEntityNotFound(_0x3446d3,_0x267183){return function(_0x4c24){if(!_0x4c24){_0x3446d3[_0xf1a3('0x13')](0x194);}return _0x4c24;};}function handleError(_0xb76e0e,_0x866d7b){_0x866d7b=_0x866d7b||0x1f4;return function(_0x14e13){logger[_0xf1a3('0x23')](_0x14e13[_0xf1a3('0x24')]);if(_0x14e13[_0xf1a3('0x25')]){delete _0x14e13[_0xf1a3('0x25')];}_0xb76e0e['status'](_0x866d7b)[_0xf1a3('0x26')](_0x14e13);};}exports[_0xf1a3('0x27')]=function(_0x1719e8,_0x365f52){var _0x5119ca={},_0x13dc4f={},_0x1cb600={'count':0x0,'rows':[]};var _0x2fee23=_[_0xf1a3('0x28')](db[_0xf1a3('0x29')][_0xf1a3('0x2a')],function(_0x4a60f5){return{'name':_0x4a60f5[_0xf1a3('0x2b')],'type':_0x4a60f5['type'][_0xf1a3('0x2c')]};});_0x13dc4f[_0xf1a3('0x2d')]=_[_0xf1a3('0x28')](_0x2fee23,'name');_0x13dc4f[_0xf1a3('0x2e')]=_[_0xf1a3('0x2f')](_0x1719e8[_0xf1a3('0x2e')]);_0x13dc4f[_0xf1a3('0x30')]=_[_0xf1a3('0x31')](_0x13dc4f[_0xf1a3('0x2d')],_0x13dc4f[_0xf1a3('0x2e')]);_0x5119ca[_0xf1a3('0x32')]=_[_0xf1a3('0x31')](_0x13dc4f[_0xf1a3('0x2d')],qs[_0xf1a3('0x33')](_0x1719e8[_0xf1a3('0x2e')][_0xf1a3('0x33')]));_0x5119ca[_0xf1a3('0x32')]=_0x5119ca[_0xf1a3('0x32')][_0xf1a3('0x34')]?_0x5119ca[_0xf1a3('0x32')]:_0x13dc4f[_0xf1a3('0x2d')];if(!_0x1719e8[_0xf1a3('0x2e')]['hasOwnProperty']('nolimit')){_0x5119ca['limit']=qs[_0xf1a3('0x19')](_0x1719e8[_0xf1a3('0x2e')][_0xf1a3('0x19')]);_0x5119ca[_0xf1a3('0x17')]=qs['offset'](_0x1719e8['query']['offset']);}_0x5119ca[_0xf1a3('0x35')]=qs['sort'](_0x1719e8[_0xf1a3('0x2e')][_0xf1a3('0x36')]);_0x5119ca[_0xf1a3('0x37')]=qs['filters'](_[_0xf1a3('0x38')](_0x1719e8[_0xf1a3('0x2e')],_0x13dc4f[_0xf1a3('0x30')]),_0x2fee23);if(_0x1719e8['query'][_0xf1a3('0x39')]){_0x5119ca['where']=_[_0xf1a3('0x3a')](_0x5119ca['where'],{'$or':_[_0xf1a3('0x28')](_0x2fee23,function(_0x353f40){if(_0x353f40[_0xf1a3('0x3b')]!==_0xf1a3('0x3c')){var _0x11fe66={};_0x11fe66[_0x353f40[_0xf1a3('0x25')]]={'$like':'%'+_0x1719e8['query'][_0xf1a3('0x39')]+'%'};return _0x11fe66;}})});}_0x5119ca=_['merge']({},_0x5119ca,_0x1719e8[_0xf1a3('0x3d')]);var _0x4048de={'where':_0x5119ca[_0xf1a3('0x37')]};return db[_0xf1a3('0x29')]['count'](_0x4048de)['then'](function(_0x2dc493){_0x1cb600[_0xf1a3('0x1a')]=_0x2dc493;if(_0x1719e8['query']['includeAll']){_0x5119ca[_0xf1a3('0x3e')]=[{'all':!![]}];}return db[_0xf1a3('0x29')][_0xf1a3('0x3f')](_0x5119ca);})[_0xf1a3('0x1e')](function(_0x41e277){_0x1cb600[_0xf1a3('0x40')]=_0x41e277;return _0x1cb600;})[_0xf1a3('0x1e')](respondWithFilteredResult(_0x365f52,_0x5119ca))[_0xf1a3('0x41')](handleError(_0x365f52,null));};exports[_0xf1a3('0x42')]=function(_0x5854ef,_0x4ea168){var _0x306403={'raw':!![],'where':{'id':_0x5854ef['params']['id']}},_0x1da5b9={};_0x1da5b9[_0xf1a3('0x2d')]=_[_0xf1a3('0x2f')](db[_0xf1a3('0x29')][_0xf1a3('0x2a')]);_0x1da5b9[_0xf1a3('0x2e')]=_['keys'](_0x5854ef[_0xf1a3('0x2e')]);_0x1da5b9[_0xf1a3('0x30')]=_['intersection'](_0x1da5b9[_0xf1a3('0x2d')],_0x1da5b9[_0xf1a3('0x2e')]);_0x306403[_0xf1a3('0x32')]=_[_0xf1a3('0x31')](_0x1da5b9[_0xf1a3('0x2d')],qs[_0xf1a3('0x33')](_0x5854ef[_0xf1a3('0x2e')][_0xf1a3('0x33')]));_0x306403[_0xf1a3('0x32')]=_0x306403['attributes'][_0xf1a3('0x34')]?_0x306403['attributes']:_0x1da5b9[_0xf1a3('0x2d')];if(_0x5854ef[_0xf1a3('0x2e')][_0xf1a3('0x43')]){_0x306403[_0xf1a3('0x3e')]=[{'all':!![]}];}_0x306403=_[_0xf1a3('0x3a')]({},_0x306403,_0x5854ef['options']);return db[_0xf1a3('0x29')]['find'](_0x306403)[_0xf1a3('0x1e')](handleEntityNotFound(_0x4ea168,null))[_0xf1a3('0x1e')](respondWithResult(_0x4ea168,null))[_0xf1a3('0x41')](handleError(_0x4ea168,null));};exports[_0xf1a3('0x44')]=function(_0x379e58,_0x56093c){return db[_0xf1a3('0x29')][_0xf1a3('0x44')](_0x379e58[_0xf1a3('0x45')],{})[_0xf1a3('0x1e')](function(_0x228e76){var _0x3e9ed5=_0x379e58[_0xf1a3('0x46')][_0xf1a3('0x20')]({'plain':!![]});if(!_0x3e9ed5)throw new Error(_0xf1a3('0x47'));if(_0x3e9ed5['role']===_0xf1a3('0x46')){var _0x2632b5=_0x228e76[_0xf1a3('0x20')]({'plain':!![]});var _0x54cd80=_0xf1a3('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x54cd80,'userProfileId':_0x3e9ed5[_0xf1a3('0x48')]},'raw':!![]})['then'](function(_0x3658ce){if(_0x3658ce&&_0x3658ce[_0xf1a3('0x49')]===0x0){return db[_0xf1a3('0x22')][_0xf1a3('0x44')]({'name':_0x2632b5['name'],'resourceId':_0x2632b5['id'],'type':_0x3658ce[_0xf1a3('0x25')],'sectionId':_0x3658ce['id']},{})[_0xf1a3('0x1e')](function(){return _0x228e76;});}else{return _0x228e76;}})['catch'](function(_0x4d8fe0){logger['error'](_0xf1a3('0x4a'),_0x4d8fe0);throw _0x4d8fe0;});}return _0x228e76;})['then'](respondWithResult(_0x56093c,0xc9))[_0xf1a3('0x41')](handleError(_0x56093c,null));};exports[_0xf1a3('0x4b')]=function(_0x39a45e,_0x35f655){if(_0x39a45e['body']['id']){delete _0x39a45e[_0xf1a3('0x45')]['id'];}return db[_0xf1a3('0x29')][_0xf1a3('0x4c')]({'where':{'id':_0x39a45e[_0xf1a3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35f655,null))['then'](saveUpdates(_0x39a45e[_0xf1a3('0x45')],null))['then'](respondWithResult(_0x35f655,null))[_0xf1a3('0x41')](handleError(_0x35f655,null));};exports[_0xf1a3('0x1f')]=function(_0x1f6def,_0x428c2d){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1f6def[_0xf1a3('0x4d')]['id']}})[_0xf1a3('0x1e')](handleEntityNotFound(_0x428c2d,null))[_0xf1a3('0x1e')](removeEntity(_0x428c2d,null))['catch'](handleError(_0x428c2d,null));};exports[_0xf1a3('0x4e')]=function(_0x404223,_0x26f6d3,_0x415194){return db['AnalyticExtractedReport'][_0xf1a3('0x4c')]({'where':{'id':_0x404223[_0xf1a3('0x4d')]['id']},'attributes':['name',_0xf1a3('0x4f'),'savename',_0xf1a3('0x50')],'raw':!![]})[_0xf1a3('0x1e')](handleEntityNotFound(_0x26f6d3,null))['then'](function(_0x50df3c){if(_0x50df3c){if(!fs[_0xf1a3('0x51')](path[_0xf1a3('0x52')](config[_0xf1a3('0x53')],'server/files/reports',_0x50df3c[_0xf1a3('0x54')]))){throw new db[(_0xf1a3('0x55'))][(_0xf1a3('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x404223['query']['exists']){return _0x26f6d3[_0xf1a3('0x13')](0xc8);}return _0x26f6d3['download'](path['join'](config[_0xf1a3('0x53')],'server/files/reports',_0x50df3c[_0xf1a3('0x54')]),util[_0xf1a3('0x57')](_0xf1a3('0x58'),_0x50df3c[_0xf1a3('0x4f')]||_0x50df3c[_0xf1a3('0x25')],_0x50df3c[_0xf1a3('0x50')][_0xf1a3('0x59')]()));}})['catch'](handleError(_0x26f6d3,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 789e426..d0f188e 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 _0x9c27=['define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4ec87c,_0x40549f){var _0x4893bc=function(_0x21ea7b){while(--_0x21ea7b){_0x4ec87c['push'](_0x4ec87c['shift']());}};_0x4893bc(++_0x40549f);}(_0x9c27,0x87));var _0x79c2=function(_0x19ef32,_0x3b78ff){_0x19ef32=_0x19ef32-0x0;var _0x20034e=_0x9c27[_0x19ef32];return _0x20034e;};'use strict';var _=require('lodash');var util=require(_0x79c2('0x0'));var logger=require(_0x79c2('0x1'))('api');var moment=require(_0x79c2('0x2'));var BPromise=require('bluebird');var rp=require(_0x79c2('0x3'));var fs=require('fs');var path=require(_0x79c2('0x4'));var rimraf=require(_0x79c2('0x5'));var config=require(_0x79c2('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x79c2('0x7')]=function(_0x1152f9,_0x1e75ab){return _0x1152f9[_0x79c2('0x8')](_0x79c2('0x9'),attributes,{'tableName':_0x79c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc223=['analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x4bebd7,_0x406296){var _0x45b0de=function(_0x3fc5e6){while(--_0x3fc5e6){_0x4bebd7['push'](_0x4bebd7['shift']());}};_0x45b0de(++_0x406296);}(_0xc223,0x9b));var _0x3c22=function(_0x59aca7,_0x4a40ef){_0x59aca7=_0x59aca7-0x0;var _0x456f4d=_0xc223[_0x59aca7];return _0x456f4d;};'use strict';var _=require(_0x3c22('0x0'));var util=require(_0x3c22('0x1'));var logger=require(_0x3c22('0x2'))(_0x3c22('0x3'));var moment=require(_0x3c22('0x4'));var BPromise=require(_0x3c22('0x5'));var rp=require(_0x3c22('0x6'));var fs=require('fs');var path=require(_0x3c22('0x7'));var rimraf=require('rimraf');var config=require(_0x3c22('0x8'));var attributes=require(_0x3c22('0x9'));module[_0x3c22('0xa')]=function(_0x420368,_0x565f5d){return _0x420368[_0x3c22('0xb')](_0x3c22('0xc'),attributes,{'tableName':_0x3c22('0xd'),'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 125ee6a..38540ff 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 _0x426a=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x49f856,_0x26dc54){var _0x1bacb6=function(_0xd115b3){while(--_0xd115b3){_0x49f856['push'](_0x49f856['shift']());}};_0x1bacb6(++_0x26dc54);}(_0x426a,0x6b));var _0xa426=function(_0x18905b,_0x3a81c4){_0x18905b=_0x18905b-0x0;var _0x18e801=_0x426a[_0x18905b];return _0x18e801;};'use strict';var _=require(_0xa426('0x0'));var util=require(_0xa426('0x1'));var moment=require(_0xa426('0x2'));var BPromise=require(_0xa426('0x3'));var rs=require(_0xa426('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa426('0x5'))['db'];var utils=require(_0xa426('0x6'));var logger=require(_0xa426('0x7'))(_0xa426('0x8'));var config=require(_0xa426('0x9'));var jayson=require(_0xa426('0xa'));var client=jayson[_0xa426('0xb')][_0xa426('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a481e,_0x100bce,_0x27ec68){return new BPromise(function(_0x1fe3fb,_0x2fd1f6){return client[_0xa426('0xd')](_0x3a481e,_0x27ec68)[_0xa426('0xe')](function(_0xc028af){logger[_0xa426('0xf')](_0xa426('0x10'),_0x100bce,_0xa426('0x11'));logger[_0xa426('0x12')](_0xa426('0x13'),_0x100bce,_0xa426('0x11'),JSON[_0xa426('0x14')](_0xc028af));if(_0xc028af[_0xa426('0x15')]){if(_0xc028af[_0xa426('0x15')][_0xa426('0x16')]===0x1f4){logger[_0xa426('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x100bce,_0xc028af[_0xa426('0x15')][_0xa426('0x17')]);return _0x2fd1f6(_0xc028af[_0xa426('0x15')][_0xa426('0x17')]);}logger['error'](_0xa426('0x10'),_0x100bce,_0xc028af['error'][_0xa426('0x17')]);return _0x1fe3fb(_0xc028af[_0xa426('0x15')][_0xa426('0x17')]);}else{logger[_0xa426('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x100bce,'request\x20sent');_0x1fe3fb(_0xc028af[_0xa426('0x18')][_0xa426('0x17')]);}})['catch'](function(_0x3011b8){logger[_0xa426('0x15')](_0xa426('0x10'),_0x100bce,_0x3011b8);_0x2fd1f6(_0x3011b8);});});}
\ No newline at end of file
+var _0xb31c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','moment'];(function(_0x3f6676,_0x2ae949){var _0x49efcf=function(_0x10a4cb){while(--_0x10a4cb){_0x3f6676['push'](_0x3f6676['shift']());}};_0x49efcf(++_0x2ae949);}(_0xb31c,0x133));var _0xcb31=function(_0x142849,_0x4f35eb){_0x142849=_0x142849-0x0;var _0x59d465=_0xb31c[_0x142849];return _0x59d465;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcb31('0x0'));var BPromise=require('bluebird');var rs=require(_0xcb31('0x1'));var fs=require('fs');var Redis=require(_0xcb31('0x2'));var db=require(_0xcb31('0x3'))['db'];var utils=require(_0xcb31('0x4'));var logger=require(_0xcb31('0x5'))(_0xcb31('0x6'));var config=require(_0xcb31('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcb31('0x8')][_0xcb31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4db4c2,_0x4db3de,_0x2fcb13){return new BPromise(function(_0x51281,_0x44fc32){return client[_0xcb31('0xa')](_0x4db4c2,_0x2fcb13)[_0xcb31('0xb')](function(_0x20493d){logger['info'](_0xcb31('0xc'),_0x4db3de,_0xcb31('0xd'));logger[_0xcb31('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4db3de,_0xcb31('0xd'),JSON[_0xcb31('0xf')](_0x20493d));if(_0x20493d[_0xcb31('0x10')]){if(_0x20493d[_0xcb31('0x10')][_0xcb31('0x11')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4db3de,_0x20493d[_0xcb31('0x10')]['message']);return _0x44fc32(_0x20493d[_0xcb31('0x10')]['message']);}logger[_0xcb31('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4db3de,_0x20493d[_0xcb31('0x10')]['message']);return _0x51281(_0x20493d[_0xcb31('0x10')][_0xcb31('0x12')]);}else{logger[_0xcb31('0x13')](_0xcb31('0xc'),_0x4db3de,_0xcb31('0xd'));_0x51281(_0x20493d[_0xcb31('0x14')][_0xcb31('0x12')]);}})[_0xcb31('0x15')](function(_0x5dcd39){logger[_0xcb31('0x10')](_0xcb31('0xc'),_0x4db3de,_0x5dcd39);_0x44fc32(_0x5dcd39);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 8ac7ac1..36912bc 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 _0xae24=['util','path','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4243f2,_0x168abb){var _0x5cfbac=function(_0x5bf049){while(--_0x5bf049){_0x4243f2['push'](_0x4243f2['shift']());}};_0x5cfbac(++_0x168abb);}(_0xae24,0xf6));var _0x4ae2=function(_0x4e49c2,_0x37c7eb){_0x4e49c2=_0x4e49c2-0x0;var _0x1c0ca9=_0xae24[_0x4e49c2];return _0x1c0ca9;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require(_0x4ae2('0x1'));var path=require(_0x4ae2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4ae2('0x4'));var interaction=require(_0x4ae2('0x5'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x6'));router[_0x4ae2('0x7')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x7')](_0x4ae2('0x9'),auth[_0x4ae2('0xa')](),controller['show']);router[_0x4ae2('0x7')](_0x4ae2('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x4ae2('0xc')]('/',auth[_0x4ae2('0xa')](),controller[_0x4ae2('0xd')]);router[_0x4ae2('0xe')](_0x4ae2('0x9'),auth[_0x4ae2('0xa')](),controller[_0x4ae2('0xf')]);router[_0x4ae2('0x10')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller[_0x4ae2('0x11')]);module[_0x4ae2('0x12')]=router;
\ No newline at end of file
+var _0xb7fa=['/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x699fb4,_0x22d4a1){var _0x443f9d=function(_0x52b3fa){while(--_0x52b3fa){_0x699fb4['push'](_0x699fb4['shift']());}};_0x443f9d(++_0x22d4a1);}(_0xb7fa,0xf1));var _0xab7f=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xb7fa[_0x17784a];return _0x41aded;};'use strict';var multer=require(_0xab7f('0x0'));var util=require(_0xab7f('0x1'));var path=require(_0xab7f('0x2'));var timeout=require(_0xab7f('0x3'));var express=require(_0xab7f('0x4'));var router=express['Router']();var fs_extra=require(_0xab7f('0x5'));var auth=require(_0xab7f('0x6'));var interaction=require(_0xab7f('0x7'));var config=require('../../config/environment');var controller=require(_0xab7f('0x8'));router[_0xab7f('0x9')]('/',auth[_0xab7f('0xa')](),controller[_0xab7f('0xb')]);router[_0xab7f('0x9')](_0xab7f('0xc'),auth[_0xab7f('0xa')](),controller[_0xab7f('0xd')]);router[_0xab7f('0x9')](_0xab7f('0xe'),auth[_0xab7f('0xa')](),controller[_0xab7f('0xf')]);router[_0xab7f('0x10')]('/',auth[_0xab7f('0xa')](),controller[_0xab7f('0x11')]);router[_0xab7f('0x12')](_0xab7f('0xc'),auth[_0xab7f('0xa')](),controller[_0xab7f('0x13')]);router[_0xab7f('0x14')](_0xab7f('0xc'),auth[_0xab7f('0xa')](),controller[_0xab7f('0x15')]);module[_0xab7f('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3f9ed63..ab55f17 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 _0x2eb5=['STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0xdc4266,_0x2b1bdd){var _0x543273=function(_0x7b7f4a){while(--_0x7b7f4a){_0xdc4266['push'](_0xdc4266['shift']());}};_0x543273(++_0x2b1bdd);}(_0x2eb5,0x9c));var _0x52eb=function(_0x3c0c0c,_0x567580){_0x3c0c0c=_0x3c0c0c-0x0;var _0x4ba2e3=_0x2eb5[_0x3c0c0c];return _0x4ba2e3;};'use strict';var Sequelize=require(_0x52eb('0x0'));module[_0x52eb('0x1')]={'field':{'type':Sequelize[_0x52eb('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x52eb('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x52eb('0x4')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe293=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x37cf79,_0x592e3b){var _0x16da17=function(_0x15b8af){while(--_0x15b8af){_0x37cf79['push'](_0x37cf79['shift']());}};_0x16da17(++_0x592e3b);}(_0xe293,0x179));var _0x3e29=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xe293[_0x247fa1];return _0x244f35;};'use strict';var Sequelize=require(_0x3e29('0x0'));module[_0x3e29('0x1')]={'field':{'type':Sequelize[_0x3e29('0x2')]},'alias':{'type':Sequelize[_0x3e29('0x3')]},'function':{'type':Sequelize[_0x3e29('0x3')]},'format':{'type':Sequelize[_0x3e29('0x3')]},'groupBy':{'type':Sequelize[_0x3e29('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3e29('0x3')]},'custom':{'type':Sequelize[_0x3e29('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4490102..2669fba 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 _0x7853=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','AnalyticFieldReport','include','show','params','keys','intersection','includeAll','find','catch','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','CustomReportId','rimraf'];(function(_0x23129d,_0x599b5b){var _0x4faa48=function(_0x5e9a93){while(--_0x5e9a93){_0x23129d['push'](_0x23129d['shift']());}};_0x4faa48(++_0x599b5b);}(_0x7853,0x97));var _0x3785=function(_0x51ca5b,_0x326c16){_0x51ca5b=_0x51ca5b-0x0;var _0x5bef49=_0x7853[_0x51ca5b];return _0x5bef49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3785('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3785('0x1'));var rp=require(_0x3785('0x2'));var moment=require('moment');var BPromise=require(_0x3785('0x3'));var Mustache=require(_0x3785('0x4'));var util=require(_0x3785('0x5'));var path=require(_0x3785('0x6'));var sox=require(_0x3785('0x7'));var csv=require(_0x3785('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3785('0x9'));var _=require(_0x3785('0xa'));var squel=require(_0x3785('0xb'));var crypto=require(_0x3785('0xc'));var jsforce=require(_0x3785('0xd'));var deskjs=require(_0x3785('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3785('0xf'));var Papa=require('papaparse');var Redis=require(_0x3785('0x10'));var authService=require(_0x3785('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3785('0x12'));var utils=require(_0x3785('0x13'));var config=require(_0x3785('0x14'));var licenseUtil=require(_0x3785('0x15'));var db=require(_0x3785('0x16'))['db'];function respondWithStatusCode(_0x233b81,_0x25a06e){_0x25a06e=_0x25a06e||0xcc;return function(_0x428162){if(_0x428162){return _0x233b81[_0x3785('0x17')](_0x25a06e);}return _0x233b81['status'](_0x25a06e)['end']();};}function respondWithResult(_0x45b1a8,_0x5d4192){_0x5d4192=_0x5d4192||0xc8;return function(_0x4cac3c){if(_0x4cac3c){return _0x45b1a8[_0x3785('0x18')](_0x5d4192)['json'](_0x4cac3c);}};}function respondWithFilteredResult(_0xaaec41,_0x2e9368){return function(_0x28068b){if(_0x28068b){var _0x8de23f=typeof _0x2e9368[_0x3785('0x19')]==='undefined'&&typeof _0x2e9368[_0x3785('0x1a')]===_0x3785('0x1b');var _0xbdf511=_0x28068b[_0x3785('0x1c')];var _0x485b1c=_0x8de23f?0x0:_0x2e9368[_0x3785('0x19')];var _0x32bfaa=_0x8de23f?_0x28068b[_0x3785('0x1c')]:_0x2e9368['offset']+_0x2e9368[_0x3785('0x1a')];var _0x242721;if(_0x32bfaa>=_0xbdf511){_0x32bfaa=_0xbdf511;_0x242721=0xc8;}else{_0x242721=0xce;}_0xaaec41['status'](_0x242721);return _0xaaec41['set']('Content-Range',_0x485b1c+'-'+_0x32bfaa+'/'+_0xbdf511)[_0x3785('0x1d')](_0x28068b);}return null;};}function patchUpdates(_0x1ffc83){return function(_0x304fe3){try{jsonpatch[_0x3785('0x1e')](_0x304fe3,_0x1ffc83,!![]);}catch(_0x36ac40){return BPromise[_0x3785('0x1f')](_0x36ac40);}return _0x304fe3[_0x3785('0x20')]();};}function saveUpdates(_0x2e99d8,_0x498e50){return function(_0x1d7676){if(_0x1d7676){return _0x1d7676[_0x3785('0x21')](_0x2e99d8)[_0x3785('0x22')](function(_0x1fd370){return _0x1fd370;});}return null;};}function removeEntity(_0x3e30a1,_0x1e7e0f){return function(_0x1aab3d){if(_0x1aab3d){return _0x1aab3d[_0x3785('0x23')]()['then'](function(){_0x3e30a1[_0x3785('0x18')](0xcc)[_0x3785('0x24')]();});}};}function handleEntityNotFound(_0x31d21a,_0x26e9ee){return function(_0x335197){if(!_0x335197){_0x31d21a[_0x3785('0x17')](0x194);}return _0x335197;};}function handleError(_0x5c7487,_0x5c35ae){_0x5c35ae=_0x5c35ae||0x1f4;return function(_0x329248){logger[_0x3785('0x25')](_0x329248['stack']);if(_0x329248[_0x3785('0x26')]){delete _0x329248[_0x3785('0x26')];}_0x5c7487[_0x3785('0x18')](_0x5c35ae)['send'](_0x329248);};}exports[_0x3785('0x27')]=function(_0x388049,_0x1b08af){var _0xe4ff62={},_0xa4711a={},_0x50c6f8={'count':0x0,'rows':[]};var _0x4494ee=_[_0x3785('0x28')](db['AnalyticFieldReport'][_0x3785('0x29')],function(_0x550c66){return{'name':_0x550c66[_0x3785('0x2a')],'type':_0x550c66['type']['key']};});_0xa4711a[_0x3785('0x2b')]=_[_0x3785('0x28')](_0x4494ee,_0x3785('0x26'));_0xa4711a['query']=_['keys'](_0x388049[_0x3785('0x2c')]);_0xa4711a['filters']=_['intersection'](_0xa4711a['model'],_0xa4711a[_0x3785('0x2c')]);_0xe4ff62[_0x3785('0x2d')]=_['intersection'](_0xa4711a[_0x3785('0x2b')],qs['fields'](_0x388049[_0x3785('0x2c')][_0x3785('0x2e')]));_0xe4ff62[_0x3785('0x2d')]=_0xe4ff62[_0x3785('0x2d')][_0x3785('0x2f')]?_0xe4ff62[_0x3785('0x2d')]:_0xa4711a[_0x3785('0x2b')];if(!_0x388049[_0x3785('0x2c')][_0x3785('0x30')](_0x3785('0x31'))){_0xe4ff62[_0x3785('0x1a')]=qs[_0x3785('0x1a')](_0x388049[_0x3785('0x2c')][_0x3785('0x1a')]);_0xe4ff62['offset']=qs[_0x3785('0x19')](_0x388049[_0x3785('0x2c')][_0x3785('0x19')]);}_0xe4ff62[_0x3785('0x32')]=qs[_0x3785('0x33')](_0x388049[_0x3785('0x2c')]['sort']);_0xe4ff62['where']=qs['filters'](_['pick'](_0x388049[_0x3785('0x2c')],_0xa4711a[_0x3785('0x34')]),_0x4494ee);if(_0x388049[_0x3785('0x2c')][_0x3785('0x35')]){_0xe4ff62[_0x3785('0x36')]=_[_0x3785('0x37')](_0xe4ff62[_0x3785('0x36')],{'$or':_[_0x3785('0x28')](_0x4494ee,function(_0x4d6dfb){if(_0x4d6dfb[_0x3785('0x38')]!==_0x3785('0x39')){var _0x4fa32f={};_0x4fa32f[_0x4d6dfb['name']]={'$like':'%'+_0x388049['query'][_0x3785('0x35')]+'%'};return _0x4fa32f;}})});}_0xe4ff62=_[_0x3785('0x37')]({},_0xe4ff62,_0x388049[_0x3785('0x3a')]);var _0x1dd603={'where':_0xe4ff62[_0x3785('0x36')]};return db[_0x3785('0x3b')]['count'](_0x1dd603)[_0x3785('0x22')](function(_0x39f751){_0x50c6f8[_0x3785('0x1c')]=_0x39f751;if(_0x388049[_0x3785('0x2c')]['includeAll']){_0xe4ff62[_0x3785('0x3c')]=[{'all':!![]}];}return db[_0x3785('0x3b')]['findAll'](_0xe4ff62);})[_0x3785('0x22')](function(_0x2fa772){_0x50c6f8['rows']=_0x2fa772;return _0x50c6f8;})[_0x3785('0x22')](respondWithFilteredResult(_0x1b08af,_0xe4ff62))['catch'](handleError(_0x1b08af,null));};exports[_0x3785('0x3d')]=function(_0x4b4c0e,_0xf5db4c){var _0x49a223={'raw':![],'where':{'id':_0x4b4c0e[_0x3785('0x3e')]['id']}},_0x34a6f1={};_0x34a6f1[_0x3785('0x2b')]=_[_0x3785('0x3f')](db['AnalyticFieldReport'][_0x3785('0x29')]);_0x34a6f1['query']=_[_0x3785('0x3f')](_0x4b4c0e[_0x3785('0x2c')]);_0x34a6f1[_0x3785('0x34')]=_['intersection'](_0x34a6f1[_0x3785('0x2b')],_0x34a6f1[_0x3785('0x2c')]);_0x49a223[_0x3785('0x2d')]=_[_0x3785('0x40')](_0x34a6f1[_0x3785('0x2b')],qs[_0x3785('0x2e')](_0x4b4c0e[_0x3785('0x2c')][_0x3785('0x2e')]));_0x49a223[_0x3785('0x2d')]=_0x49a223['attributes'][_0x3785('0x2f')]?_0x49a223[_0x3785('0x2d')]:_0x34a6f1['model'];if(_0x4b4c0e['query'][_0x3785('0x41')]){_0x49a223[_0x3785('0x3c')]=[{'all':!![]}];}_0x49a223=_[_0x3785('0x37')]({},_0x49a223,_0x4b4c0e[_0x3785('0x3a')]);return db[_0x3785('0x3b')][_0x3785('0x42')](_0x49a223)[_0x3785('0x22')](handleEntityNotFound(_0xf5db4c,null))[_0x3785('0x22')](respondWithResult(_0xf5db4c,null))[_0x3785('0x43')](handleError(_0xf5db4c,null));};exports[_0x3785('0x44')]=function(_0x790f84,_0x2f7b5e){return db[_0x3785('0x3b')][_0x3785('0x44')](_0x790f84['body'],{})[_0x3785('0x22')](respondWithResult(_0x2f7b5e,0xc9))[_0x3785('0x43')](handleError(_0x2f7b5e,null));};exports[_0x3785('0x45')]=function(_0x50974a,_0x576ff3){return db['AnalyticFieldReport']['bulkCreate'](_0x50974a[_0x3785('0x46')],{'raw':![],'individualHooks':!![]})[_0x3785('0x22')](respondWithResult(_0x576ff3,0xc9))[_0x3785('0x43')](handleError(_0x576ff3,null));};exports['update']=function(_0x2a296c,_0x491925){if(_0x2a296c['body']['id']){delete _0x2a296c[_0x3785('0x46')]['id'];}return db[_0x3785('0x3b')][_0x3785('0x42')]({'where':{'id':_0x2a296c[_0x3785('0x3e')]['id']}})[_0x3785('0x22')](handleEntityNotFound(_0x491925,null))[_0x3785('0x22')](saveUpdates(_0x2a296c['body'],null))[_0x3785('0x22')](respondWithResult(_0x491925,null))[_0x3785('0x43')](handleError(_0x491925,null));};exports[_0x3785('0x23')]=function(_0x5cb069,_0x3fb4c8){return db[_0x3785('0x3b')][_0x3785('0x42')]({'where':{'id':_0x5cb069[_0x3785('0x3e')]['id']}})[_0x3785('0x22')](handleEntityNotFound(_0x3fb4c8,null))[_0x3785('0x22')](removeEntity(_0x3fb4c8,null))[_0x3785('0x43')](handleError(_0x3fb4c8,null));};exports[_0x3785('0x47')]=function(_0x1cb104,_0x2ffa4b){return db['AnalyticFieldReport'][_0x3785('0x23')]({'where':{'id':_0x1cb104[_0x3785('0x2c')][_0x3785('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x3785('0x22')](respondWithResult(_0x2ffa4b,0xcc))['catch'](handleError(_0x2ffa4b,null));};exports[_0x3785('0x49')]=function(_0x33f609,_0x4e6b99,_0x2cf8d0){return db[_0x3785('0x4a')]['findOne']({'where':{'id':_0x33f609['params']['id']}})[_0x3785('0x22')](handleEntityNotFound(_0x4e6b99,null))[_0x3785('0x22')](function(_0x59d7cc){if(_0x59d7cc){return db['sequelize']['transaction'](function(_0x50dab4){return db[_0x3785('0x3b')]['destroy']({'where':{'CustomReportId':_0x33f609['params']['id']},'transaction':_0x50dab4})['then'](function(_0x4f1ec0){var _0x3e644e=_[_0x3785('0x28')](_0x33f609[_0x3785('0x46')],function(_0x3223ed){delete _0x3223ed['id'];_0x3223ed[_0x3785('0x4b')]=_0x33f609[_0x3785('0x3e')]['id'];return _0x3223ed;});return db[_0x3785('0x3b')][_0x3785('0x45')](_0x3e644e,{'transaction':_0x50dab4});});})[_0x3785('0x22')](function(){return db[_0x3785('0x3b')]['findAll']({'where':{'CustomReportId':_0x33f609[_0x3785('0x3e')]['id']}});});}})[_0x3785('0x22')](respondWithResult(_0x4e6b99,null))[_0x3785('0x43')](handleError(_0x4e6b99,null));};
\ No newline at end of file
+var _0x400a=['limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0x400a,0x18b));var _0xa400=function(_0x15ba86,_0x2a85de){_0x15ba86=_0x15ba86-0x0;var _0x45b830=_0x400a[_0x15ba86];return _0x45b830;};'use strict';var emlformat=require(_0xa400('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa400('0x1'));var jsonpatch=require(_0xa400('0x2'));var rp=require(_0xa400('0x3'));var moment=require(_0xa400('0x4'));var BPromise=require(_0xa400('0x5'));var Mustache=require(_0xa400('0x6'));var util=require(_0xa400('0x7'));var path=require('path');var sox=require(_0xa400('0x8'));var csv=require(_0xa400('0x9'));var ejs=require(_0xa400('0xa'));var fs=require('fs');var fs_extra=require(_0xa400('0xb'));var _=require(_0xa400('0xc'));var squel=require(_0xa400('0xd'));var crypto=require(_0xa400('0xe'));var jsforce=require(_0xa400('0xf'));var deskjs=require(_0xa400('0x10'));var toCsv=require(_0xa400('0x9'));var querystring=require(_0xa400('0x11'));var Papa=require(_0xa400('0x12'));var Redis=require(_0xa400('0x13'));var authService=require(_0xa400('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa400('0x15'));var hardwareService=require(_0xa400('0x16'));var logger=require(_0xa400('0x17'))('api');var utils=require(_0xa400('0x18'));var config=require(_0xa400('0x19'));var licenseUtil=require(_0xa400('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fc8a3,_0x2161b6){_0x2161b6=_0x2161b6||0xcc;return function(_0x15f005){if(_0x15f005){return _0x2fc8a3['sendStatus'](_0x2161b6);}return _0x2fc8a3[_0xa400('0x1b')](_0x2161b6)['end']();};}function respondWithResult(_0x283653,_0x5de8bb){_0x5de8bb=_0x5de8bb||0xc8;return function(_0x543f02){if(_0x543f02){return _0x283653[_0xa400('0x1b')](_0x5de8bb)['json'](_0x543f02);}};}function respondWithFilteredResult(_0x575dc9,_0x5f3059){return function(_0x5ea145){if(_0x5ea145){var _0xddd10d=typeof _0x5f3059[_0xa400('0x1c')]===_0xa400('0x1d')&&typeof _0x5f3059[_0xa400('0x1e')]===_0xa400('0x1d');var _0x435902=_0x5ea145[_0xa400('0x1f')];var _0x30ed2b=_0xddd10d?0x0:_0x5f3059[_0xa400('0x1c')];var _0x4fde7b=_0xddd10d?_0x5ea145[_0xa400('0x1f')]:_0x5f3059[_0xa400('0x1c')]+_0x5f3059[_0xa400('0x1e')];var _0x5ed2f6;if(_0x4fde7b>=_0x435902){_0x4fde7b=_0x435902;_0x5ed2f6=0xc8;}else{_0x5ed2f6=0xce;}_0x575dc9['status'](_0x5ed2f6);return _0x575dc9['set'](_0xa400('0x20'),_0x30ed2b+'-'+_0x4fde7b+'/'+_0x435902)[_0xa400('0x21')](_0x5ea145);}return null;};}function patchUpdates(_0x4dcd71){return function(_0xdd5b9e){try{jsonpatch[_0xa400('0x22')](_0xdd5b9e,_0x4dcd71,!![]);}catch(_0xa95332){return BPromise[_0xa400('0x23')](_0xa95332);}return _0xdd5b9e[_0xa400('0x24')]();};}function saveUpdates(_0x32fb18,_0x46bafb){return function(_0x45db82){if(_0x45db82){return _0x45db82[_0xa400('0x25')](_0x32fb18)[_0xa400('0x26')](function(_0xeff1b2){return _0xeff1b2;});}return null;};}function removeEntity(_0x47e094,_0x579c46){return function(_0xa49e5b){if(_0xa49e5b){return _0xa49e5b[_0xa400('0x27')]()[_0xa400('0x26')](function(){_0x47e094[_0xa400('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x230cd6,_0x512d3c){return function(_0x11f4c5){if(!_0x11f4c5){_0x230cd6[_0xa400('0x28')](0x194);}return _0x11f4c5;};}function handleError(_0x20ef2a,_0x42b805){_0x42b805=_0x42b805||0x1f4;return function(_0x3e64fa){logger['error'](_0x3e64fa['stack']);if(_0x3e64fa[_0xa400('0x29')]){delete _0x3e64fa['name'];}_0x20ef2a[_0xa400('0x1b')](_0x42b805)[_0xa400('0x2a')](_0x3e64fa);};}exports['index']=function(_0x40bb42,_0x1db934){var _0xa92d6d={},_0x1c3b3b={},_0x10c8a9={'count':0x0,'rows':[]};var _0x494a80=_[_0xa400('0x2b')](db['AnalyticFieldReport']['rawAttributes'],function(_0x20baec){return{'name':_0x20baec[_0xa400('0x2c')],'type':_0x20baec[_0xa400('0x2d')][_0xa400('0x2e')]};});_0x1c3b3b[_0xa400('0x2f')]=_[_0xa400('0x2b')](_0x494a80,_0xa400('0x29'));_0x1c3b3b[_0xa400('0x30')]=_[_0xa400('0x31')](_0x40bb42['query']);_0x1c3b3b[_0xa400('0x32')]=_[_0xa400('0x33')](_0x1c3b3b[_0xa400('0x2f')],_0x1c3b3b[_0xa400('0x30')]);_0xa92d6d[_0xa400('0x34')]=_['intersection'](_0x1c3b3b[_0xa400('0x2f')],qs[_0xa400('0x35')](_0x40bb42[_0xa400('0x30')][_0xa400('0x35')]));_0xa92d6d[_0xa400('0x34')]=_0xa92d6d[_0xa400('0x34')]['length']?_0xa92d6d['attributes']:_0x1c3b3b['model'];if(!_0x40bb42[_0xa400('0x30')][_0xa400('0x36')](_0xa400('0x37'))){_0xa92d6d[_0xa400('0x1e')]=qs['limit'](_0x40bb42['query'][_0xa400('0x1e')]);_0xa92d6d[_0xa400('0x1c')]=qs['offset'](_0x40bb42[_0xa400('0x30')][_0xa400('0x1c')]);}_0xa92d6d[_0xa400('0x38')]=qs['sort'](_0x40bb42['query'][_0xa400('0x39')]);_0xa92d6d[_0xa400('0x3a')]=qs[_0xa400('0x32')](_[_0xa400('0x3b')](_0x40bb42[_0xa400('0x30')],_0x1c3b3b[_0xa400('0x32')]),_0x494a80);if(_0x40bb42[_0xa400('0x30')]['filter']){_0xa92d6d[_0xa400('0x3a')]=_[_0xa400('0x3c')](_0xa92d6d['where'],{'$or':_['map'](_0x494a80,function(_0xdf7cf2){if(_0xdf7cf2[_0xa400('0x2d')]!==_0xa400('0x3d')){var _0x582426={};_0x582426[_0xdf7cf2[_0xa400('0x29')]]={'$like':'%'+_0x40bb42[_0xa400('0x30')][_0xa400('0x3e')]+'%'};return _0x582426;}})});}_0xa92d6d=_['merge']({},_0xa92d6d,_0x40bb42[_0xa400('0x3f')]);var _0x7e6204={'where':_0xa92d6d[_0xa400('0x3a')]};return db[_0xa400('0x40')][_0xa400('0x1f')](_0x7e6204)[_0xa400('0x26')](function(_0x57501c){_0x10c8a9[_0xa400('0x1f')]=_0x57501c;if(_0x40bb42[_0xa400('0x30')][_0xa400('0x41')]){_0xa92d6d[_0xa400('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa400('0x43')](_0xa92d6d);})[_0xa400('0x26')](function(_0x201b3f){_0x10c8a9[_0xa400('0x44')]=_0x201b3f;return _0x10c8a9;})['then'](respondWithFilteredResult(_0x1db934,_0xa92d6d))['catch'](handleError(_0x1db934,null));};exports[_0xa400('0x45')]=function(_0x118a60,_0x3d0c4c){var _0x20421={'raw':![],'where':{'id':_0x118a60[_0xa400('0x46')]['id']}},_0x499350={};_0x499350['model']=_[_0xa400('0x31')](db[_0xa400('0x40')][_0xa400('0x47')]);_0x499350[_0xa400('0x30')]=_[_0xa400('0x31')](_0x118a60[_0xa400('0x30')]);_0x499350[_0xa400('0x32')]=_[_0xa400('0x33')](_0x499350[_0xa400('0x2f')],_0x499350[_0xa400('0x30')]);_0x20421[_0xa400('0x34')]=_['intersection'](_0x499350[_0xa400('0x2f')],qs['fields'](_0x118a60[_0xa400('0x30')][_0xa400('0x35')]));_0x20421['attributes']=_0x20421[_0xa400('0x34')][_0xa400('0x48')]?_0x20421[_0xa400('0x34')]:_0x499350[_0xa400('0x2f')];if(_0x118a60[_0xa400('0x30')][_0xa400('0x41')]){_0x20421[_0xa400('0x42')]=[{'all':!![]}];}_0x20421=_[_0xa400('0x3c')]({},_0x20421,_0x118a60[_0xa400('0x3f')]);return db[_0xa400('0x40')][_0xa400('0x49')](_0x20421)['then'](handleEntityNotFound(_0x3d0c4c,null))[_0xa400('0x26')](respondWithResult(_0x3d0c4c,null))[_0xa400('0x4a')](handleError(_0x3d0c4c,null));};exports[_0xa400('0x4b')]=function(_0x2bcff7,_0x499953){return db[_0xa400('0x40')][_0xa400('0x4b')](_0x2bcff7['body'],{})[_0xa400('0x26')](respondWithResult(_0x499953,0xc9))[_0xa400('0x4a')](handleError(_0x499953,null));};exports['bulkCreate']=function(_0x3f40bf,_0x57a15b){return db['AnalyticFieldReport'][_0xa400('0x4c')](_0x3f40bf[_0xa400('0x4d')],{'raw':![],'individualHooks':!![]})[_0xa400('0x26')](respondWithResult(_0x57a15b,0xc9))['catch'](handleError(_0x57a15b,null));};exports[_0xa400('0x25')]=function(_0x6e44dc,_0x3666e7){if(_0x6e44dc[_0xa400('0x4d')]['id']){delete _0x6e44dc[_0xa400('0x4d')]['id'];}return db[_0xa400('0x40')][_0xa400('0x49')]({'where':{'id':_0x6e44dc[_0xa400('0x46')]['id']}})[_0xa400('0x26')](handleEntityNotFound(_0x3666e7,null))['then'](saveUpdates(_0x6e44dc[_0xa400('0x4d')],null))[_0xa400('0x26')](respondWithResult(_0x3666e7,null))[_0xa400('0x4a')](handleError(_0x3666e7,null));};exports[_0xa400('0x27')]=function(_0x17669a,_0x514102){return db[_0xa400('0x40')][_0xa400('0x49')]({'where':{'id':_0x17669a[_0xa400('0x46')]['id']}})['then'](handleEntityNotFound(_0x514102,null))['then'](removeEntity(_0x514102,null))['catch'](handleError(_0x514102,null));};exports[_0xa400('0x4e')]=function(_0x2fbd5a,_0x20cf27){return db[_0xa400('0x40')][_0xa400('0x27')]({'where':{'id':_0x2fbd5a[_0xa400('0x30')][_0xa400('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0xa400('0x26')](respondWithResult(_0x20cf27,0xcc))[_0xa400('0x4a')](handleError(_0x20cf27,null));};exports[_0xa400('0x50')]=function(_0x174c6b,_0x49571a,_0x1bacf9){return db[_0xa400('0x51')]['findOne']({'where':{'id':_0x174c6b['params']['id']}})[_0xa400('0x26')](handleEntityNotFound(_0x49571a,null))['then'](function(_0x282afa){if(_0x282afa){return db[_0xa400('0x52')][_0xa400('0x53')](function(_0x4e092d){return db[_0xa400('0x40')]['destroy']({'where':{'CustomReportId':_0x174c6b['params']['id']},'transaction':_0x4e092d})['then'](function(_0xd1aeb1){var _0x1f7fda=_['map'](_0x174c6b[_0xa400('0x4d')],function(_0x525e17){delete _0x525e17['id'];_0x525e17[_0xa400('0x54')]=_0x174c6b[_0xa400('0x46')]['id'];return _0x525e17;});return db[_0xa400('0x40')][_0xa400('0x4c')](_0x1f7fda,{'transaction':_0x4e092d});});})[_0xa400('0x26')](function(){return db[_0xa400('0x40')][_0xa400('0x43')]({'where':{'CustomReportId':_0x174c6b['params']['id']}});});}})[_0xa400('0x26')](respondWithResult(_0x49571a,null))[_0xa400('0x4a')](handleError(_0x49571a,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index d23779d..5f0df83 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 _0x5cae=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x378507,_0x28b8ca){var _0x153297=function(_0x4808f6){while(--_0x4808f6){_0x378507['push'](_0x378507['shift']());}};_0x153297(++_0x28b8ca);}(_0x5cae,0x1ce));var _0xe5ca=function(_0x5b21a2,_0x2c6461){_0x5b21a2=_0x5b21a2-0x0;var _0x57166b=_0x5cae[_0x5b21a2];return _0x57166b;};'use strict';var _=require(_0xe5ca('0x0'));var util=require(_0xe5ca('0x1'));var logger=require(_0xe5ca('0x2'))('api');var moment=require(_0xe5ca('0x3'));var BPromise=require(_0xe5ca('0x4'));var rp=require(_0xe5ca('0x5'));var fs=require('fs');var path=require(_0xe5ca('0x6'));var rimraf=require(_0xe5ca('0x7'));var config=require(_0xe5ca('0x8'));var attributes=require(_0xe5ca('0x9'));module[_0xe5ca('0xa')]=function(_0x5627c1,_0x25ebdb){return _0x5627c1['define'](_0xe5ca('0xb'),attributes,{'tableName':_0xe5ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3797=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./analyticFieldReport.attributes','exports'];(function(_0x421bec,_0x5efe48){var _0x26ad85=function(_0x30cdad){while(--_0x30cdad){_0x421bec['push'](_0x421bec['shift']());}};_0x26ad85(++_0x5efe48);}(_0x3797,0x157));var _0x7379=function(_0x25fe30,_0x39b37f){_0x25fe30=_0x25fe30-0x0;var _0x5d15e2=_0x3797[_0x25fe30];return _0x5d15e2;};'use strict';var _=require(_0x7379('0x0'));var util=require(_0x7379('0x1'));var logger=require(_0x7379('0x2'))(_0x7379('0x3'));var moment=require(_0x7379('0x4'));var BPromise=require('bluebird');var rp=require(_0x7379('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7379('0x6'));var config=require('../../config/environment');var attributes=require(_0x7379('0x7'));module[_0x7379('0x8')]=function(_0x49cff6,_0x4d78ef){return _0x49cff6['define'](_0x7379('0x9'),attributes,{'tableName':_0x7379('0xa'),'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 9619231..34f79a5 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 _0x7fea=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','error','AnalyticFieldReport,\x20%s,\x20%s','message','info'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7fea,0x130));var _0xa7fe=function(_0x4b4b56,_0x4d3e8e){_0x4b4b56=_0x4b4b56-0x0;var _0x250078=_0x7fea[_0x4b4b56];return _0x250078;};'use strict';var _=require(_0xa7fe('0x0'));var util=require(_0xa7fe('0x1'));var moment=require(_0xa7fe('0x2'));var BPromise=require(_0xa7fe('0x3'));var rs=require(_0xa7fe('0x4'));var fs=require('fs');var Redis=require(_0xa7fe('0x5'));var db=require(_0xa7fe('0x6'))['db'];var utils=require(_0xa7fe('0x7'));var logger=require('../../config/logger')(_0xa7fe('0x8'));var config=require(_0xa7fe('0x9'));var jayson=require(_0xa7fe('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4eb581,_0x329ac4,_0x259ba7){return new BPromise(function(_0x329edb,_0x1e2511){return client[_0xa7fe('0xb')](_0x4eb581,_0x259ba7)[_0xa7fe('0xc')](function(_0x48e374){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x329ac4,_0xa7fe('0xd'));logger[_0xa7fe('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x329ac4,'request\x20sent',JSON['stringify'](_0x48e374));if(_0x48e374[_0xa7fe('0xf')]){if(_0x48e374[_0xa7fe('0xf')]['code']===0x1f4){logger[_0xa7fe('0xf')](_0xa7fe('0x10'),_0x329ac4,_0x48e374[_0xa7fe('0xf')][_0xa7fe('0x11')]);return _0x1e2511(_0x48e374[_0xa7fe('0xf')][_0xa7fe('0x11')]);}logger['error'](_0xa7fe('0x10'),_0x329ac4,_0x48e374['error']['message']);return _0x329edb(_0x48e374[_0xa7fe('0xf')]['message']);}else{logger[_0xa7fe('0x12')](_0xa7fe('0x10'),_0x329ac4,'request\x20sent');_0x329edb(_0x48e374['result'][_0xa7fe('0x11')]);}})['catch'](function(_0x3ec431){logger[_0xa7fe('0xf')](_0xa7fe('0x10'),_0x329ac4,_0x3ec431);_0x1e2511(_0x3ec431);});});}
\ No newline at end of file
+var _0xeebf=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1e7ead,_0x7f6227){var _0x3912b2=function(_0x1eeb03){while(--_0x1eeb03){_0x1e7ead['push'](_0x1e7ead['shift']());}};_0x3912b2(++_0x7f6227);}(_0xeebf,0x114));var _0xfeeb=function(_0x431bd7,_0x47fdf6){_0x431bd7=_0x431bd7-0x0;var _0x356280=_0xeebf[_0x431bd7];return _0x356280;};'use strict';var _=require(_0xfeeb('0x0'));var util=require(_0xfeeb('0x1'));var moment=require(_0xfeeb('0x2'));var BPromise=require(_0xfeeb('0x3'));var rs=require(_0xfeeb('0x4'));var fs=require('fs');var Redis=require(_0xfeeb('0x5'));var db=require(_0xfeeb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfeeb('0x7'))(_0xfeeb('0x8'));var config=require('../../config/environment');var jayson=require(_0xfeeb('0x9'));var client=jayson[_0xfeeb('0xa')][_0xfeeb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d3f5e,_0x506b6d,_0x305fdf){return new BPromise(function(_0x5e5127,_0x442f2b){return client['request'](_0x1d3f5e,_0x305fdf)[_0xfeeb('0xc')](function(_0x2ab593){logger[_0xfeeb('0xd')](_0xfeeb('0xe'),_0x506b6d,_0xfeeb('0xf'));logger['debug'](_0xfeeb('0x10'),_0x506b6d,_0xfeeb('0xf'),JSON[_0xfeeb('0x11')](_0x2ab593));if(_0x2ab593[_0xfeeb('0x12')]){if(_0x2ab593[_0xfeeb('0x12')][_0xfeeb('0x13')]===0x1f4){logger[_0xfeeb('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x506b6d,_0x2ab593[_0xfeeb('0x12')]['message']);return _0x442f2b(_0x2ab593[_0xfeeb('0x12')][_0xfeeb('0x14')]);}logger[_0xfeeb('0x12')](_0xfeeb('0xe'),_0x506b6d,_0x2ab593[_0xfeeb('0x12')][_0xfeeb('0x14')]);return _0x5e5127(_0x2ab593['error'][_0xfeeb('0x14')]);}else{logger[_0xfeeb('0xd')](_0xfeeb('0xe'),_0x506b6d,_0xfeeb('0xf'));_0x5e5127(_0x2ab593[_0xfeeb('0x15')][_0xfeeb('0x14')]);}})[_0xfeeb('0x16')](function(_0x307dbf){logger[_0xfeeb('0x12')](_0xfeeb('0xe'),_0x506b6d,_0x307dbf);_0x442f2b(_0x307dbf);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 612e17b..331e7f1 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(_0x54acc9,_0x13c2ab){var _0x189fb0=function(_0x4ab002){while(--_0x4ab002){_0x54acc9['push'](_0x54acc9['shift']());}};_0x189fb0(++_0x13c2ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x22e19d,_0x121e11){var _0x412858=function(_0x321751){while(--_0x321751){_0x22e19d['push'](_0x22e19d['shift']());}};_0x412858(++_0x121e11);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 30b80f4..2b975e8 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 _0xb49a=['exports','STRING','name','sequelize'];(function(_0x21072f,_0x47b0f0){var _0x140d62=function(_0x1b0c71){while(--_0x1b0c71){_0x21072f['push'](_0x21072f['shift']());}};_0x140d62(++_0x47b0f0);}(_0xb49a,0xfb));var _0xab49=function(_0x3420bd,_0x34703d){_0x3420bd=_0x3420bd-0x0;var _0x5c7793=_0xb49a[_0x3420bd];return _0x5c7793;};'use strict';var Sequelize=require(_0xab49('0x0'));module[_0xab49('0x1')]={'name':{'type':Sequelize[_0xab49('0x2')],'allowNull':![],'unique':_0xab49('0x3')},'table':{'type':Sequelize[_0xab49('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xab49('0x2')]}};
\ No newline at end of file
+var _0xea28=['exports','STRING','name','TEXT','sequelize'];(function(_0xe8e4b4,_0x5b8a78){var _0x46d16d=function(_0x590093){while(--_0x590093){_0xe8e4b4['push'](_0xe8e4b4['shift']());}};_0x46d16d(++_0x5b8a78);}(_0xea28,0x13a));var _0x8ea2=function(_0x658684,_0x3b356e){_0x658684=_0x658684-0x0;var _0x192f71=_0xea28[_0x658684];return _0x192f71;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'name':{'type':Sequelize[_0x8ea2('0x2')],'allowNull':![],'unique':_0x8ea2('0x3')},'table':{'type':Sequelize[_0x8ea2('0x2')]},'metric':{'type':Sequelize[_0x8ea2('0x4')]},'description':{'type':Sequelize[_0x8ea2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ba25022..2e8c036 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0xcdc46b,_0x5007bf){var _0x4f46cb=function(_0xee0bfa){while(--_0xee0bfa){_0xcdc46b['push'](_0xcdc46b['shift']());}};_0x4f46cb(++_0x5007bf);}(_0x81bd,0x7c));var _0xd81b=function(_0xc9df8b,_0x21744d){_0xc9df8b=_0xc9df8b-0x0;var _0x35ca5d=_0x81bd[_0xc9df8b];return _0x35ca5d;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
+var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5be8a0,_0x5f18ae){var _0x1ce890=function(_0xfb7e75){while(--_0xfb7e75){_0x5be8a0['push'](_0x5be8a0['shift']());}};_0x1ce890(++_0x5f18ae);}(_0x55ca,0x126));var _0xa55c=function(_0x7aee79,_0x124af2){_0x7aee79=_0x7aee79-0x0;var _0xcbf9d1=_0x55ca[_0x7aee79];return _0xcbf9d1;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index acee79e..e876c7f 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 _0xbfe8=['analytics_metrics','util','api','moment','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x221abd,_0x621d76){var _0x47e399=function(_0x3c966f){while(--_0x3c966f){_0x221abd['push'](_0x221abd['shift']());}};_0x47e399(++_0x621d76);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x2d16ef,_0x44374e){_0x2d16ef=_0x2d16ef-0x0;var _0x4e4d1f=_0xbfe8[_0x2d16ef];return _0x4e4d1f;};'use strict';var _=require('lodash');var util=require(_0x8bfe('0x0'));var logger=require('../../config/logger')(_0x8bfe('0x1'));var moment=require(_0x8bfe('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bfe('0x3'));var rimraf=require(_0x8bfe('0x4'));var config=require('../../config/environment');var attributes=require(_0x8bfe('0x5'));module[_0x8bfe('0x6')]=function(_0x314a9a,_0x4933c9){return _0x314a9a[_0x8bfe('0x7')](_0x8bfe('0x8'),attributes,{'tableName':_0x8bfe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14a=['exports','define','AnalyticMetric','analytics_metrics','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x27d185,_0x425f42){var _0x3b0526=function(_0x43807c){while(--_0x43807c){_0x27d185['push'](_0x27d185['shift']());}};_0x3b0526(++_0x425f42);}(_0xe14a,0x94));var _0xae14=function(_0x5924e0,_0x2af250){_0x5924e0=_0x5924e0-0x0;var _0x47389b=_0xe14a[_0x5924e0];return _0x47389b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae14('0x0'));var rp=require(_0xae14('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae14('0x2'));var config=require(_0xae14('0x3'));var attributes=require(_0xae14('0x4'));module[_0xae14('0x5')]=function(_0x2b5138,_0x3a6279){return _0x2b5138[_0xae14('0x6')](_0xae14('0x7'),attributes,{'tableName':_0xae14('0x8'),'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 e4ad3cc..67daa61 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 _0xd103=['stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug'];(function(_0x1fbd15,_0x1cde0e){var _0x3689ab=function(_0x56158d){while(--_0x56158d){_0x1fbd15['push'](_0x1fbd15['shift']());}};_0x3689ab(++_0x1cde0e);}(_0xd103,0x1e2));var _0x3d10=function(_0x581b29,_0x355ba6){_0x581b29=_0x581b29-0x0;var _0x26fda6=_0xd103[_0x581b29];return _0x26fda6;};'use strict';var _=require(_0x3d10('0x0'));var util=require(_0x3d10('0x1'));var moment=require('moment');var BPromise=require(_0x3d10('0x2'));var rs=require(_0x3d10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d10('0x4'));var logger=require(_0x3d10('0x5'))(_0x3d10('0x6'));var config=require('../../config/environment');var jayson=require(_0x3d10('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52333c,_0x178f1d,_0x17c049){return new BPromise(function(_0x506cde,_0x394c09){return client[_0x3d10('0x8')](_0x52333c,_0x17c049)[_0x3d10('0x9')](function(_0xd5c7b1){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x178f1d,_0x3d10('0xa'));logger[_0x3d10('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x178f1d,_0x3d10('0xa'),JSON[_0x3d10('0xc')](_0xd5c7b1));if(_0xd5c7b1['error']){if(_0xd5c7b1[_0x3d10('0xd')]['code']===0x1f4){logger[_0x3d10('0xd')](_0x3d10('0xe'),_0x178f1d,_0xd5c7b1[_0x3d10('0xd')][_0x3d10('0xf')]);return _0x394c09(_0xd5c7b1[_0x3d10('0xd')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x178f1d,_0xd5c7b1[_0x3d10('0xd')]['message']);return _0x506cde(_0xd5c7b1[_0x3d10('0xd')][_0x3d10('0xf')]);}else{logger[_0x3d10('0x10')](_0x3d10('0xe'),_0x178f1d,_0x3d10('0xa'));_0x506cde(_0xd5c7b1[_0x3d10('0x11')][_0x3d10('0xf')]);}})[_0x3d10('0x12')](function(_0x3b1150){logger[_0x3d10('0xd')](_0x3d10('0xe'),_0x178f1d,_0x3b1150);_0x394c09(_0x3b1150);});});}
\ No newline at end of file
+var _0xfb0f=['rpc','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','ioredis','../../config/utils','../../config/logger'];(function(_0x3b7d6,_0x3fd0e4){var _0x97f072=function(_0x9d36a1){while(--_0x9d36a1){_0x3b7d6['push'](_0x3b7d6['shift']());}};_0x97f072(++_0x3fd0e4);}(_0xfb0f,0x18c));var _0xffb0=function(_0x20e52f,_0x3107f5){_0x20e52f=_0x20e52f-0x0;var _0x338748=_0xfb0f[_0x20e52f];return _0x338748;};'use strict';var _=require(_0xffb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffb0('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xffb0('0x2'));var logger=require(_0xffb0('0x3'))(_0xffb0('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xffb0('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4a1a8b,_0x4bc272,_0x3d9857){return new BPromise(function(_0x48943d,_0x53e59b){return client[_0xffb0('0x6')](_0x4a1a8b,_0x3d9857)[_0xffb0('0x7')](function(_0x283399){logger['info'](_0xffb0('0x8'),_0x4bc272,_0xffb0('0x9'));logger['debug'](_0xffb0('0xa'),_0x4bc272,_0xffb0('0x9'),JSON['stringify'](_0x283399));if(_0x283399[_0xffb0('0xb')]){if(_0x283399[_0xffb0('0xb')][_0xffb0('0xc')]===0x1f4){logger[_0xffb0('0xb')](_0xffb0('0x8'),_0x4bc272,_0x283399[_0xffb0('0xb')][_0xffb0('0xd')]);return _0x53e59b(_0x283399[_0xffb0('0xb')][_0xffb0('0xd')]);}logger[_0xffb0('0xb')](_0xffb0('0x8'),_0x4bc272,_0x283399['error']['message']);return _0x48943d(_0x283399[_0xffb0('0xb')]['message']);}else{logger[_0xffb0('0xe')](_0xffb0('0x8'),_0x4bc272,_0xffb0('0x9'));_0x48943d(_0x283399['result'][_0xffb0('0xd')]);}})[_0xffb0('0xf')](function(_0x1d175b){logger[_0xffb0('0xb')](_0xffb0('0x8'),_0x4bc272,_0x1d175b);_0x53e59b(_0x1d175b);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 8bfe8f2..a67c6bc 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 _0x4491=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe4fcb6,_0x41e92e){var _0x16ca9d=function(_0x5cea72){while(--_0x5cea72){_0xe4fcb6['push'](_0xe4fcb6['shift']());}};_0x16ca9d(++_0x41e92e);}(_0x4491,0x1bb));var _0x1449=function(_0x95a2d6,_0x36d066){_0x95a2d6=_0x95a2d6-0x0;var _0xd024a4=_0x4491[_0x95a2d6];return _0xd024a4;};'use strict';var multer=require(_0x1449('0x0'));var util=require('util');var path=require(_0x1449('0x1'));var timeout=require('connect-timeout');var express=require(_0x1449('0x2'));var router=express[_0x1449('0x3')]();var fs_extra=require(_0x1449('0x4'));var auth=require(_0x1449('0x5'));var interaction=require(_0x1449('0x6'));var config=require(_0x1449('0x7'));var controller=require('./analyticMetric.controller');router[_0x1449('0x8')]('/',auth['isAuthenticated'](),controller[_0x1449('0x9')]);router[_0x1449('0x8')](_0x1449('0xa'),auth[_0x1449('0xb')](),controller[_0x1449('0xc')]);router[_0x1449('0xd')]('/',auth['isAuthenticated'](),controller[_0x1449('0xe')]);router[_0x1449('0xf')]('/:id',auth[_0x1449('0xb')](),controller[_0x1449('0x10')]);router['delete'](_0x1449('0xa'),auth[_0x1449('0xb')](),controller['destroy']);module[_0x1449('0x11')]=router;
\ No newline at end of file
+var _0x1501=['show','post','put','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index','get','/:id'];(function(_0x12a414,_0x239012){var _0x4e7063=function(_0x1fa7ec){while(--_0x1fa7ec){_0x12a414['push'](_0x12a414['shift']());}};_0x4e7063(++_0x239012);}(_0x1501,0x126));var _0x1150=function(_0x1ed08f,_0x3d499a){_0x1ed08f=_0x1ed08f-0x0;var _0x9df16c=_0x1501[_0x1ed08f];return _0x9df16c;};'use strict';var multer=require('multer');var util=require(_0x1150('0x0'));var path=require(_0x1150('0x1'));var timeout=require(_0x1150('0x2'));var express=require('express');var router=express[_0x1150('0x3')]();var fs_extra=require(_0x1150('0x4'));var auth=require(_0x1150('0x5'));var interaction=require(_0x1150('0x6'));var config=require('../../config/environment');var controller=require(_0x1150('0x7'));router['get']('/',auth[_0x1150('0x8')](),controller[_0x1150('0x9')]);router[_0x1150('0xa')](_0x1150('0xb'),auth[_0x1150('0x8')](),controller[_0x1150('0xc')]);router[_0x1150('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1150('0xe')](_0x1150('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1150('0xf')](_0x1150('0xb'),auth[_0x1150('0x8')](),controller[_0x1150('0x10')]);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 9b74af4..91ed205 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 _0x7420=['exports','sequelize'];(function(_0x2b9358,_0x5a9e10){var _0x73cce8=function(_0x2c4a6f){while(--_0x2c4a6f){_0x2b9358['push'](_0x2b9358['shift']());}};_0x73cce8(++_0x5a9e10);}(_0x7420,0x183));var _0x0742=function(_0x485ed8,_0x18043e){_0x485ed8=_0x485ed8-0x0;var _0x1863f7=_0x7420[_0x485ed8];return _0x1863f7;};'use strict';var Sequelize=require(_0x0742('0x0'));module[_0x0742('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x1936=['exports','TEXT','sequelize'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x1936,0x1d6));var _0x6193=function(_0x438e5c,_0x13c551){_0x438e5c=_0x438e5c-0x0;var _0x2104a1=_0x1936[_0x438e5c];return _0x2104a1;};'use strict';var Sequelize=require(_0x6193('0x0'));module[_0x6193('0x1')]={'tree':{'type':Sequelize[_0x6193('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 69291c8..a680a9e 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 _0x8e13=['keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','query'];(function(_0x2ddc53,_0x4c5578){var _0x30d728=function(_0x4e6bb5){while(--_0x4e6bb5){_0x2ddc53['push'](_0x2ddc53['shift']());}};_0x30d728(++_0x4c5578);}(_0x8e13,0x16e));var _0x38e1=function(_0x136c6a,_0x2e5e75){_0x136c6a=_0x136c6a-0x0;var _0x339477=_0x8e13[_0x136c6a];return _0x339477;};'use strict';var emlformat=require(_0x38e1('0x0'));var rimraf=require(_0x38e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38e1('0x2'));var rp=require('request-promise');var moment=require(_0x38e1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x38e1('0x4'));var path=require('path');var sox=require(_0x38e1('0x5'));var csv=require('to-csv');var ejs=require(_0x38e1('0x6'));var fs=require('fs');var fs_extra=require(_0x38e1('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x38e1('0x8'));var jsforce=require(_0x38e1('0x9'));var deskjs=require(_0x38e1('0xa'));var toCsv=require(_0x38e1('0xb'));var querystring=require(_0x38e1('0xc'));var Papa=require(_0x38e1('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x38e1('0xe'));var hardwareService=require(_0x38e1('0xf'));var logger=require(_0x38e1('0x10'))(_0x38e1('0x11'));var utils=require(_0x38e1('0x12'));var config=require(_0x38e1('0x13'));var licenseUtil=require(_0x38e1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b756e,_0x39d2c8){_0x39d2c8=_0x39d2c8||0xcc;return function(_0x409b43){if(_0x409b43){return _0x4b756e[_0x38e1('0x15')](_0x39d2c8);}return _0x4b756e[_0x38e1('0x16')](_0x39d2c8)[_0x38e1('0x17')]();};}function respondWithResult(_0x4bc413,_0x38362d){_0x38362d=_0x38362d||0xc8;return function(_0x5811b9){if(_0x5811b9){return _0x4bc413[_0x38e1('0x16')](_0x38362d)[_0x38e1('0x18')](_0x5811b9);}};}function respondWithFilteredResult(_0x5ae628,_0x345885){return function(_0x1062a3){if(_0x1062a3){var _0x390eb7=typeof _0x345885[_0x38e1('0x19')]==='undefined'&&typeof _0x345885[_0x38e1('0x1a')]===_0x38e1('0x1b');var _0x17db91=_0x1062a3['count'];var _0x5b4140=_0x390eb7?0x0:_0x345885['offset'];var _0x4da3a0=_0x390eb7?_0x1062a3[_0x38e1('0x1c')]:_0x345885[_0x38e1('0x19')]+_0x345885[_0x38e1('0x1a')];var _0x1652f2;if(_0x4da3a0>=_0x17db91){_0x4da3a0=_0x17db91;_0x1652f2=0xc8;}else{_0x1652f2=0xce;}_0x5ae628[_0x38e1('0x16')](_0x1652f2);return _0x5ae628['set'](_0x38e1('0x1d'),_0x5b4140+'-'+_0x4da3a0+'/'+_0x17db91)[_0x38e1('0x18')](_0x1062a3);}return null;};}function patchUpdates(_0x2a0964){return function(_0x53a592){try{jsonpatch['apply'](_0x53a592,_0x2a0964,!![]);}catch(_0x48cf09){return BPromise['reject'](_0x48cf09);}return _0x53a592['save']();};}function saveUpdates(_0x4474b4,_0x5637b6){return function(_0x1d7a1e){if(_0x1d7a1e){return _0x1d7a1e[_0x38e1('0x1e')](_0x4474b4)['then'](function(_0x5d5e29){return _0x5d5e29;});}return null;};}function removeEntity(_0x212c1f,_0x18d989){return function(_0xfa4113){if(_0xfa4113){return _0xfa4113[_0x38e1('0x1f')]()['then'](function(){_0x212c1f[_0x38e1('0x16')](0xcc)[_0x38e1('0x17')]();});}};}function handleEntityNotFound(_0x18eff2,_0x5bd4d6){return function(_0x1bc810){if(!_0x1bc810){_0x18eff2[_0x38e1('0x15')](0x194);}return _0x1bc810;};}function handleError(_0x5ed30c,_0x2d3eea){_0x2d3eea=_0x2d3eea||0x1f4;return function(_0x1083fd){logger[_0x38e1('0x20')](_0x1083fd[_0x38e1('0x21')]);if(_0x1083fd[_0x38e1('0x22')]){delete _0x1083fd[_0x38e1('0x22')];}_0x5ed30c[_0x38e1('0x16')](_0x2d3eea)[_0x38e1('0x23')](_0x1083fd);};}exports[_0x38e1('0x24')]=function(_0x9824f9,_0x53810b){var _0x35766b={},_0x2a5d30={},_0x498fa8={'count':0x0,'rows':[]};var _0x52b90c=_[_0x38e1('0x25')](db[_0x38e1('0x26')][_0x38e1('0x27')],function(_0x408a1b){return{'name':_0x408a1b['fieldName'],'type':_0x408a1b[_0x38e1('0x28')]['key']};});_0x2a5d30['model']=_[_0x38e1('0x25')](_0x52b90c,_0x38e1('0x22'));_0x2a5d30[_0x38e1('0x29')]=_[_0x38e1('0x2a')](_0x9824f9[_0x38e1('0x29')]);_0x2a5d30[_0x38e1('0x2b')]=_[_0x38e1('0x2c')](_0x2a5d30[_0x38e1('0x2d')],_0x2a5d30[_0x38e1('0x29')]);_0x35766b[_0x38e1('0x2e')]=_['intersection'](_0x2a5d30['model'],qs[_0x38e1('0x2f')](_0x9824f9[_0x38e1('0x29')]['fields']));_0x35766b[_0x38e1('0x2e')]=_0x35766b[_0x38e1('0x2e')][_0x38e1('0x30')]?_0x35766b[_0x38e1('0x2e')]:_0x2a5d30[_0x38e1('0x2d')];if(!_0x9824f9['query']['hasOwnProperty'](_0x38e1('0x31'))){_0x35766b['limit']=qs[_0x38e1('0x1a')](_0x9824f9[_0x38e1('0x29')][_0x38e1('0x1a')]);_0x35766b[_0x38e1('0x19')]=qs['offset'](_0x9824f9['query'][_0x38e1('0x19')]);}_0x35766b[_0x38e1('0x32')]=qs[_0x38e1('0x33')](_0x9824f9[_0x38e1('0x29')]['sort']);_0x35766b[_0x38e1('0x34')]=qs[_0x38e1('0x2b')](_[_0x38e1('0x35')](_0x9824f9[_0x38e1('0x29')],_0x2a5d30[_0x38e1('0x2b')]),_0x52b90c);if(_0x9824f9['query'][_0x38e1('0x36')]){_0x35766b[_0x38e1('0x34')]=_[_0x38e1('0x37')](_0x35766b['where'],{'$or':_[_0x38e1('0x25')](_0x52b90c,function(_0x4854e9){if(_0x4854e9[_0x38e1('0x28')]!=='VIRTUAL'){var _0x2a977c={};_0x2a977c[_0x4854e9[_0x38e1('0x22')]]={'$like':'%'+_0x9824f9['query']['filter']+'%'};return _0x2a977c;}})});}_0x35766b=_['merge']({},_0x35766b,_0x9824f9[_0x38e1('0x38')]);var _0x2ad1c9={'where':_0x35766b[_0x38e1('0x34')]};return db[_0x38e1('0x26')][_0x38e1('0x1c')](_0x2ad1c9)[_0x38e1('0x39')](function(_0x1e44c0){_0x498fa8['count']=_0x1e44c0;if(_0x9824f9[_0x38e1('0x29')][_0x38e1('0x3a')]){_0x35766b[_0x38e1('0x3b')]=[{'all':!![]}];}return db[_0x38e1('0x26')][_0x38e1('0x3c')](_0x35766b);})[_0x38e1('0x39')](function(_0x3bb2bd){_0x498fa8[_0x38e1('0x3d')]=_0x3bb2bd;return _0x498fa8;})[_0x38e1('0x39')](respondWithFilteredResult(_0x53810b,_0x35766b))['catch'](handleError(_0x53810b,null));};exports[_0x38e1('0x3e')]=function(_0xf93afe,_0x1c90e2){var _0xd63fb6={'raw':!![],'where':{'id':_0xf93afe[_0x38e1('0x3f')]['id']}},_0x4fc9b0={};_0x4fc9b0[_0x38e1('0x2d')]=_['keys'](db[_0x38e1('0x26')][_0x38e1('0x27')]);_0x4fc9b0['query']=_[_0x38e1('0x2a')](_0xf93afe['query']);_0x4fc9b0[_0x38e1('0x2b')]=_['intersection'](_0x4fc9b0[_0x38e1('0x2d')],_0x4fc9b0['query']);_0xd63fb6[_0x38e1('0x2e')]=_[_0x38e1('0x2c')](_0x4fc9b0[_0x38e1('0x2d')],qs[_0x38e1('0x2f')](_0xf93afe[_0x38e1('0x29')]['fields']));_0xd63fb6[_0x38e1('0x2e')]=_0xd63fb6[_0x38e1('0x2e')]['length']?_0xd63fb6['attributes']:_0x4fc9b0[_0x38e1('0x2d')];if(_0xf93afe['query'][_0x38e1('0x3a')]){_0xd63fb6[_0x38e1('0x3b')]=[{'all':!![]}];}_0xd63fb6=_['merge']({},_0xd63fb6,_0xf93afe[_0x38e1('0x38')]);return db[_0x38e1('0x26')][_0x38e1('0x40')](_0xd63fb6)['then'](handleEntityNotFound(_0x1c90e2,null))[_0x38e1('0x39')](respondWithResult(_0x1c90e2,null))[_0x38e1('0x41')](handleError(_0x1c90e2,null));};exports[_0x38e1('0x42')]=function(_0x1ff5a5,_0xb73d15){return db[_0x38e1('0x26')][_0x38e1('0x42')](_0x1ff5a5[_0x38e1('0x43')],{})['then'](respondWithResult(_0xb73d15,0xc9))[_0x38e1('0x41')](handleError(_0xb73d15,null));};exports[_0x38e1('0x1e')]=function(_0x1ed4b5,_0x251987){if(_0x1ed4b5[_0x38e1('0x43')]['id']){delete _0x1ed4b5[_0x38e1('0x43')]['id'];}return db[_0x38e1('0x26')][_0x38e1('0x40')]({'where':{'id':_0x1ed4b5[_0x38e1('0x3f')]['id']}})[_0x38e1('0x39')](handleEntityNotFound(_0x251987,null))[_0x38e1('0x39')](saveUpdates(_0x1ed4b5[_0x38e1('0x43')],null))[_0x38e1('0x39')](respondWithResult(_0x251987,null))[_0x38e1('0x41')](handleError(_0x251987,null));};exports[_0x38e1('0x1f')]=function(_0x4a57d6,_0x2083cd){return db[_0x38e1('0x26')]['find']({'where':{'id':_0x4a57d6['params']['id']}})[_0x38e1('0x39')](handleEntityNotFound(_0x2083cd,null))['then'](removeEntity(_0x2083cd,null))[_0x38e1('0x41')](handleError(_0x2083cd,null));};
\ No newline at end of file
+var _0x8d51=['destroy','error','stack','name','send','index','AnalyticTreeReport','type','key','model','map','query','keys','intersection','attributes','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','catch','show','params','rawAttributes','fields','length','include','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','apply','reject','update','then'];(function(_0x58df61,_0x263bda){var _0x2af205=function(_0x14c8aa){while(--_0x14c8aa){_0x58df61['push'](_0x58df61['shift']());}};_0x2af205(++_0x263bda);}(_0x8d51,0x13e));var _0x18d5=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x8d51[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require(_0x18d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18d5('0x1'));var jsonpatch=require(_0x18d5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x18d5('0x3'));var Mustache=require(_0x18d5('0x4'));var util=require(_0x18d5('0x5'));var path=require(_0x18d5('0x6'));var sox=require(_0x18d5('0x7'));var csv=require(_0x18d5('0x8'));var ejs=require(_0x18d5('0x9'));var fs=require('fs');var fs_extra=require(_0x18d5('0xa'));var _=require(_0x18d5('0xb'));var squel=require(_0x18d5('0xc'));var crypto=require(_0x18d5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x18d5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x18d5('0xf'));var Papa=require(_0x18d5('0x10'));var Redis=require(_0x18d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x18d5('0x12'));var as=require(_0x18d5('0x13'));var hardwareService=require(_0x18d5('0x14'));var logger=require(_0x18d5('0x15'))('api');var utils=require(_0x18d5('0x16'));var config=require(_0x18d5('0x17'));var licenseUtil=require(_0x18d5('0x18'));var db=require(_0x18d5('0x19'))['db'];function respondWithStatusCode(_0x34f790,_0x479ead){_0x479ead=_0x479ead||0xcc;return function(_0x4f0954){if(_0x4f0954){return _0x34f790[_0x18d5('0x1a')](_0x479ead);}return _0x34f790['status'](_0x479ead)[_0x18d5('0x1b')]();};}function respondWithResult(_0x477ebe,_0x914441){_0x914441=_0x914441||0xc8;return function(_0x263e47){if(_0x263e47){return _0x477ebe['status'](_0x914441)[_0x18d5('0x1c')](_0x263e47);}};}function respondWithFilteredResult(_0x1436f5,_0x4c7f7c){return function(_0xaa95eb){if(_0xaa95eb){var _0x4f4e14=typeof _0x4c7f7c['offset']===_0x18d5('0x1d')&&typeof _0x4c7f7c[_0x18d5('0x1e')]===_0x18d5('0x1d');var _0x9f1588=_0xaa95eb[_0x18d5('0x1f')];var _0x1e656d=_0x4f4e14?0x0:_0x4c7f7c[_0x18d5('0x20')];var _0x20294a=_0x4f4e14?_0xaa95eb[_0x18d5('0x1f')]:_0x4c7f7c[_0x18d5('0x20')]+_0x4c7f7c[_0x18d5('0x1e')];var _0x262db3;if(_0x20294a>=_0x9f1588){_0x20294a=_0x9f1588;_0x262db3=0xc8;}else{_0x262db3=0xce;}_0x1436f5['status'](_0x262db3);return _0x1436f5['set']('Content-Range',_0x1e656d+'-'+_0x20294a+'/'+_0x9f1588)[_0x18d5('0x1c')](_0xaa95eb);}return null;};}function patchUpdates(_0x5085a7){return function(_0x155aa2){try{jsonpatch[_0x18d5('0x21')](_0x155aa2,_0x5085a7,!![]);}catch(_0x5c86b9){return BPromise[_0x18d5('0x22')](_0x5c86b9);}return _0x155aa2['save']();};}function saveUpdates(_0x13c7ed,_0x550d29){return function(_0x4a375e){if(_0x4a375e){return _0x4a375e[_0x18d5('0x23')](_0x13c7ed)[_0x18d5('0x24')](function(_0x14f701){return _0x14f701;});}return null;};}function removeEntity(_0x20c20b,_0x81dddf){return function(_0x5a0edd){if(_0x5a0edd){return _0x5a0edd[_0x18d5('0x25')]()[_0x18d5('0x24')](function(){_0x20c20b['status'](0xcc)[_0x18d5('0x1b')]();});}};}function handleEntityNotFound(_0x3d2e6f,_0x2f22e4){return function(_0x19eb63){if(!_0x19eb63){_0x3d2e6f['sendStatus'](0x194);}return _0x19eb63;};}function handleError(_0x41a19e,_0x34238e){_0x34238e=_0x34238e||0x1f4;return function(_0x42ff10){logger[_0x18d5('0x26')](_0x42ff10[_0x18d5('0x27')]);if(_0x42ff10[_0x18d5('0x28')]){delete _0x42ff10[_0x18d5('0x28')];}_0x41a19e['status'](_0x34238e)[_0x18d5('0x29')](_0x42ff10);};}exports[_0x18d5('0x2a')]=function(_0x4c3598,_0x48ccad){var _0x464238={},_0x5ae824={},_0x4bcfe9={'count':0x0,'rows':[]};var _0x415d17=_['map'](db[_0x18d5('0x2b')]['rawAttributes'],function(_0x155e3d){return{'name':_0x155e3d['fieldName'],'type':_0x155e3d[_0x18d5('0x2c')][_0x18d5('0x2d')]};});_0x5ae824[_0x18d5('0x2e')]=_[_0x18d5('0x2f')](_0x415d17,_0x18d5('0x28'));_0x5ae824[_0x18d5('0x30')]=_[_0x18d5('0x31')](_0x4c3598[_0x18d5('0x30')]);_0x5ae824['filters']=_[_0x18d5('0x32')](_0x5ae824[_0x18d5('0x2e')],_0x5ae824['query']);_0x464238[_0x18d5('0x33')]=_[_0x18d5('0x32')](_0x5ae824[_0x18d5('0x2e')],qs['fields'](_0x4c3598[_0x18d5('0x30')]['fields']));_0x464238[_0x18d5('0x33')]=_0x464238[_0x18d5('0x33')]['length']?_0x464238[_0x18d5('0x33')]:_0x5ae824[_0x18d5('0x2e')];if(!_0x4c3598[_0x18d5('0x30')]['hasOwnProperty'](_0x18d5('0x34'))){_0x464238[_0x18d5('0x1e')]=qs[_0x18d5('0x1e')](_0x4c3598['query']['limit']);_0x464238[_0x18d5('0x20')]=qs[_0x18d5('0x20')](_0x4c3598[_0x18d5('0x30')][_0x18d5('0x20')]);}_0x464238['order']=qs[_0x18d5('0x35')](_0x4c3598[_0x18d5('0x30')][_0x18d5('0x35')]);_0x464238[_0x18d5('0x36')]=qs[_0x18d5('0x37')](_[_0x18d5('0x38')](_0x4c3598[_0x18d5('0x30')],_0x5ae824[_0x18d5('0x37')]),_0x415d17);if(_0x4c3598[_0x18d5('0x30')][_0x18d5('0x39')]){_0x464238[_0x18d5('0x36')]=_[_0x18d5('0x3a')](_0x464238['where'],{'$or':_[_0x18d5('0x2f')](_0x415d17,function(_0x5258b3){if(_0x5258b3['type']!=='VIRTUAL'){var _0x2ddfc7={};_0x2ddfc7[_0x5258b3['name']]={'$like':'%'+_0x4c3598['query']['filter']+'%'};return _0x2ddfc7;}})});}_0x464238=_[_0x18d5('0x3a')]({},_0x464238,_0x4c3598[_0x18d5('0x3b')]);var _0x220e7d={'where':_0x464238[_0x18d5('0x36')]};return db['AnalyticTreeReport']['count'](_0x220e7d)[_0x18d5('0x24')](function(_0x3ea66b){_0x4bcfe9[_0x18d5('0x1f')]=_0x3ea66b;if(_0x4c3598[_0x18d5('0x30')][_0x18d5('0x3c')]){_0x464238['include']=[{'all':!![]}];}return db[_0x18d5('0x2b')]['findAll'](_0x464238);})[_0x18d5('0x24')](function(_0x5a384c){_0x4bcfe9['rows']=_0x5a384c;return _0x4bcfe9;})[_0x18d5('0x24')](respondWithFilteredResult(_0x48ccad,_0x464238))[_0x18d5('0x3d')](handleError(_0x48ccad,null));};exports[_0x18d5('0x3e')]=function(_0x4ff96d,_0x267ced){var _0x502d28={'raw':!![],'where':{'id':_0x4ff96d[_0x18d5('0x3f')]['id']}},_0x413828={};_0x413828[_0x18d5('0x2e')]=_[_0x18d5('0x31')](db[_0x18d5('0x2b')][_0x18d5('0x40')]);_0x413828[_0x18d5('0x30')]=_[_0x18d5('0x31')](_0x4ff96d[_0x18d5('0x30')]);_0x413828['filters']=_['intersection'](_0x413828[_0x18d5('0x2e')],_0x413828[_0x18d5('0x30')]);_0x502d28[_0x18d5('0x33')]=_[_0x18d5('0x32')](_0x413828[_0x18d5('0x2e')],qs[_0x18d5('0x41')](_0x4ff96d[_0x18d5('0x30')][_0x18d5('0x41')]));_0x502d28[_0x18d5('0x33')]=_0x502d28[_0x18d5('0x33')][_0x18d5('0x42')]?_0x502d28[_0x18d5('0x33')]:_0x413828['model'];if(_0x4ff96d[_0x18d5('0x30')][_0x18d5('0x3c')]){_0x502d28[_0x18d5('0x43')]=[{'all':!![]}];}_0x502d28=_['merge']({},_0x502d28,_0x4ff96d[_0x18d5('0x3b')]);return db[_0x18d5('0x2b')][_0x18d5('0x44')](_0x502d28)[_0x18d5('0x24')](handleEntityNotFound(_0x267ced,null))[_0x18d5('0x24')](respondWithResult(_0x267ced,null))[_0x18d5('0x3d')](handleError(_0x267ced,null));};exports[_0x18d5('0x45')]=function(_0x191605,_0x25c6a7){return db[_0x18d5('0x2b')]['create'](_0x191605[_0x18d5('0x46')],{})[_0x18d5('0x24')](respondWithResult(_0x25c6a7,0xc9))[_0x18d5('0x3d')](handleError(_0x25c6a7,null));};exports['update']=function(_0x4a4d62,_0x444c1c){if(_0x4a4d62['body']['id']){delete _0x4a4d62[_0x18d5('0x46')]['id'];}return db[_0x18d5('0x2b')]['find']({'where':{'id':_0x4a4d62[_0x18d5('0x3f')]['id']}})[_0x18d5('0x24')](handleEntityNotFound(_0x444c1c,null))[_0x18d5('0x24')](saveUpdates(_0x4a4d62['body'],null))[_0x18d5('0x24')](respondWithResult(_0x444c1c,null))[_0x18d5('0x3d')](handleError(_0x444c1c,null));};exports[_0x18d5('0x25')]=function(_0x2c23a6,_0xbb33f3){return db[_0x18d5('0x2b')][_0x18d5('0x44')]({'where':{'id':_0x2c23a6[_0x18d5('0x3f')]['id']}})['then'](handleEntityNotFound(_0xbb33f3,null))[_0x18d5('0x24')](removeEntity(_0xbb33f3,null))['catch'](handleError(_0xbb33f3,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index b43075e..61bc808 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 _0xc4b1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','../../config/logger'];(function(_0x455a09,_0x379272){var _0x57a49d=function(_0x3795fb){while(--_0x3795fb){_0x455a09['push'](_0x455a09['shift']());}};_0x57a49d(++_0x379272);}(_0xc4b1,0x1ab));var _0x1c4b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc4b1[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x1c4b('0x0'));var util=require('util');var logger=require(_0x1c4b('0x1'))('api');var moment=require(_0x1c4b('0x2'));var BPromise=require(_0x1c4b('0x3'));var rp=require(_0x1c4b('0x4'));var fs=require('fs');var path=require(_0x1c4b('0x5'));var rimraf=require(_0x1c4b('0x6'));var config=require(_0x1c4b('0x7'));var attributes=require(_0x1c4b('0x8'));module[_0x1c4b('0x9')]=function(_0x17b1b8,_0x55a877){return _0x17b1b8['define'](_0x1c4b('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x811a=['api','moment','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0x811a,0xb9));var _0xa811=function(_0x1b09f5,_0x52d403){_0x1b09f5=_0x1b09f5-0x0;var _0x3974bf=_0x811a[_0x1b09f5];return _0x3974bf;};'use strict';var _=require(_0xa811('0x0'));var util=require(_0xa811('0x1'));var logger=require('../../config/logger')(_0xa811('0x2'));var moment=require(_0xa811('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa811('0x4'));var rimraf=require(_0xa811('0x5'));var config=require(_0xa811('0x6'));var attributes=require(_0xa811('0x7'));module[_0xa811('0x8')]=function(_0x4f520c,_0x29c97c){return _0x4f520c[_0xa811('0x9')](_0xa811('0xa'),attributes,{'tableName':'analytics_report_trees','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 1b22696..a0b2143 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xd436c4,_0x298c0b){var _0x506952=function(_0x771356){while(--_0x771356){_0xd436c4['push'](_0xd436c4['shift']());}};_0x506952(++_0x298c0b);}(_0x2ef3,0xba));var _0x32ef=function(_0x4fb525,_0x16b5f9){_0x4fb525=_0x4fb525-0x0;var _0x5e8d50=_0x2ef3[_0x4fb525];return _0x5e8d50;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+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(_0x1ca09e,_0x232ad1){var _0x4149bc=function(_0x51e14a){while(--_0x51e14a){_0x1ca09e['push'](_0x1ca09e['shift']());}};_0x4149bc(++_0x232ad1);}(_0xdb28,0x106));var _0x8db2=function(_0x3bf674,_0x2cb42a){_0x3bf674=_0x3bf674-0x0;var _0x3163fd=_0xdb28[_0x3bf674];return _0x3163fd;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d7364d6..8a5085d 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 _0x7380=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x3c5191,_0x2f6745){var _0x5415a7=function(_0x1d852d){while(--_0x1d852d){_0x3c5191['push'](_0x3c5191['shift']());}};_0x5415a7(++_0x2f6745);}(_0x7380,0x17c));var _0x0738=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x7380[_0x5c2a2b];return _0x19921f;};'use strict';var multer=require(_0x0738('0x0'));var util=require(_0x0738('0x1'));var path=require('path');var timeout=require(_0x0738('0x2'));var express=require('express');var router=express[_0x0738('0x3')]();var fs_extra=require(_0x0738('0x4'));var auth=require(_0x0738('0x5'));var interaction=require(_0x0738('0x6'));var config=require(_0x0738('0x7'));var controller=require(_0x0738('0x8'));router[_0x0738('0x9')]('/',auth[_0x0738('0xa')](),controller[_0x0738('0xb')]);router['get'](_0x0738('0xc'),auth['isAuthenticated'](),controller[_0x0738('0xd')]);router[_0x0738('0xe')]('/',auth['isAuthenticated'](),controller[_0x0738('0xf')]);router[_0x0738('0x10')](_0x0738('0xc'),auth[_0x0738('0xa')](),controller[_0x0738('0x11')]);router['delete'](_0x0738('0xc'),auth[_0x0738('0xa')](),controller[_0x0738('0x12')]);module[_0x0738('0x13')]=router;
\ No newline at end of file
+var _0xa148=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa148,0x14d));var _0x8a14=function(_0x2fe726,_0x34307b){_0x2fe726=_0x2fe726-0x0;var _0x25bc11=_0xa148[_0x2fe726];return _0x25bc11;};'use strict';var multer=require(_0x8a14('0x0'));var util=require(_0x8a14('0x1'));var path=require(_0x8a14('0x2'));var timeout=require(_0x8a14('0x3'));var express=require(_0x8a14('0x4'));var router=express['Router']();var fs_extra=require(_0x8a14('0x5'));var auth=require(_0x8a14('0x6'));var interaction=require(_0x8a14('0x7'));var config=require(_0x8a14('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x8a14('0x9')]('/',auth[_0x8a14('0xa')](),controller[_0x8a14('0xb')]);router[_0x8a14('0x9')]('/:id',auth[_0x8a14('0xa')](),controller[_0x8a14('0xc')]);router[_0x8a14('0xd')]('/',auth[_0x8a14('0xa')](),controller[_0x8a14('0xe')]);router[_0x8a14('0xf')](_0x8a14('0x10'),auth[_0x8a14('0xa')](),controller[_0x8a14('0x11')]);router[_0x8a14('0x12')]('/:id',auth[_0x8a14('0xa')](),controller[_0x8a14('0x13')]);module[_0x8a14('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 80f4d8e..7ffe51b 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 _0xc3b5=['STRING'];(function(_0xb5ac6c,_0x5c5762){var _0x48aace=function(_0x30bb19){while(--_0x30bb19){_0xb5ac6c['push'](_0xb5ac6c['shift']());}};_0x48aace(++_0x5c5762);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x1e1144,_0x187147){_0x1e1144=_0x1e1144-0x0;var _0x1ee473=_0xc3b5[_0x1e1144];return _0x1ee473;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5c3b('0x0')]},'basename':{'type':Sequelize[_0x5c3b('0x0')]},'type':{'type':Sequelize[_0x5c3b('0x0')]}};
\ No newline at end of file
+var _0xb26e=['STRING','sequelize'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0xb26e,0x11d));var _0xeb26=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0xb26e[_0x42e25e];return _0x1ed3a6;};'use strict';var Sequelize=require(_0xeb26('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xeb26('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index bc56b62..1cb5b48 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 _0xb054=['merge','options','includeAll','include','rows','params','fields','catch','clone','find','get','omit','updatedAt','body','createdAt','create','file','originalname','mimetype','download','findOne','ChatOfflineMessageId','root','offline-chat/','join','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb054,0x70));var _0x4b05=function(_0xde12cd,_0x269a1f){_0xde12cd=_0xde12cd-0x0;var _0x93a6e2=_0xb054[_0xde12cd];return _0x93a6e2;};'use strict';var emlformat=require(_0x4b05('0x0'));var rimraf=require(_0x4b05('0x1'));var zipdir=require(_0x4b05('0x2'));var jsonpatch=require(_0x4b05('0x3'));var rp=require('request-promise');var moment=require(_0x4b05('0x4'));var BPromise=require(_0x4b05('0x5'));var Mustache=require('mustache');var util=require(_0x4b05('0x6'));var path=require(_0x4b05('0x7'));var sox=require(_0x4b05('0x8'));var csv=require(_0x4b05('0x9'));var ejs=require(_0x4b05('0xa'));var fs=require('fs');var fs_extra=require(_0x4b05('0xb'));var _=require(_0x4b05('0xc'));var squel=require(_0x4b05('0xd'));var crypto=require(_0x4b05('0xe'));var jsforce=require(_0x4b05('0xf'));var deskjs=require(_0x4b05('0x10'));var toCsv=require(_0x4b05('0x9'));var querystring=require('querystring');var Papa=require(_0x4b05('0x11'));var Redis=require(_0x4b05('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4b05('0x13'));var as=require(_0x4b05('0x14'));var hardwareService=require(_0x4b05('0x15'));var logger=require('../../config/logger')(_0x4b05('0x16'));var utils=require('../../config/utils');var config=require(_0x4b05('0x17'));var licenseUtil=require(_0x4b05('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12f5ac,_0x5a52d9){_0x5a52d9=_0x5a52d9||0xcc;return function(_0x4681d5){if(_0x4681d5){return _0x12f5ac[_0x4b05('0x19')](_0x5a52d9);}return _0x12f5ac[_0x4b05('0x1a')](_0x5a52d9)[_0x4b05('0x1b')]();};}function respondWithResult(_0x460025,_0x5744f2){_0x5744f2=_0x5744f2||0xc8;return function(_0x5ced4f){if(_0x5ced4f){return _0x460025[_0x4b05('0x1a')](_0x5744f2)[_0x4b05('0x1c')](_0x5ced4f);}};}function respondWithFilteredResult(_0x4b5819,_0x396262){return function(_0x575abc){if(_0x575abc){var _0x9f1ce5=typeof _0x396262[_0x4b05('0x1d')]===_0x4b05('0x1e')&&typeof _0x396262['limit']==='undefined';var _0x2a7b14=_0x575abc[_0x4b05('0x1f')];var _0x50f2af=_0x9f1ce5?0x0:_0x396262[_0x4b05('0x1d')];var _0x5ec6bb=_0x9f1ce5?_0x575abc[_0x4b05('0x1f')]:_0x396262[_0x4b05('0x1d')]+_0x396262['limit'];var _0x1b7dc0;if(_0x5ec6bb>=_0x2a7b14){_0x5ec6bb=_0x2a7b14;_0x1b7dc0=0xc8;}else{_0x1b7dc0=0xce;}_0x4b5819['status'](_0x1b7dc0);return _0x4b5819[_0x4b05('0x20')](_0x4b05('0x21'),_0x50f2af+'-'+_0x5ec6bb+'/'+_0x2a7b14)['json'](_0x575abc);}return null;};}function patchUpdates(_0x168802){return function(_0x30a75f){try{jsonpatch[_0x4b05('0x22')](_0x30a75f,_0x168802,!![]);}catch(_0xb13ca6){return BPromise[_0x4b05('0x23')](_0xb13ca6);}return _0x30a75f['save']();};}function saveUpdates(_0x5e667a,_0x28f2d2){return function(_0x47b8c9){if(_0x47b8c9){return _0x47b8c9[_0x4b05('0x24')](_0x5e667a)[_0x4b05('0x25')](function(_0x3f8c17){return _0x3f8c17;});}return null;};}function removeEntity(_0x148966,_0x3ff2fa){return function(_0x29f82e){if(_0x29f82e){return _0x29f82e[_0x4b05('0x26')]()['then'](function(){_0x148966[_0x4b05('0x1a')](0xcc)[_0x4b05('0x1b')]();});}};}function handleEntityNotFound(_0x2a5bb8,_0x288067){return function(_0x21f212){if(!_0x21f212){_0x2a5bb8[_0x4b05('0x19')](0x194);}return _0x21f212;};}function handleError(_0x7c8f26,_0xd46e8e){_0xd46e8e=_0xd46e8e||0x1f4;return function(_0x2daa94){logger['error'](_0x2daa94['stack']);if(_0x2daa94[_0x4b05('0x27')]){delete _0x2daa94[_0x4b05('0x27')];}_0x7c8f26['status'](_0xd46e8e)['send'](_0x2daa94);};}exports[_0x4b05('0x28')]=function(_0x3514b5,_0xe8d8a){var _0x2b18e9={},_0x45c8f3={},_0x3da6cb={'count':0x0,'rows':[]};var _0x323d1d=_[_0x4b05('0x29')](db[_0x4b05('0x2a')][_0x4b05('0x2b')],function(_0x480b4d){return{'name':_0x480b4d[_0x4b05('0x2c')],'type':_0x480b4d[_0x4b05('0x2d')][_0x4b05('0x2e')]};});_0x45c8f3[_0x4b05('0x2f')]=_[_0x4b05('0x29')](_0x323d1d,_0x4b05('0x27'));_0x45c8f3[_0x4b05('0x30')]=_[_0x4b05('0x31')](_0x3514b5[_0x4b05('0x30')]);_0x45c8f3[_0x4b05('0x32')]=_[_0x4b05('0x33')](_0x45c8f3[_0x4b05('0x2f')],_0x45c8f3['query']);_0x2b18e9[_0x4b05('0x34')]=_[_0x4b05('0x33')](_0x45c8f3[_0x4b05('0x2f')],qs['fields'](_0x3514b5[_0x4b05('0x30')]['fields']));_0x2b18e9['attributes']=_0x2b18e9['attributes'][_0x4b05('0x35')]?_0x2b18e9[_0x4b05('0x34')]:_0x45c8f3['model'];if(!_0x3514b5[_0x4b05('0x30')][_0x4b05('0x36')](_0x4b05('0x37'))){_0x2b18e9[_0x4b05('0x38')]=qs[_0x4b05('0x38')](_0x3514b5[_0x4b05('0x30')][_0x4b05('0x38')]);_0x2b18e9[_0x4b05('0x1d')]=qs[_0x4b05('0x1d')](_0x3514b5[_0x4b05('0x30')][_0x4b05('0x1d')]);}_0x2b18e9[_0x4b05('0x39')]=qs[_0x4b05('0x3a')](_0x3514b5[_0x4b05('0x30')][_0x4b05('0x3a')]);_0x2b18e9[_0x4b05('0x3b')]=qs[_0x4b05('0x32')](_[_0x4b05('0x3c')](_0x3514b5[_0x4b05('0x30')],_0x45c8f3[_0x4b05('0x32')]),_0x323d1d);if(_0x3514b5[_0x4b05('0x30')]['filter']){_0x2b18e9[_0x4b05('0x3b')]=_['merge'](_0x2b18e9[_0x4b05('0x3b')],{'$or':_[_0x4b05('0x29')](_0x323d1d,function(_0x4487cb){if(_0x4487cb[_0x4b05('0x2d')]!=='VIRTUAL'){var _0x2903eb={};_0x2903eb[_0x4487cb[_0x4b05('0x27')]]={'$like':'%'+_0x3514b5[_0x4b05('0x30')][_0x4b05('0x3d')]+'%'};return _0x2903eb;}})});}_0x2b18e9=_[_0x4b05('0x3e')]({},_0x2b18e9,_0x3514b5[_0x4b05('0x3f')]);var _0x4147d2={'where':_0x2b18e9[_0x4b05('0x3b')]};return db[_0x4b05('0x2a')]['count'](_0x4147d2)[_0x4b05('0x25')](function(_0x356dda){_0x3da6cb[_0x4b05('0x1f')]=_0x356dda;if(_0x3514b5[_0x4b05('0x30')][_0x4b05('0x40')]){_0x2b18e9[_0x4b05('0x41')]=[{'all':!![]}];}return db[_0x4b05('0x2a')]['findAll'](_0x2b18e9);})[_0x4b05('0x25')](function(_0x2526f2){_0x3da6cb[_0x4b05('0x42')]=_0x2526f2;return _0x3da6cb;})[_0x4b05('0x25')](respondWithFilteredResult(_0xe8d8a,_0x2b18e9))['catch'](handleError(_0xe8d8a,null));};exports['show']=function(_0x37511c,_0x7c5267){var _0x46449f={'raw':!![],'where':{'id':_0x37511c[_0x4b05('0x43')]['id']}},_0x4916d8={};_0x4916d8['model']=_[_0x4b05('0x31')](db[_0x4b05('0x2a')]['rawAttributes']);_0x4916d8[_0x4b05('0x30')]=_[_0x4b05('0x31')](_0x37511c[_0x4b05('0x30')]);_0x4916d8[_0x4b05('0x32')]=_[_0x4b05('0x33')](_0x4916d8[_0x4b05('0x2f')],_0x4916d8[_0x4b05('0x30')]);_0x46449f['attributes']=_[_0x4b05('0x33')](_0x4916d8['model'],qs['fields'](_0x37511c[_0x4b05('0x30')][_0x4b05('0x44')]));_0x46449f['attributes']=_0x46449f['attributes']['length']?_0x46449f[_0x4b05('0x34')]:_0x4916d8[_0x4b05('0x2f')];if(_0x37511c[_0x4b05('0x30')][_0x4b05('0x40')]){_0x46449f[_0x4b05('0x41')]=[{'all':!![]}];}_0x46449f=_[_0x4b05('0x3e')]({},_0x46449f,_0x37511c['options']);return db['Attachment']['find'](_0x46449f)[_0x4b05('0x25')](handleEntityNotFound(_0x7c5267,null))[_0x4b05('0x25')](respondWithResult(_0x7c5267,null))[_0x4b05('0x45')](handleError(_0x7c5267,null));};exports[_0x4b05('0x46')]=function(_0x409ff8,_0x3c6471){var _0x51e20b={'where':{'id':_0x409ff8[_0x4b05('0x43')]['id']}},_0x20dc51={};_0x20dc51[_0x4b05('0x2f')]=_['keys'](db[_0x4b05('0x2a')][_0x4b05('0x2b')]);_0x51e20b[_0x4b05('0x34')]=_[_0x4b05('0x33')](_0x20dc51[_0x4b05('0x2f')],qs[_0x4b05('0x44')](_0x409ff8[_0x4b05('0x30')]['fields']));_0x51e20b[_0x4b05('0x34')]=_0x51e20b[_0x4b05('0x34')][_0x4b05('0x35')]?_0x51e20b[_0x4b05('0x34')]:_0x20dc51[_0x4b05('0x2f')];if(_0x409ff8[_0x4b05('0x30')][_0x4b05('0x40')]){_0x51e20b[_0x4b05('0x41')]=[{'all':!![]}];}_0x51e20b=_[_0x4b05('0x3e')]({},_0x51e20b,_0x409ff8[_0x4b05('0x3f')]);return db[_0x4b05('0x2a')][_0x4b05('0x47')](_0x51e20b)[_0x4b05('0x25')](handleEntityNotFound(_0x3c6471,null))[_0x4b05('0x25')](function(_0x16d9bc){if(_0x16d9bc){var _0x42f9e1=_0x16d9bc[_0x4b05('0x48')]({'plain':!![]});_0x42f9e1=qs[_0x4b05('0x49')](_0x42f9e1,['id','createdAt',_0x4b05('0x4a')]);_0x409ff8[_0x4b05('0x4b')]=_['omit'](_0x409ff8[_0x4b05('0x4b')],['id',_0x4b05('0x4c'),'updatedAt']);return db['Attachment'][_0x4b05('0x4d')](_[_0x4b05('0x3e')](_0x42f9e1,_0x409ff8[_0x4b05('0x4b')]),{'include':_0x409ff8[_0x4b05('0x30')][_0x4b05('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3c6471,0xc9))[_0x4b05('0x45')](handleError(_0x3c6471,null));};exports[_0x4b05('0x24')]=function(_0xb93856,_0x166e32){if(_0xb93856[_0x4b05('0x4b')]['id']){delete _0xb93856[_0x4b05('0x4b')]['id'];}return db[_0x4b05('0x2a')][_0x4b05('0x47')]({'where':{'id':_0xb93856['params']['id']}})[_0x4b05('0x25')](handleEntityNotFound(_0x166e32,null))[_0x4b05('0x25')](saveUpdates(_0xb93856[_0x4b05('0x4b')],null))['then'](respondWithResult(_0x166e32,null))[_0x4b05('0x45')](handleError(_0x166e32,null));};exports[_0x4b05('0x26')]=function(_0x3859e6,_0x43d800){return db['Attachment']['find']({'where':{'id':_0x3859e6[_0x4b05('0x43')]['id']}})[_0x4b05('0x25')](handleEntityNotFound(_0x43d800,null))[_0x4b05('0x25')](removeEntity(_0x43d800,null))[_0x4b05('0x45')](handleError(_0x43d800,null));};exports[_0x4b05('0x4d')]=function(_0x53f9fc,_0x1951fe,_0x3e73bd){_0x53f9fc['body']['name']=_0x53f9fc[_0x4b05('0x4e')][_0x4b05('0x4f')];_0x53f9fc[_0x4b05('0x4b')]['basename']=_0x53f9fc['file']['filename'];_0x53f9fc[_0x4b05('0x4b')][_0x4b05('0x2d')]=_0x53f9fc[_0x4b05('0x4e')][_0x4b05('0x50')];return db[_0x4b05('0x2a')][_0x4b05('0x4d')](_0x53f9fc[_0x4b05('0x4b')])['then'](respondWithResult(_0x1951fe,0xc9))['catch'](handleError(_0x1951fe,null));};exports[_0x4b05('0x51')]=function(_0x3713d6,_0xc86bae,_0x52adf7){return db[_0x4b05('0x2a')][_0x4b05('0x52')]({'where':{'id':_0x3713d6[_0x4b05('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xc86bae,null))[_0x4b05('0x25')](function(_0x184b61){if(_0x184b61){var _0x16a83f=_0x184b61[_0x4b05('0x53')]!==null;var _0x1fa34d=path['join'](config[_0x4b05('0x54')],'server/files/attachments/');if(_0x16a83f){_0x1fa34d=path['join'](_0x1fa34d,_0x4b05('0x55'));}var _0x45469a=path[_0x4b05('0x56')](_0x1fa34d,_0x184b61['basename']);return _0xc86bae[_0x4b05('0x51')](_0x45469a);}})[_0x4b05('0x45')](handleError(_0xc86bae,null));};
\ No newline at end of file
+var _0x28aa=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','Attachment','includeAll','findAll','rows','show','params','keys','include','options','find','catch','clone','get','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x28aa,0xa4));var _0xa28a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x28aa[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xa28a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa28a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa28a('0x2'));var Mustache=require(_0xa28a('0x3'));var util=require(_0xa28a('0x4'));var path=require(_0xa28a('0x5'));var sox=require(_0xa28a('0x6'));var csv=require('to-csv');var ejs=require(_0xa28a('0x7'));var fs=require('fs');var fs_extra=require(_0xa28a('0x8'));var _=require('lodash');var squel=require(_0xa28a('0x9'));var crypto=require(_0xa28a('0xa'));var jsforce=require(_0xa28a('0xb'));var deskjs=require(_0xa28a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa28a('0xd'));var Papa=require(_0xa28a('0xe'));var Redis=require(_0xa28a('0xf'));var authService=require(_0xa28a('0x10'));var qs=require(_0xa28a('0x11'));var as=require(_0xa28a('0x12'));var hardwareService=require(_0xa28a('0x13'));var logger=require(_0xa28a('0x14'))(_0xa28a('0x15'));var utils=require(_0xa28a('0x16'));var config=require(_0xa28a('0x17'));var licenseUtil=require(_0xa28a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e78d4,_0x26d5b6){_0x26d5b6=_0x26d5b6||0xcc;return function(_0x5cbe76){if(_0x5cbe76){return _0x3e78d4[_0xa28a('0x19')](_0x26d5b6);}return _0x3e78d4[_0xa28a('0x1a')](_0x26d5b6)[_0xa28a('0x1b')]();};}function respondWithResult(_0x5b8ad1,_0x664726){_0x664726=_0x664726||0xc8;return function(_0x2f400f){if(_0x2f400f){return _0x5b8ad1['status'](_0x664726)[_0xa28a('0x1c')](_0x2f400f);}};}function respondWithFilteredResult(_0x1215ab,_0x2c6c7a){return function(_0x45fc72){if(_0x45fc72){var _0x4d91cb=typeof _0x2c6c7a[_0xa28a('0x1d')]===_0xa28a('0x1e')&&typeof _0x2c6c7a['limit']===_0xa28a('0x1e');var _0xffa08a=_0x45fc72[_0xa28a('0x1f')];var _0x4975cc=_0x4d91cb?0x0:_0x2c6c7a['offset'];var _0x16ad19=_0x4d91cb?_0x45fc72[_0xa28a('0x1f')]:_0x2c6c7a[_0xa28a('0x1d')]+_0x2c6c7a[_0xa28a('0x20')];var _0x2d8158;if(_0x16ad19>=_0xffa08a){_0x16ad19=_0xffa08a;_0x2d8158=0xc8;}else{_0x2d8158=0xce;}_0x1215ab[_0xa28a('0x1a')](_0x2d8158);return _0x1215ab[_0xa28a('0x21')](_0xa28a('0x22'),_0x4975cc+'-'+_0x16ad19+'/'+_0xffa08a)[_0xa28a('0x1c')](_0x45fc72);}return null;};}function patchUpdates(_0x106e8a){return function(_0x422b94){try{jsonpatch[_0xa28a('0x23')](_0x422b94,_0x106e8a,!![]);}catch(_0x75b573){return BPromise[_0xa28a('0x24')](_0x75b573);}return _0x422b94['save']();};}function saveUpdates(_0x5df3b4,_0x40b49f){return function(_0x165bb6){if(_0x165bb6){return _0x165bb6[_0xa28a('0x25')](_0x5df3b4)[_0xa28a('0x26')](function(_0x5741a5){return _0x5741a5;});}return null;};}function removeEntity(_0x26ff71,_0x3b0746){return function(_0xa593aa){if(_0xa593aa){return _0xa593aa[_0xa28a('0x27')]()[_0xa28a('0x26')](function(){_0x26ff71[_0xa28a('0x1a')](0xcc)[_0xa28a('0x1b')]();});}};}function handleEntityNotFound(_0x561b4a,_0x5c977b){return function(_0x41c6aa){if(!_0x41c6aa){_0x561b4a['sendStatus'](0x194);}return _0x41c6aa;};}function handleError(_0xc3e1c3,_0x1a2229){_0x1a2229=_0x1a2229||0x1f4;return function(_0x235c53){logger[_0xa28a('0x28')](_0x235c53[_0xa28a('0x29')]);if(_0x235c53[_0xa28a('0x2a')]){delete _0x235c53[_0xa28a('0x2a')];}_0xc3e1c3[_0xa28a('0x1a')](_0x1a2229)[_0xa28a('0x2b')](_0x235c53);};}exports['index']=function(_0x15ac97,_0x2572cc){var _0x480096={},_0x2f0647={},_0xeeb9fa={'count':0x0,'rows':[]};var _0x563963=_['map'](db['Attachment'][_0xa28a('0x2c')],function(_0x52c651){return{'name':_0x52c651[_0xa28a('0x2d')],'type':_0x52c651[_0xa28a('0x2e')][_0xa28a('0x2f')]};});_0x2f0647[_0xa28a('0x30')]=_[_0xa28a('0x31')](_0x563963,_0xa28a('0x2a'));_0x2f0647['query']=_['keys'](_0x15ac97[_0xa28a('0x32')]);_0x2f0647[_0xa28a('0x33')]=_[_0xa28a('0x34')](_0x2f0647['model'],_0x2f0647[_0xa28a('0x32')]);_0x480096[_0xa28a('0x35')]=_[_0xa28a('0x34')](_0x2f0647[_0xa28a('0x30')],qs[_0xa28a('0x36')](_0x15ac97[_0xa28a('0x32')]['fields']));_0x480096['attributes']=_0x480096[_0xa28a('0x35')][_0xa28a('0x37')]?_0x480096[_0xa28a('0x35')]:_0x2f0647[_0xa28a('0x30')];if(!_0x15ac97[_0xa28a('0x32')][_0xa28a('0x38')]('nolimit')){_0x480096['limit']=qs[_0xa28a('0x20')](_0x15ac97[_0xa28a('0x32')][_0xa28a('0x20')]);_0x480096[_0xa28a('0x1d')]=qs[_0xa28a('0x1d')](_0x15ac97['query']['offset']);}_0x480096[_0xa28a('0x39')]=qs[_0xa28a('0x3a')](_0x15ac97[_0xa28a('0x32')][_0xa28a('0x3a')]);_0x480096[_0xa28a('0x3b')]=qs[_0xa28a('0x33')](_[_0xa28a('0x3c')](_0x15ac97[_0xa28a('0x32')],_0x2f0647[_0xa28a('0x33')]),_0x563963);if(_0x15ac97[_0xa28a('0x32')][_0xa28a('0x3d')]){_0x480096['where']=_[_0xa28a('0x3e')](_0x480096['where'],{'$or':_[_0xa28a('0x31')](_0x563963,function(_0x2b0b10){if(_0x2b0b10[_0xa28a('0x2e')]!=='VIRTUAL'){var _0x10ceaf={};_0x10ceaf[_0x2b0b10['name']]={'$like':'%'+_0x15ac97[_0xa28a('0x32')][_0xa28a('0x3d')]+'%'};return _0x10ceaf;}})});}_0x480096=_[_0xa28a('0x3e')]({},_0x480096,_0x15ac97['options']);var _0x5f49ec={'where':_0x480096['where']};return db[_0xa28a('0x3f')]['count'](_0x5f49ec)[_0xa28a('0x26')](function(_0x5165cb){_0xeeb9fa['count']=_0x5165cb;if(_0x15ac97[_0xa28a('0x32')][_0xa28a('0x40')]){_0x480096['include']=[{'all':!![]}];}return db[_0xa28a('0x3f')][_0xa28a('0x41')](_0x480096);})[_0xa28a('0x26')](function(_0x31f476){_0xeeb9fa[_0xa28a('0x42')]=_0x31f476;return _0xeeb9fa;})[_0xa28a('0x26')](respondWithFilteredResult(_0x2572cc,_0x480096))['catch'](handleError(_0x2572cc,null));};exports[_0xa28a('0x43')]=function(_0x2b1db4,_0x386d99){var _0x28ff42={'raw':!![],'where':{'id':_0x2b1db4[_0xa28a('0x44')]['id']}},_0x280757={};_0x280757[_0xa28a('0x30')]=_[_0xa28a('0x45')](db[_0xa28a('0x3f')][_0xa28a('0x2c')]);_0x280757[_0xa28a('0x32')]=_[_0xa28a('0x45')](_0x2b1db4[_0xa28a('0x32')]);_0x280757[_0xa28a('0x33')]=_[_0xa28a('0x34')](_0x280757[_0xa28a('0x30')],_0x280757[_0xa28a('0x32')]);_0x28ff42[_0xa28a('0x35')]=_['intersection'](_0x280757['model'],qs['fields'](_0x2b1db4[_0xa28a('0x32')][_0xa28a('0x36')]));_0x28ff42['attributes']=_0x28ff42[_0xa28a('0x35')][_0xa28a('0x37')]?_0x28ff42['attributes']:_0x280757['model'];if(_0x2b1db4['query'][_0xa28a('0x40')]){_0x28ff42[_0xa28a('0x46')]=[{'all':!![]}];}_0x28ff42=_['merge']({},_0x28ff42,_0x2b1db4[_0xa28a('0x47')]);return db[_0xa28a('0x3f')][_0xa28a('0x48')](_0x28ff42)[_0xa28a('0x26')](handleEntityNotFound(_0x386d99,null))[_0xa28a('0x26')](respondWithResult(_0x386d99,null))[_0xa28a('0x49')](handleError(_0x386d99,null));};exports[_0xa28a('0x4a')]=function(_0x173145,_0xac40bb){var _0x352f83={'where':{'id':_0x173145['params']['id']}},_0x50d242={};_0x50d242[_0xa28a('0x30')]=_[_0xa28a('0x45')](db['Attachment'][_0xa28a('0x2c')]);_0x352f83['attributes']=_[_0xa28a('0x34')](_0x50d242['model'],qs[_0xa28a('0x36')](_0x173145['query'][_0xa28a('0x36')]));_0x352f83[_0xa28a('0x35')]=_0x352f83[_0xa28a('0x35')][_0xa28a('0x37')]?_0x352f83[_0xa28a('0x35')]:_0x50d242[_0xa28a('0x30')];if(_0x173145[_0xa28a('0x32')][_0xa28a('0x40')]){_0x352f83[_0xa28a('0x46')]=[{'all':!![]}];}_0x352f83=_[_0xa28a('0x3e')]({},_0x352f83,_0x173145[_0xa28a('0x47')]);return db[_0xa28a('0x3f')][_0xa28a('0x48')](_0x352f83)['then'](handleEntityNotFound(_0xac40bb,null))[_0xa28a('0x26')](function(_0x43b6ee){if(_0x43b6ee){var _0x3331c7=_0x43b6ee[_0xa28a('0x4b')]({'plain':!![]});_0x3331c7=qs[_0xa28a('0x4c')](_0x3331c7,['id',_0xa28a('0x4d'),_0xa28a('0x4e')]);_0x173145[_0xa28a('0x4f')]=_[_0xa28a('0x4c')](_0x173145[_0xa28a('0x4f')],['id',_0xa28a('0x4d'),'updatedAt']);return db[_0xa28a('0x3f')][_0xa28a('0x50')](_[_0xa28a('0x3e')](_0x3331c7,_0x173145[_0xa28a('0x4f')]),{'include':_0x173145['query'][_0xa28a('0x40')]?[{'all':!![]}]:undefined});}})[_0xa28a('0x26')](respondWithResult(_0xac40bb,0xc9))[_0xa28a('0x49')](handleError(_0xac40bb,null));};exports[_0xa28a('0x25')]=function(_0xfb6c71,_0xcc22ae){if(_0xfb6c71[_0xa28a('0x4f')]['id']){delete _0xfb6c71[_0xa28a('0x4f')]['id'];}return db[_0xa28a('0x3f')]['find']({'where':{'id':_0xfb6c71['params']['id']}})['then'](handleEntityNotFound(_0xcc22ae,null))[_0xa28a('0x26')](saveUpdates(_0xfb6c71[_0xa28a('0x4f')],null))['then'](respondWithResult(_0xcc22ae,null))[_0xa28a('0x49')](handleError(_0xcc22ae,null));};exports[_0xa28a('0x27')]=function(_0x52c6ba,_0x1c9c79){return db[_0xa28a('0x3f')][_0xa28a('0x48')]({'where':{'id':_0x52c6ba[_0xa28a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c9c79,null))[_0xa28a('0x26')](removeEntity(_0x1c9c79,null))[_0xa28a('0x49')](handleError(_0x1c9c79,null));};exports[_0xa28a('0x50')]=function(_0x1975ba,_0x505bca,_0x2681a3){_0x1975ba[_0xa28a('0x4f')][_0xa28a('0x2a')]=_0x1975ba[_0xa28a('0x51')]['originalname'];_0x1975ba['body'][_0xa28a('0x52')]=_0x1975ba[_0xa28a('0x51')][_0xa28a('0x53')];_0x1975ba[_0xa28a('0x4f')][_0xa28a('0x2e')]=_0x1975ba['file'][_0xa28a('0x54')];return db[_0xa28a('0x3f')]['create'](_0x1975ba[_0xa28a('0x4f')])[_0xa28a('0x26')](respondWithResult(_0x505bca,0xc9))['catch'](handleError(_0x505bca,null));};exports[_0xa28a('0x55')]=function(_0x37806b,_0x5f05bb,_0x3f5cb7){return db[_0xa28a('0x3f')][_0xa28a('0x56')]({'where':{'id':_0x37806b[_0xa28a('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5f05bb,null))['then'](function(_0x35ebe8){if(_0x35ebe8){var _0x4c68d4=_0x35ebe8[_0xa28a('0x57')]!==null;var _0x3b9e1e=path[_0xa28a('0x58')](config[_0xa28a('0x59')],'server/files/attachments/');if(_0x4c68d4){_0x3b9e1e=path[_0xa28a('0x58')](_0x3b9e1e,'offline-chat/');}var _0x2ff28a=path[_0xa28a('0x58')](_0x3b9e1e,_0x35ebe8[_0xa28a('0x52')]);return _0x5f05bb[_0xa28a('0x55')](_0x2ff28a);}})[_0xa28a('0x49')](handleError(_0x5f05bb,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 03e6e4e..3c13258 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 _0x15d8=['Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','../../config/environment','./attachment.attributes','exports','define'];(function(_0x720b74,_0x4ecf2b){var _0x2e7715=function(_0x961b89){while(--_0x961b89){_0x720b74['push'](_0x720b74['shift']());}};_0x2e7715(++_0x4ecf2b);}(_0x15d8,0x1e6));var _0x815d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x815d('0x0'));var util=require('util');var logger=require(_0x815d('0x1'))(_0x815d('0x2'));var moment=require(_0x815d('0x3'));var BPromise=require(_0x815d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x815d('0x5'));var attributes=require(_0x815d('0x6'));module[_0x815d('0x7')]=function(_0x4b6991,_0x48da01){return _0x4b6991[_0x815d('0x8')](_0x815d('0x9'),attributes,{'tableName':_0x815d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc62c=['request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','moment','bluebird'];(function(_0x921f7a,_0x361b59){var _0x2ae9a2=function(_0x3f370c){while(--_0x3f370c){_0x921f7a['push'](_0x921f7a['shift']());}};_0x2ae9a2(++_0x361b59);}(_0xc62c,0xc8));var _0xcc62=function(_0x34aec2,_0xb610fd){_0x34aec2=_0x34aec2-0x0;var _0x2d36f2=_0xc62c[_0x34aec2];return _0x2d36f2;};'use strict';var _=require(_0xcc62('0x0'));var util=require('util');var logger=require(_0xcc62('0x1'))('api');var moment=require(_0xcc62('0x2'));var BPromise=require(_0xcc62('0x3'));var rp=require(_0xcc62('0x4'));var fs=require('fs');var path=require(_0xcc62('0x5'));var rimraf=require(_0xcc62('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc62('0x7'));module[_0xcc62('0x8')]=function(_0x496fb2,_0x452145){return _0x496fb2[_0xcc62('0x9')](_0xcc62('0xa'),attributes,{'tableName':_0xcc62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index cbd4fee..db88ad1 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 _0xfa2b=['Attachment','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','CreateAttachment'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x109a21,_0x1f1c57){_0x109a21=_0x109a21-0x0;var _0x16468e=_0xfa2b[_0x109a21];return _0x16468e;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Attachment,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Attachment,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});}exports[_0xbfa2('0x19')]=function(_0x12627a){var _0x28fe6f=this;return new Promise(function(_0x4088c5,_0x37aed6){return db[_0xbfa2('0x1a')][_0xbfa2('0x1b')](_0x12627a['body'],{'raw':_0x12627a[_0xbfa2('0x1c')]?_0x12627a[_0xbfa2('0x1c')][_0xbfa2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2ac6c3){logger[_0xbfa2('0x10')]('CreateAttachment',_0x12627a);logger[_0xbfa2('0x13')]('CreateAttachment',_0x12627a,JSON['stringify'](_0x2ac6c3));_0x4088c5(_0x2ac6c3);})[_0xbfa2('0x1e')](function(_0xdb059b){logger[_0xbfa2('0x16')](_0xbfa2('0x19'),_0xdb059b['message'],_0x12627a);_0x37aed6(_0x28fe6f['error'](0x1f4,_0xdb059b[_0xbfa2('0x17')]));});});};
\ No newline at end of file
+var _0x8388=['rpc','jayson/promise','client','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x8388,0x18d));var _0x8838=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x8388[_0x5f3905];return _0x2923b1;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca2d0f,_0x2d9615,_0x27707c){return new BPromise(function(_0x56596f,_0x4645f4){return client['request'](_0xca2d0f,_0x27707c)['then'](function(_0x8555b2){logger['info']('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));logger[_0x8838('0xc')](_0x8838('0xd'),_0x2d9615,_0x8838('0xb'),JSON['stringify'](_0x8555b2));if(_0x8555b2[_0x8838('0xe')]){if(_0x8555b2[_0x8838('0xe')][_0x8838('0xf')]===0x1f4){logger[_0x8838('0xe')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8555b2[_0x8838('0xe')]['message']);return _0x4645f4(_0x8555b2['error'][_0x8838('0x10')]);}logger[_0x8838('0xe')](_0x8838('0x11'),_0x2d9615,_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);return _0x56596f(_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);}else{logger[_0x8838('0x12')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));_0x56596f(_0x8555b2[_0x8838('0x13')]['message']);}})[_0x8838('0x14')](function(_0xab3fb8){logger[_0x8838('0xe')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0xab3fb8);_0x4645f4(_0xab3fb8);});});}exports[_0x8838('0x15')]=function(_0x522d44){var _0xc4129=this;return new Promise(function(_0x204120,_0xe9e4f4){return db['Attachment'][_0x8838('0x16')](_0x522d44[_0x8838('0x17')],{'raw':_0x522d44['options']?_0x522d44[_0x8838('0x18')][_0x8838('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x9de0f6){logger[_0x8838('0x12')]('CreateAttachment',_0x522d44);logger['debug'](_0x8838('0x15'),_0x522d44,JSON[_0x8838('0x1a')](_0x9de0f6));_0x204120(_0x9de0f6);})[_0x8838('0x14')](function(_0xb74e1b){logger[_0x8838('0xe')](_0x8838('0x15'),_0xb74e1b[_0x8838('0x10')],_0x522d44);_0xe9e4f4(_0xc4129[_0x8838('0xe')](0x1f4,_0xb74e1b[_0x8838('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index b52c780..af792d7 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x5526c4,_0x2f9faf){_0x5526c4=_0x5526c4-0x0;var _0x5b6678=_0xdb28[_0x5526c4];return _0x5b6678;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x10c95f,_0x5affe0){var _0x1ae957=function(_0x12e2a0){while(--_0x12e2a0){_0x10c95f['push'](_0x10c95f['shift']());}};_0x1ae957(++_0x5affe0);}(_0x2032,0xd9));var _0x2203=function(_0x13b4ea,_0x17b356){_0x13b4ea=_0x13b4ea-0x0;var _0x14f2bf=_0x2032[_0x13b4ea];return _0x14f2bf;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('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 53feb84..deb39de 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 _0x1170=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','Strategy','moment','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','user','agent','domain','blocked','minutes','getLicense','catch','status','send','message','login','authenticate','ad-login'];(function(_0x65259c,_0x3b4cf9){var _0x2f9c3a=function(_0x49d13e){while(--_0x49d13e){_0x65259c['push'](_0x65259c['shift']());}};_0x2f9c3a(++_0x3b4cf9);}(_0x1170,0xbd));var _0x0117=function(_0x17ae3c,_0x4e15d5){_0x17ae3c=_0x17ae3c-0x0;var _0x56fab6=_0x1170[_0x17ae3c];return _0x56fab6;};'use strict';var passport=require(_0x0117('0x0'));var LocalStrategy=require('passport-local')[_0x0117('0x1')];var moment=require(_0x0117('0x2'));var ActiveDirectory=require(_0x0117('0x3'));var BPromise=require('bluebird');var util=require(_0x0117('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x0117('0x5'));var utils=require(_0x0117('0x6'));var config=require('../../config/environment');var logger=require(_0x0117('0x7'))(_0x0117('0x8'));function isActiveDirectoryConfigured(_0xdcfbc1){var _0x1ae28c=![];if(typeof _0xdcfbc1[_0x0117('0x9')]!=='undefined'){_0x1ae28c=_0xdcfbc1[_0x0117('0x9')]['baseDN']&&_0xdcfbc1['activedirectory']['url']&&_0xdcfbc1[_0x0117('0x9')]['domain'];}return _0x1ae28c;}function adAuthenticate(_0x31e011,_0x4b7c63,_0x1d0fde){return new BPromise(function(_0x16bfa4,_0x105876){try{var _0x1cedcd=new ActiveDirectory(_0x31e011);_0x1cedcd['authenticate'](_0x4b7c63,_0x1d0fde,function(_0x596f85,_0x564866){if(_0x596f85){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x4b7c63,util['inspect'](_0x596f85,{'showHidden':![],'depth':null}));_0x105876(_0x0117('0xa'));}else if(!_0x564866){logger[_0x0117('0xb')](_0x0117('0xc'),_0x4b7c63);_0x105876('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x16bfa4(_0x564866);}});}catch(_0x4fa1c5){_0x105876(_0x4fa1c5);}});}function ActiveDirectoryAuthenticate(_0x49363f,_0x4bfc0c,_0xa1ac5b,_0x3018e1){var _0x4cdaa2,_0x569916;if(!isActiveDirectoryConfigured(config)){logger[_0x0117('0xb')](_0x0117('0xd'),_0x4bfc0c);return _0x3018e1(null,![],{'message':_0x0117('0xa')});}return db[_0x0117('0xe')][_0x0117('0xf')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0117('0x10')],'raw':!![]})[_0x0117('0x11')](function(_0x4f1c15){_0x4cdaa2=_0x4f1c15;if(!_0x4cdaa2[_0x0117('0x12')]){logger['error'](_0x0117('0x13'),_0x4bfc0c);throw new Error(_0x0117('0xa'));}return _0x49363f['findOne']({'attributes':['id',_0x0117('0x14'),_0x0117('0x15'),_0x0117('0x16'),_0x0117('0x17'),_0x0117('0x18'),'blocked',_0x0117('0x19'),_0x0117('0x1a')],'where':{'name':_0x4bfc0c,'role':{'$or':[_0x0117('0x1b'),_0x0117('0x1c'),_0x0117('0x1d')]},'adSsoEnabled':!![]}});})[_0x0117('0x11')](function(_0x4ce874){if(!_0x4ce874||_0x4ce874&&_0x4ce874[_0x0117('0x14')]!==_0x4bfc0c){throw new Error(_0x0117('0xa'));}_0x569916=_0x4ce874;var _0x46d676=_0x569916[_0x0117('0x14')]+'@'+config['activedirectory'][_0x0117('0x1e')];return adAuthenticate(config[_0x0117('0x9')],_0x46d676,_0xa1ac5b);})['then'](function(_0x46ff70){if(_0x569916[_0x0117('0x18')]){throw new Error(_0x0117('0xa'));}if(_0x4cdaa2[_0x0117('0x10')]>0x0){if(_0x569916[_0x0117('0x1f')]){if(moment(_0x569916[_0x0117('0x19')])['add'](_0x4cdaa2[_0x0117('0x10')],_0x0117('0x20'))>moment()){throw new Error(_0x0117('0xa'));}return utils['clearBlockUser'](_0x569916,0x0,![],null)[_0x0117('0x11')](function(){return utils['getLicense'](_0x569916);})['then'](function(){return _0x3018e1(null,_0x569916);});}else{return utils['getLicense'](_0x569916)[_0x0117('0x11')](function(){return _0x3018e1(null,_0x569916);});}}else{return utils[_0x0117('0x21')](_0x569916)[_0x0117('0x11')](function(){return _0x3018e1(null,_0x569916);});}})[_0x0117('0x22')](function(_0x4835e9){return _0x3018e1(null,![],_0x4835e9);});}function handleError(_0x587b59,_0x33201b,_0x1c74fd){return _0x587b59[_0x0117('0x23')](_0x33201b||0x1f4)[_0x0117('0x24')]({'message':_0x1c74fd?_0x1c74fd[_0x0117('0x25')]||_0x1c74fd:''});}exports[_0x0117('0x26')]=function(_0x554ede,_0x2491a6,_0x11db01){passport[_0x0117('0x27')](_0x0117('0x28'),function(_0x16c3ae,_0x4a55c5,_0x38ab8b){var _0x25d9b3=_0x16c3ae||_0x38ab8b;if(_0x25d9b3){return handleError(_0x2491a6,0x191,_0x25d9b3);}if(!_0x4a55c5){return handleError(_0x2491a6,0x194,{'message':_0x0117('0x29')});}else{var _0x546b98={'payload':{'id':_0x4a55c5['id'],'role':_0x4a55c5[_0x0117('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0x0117('0x2a')](_0x546b98)[_0x0117('0x11')](function(_0x54d0c0){_0x2491a6[_0x0117('0x2b')]({'id':_0x4a55c5['id'],'token':_0x54d0c0,'statusCall':'','isAlreadyLogged':_0x4a55c5[_0x0117('0x1a')]});});}})(_0x554ede,_0x2491a6,_0x11db01);};passport[_0x0117('0x2c')](_0x0117('0x28'),new LocalStrategy({'usernameField':_0x0117('0x14'),'passwordField':_0x0117('0x15')},function(_0x1f084a,_0x4a3326,_0x5218e0){return ActiveDirectoryAuthenticate(db[_0x0117('0x2d')],_0x1f084a,_0x4a3326,_0x5218e0);}));
\ No newline at end of file
+var _0x04b7=['../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','baseDN','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','online','admin','user','agent','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','name','activedirectory2','bluebird','util'];(function(_0x444962,_0x931e2d){var _0x429b11=function(_0x30eaf1){while(--_0x30eaf1){_0x444962['push'](_0x444962['shift']());}};_0x429b11(++_0x931e2d);}(_0x04b7,0x105));var _0x704b=function(_0x263b1f,_0x3f2376){_0x263b1f=_0x263b1f-0x0;var _0x4aa612=_0x04b7[_0x263b1f];return _0x4aa612;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x704b('0x0'));var BPromise=require(_0x704b('0x1'));var util=require(_0x704b('0x2'));var db=require(_0x704b('0x3'))['db'];var authService=require(_0x704b('0x4'));var utils=require(_0x704b('0x5'));var config=require('../../config/environment');var logger=require(_0x704b('0x6'))('api');function isActiveDirectoryConfigured(_0x1039d4){var _0x1232d5=![];if(typeof _0x1039d4[_0x704b('0x7')]!=='undefined'){_0x1232d5=_0x1039d4[_0x704b('0x7')][_0x704b('0x8')]&&_0x1039d4[_0x704b('0x7')][_0x704b('0x9')]&&_0x1039d4[_0x704b('0x7')][_0x704b('0xa')];}return _0x1232d5;}function adAuthenticate(_0x4a6740,_0x34f123,_0x49e40e){return new BPromise(function(_0x572e56,_0x149ce7){try{var _0x5d8811=new ActiveDirectory(_0x4a6740);_0x5d8811[_0x704b('0xb')](_0x34f123,_0x49e40e,function(_0x2757ef,_0x549a0b){if(_0x2757ef){logger[_0x704b('0xc')]('Error\x20authenticate\x20%s:\x20%s',_0x34f123,util[_0x704b('0xd')](_0x2757ef,{'showHidden':![],'depth':null}));_0x149ce7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x549a0b){logger['error'](_0x704b('0xe'),_0x34f123);_0x149ce7(_0x704b('0xf'));}else{_0x572e56(_0x549a0b);}});}catch(_0x575e09){_0x149ce7(_0x575e09);}});}function ActiveDirectoryAuthenticate(_0x2b1ede,_0x1e495f,_0x314ffb,_0x42d812){var _0x14ebb9,_0x5b68f9;if(!isActiveDirectoryConfigured(config)){logger[_0x704b('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x1e495f);return _0x42d812(null,![],{'message':_0x704b('0xf')});}return db[_0x704b('0x10')][_0x704b('0x11')]({'where':{'id':0x1},'attributes':[_0x704b('0x12'),_0x704b('0x13')],'raw':!![]})[_0x704b('0x14')](function(_0x5a1516){_0x14ebb9=_0x5a1516;if(!_0x14ebb9[_0x704b('0x12')]){logger[_0x704b('0xc')](_0x704b('0x15'),_0x1e495f);throw new Error(_0x704b('0xf'));}return _0x2b1ede[_0x704b('0x11')]({'attributes':['id','name',_0x704b('0x16'),_0x704b('0x17'),_0x704b('0x18'),_0x704b('0x19'),'blocked','blockedAt',_0x704b('0x1a')],'where':{'name':_0x1e495f,'role':{'$or':[_0x704b('0x1b'),_0x704b('0x1c'),_0x704b('0x1d')]},'adSsoEnabled':!![]}});})['then'](function(_0x12155c){if(!_0x12155c||_0x12155c&&_0x12155c['name']!==_0x1e495f){throw new Error(_0x704b('0xf'));}_0x5b68f9=_0x12155c;var _0x112ad1=_0x5b68f9['name']+'@'+config[_0x704b('0x7')][_0x704b('0xa')];return adAuthenticate(config[_0x704b('0x7')],_0x112ad1,_0x314ffb);})[_0x704b('0x14')](function(_0x47173b){if(_0x5b68f9[_0x704b('0x19')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x14ebb9[_0x704b('0x13')]>0x0){if(_0x5b68f9[_0x704b('0x1e')]){if(moment(_0x5b68f9[_0x704b('0x1f')])['add'](_0x14ebb9['blockDuration'],_0x704b('0x20'))>moment()){throw new Error(_0x704b('0xf'));}return utils[_0x704b('0x21')](_0x5b68f9,0x0,![],null)[_0x704b('0x14')](function(){return utils[_0x704b('0x22')](_0x5b68f9);})['then'](function(){return _0x42d812(null,_0x5b68f9);});}else{return utils[_0x704b('0x22')](_0x5b68f9)[_0x704b('0x14')](function(){return _0x42d812(null,_0x5b68f9);});}}else{return utils[_0x704b('0x22')](_0x5b68f9)[_0x704b('0x14')](function(){return _0x42d812(null,_0x5b68f9);});}})[_0x704b('0x23')](function(_0x5dcede){return _0x42d812(null,![],_0x5dcede);});}function handleError(_0x42f3c2,_0xf9e754,_0x387d27){return _0x42f3c2[_0x704b('0x24')](_0xf9e754||0x1f4)[_0x704b('0x25')]({'message':_0x387d27?_0x387d27['message']||_0x387d27:''});}exports['login']=function(_0x5af0ec,_0x34fb69,_0x40b01e){passport[_0x704b('0xb')](_0x704b('0x26'),function(_0x4cf62a,_0x3fbd33,_0x382414){var _0x46bcb3=_0x4cf62a||_0x382414;if(_0x46bcb3){return handleError(_0x34fb69,0x191,_0x46bcb3);}if(!_0x3fbd33){return handleError(_0x34fb69,0x194,{'message':_0x704b('0x27')});}else{var _0x5a1176={'payload':{'id':_0x3fbd33['id'],'role':_0x3fbd33[_0x704b('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0x704b('0x28')](_0x5a1176)[_0x704b('0x14')](function(_0x727b9d){_0x34fb69[_0x704b('0x29')]({'id':_0x3fbd33['id'],'token':_0x727b9d,'statusCall':'','isAlreadyLogged':_0x3fbd33[_0x704b('0x1a')]});});}})(_0x5af0ec,_0x34fb69,_0x40b01e);};passport[_0x704b('0x2a')](_0x704b('0x26'),new LocalStrategy({'usernameField':_0x704b('0x2b'),'passwordField':_0x704b('0x16')},function(_0x561b56,_0x4c4ba0,_0x248b06){return ActiveDirectoryAuthenticate(db['User'],_0x561b56,_0x4c4ba0,_0x248b06);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index e9b9343..372a23e 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 _0x5621=['./authActiveDirectory.controller','exports','express','Router'];(function(_0x49ab9e,_0x2b70dd){var _0x29b735=function(_0x2d41d3){while(--_0x2d41d3){_0x49ab9e['push'](_0x49ab9e['shift']());}};_0x29b735(++_0x2b70dd);}(_0x5621,0xbe));var _0x1562=function(_0x15279e,_0x2051f1){_0x15279e=_0x15279e-0x0;var _0x5c3571=_0x5621[_0x15279e];return _0x5c3571;};'use strict';var express=require(_0x1562('0x0'));var router=express[_0x1562('0x1')]();var controller=require(_0x1562('0x2'));router['post']('/',controller['login']);module[_0x1562('0x3')]=router;
\ No newline at end of file
+var _0xe68f=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0xfb1077,_0x4e81ff){var _0xe73c1=function(_0x112675){while(--_0x112675){_0xfb1077['push'](_0xfb1077['shift']());}};_0xe73c1(++_0x4e81ff);}(_0xe68f,0x94));var _0xfe68=function(_0x4db48e,_0x241ab6){_0x4db48e=_0x4db48e-0x0;var _0x37167e=_0xe68f[_0x4db48e];return _0x37167e;};'use strict';var express=require(_0xfe68('0x0'));var router=express[_0xfe68('0x1')]();var controller=require(_0xfe68('0x2'));router[_0xfe68('0x3')]('/',controller[_0xfe68('0x4')]);module[_0xfe68('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 5c2263b..d2066f8 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7a54,0x106));var _0x47a5=function(_0x591e1b,_0x19a4f0){_0x591e1b=_0x591e1b-0x0;var _0x81f866=_0x7a54[_0x591e1b];return _0x81f866;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _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(_0x178f3e,_0x567056){var _0x2c73ab=function(_0x240923){while(--_0x240923){_0x178f3e['push'](_0x178f3e['shift']());}};_0x2c73ab(++_0x567056);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 25251c8..bb84365 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 _0x69e8=['get','/callback','login','setTokenCookie','exports','express','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x50afb1,_0x4e137e){var _0x453119=function(_0x123b7d){while(--_0x123b7d){_0x50afb1['push'](_0x50afb1['shift']());}};_0x453119(++_0x4e137e);}(_0x69e8,0x137));var _0x869e=function(_0x313b59,_0x271d98){_0x313b59=_0x313b59-0x0;var _0x760cd1=_0x69e8[_0x313b59];return _0x760cd1;};'use strict';var express=require(_0x869e('0x0'));var passport=require('passport');var router=express[_0x869e('0x1')]();var controller=require(_0x869e('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x869e('0x3'));router['get']('/',controller['login']);router[_0x869e('0x4')](_0x869e('0x5'),controller['callback'],authService['isMiddleware'],userController[_0x869e('0x6')],authService[_0x869e('0x7')]);module[_0x869e('0x8')]=router;
\ No newline at end of file
+var _0x4a3f=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router'];(function(_0x492813,_0x4fad44){var _0x1c30ab=function(_0x454c23){while(--_0x454c23){_0x492813['push'](_0x492813['shift']());}};_0x1c30ab(++_0x4fad44);}(_0x4a3f,0x101));var _0xf4a3=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x4a3f[_0x571a17];return _0x3ef337;};'use strict';var express=require(_0xf4a3('0x0'));var passport=require(_0xf4a3('0x1'));var router=express[_0xf4a3('0x2')]();var controller=require(_0xf4a3('0x3'));var userController=require(_0xf4a3('0x4'));var authService=require(_0xf4a3('0x5'));router[_0xf4a3('0x6')]('/',controller[_0xf4a3('0x7')]);router['get'](_0xf4a3('0x8'),controller[_0xf4a3('0x9')],authService[_0xf4a3('0xa')],userController[_0xf4a3('0x7')],authService[_0xf4a3('0xb')]);module[_0xf4a3('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index b897db8..44f01f5 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 _0x90d2=['Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','blockDuration','then','findOne','name','password','role','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','find','MailServerOut','Smtp','CloudProvider'];(function(_0x17b45f,_0x2353cc){var _0x31a460=function(_0x27084f){while(--_0x27084f){_0x17b45f['push'](_0x17b45f['shift']());}};_0x31a460(++_0x2353cc);}(_0x90d2,0x86));var _0x290d=function(_0x558797,_0x387f41){_0x558797=_0x558797-0x0;var _0x29ac55=_0x90d2[_0x558797];return _0x29ac55;};'use strict';var util=require(_0x290d('0x0'));var passport=require(_0x290d('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x290d('0x2'));var _=require('lodash');var rs=require(_0x290d('0x3'));var moment=require('moment');var db=require(_0x290d('0x4'))['db'];var authService=require(_0x290d('0x5'));var utils=require(_0x290d('0x6'));var client=jayson[_0x290d('0x7')][_0x290d('0x8')]({'port':0x232b});function localAuthenticate(_0x456c97,_0x416f5b,_0x4eeddf,_0x3aeb85){var _0x286134,_0x2fe9f7;return db[_0x290d('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x290d('0xa')],'raw':!![]})[_0x290d('0xb')](function(_0x21e6e8){_0x286134=_0x21e6e8;return _0x456c97[_0x290d('0xc')]({'attributes':['id',_0x290d('0xd'),_0x290d('0xe'),'salt',_0x290d('0xf'),'disabled',_0x290d('0x10'),_0x290d('0x11'),_0x290d('0x12')],'where':{'name':_0x416f5b,'role':{'$or':[_0x290d('0x13'),'user',_0x290d('0x14')]}}});})[_0x290d('0xb')](function(_0x19b2b3){if(!_0x19b2b3||_0x19b2b3&&_0x19b2b3[_0x290d('0xd')]!==_0x416f5b){throw new Error(_0x290d('0x15'));}else{_0x2fe9f7=_0x19b2b3;return _0x2fe9f7;}})[_0x290d('0xb')](function(){_0x2fe9f7[_0x290d('0x16')](_0x4eeddf,function(_0x39a335,_0x47a028){var _0x3b5ce9=_0x2fe9f7[_0x290d('0x12')]+0x1;if(_0x39a335){return _0x3aeb85(_0x39a335);}else if(!_0x47a028){if(_0x2fe9f7[_0x290d('0x17')]){return _0x3aeb85(null,![],{'message':_0x290d('0x15')});}else if(_0x286134['allowedLoginAttempts']>0x0){if(_0x2fe9f7['blocked']){if(_0x286134[_0x290d('0xa')]>0x0){if(moment(_0x2fe9f7['blockedAt'])[_0x290d('0x18')](_0x286134[_0x290d('0xa')],_0x290d('0x19'))>moment()){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x290d('0x1a')](_0x2fe9f7,_0x3b5ce9,![],null)[_0x290d('0xb')](function(){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3b5ce9>=_0x286134['allowedLoginAttempts']){return utils[_0x290d('0x1a')](_0x2fe9f7,0x0,!![],moment())[_0x290d('0xb')](function(){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x290d('0x1a')](_0x2fe9f7,_0x3b5ce9,![],null)['then'](function(){return _0x3aeb85(null,![],{'message':_0x290d('0x15')});});}}}else{return _0x3aeb85(null,![],{'message':_0x290d('0x15')});}}else{if(_0x2fe9f7[_0x290d('0x17')]){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x286134[_0x290d('0x1b')]>0x0){if(_0x2fe9f7[_0x290d('0x10')]){if(_0x286134[_0x290d('0xa')]>0x0){if(moment(_0x2fe9f7[_0x290d('0x11')])[_0x290d('0x18')](_0x286134[_0x290d('0xa')],'minutes')>moment()){return _0x3aeb85(null,![],{'message':_0x290d('0x15')});}else{return utils[_0x290d('0x1a')](_0x2fe9f7,0x0,![],null)[_0x290d('0xb')](function(){return utils[_0x290d('0x1c')](_0x2fe9f7);})[_0x290d('0xb')](function(){return _0x3aeb85(null,_0x2fe9f7);});}}else{return _0x3aeb85(null,![],{'message':_0x290d('0x15')});}}else{return utils[_0x290d('0x1a')](_0x2fe9f7,0x0,![],null)[_0x290d('0xb')](function(){return utils['getLicense'](_0x2fe9f7);})[_0x290d('0xb')](function(){return _0x3aeb85(null,_0x2fe9f7);})[_0x290d('0x1d')](function(_0x3611fe){return _0x3aeb85(null,![],_0x3611fe);});}}else{if(_0x2fe9f7['blocked']){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x290d('0x1c')](_0x2fe9f7)['then'](function(){return _0x3aeb85(null,_0x2fe9f7);});}}}});})[_0x290d('0x1d')](function(_0x5e2066){return _0x3aeb85(null,![],_0x5e2066);});}function sendServiceMail(_0x3ff913){return db['MailAccount'][_0x290d('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x290d('0xd'),'email'],'include':[{'model':db[_0x290d('0x1f')],'as':_0x290d('0x20'),'include':[{'model':db[_0x290d('0x21')],'as':_0x290d('0x21')}]}]})[_0x290d('0xb')](function(_0x4a3a27){if(!_0x4a3a27){throw new Error(_0x290d('0x22'));}var _0x41b0a0=_0x4a3a27[_0x290d('0x23')]();var _0x1c5469={'account':_0x41b0a0,'message':_[_0x290d('0x24')]({'from':util[_0x290d('0x25')](_0x290d('0x26'),_0x4a3a27['name'],_0x4a3a27[_0x290d('0x27')]||_0x4a3a27['Smtp'][_0x290d('0x28')])},_0x3ff913)};return client[_0x290d('0x29')]('SendMail',_0x1c5469);})[_0x290d('0xb')](function(_0xe75085){if(_0xe75085[_0x290d('0x2a')]){throw new Error(util[_0x290d('0x25')](_0x290d('0x2b'),_0xe75085[_0x290d('0x2a')]['message']||JSON[_0x290d('0x2c')](_0xe75085['error'])));}return!![];});}function handleError(_0x2679cc,_0x1cbaff,_0x358bcd){return _0x2679cc['status'](_0x1cbaff||0x1f4)[_0x290d('0x2d')]({'message':_0x358bcd?_0x358bcd[_0x290d('0x2e')]||_0x358bcd:''});}exports[_0x290d('0x2f')]=function(_0x46521b,_0x3ce65e,_0x189c2c){passport['authenticate'](_0x290d('0x30'),function(_0x14173a,_0xb55f10,_0x3a3f1d){var _0x27db29=_0x14173a||_0x3a3f1d;if(_0x27db29){return handleError(_0x3ce65e,0x191,_0x27db29);}if(!_0xb55f10){return handleError(_0x3ce65e,0x194,{'message':_0x290d('0x31')});}else{var _0x5fe2b9={'payload':{'id':_0xb55f10['id'],'role':_0xb55f10[_0x290d('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x290d('0x32')](_0x5fe2b9)[_0x290d('0xb')](function(_0x562b15){_0x3ce65e[_0x290d('0x33')]({'id':_0xb55f10['id'],'token':_0x562b15,'statusCall':'','isAlreadyLogged':_0xb55f10[_0x290d('0x34')]});});}})(_0x46521b,_0x3ce65e,_0x189c2c);};exports[_0x290d('0x35')]=function(_0x30803a,_0x32f058){if(!_0x30803a['body'][_0x290d('0x27')]){return handleError(_0x32f058,0x1f4,{'message':_0x290d('0x36')});}var _0x1644f9=rs[_0x290d('0x37')]();_0x30803a[_0x290d('0x38')][_0x290d('0x27')]=_0x30803a[_0x290d('0x38')][_0x290d('0x27')]['trim']()[_0x290d('0x39')]();var _0x1db4a6;return db[_0x290d('0x9')][_0x290d('0xc')]({'where':{'id':0x1},'attributes':[_0x290d('0x1b'),'blockDuration'],'raw':!![]})['then'](function(_0x27cebe){_0x1db4a6=_0x27cebe;return db['User'][_0x290d('0x1e')]({'where':{'email':_0x30803a[_0x290d('0x38')][_0x290d('0x27')]}});})[_0x290d('0xb')](function(_0x37f187){if(!_0x37f187){throw new Error(_0x290d('0x3a'));}if(_0x37f187[_0x290d('0x17')]){throw new Error(_0x290d('0x3b'));}if(_0x37f187['blocked']){if(moment(_0x37f187[_0x290d('0x11')])[_0x290d('0x18')](_0x1db4a6[_0x290d('0xa')],_0x290d('0x19'))>moment()){throw new Error(_0x290d('0x3c'));}else{_0x37f187[_0x290d('0x10')]=![];_0x37f187['blockedAt']=null;}}_0x37f187[_0x290d('0x3d')]=_0x1644f9;_0x37f187[_0x290d('0x3e')]=Date[_0x290d('0x3f')]()+0x36ee80;return _0x37f187[_0x290d('0x40')]();})[_0x290d('0xb')](function(){return sendServiceMail({'to':_0x30803a[_0x290d('0x38')][_0x290d('0x27')],'subject':_0x290d('0x41'),'text':_0x290d('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x30803a[_0x290d('0x43')]['host']+_0x290d('0x44')+_0x1644f9+'\x0a\x0a'+_0x290d('0x45')});})[_0x290d('0xb')](function(){_0x32f058[_0x290d('0x46')](0xc8)[_0x290d('0x2d')]({'message':'Reset\x20Email\x20sent!'});})[_0x290d('0x1d')](function(_0x5611b4){return handleError(_0x32f058,0x1f4,_0x5611b4);});};exports[_0x290d('0x47')]=function(_0x4e5254,_0x4e3b97){return db[_0x290d('0x48')][_0x290d('0x1e')]({'where':{'resetPasswordToken':_0x4e5254[_0x290d('0x49')][_0x290d('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x290d('0x3f')]()}}})[_0x290d('0xb')](function(_0x178e58){if(!_0x178e58){throw new Error(_0x290d('0x4b'));}return db[_0x290d('0x9')][_0x290d('0xc')]({'attributes':['id',_0x290d('0x4c'),_0x290d('0x4d'),_0x290d('0x4e')]})[_0x290d('0xb')](function(_0x17b73e){if(_0x17b73e['securePassword'])authService[_0x290d('0x4f')](_0x4e5254['body'][_0x290d('0xe')]);if(!_0x17b73e[_0x290d('0x4d')]||!_0x178e58[_0x290d('0x50')])return _0x178e58;authService[_0x290d('0x51')](_0x4e5254[_0x290d('0x38')]['password'],_0x178e58[_0x290d('0x50')],_0x17b73e[_0x290d('0x4e')]);return _0x178e58;})['then'](function(){_0x178e58[_0x290d('0xe')]=_0x4e5254[_0x290d('0x38')]['password'];_0x178e58[_0x290d('0x3d')]=null;_0x178e58[_0x290d('0x3e')]=null;return _0x178e58['save']();});})[_0x290d('0xb')](function(){_0x4e3b97[_0x290d('0x46')](0xc8)[_0x290d('0x2d')]({'message':_0x290d('0x52')});})['catch'](function(_0x64f384){return handleError(_0x4e3b97,0x1f4,_0x64f384);});};passport[_0x290d('0x53')]('local-login',new LocalStrategy({'usernameField':_0x290d('0xd'),'passwordField':_0x290d('0xe')},function(_0x5c6e61,_0x309f7d,_0x1a146c){return localAuthenticate(db[_0x290d('0x48')],_0x5c6e61,_0x309f7d,_0x1a146c);}));
\ No newline at end of file
+var _0xf454=['blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','minutes','clearBlockUser','add','getLicense','catch','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','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','User','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','name','password','salt','disabled'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xf454,0x188));var _0x4f45=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf454[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x4f45('0x0'));var passport=require(_0x4f45('0x1'));var LocalStrategy=require('passport-local')[_0x4f45('0x2')];var jayson=require(_0x4f45('0x3'));var _=require(_0x4f45('0x4'));var rs=require('randomstring');var moment=require(_0x4f45('0x5'));var db=require(_0x4f45('0x6'))['db'];var authService=require(_0x4f45('0x7'));var utils=require(_0x4f45('0x8'));var client=jayson[_0x4f45('0x9')][_0x4f45('0xa')]({'port':0x232b});function localAuthenticate(_0x4c346b,_0x4a2969,_0x3e2bca,_0x54aee0){var _0x2e0731,_0x47970d;return db['Setting'][_0x4f45('0xb')]({'where':{'id':0x1},'attributes':[_0x4f45('0xc'),'blockDuration'],'raw':!![]})[_0x4f45('0xd')](function(_0xb7b116){_0x2e0731=_0xb7b116;return _0x4c346b[_0x4f45('0xb')]({'attributes':['id',_0x4f45('0xe'),_0x4f45('0xf'),_0x4f45('0x10'),'role',_0x4f45('0x11'),_0x4f45('0x12'),_0x4f45('0x13'),'loginAttempts'],'where':{'name':_0x4a2969,'role':{'$or':[_0x4f45('0x14'),_0x4f45('0x15'),'agent']}}});})[_0x4f45('0xd')](function(_0x5510fd){if(!_0x5510fd||_0x5510fd&&_0x5510fd[_0x4f45('0xe')]!==_0x4a2969){throw new Error(_0x4f45('0x16'));}else{_0x47970d=_0x5510fd;return _0x47970d;}})[_0x4f45('0xd')](function(){_0x47970d[_0x4f45('0x17')](_0x3e2bca,function(_0x168770,_0x2e48dc){var _0x3dce81=_0x47970d['loginAttempts']+0x1;if(_0x168770){return _0x54aee0(_0x168770);}else if(!_0x2e48dc){if(_0x47970d[_0x4f45('0x11')]){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}else if(_0x2e0731['allowedLoginAttempts']>0x0){if(_0x47970d[_0x4f45('0x12')]){if(_0x2e0731[_0x4f45('0x18')]>0x0){if(moment(_0x47970d[_0x4f45('0x13')])['add'](_0x2e0731[_0x4f45('0x18')],_0x4f45('0x19'))>moment()){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}else{return utils[_0x4f45('0x1a')](_0x47970d,_0x3dce81,![],null)['then'](function(){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});});}}else{return _0x54aee0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3dce81>=_0x2e0731[_0x4f45('0xc')]){return utils[_0x4f45('0x1a')](_0x47970d,0x0,!![],moment())['then'](function(){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});});}else{return utils['clearBlockUser'](_0x47970d,_0x3dce81,![],null)[_0x4f45('0xd')](function(){return _0x54aee0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}}else{if(_0x47970d[_0x4f45('0x11')]){return _0x54aee0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2e0731['allowedLoginAttempts']>0x0){if(_0x47970d[_0x4f45('0x12')]){if(_0x2e0731[_0x4f45('0x18')]>0x0){if(moment(_0x47970d['blockedAt'])[_0x4f45('0x1b')](_0x2e0731[_0x4f45('0x18')],'minutes')>moment()){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}else{return utils[_0x4f45('0x1a')](_0x47970d,0x0,![],null)[_0x4f45('0xd')](function(){return utils[_0x4f45('0x1c')](_0x47970d);})[_0x4f45('0xd')](function(){return _0x54aee0(null,_0x47970d);});}}else{return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}}else{return utils[_0x4f45('0x1a')](_0x47970d,0x0,![],null)['then'](function(){return utils[_0x4f45('0x1c')](_0x47970d);})['then'](function(){return _0x54aee0(null,_0x47970d);})[_0x4f45('0x1d')](function(_0xd71da){return _0x54aee0(null,![],_0xd71da);});}}else{if(_0x47970d[_0x4f45('0x12')]){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}else{return utils['getLicense'](_0x47970d)['then'](function(){return _0x54aee0(null,_0x47970d);});}}}});})[_0x4f45('0x1d')](function(_0x8ae2fe){return _0x54aee0(null,![],_0x8ae2fe);});}function sendServiceMail(_0x54c463){return db['MailAccount'][_0x4f45('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x4f45('0xe'),_0x4f45('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x4f45('0x20'),'include':[{'model':db[_0x4f45('0x21')],'as':_0x4f45('0x21')}]}]})[_0x4f45('0xd')](function(_0x23f08f){if(!_0x23f08f){throw new Error(_0x4f45('0x22'));}var _0x57e096=_0x23f08f['getSmtpOptions']();var _0x1977a5={'account':_0x57e096,'message':_[_0x4f45('0x23')]({'from':util[_0x4f45('0x24')](_0x4f45('0x25'),_0x23f08f[_0x4f45('0xe')],_0x23f08f[_0x4f45('0x1f')]||_0x23f08f[_0x4f45('0x20')][_0x4f45('0x15')])},_0x54c463)};return client['request'](_0x4f45('0x26'),_0x1977a5);})['then'](function(_0x52a799){if(_0x52a799[_0x4f45('0x27')]){throw new Error(util[_0x4f45('0x24')](_0x4f45('0x28'),_0x52a799[_0x4f45('0x27')]['message']||JSON[_0x4f45('0x29')](_0x52a799['error'])));}return!![];});}function handleError(_0x137fa0,_0x404ce2,_0x381620){return _0x137fa0[_0x4f45('0x2a')](_0x404ce2||0x1f4)[_0x4f45('0x2b')]({'message':_0x381620?_0x381620[_0x4f45('0x2c')]||_0x381620:''});}exports['login']=function(_0x5cbdd6,_0x226460,_0x4690e1){passport[_0x4f45('0x17')](_0x4f45('0x2d'),function(_0x28a686,_0x2d4765,_0x9b8702){var _0x5eb184=_0x28a686||_0x9b8702;if(_0x5eb184){return handleError(_0x226460,0x191,_0x5eb184);}if(!_0x2d4765){return handleError(_0x226460,0x194,{'message':_0x4f45('0x2e')});}else{var _0x5e81b7={'payload':{'id':_0x2d4765['id'],'role':_0x2d4765[_0x4f45('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x4f45('0x30')](_0x5e81b7)[_0x4f45('0xd')](function(_0x57ac23){_0x226460[_0x4f45('0x31')]({'id':_0x2d4765['id'],'token':_0x57ac23,'statusCall':'','isAlreadyLogged':_0x2d4765[_0x4f45('0x32')]});});}})(_0x5cbdd6,_0x226460,_0x4690e1);};exports['forgot']=function(_0x54af9a,_0x408eb5){if(!_0x54af9a[_0x4f45('0x33')]['email']){return handleError(_0x408eb5,0x1f4,{'message':_0x4f45('0x34')});}var _0x45c49d=rs[_0x4f45('0x35')]();_0x54af9a['body'][_0x4f45('0x1f')]=_0x54af9a[_0x4f45('0x33')][_0x4f45('0x1f')][_0x4f45('0x36')]()['toLowerCase']();var _0x3f55bf;return db[_0x4f45('0x37')][_0x4f45('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x4f45('0x18')],'raw':!![]})[_0x4f45('0xd')](function(_0x1bc91f){_0x3f55bf=_0x1bc91f;return db['User'][_0x4f45('0x1e')]({'where':{'email':_0x54af9a['body'][_0x4f45('0x1f')]}});})[_0x4f45('0xd')](function(_0x56f146){if(!_0x56f146){throw new Error(_0x4f45('0x38'));}if(_0x56f146['disabled']){throw new Error(_0x4f45('0x39'));}if(_0x56f146['blocked']){if(moment(_0x56f146[_0x4f45('0x13')])[_0x4f45('0x1b')](_0x3f55bf[_0x4f45('0x18')],_0x4f45('0x19'))>moment()){throw new Error(_0x4f45('0x3a'));}else{_0x56f146['blocked']=![];_0x56f146[_0x4f45('0x13')]=null;}}_0x56f146[_0x4f45('0x3b')]=_0x45c49d;_0x56f146[_0x4f45('0x3c')]=Date[_0x4f45('0x3d')]()+0x36ee80;return _0x56f146[_0x4f45('0x3e')]();})[_0x4f45('0xd')](function(){return sendServiceMail({'to':_0x54af9a['body'][_0x4f45('0x1f')],'subject':_0x4f45('0x3f'),'text':_0x4f45('0x40')+_0x4f45('0x41')+_0x4f45('0x42')+_0x54af9a[_0x4f45('0x43')][_0x4f45('0x44')]+_0x4f45('0x45')+_0x45c49d+'\x0a\x0a'+_0x4f45('0x46')});})['then'](function(){_0x408eb5[_0x4f45('0x2a')](0xc8)[_0x4f45('0x2b')]({'message':'Reset\x20Email\x20sent!'});})[_0x4f45('0x1d')](function(_0x50dbe8){return handleError(_0x408eb5,0x1f4,_0x50dbe8);});};exports[_0x4f45('0x47')]=function(_0x3e91f9,_0x148be){return db[_0x4f45('0x48')][_0x4f45('0x1e')]({'where':{'resetPasswordToken':_0x3e91f9[_0x4f45('0x49')][_0x4f45('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x4f45('0x3d')]()}}})[_0x4f45('0xd')](function(_0x34d377){if(!_0x34d377){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x4f45('0x37')][_0x4f45('0xb')]({'attributes':['id',_0x4f45('0x4b'),_0x4f45('0x4c'),_0x4f45('0x4d')]})['then'](function(_0xbf65c6){if(_0xbf65c6[_0x4f45('0x4b')])authService['validatePasswordPattern'](_0x3e91f9[_0x4f45('0x33')][_0x4f45('0xf')]);if(!_0xbf65c6[_0x4f45('0x4c')]||!_0x34d377[_0x4f45('0x4e')])return _0x34d377;authService[_0x4f45('0x4f')](_0x3e91f9['body']['password'],_0x34d377[_0x4f45('0x4e')],_0xbf65c6[_0x4f45('0x4d')]);return _0x34d377;})[_0x4f45('0xd')](function(){_0x34d377[_0x4f45('0xf')]=_0x3e91f9[_0x4f45('0x33')][_0x4f45('0xf')];_0x34d377[_0x4f45('0x3b')]=null;_0x34d377[_0x4f45('0x3c')]=null;return _0x34d377[_0x4f45('0x3e')]();});})['then'](function(){_0x148be[_0x4f45('0x2a')](0xc8)[_0x4f45('0x2b')]({'message':_0x4f45('0x50')});})['catch'](function(_0x3aa5dc){return handleError(_0x148be,0x1f4,_0x3aa5dc);});};passport[_0x4f45('0x51')](_0x4f45('0x2d'),new LocalStrategy({'usernameField':_0x4f45('0xe'),'passwordField':_0x4f45('0xf')},function(_0x1a6df9,_0x48b336,_0x40b5d7){return localAuthenticate(db[_0x4f45('0x48')],_0x1a6df9,_0x48b336,_0x40b5d7);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index dcb17a5..82c90fb 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 _0xe5be=['post','/forgot','forgot','/reset/:token','reset','./authLocal.controller'];(function(_0x493a20,_0x9fbf06){var _0x4ca488=function(_0x427378){while(--_0x427378){_0x493a20['push'](_0x493a20['shift']());}};_0x4ca488(++_0x9fbf06);}(_0xe5be,0x1c7));var _0xee5b=function(_0xb1158b,_0x1ed8de){_0xb1158b=_0xb1158b-0x0;var _0x5c1506=_0xe5be[_0xb1158b];return _0x5c1506;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xee5b('0x0'));router[_0xee5b('0x1')]('/',controller['login']);router[_0xee5b('0x1')](_0xee5b('0x2'),controller[_0xee5b('0x3')]);router[_0xee5b('0x1')](_0xee5b('0x4'),controller[_0xee5b('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x034c=['login','/forgot','express','Router','./authLocal.controller','post'];(function(_0x38cf3d,_0x2b8f37){var _0x4b97f0=function(_0x237829){while(--_0x237829){_0x38cf3d['push'](_0x38cf3d['shift']());}};_0x4b97f0(++_0x2b8f37);}(_0x034c,0x1c4));var _0xc034=function(_0x4b6548,_0x67b78d){_0x4b6548=_0x4b6548-0x0;var _0x8fd11e=_0x034c[_0x4b6548];return _0x8fd11e;};'use strict';var express=require(_0xc034('0x0'));var router=express[_0xc034('0x1')]();var controller=require(_0xc034('0x2'));router[_0xc034('0x3')]('/',controller[_0xc034('0x4')]);router[_0xc034('0x3')](_0xc034('0x5'),controller['forgot']);router['post']('/reset/:token',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 9e002e3..ebbc4df 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 _0x3562=['STRING','INTEGER','sequelize','exports'];(function(_0xf03eeb,_0x42cc3c){var _0x4815af=function(_0x49a038){while(--_0x49a038){_0xf03eeb['push'](_0xf03eeb['shift']());}};_0x4815af(++_0x42cc3c);}(_0x3562,0x186));var _0x2356=function(_0x42f154,_0x32110c){_0x42f154=_0x42f154-0x0;var _0x471993=_0x3562[_0x42f154];return _0x471993;};'use strict';var Sequelize=require(_0x2356('0x0'));module[_0x2356('0x1')]={'name':{'type':Sequelize[_0x2356('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2356('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2356('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xe875=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x87fdaf,_0x165914){var _0x5dacf0=function(_0x4b7f61){while(--_0x4b7f61){_0x87fdaf['push'](_0x87fdaf['shift']());}};_0x5dacf0(++_0x165914);}(_0xe875,0xa1));var _0x5e87=function(_0x5bd118,_0x2553af){_0x5bd118=_0x5bd118-0x0;var _0x2db56d=_0xe875[_0x5bd118];return _0x2db56d;};'use strict';var Sequelize=require(_0x5e87('0x0'));module[_0x5e87('0x1')]={'name':{'type':Sequelize[_0x5e87('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5e87('0x2')]},'description':{'type':Sequelize[_0x5e87('0x2')]},'status':{'type':Sequelize[_0x5e87('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5e87('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 87d9b1c..a34b32d 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 _0xed38=['mustache','util','sox','to-csv','ejs','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','Automation','include','findAll','rows','catch','show','params','includeAll','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','pick','getActions','Action','rawAttributes','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0xa6d014,_0x3b7030){var _0x2b208e=function(_0x3c98ee){while(--_0x3c98ee){_0xa6d014['push'](_0xa6d014['shift']());}};_0x2b208e(++_0x3b7030);}(_0xed38,0xf1));var _0x8ed3=function(_0x27acb6,_0x54f2ad){_0x27acb6=_0x27acb6-0x0;var _0x2c3dfd=_0xed38[_0x27acb6];return _0x2c3dfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed3('0x0'));var zipdir=require(_0x8ed3('0x1'));var jsonpatch=require(_0x8ed3('0x2'));var rp=require('request-promise');var moment=require(_0x8ed3('0x3'));var BPromise=require(_0x8ed3('0x4'));var Mustache=require(_0x8ed3('0x5'));var util=require(_0x8ed3('0x6'));var path=require('path');var sox=require(_0x8ed3('0x7'));var csv=require(_0x8ed3('0x8'));var ejs=require(_0x8ed3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ed3('0x8'));var querystring=require(_0x8ed3('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8ed3('0xb'));var qs=require(_0x8ed3('0xc'));var as=require(_0x8ed3('0xd'));var hardwareService=require(_0x8ed3('0xe'));var logger=require(_0x8ed3('0xf'))(_0x8ed3('0x10'));var utils=require(_0x8ed3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x8ed3('0x12'));var db=require(_0x8ed3('0x13'))['db'];function respondWithStatusCode(_0x2768e7,_0xc49201){_0xc49201=_0xc49201||0xcc;return function(_0x13ebcb){if(_0x13ebcb){return _0x2768e7[_0x8ed3('0x14')](_0xc49201);}return _0x2768e7[_0x8ed3('0x15')](_0xc49201)[_0x8ed3('0x16')]();};}function respondWithResult(_0x10b8b8,_0x47398d){_0x47398d=_0x47398d||0xc8;return function(_0x4a4c14){if(_0x4a4c14){return _0x10b8b8[_0x8ed3('0x15')](_0x47398d)[_0x8ed3('0x17')](_0x4a4c14);}};}function respondWithFilteredResult(_0x27969f,_0x2f1dcb){return function(_0x2856aa){if(_0x2856aa){var _0x543835=typeof _0x2f1dcb[_0x8ed3('0x18')]==='undefined'&&typeof _0x2f1dcb[_0x8ed3('0x19')]===_0x8ed3('0x1a');var _0x3d70b7=_0x2856aa[_0x8ed3('0x1b')];var _0x1957e0=_0x543835?0x0:_0x2f1dcb[_0x8ed3('0x18')];var _0x1387f6=_0x543835?_0x2856aa[_0x8ed3('0x1b')]:_0x2f1dcb[_0x8ed3('0x18')]+_0x2f1dcb[_0x8ed3('0x19')];var _0x20350a;if(_0x1387f6>=_0x3d70b7){_0x1387f6=_0x3d70b7;_0x20350a=0xc8;}else{_0x20350a=0xce;}_0x27969f[_0x8ed3('0x15')](_0x20350a);return _0x27969f[_0x8ed3('0x1c')](_0x8ed3('0x1d'),_0x1957e0+'-'+_0x1387f6+'/'+_0x3d70b7)[_0x8ed3('0x17')](_0x2856aa);}return null;};}function patchUpdates(_0x465705){return function(_0x39efa7){try{jsonpatch[_0x8ed3('0x1e')](_0x39efa7,_0x465705,!![]);}catch(_0x2520d9){return BPromise[_0x8ed3('0x1f')](_0x2520d9);}return _0x39efa7[_0x8ed3('0x20')]();};}function saveUpdates(_0x4818be,_0x1aa284){return function(_0x19a794){if(_0x19a794){return _0x19a794[_0x8ed3('0x21')](_0x4818be)[_0x8ed3('0x22')](function(_0x2c133a){return _0x2c133a;});}return null;};}function removeEntity(_0x8888d,_0x4df5e3){return function(_0x178fda){if(_0x178fda){return _0x178fda[_0x8ed3('0x23')]()[_0x8ed3('0x22')](function(){_0x8888d[_0x8ed3('0x15')](0xcc)[_0x8ed3('0x16')]();});}};}function handleEntityNotFound(_0x1d8a15,_0x5219dd){return function(_0x550045){if(!_0x550045){_0x1d8a15[_0x8ed3('0x14')](0x194);}return _0x550045;};}function handleError(_0x2b1a42,_0x45176e){_0x45176e=_0x45176e||0x1f4;return function(_0xd2dc8b){logger[_0x8ed3('0x24')](_0xd2dc8b[_0x8ed3('0x25')]);if(_0xd2dc8b[_0x8ed3('0x26')]){delete _0xd2dc8b['name'];}_0x2b1a42[_0x8ed3('0x15')](_0x45176e)['send'](_0xd2dc8b);};}exports[_0x8ed3('0x27')]=function(_0xa5e83c,_0x8eb917){var _0x3f75a2={},_0x5352be={},_0x3a688={'count':0x0,'rows':[]};var _0x1aa4a6=_[_0x8ed3('0x28')](db['Automation']['rawAttributes'],function(_0x46ad06){return{'name':_0x46ad06[_0x8ed3('0x29')],'type':_0x46ad06[_0x8ed3('0x2a')][_0x8ed3('0x2b')]};});_0x5352be['model']=_['map'](_0x1aa4a6,'name');_0x5352be[_0x8ed3('0x2c')]=_[_0x8ed3('0x2d')](_0xa5e83c[_0x8ed3('0x2c')]);_0x5352be[_0x8ed3('0x2e')]=_[_0x8ed3('0x2f')](_0x5352be[_0x8ed3('0x30')],_0x5352be[_0x8ed3('0x2c')]);_0x3f75a2['attributes']=_[_0x8ed3('0x2f')](_0x5352be[_0x8ed3('0x30')],qs[_0x8ed3('0x31')](_0xa5e83c['query'][_0x8ed3('0x31')]));_0x3f75a2[_0x8ed3('0x32')]=_0x3f75a2[_0x8ed3('0x32')][_0x8ed3('0x33')]?_0x3f75a2['attributes']:_0x5352be[_0x8ed3('0x30')];if(!_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x34')](_0x8ed3('0x35'))){_0x3f75a2[_0x8ed3('0x19')]=qs[_0x8ed3('0x19')](_0xa5e83c['query'][_0x8ed3('0x19')]);_0x3f75a2['offset']=qs[_0x8ed3('0x18')](_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x18')]);}_0x3f75a2[_0x8ed3('0x36')]=qs[_0x8ed3('0x37')](_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x37')]);_0x3f75a2[_0x8ed3('0x38')]=qs[_0x8ed3('0x2e')](_['pick'](_0xa5e83c[_0x8ed3('0x2c')],_0x5352be['filters']),_0x1aa4a6);if(_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x39')]){_0x3f75a2[_0x8ed3('0x38')]=_['merge'](_0x3f75a2['where'],{'$or':_[_0x8ed3('0x28')](_0x1aa4a6,function(_0x6927d3){if(_0x6927d3[_0x8ed3('0x2a')]!==_0x8ed3('0x3a')){var _0x4a7006={};_0x4a7006[_0x6927d3[_0x8ed3('0x26')]]={'$like':'%'+_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x39')]+'%'};return _0x4a7006;}})});}_0x3f75a2=_[_0x8ed3('0x3b')]({},_0x3f75a2,_0xa5e83c[_0x8ed3('0x3c')]);var _0x4da127={'where':_0x3f75a2[_0x8ed3('0x38')]};return db[_0x8ed3('0x3d')][_0x8ed3('0x1b')](_0x4da127)[_0x8ed3('0x22')](function(_0x26e741){_0x3a688[_0x8ed3('0x1b')]=_0x26e741;if(_0xa5e83c['query']['includeAll']){_0x3f75a2[_0x8ed3('0x3e')]=[{'all':!![]}];}return db['Automation'][_0x8ed3('0x3f')](_0x3f75a2);})[_0x8ed3('0x22')](function(_0x7002ae){_0x3a688[_0x8ed3('0x40')]=_0x7002ae;return _0x3a688;})['then'](respondWithFilteredResult(_0x8eb917,_0x3f75a2))[_0x8ed3('0x41')](handleError(_0x8eb917,null));};exports[_0x8ed3('0x42')]=function(_0x6d98d,_0x1a0582){var _0x11ef0b={'raw':![],'where':{'id':_0x6d98d[_0x8ed3('0x43')]['id']}},_0x1ce092={};_0x1ce092['model']=_['keys'](db['Automation']['rawAttributes']);_0x1ce092[_0x8ed3('0x2c')]=_[_0x8ed3('0x2d')](_0x6d98d[_0x8ed3('0x2c')]);_0x1ce092[_0x8ed3('0x2e')]=_[_0x8ed3('0x2f')](_0x1ce092[_0x8ed3('0x30')],_0x1ce092[_0x8ed3('0x2c')]);_0x11ef0b['attributes']=_[_0x8ed3('0x2f')](_0x1ce092[_0x8ed3('0x30')],qs[_0x8ed3('0x31')](_0x6d98d['query'][_0x8ed3('0x31')]));_0x11ef0b[_0x8ed3('0x32')]=_0x11ef0b[_0x8ed3('0x32')][_0x8ed3('0x33')]?_0x11ef0b[_0x8ed3('0x32')]:_0x1ce092[_0x8ed3('0x30')];if(_0x6d98d[_0x8ed3('0x2c')][_0x8ed3('0x44')]){_0x11ef0b['include']=[{'all':!![]}];}_0x11ef0b=_['merge']({},_0x11ef0b,_0x6d98d[_0x8ed3('0x3c')]);return db['Automation'][_0x8ed3('0x45')](_0x11ef0b)[_0x8ed3('0x22')](handleEntityNotFound(_0x1a0582,null))[_0x8ed3('0x22')](respondWithResult(_0x1a0582,null))[_0x8ed3('0x41')](handleError(_0x1a0582,null));};exports[_0x8ed3('0x46')]=function(_0x141b9d,_0x152262){return db[_0x8ed3('0x3d')]['create'](_0x141b9d[_0x8ed3('0x47')],{})[_0x8ed3('0x22')](respondWithResult(_0x152262,0xc9))[_0x8ed3('0x41')](handleError(_0x152262,null));};exports['update']=function(_0x478db4,_0x52eed2){if(_0x478db4[_0x8ed3('0x47')]['id']){delete _0x478db4['body']['id'];}return db[_0x8ed3('0x3d')][_0x8ed3('0x45')]({'where':{'id':_0x478db4[_0x8ed3('0x43')]['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x52eed2,null))[_0x8ed3('0x22')](saveUpdates(_0x478db4[_0x8ed3('0x47')],null))[_0x8ed3('0x22')](respondWithResult(_0x52eed2,null))[_0x8ed3('0x41')](handleError(_0x52eed2,null));};exports[_0x8ed3('0x23')]=function(_0x45a47b,_0x3fe21c){return db['Automation']['find']({'where':{'id':_0x45a47b['params']['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x3fe21c,null))[_0x8ed3('0x22')](removeEntity(_0x3fe21c,null))[_0x8ed3('0x41')](handleError(_0x3fe21c,null));};exports[_0x8ed3('0x48')]=function(_0xaa211e,_0x40a7c0,_0x192015){return db[_0x8ed3('0x49')][_0x8ed3('0x45')]({'where':{'id':_0xaa211e['params']['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x40a7c0,null))[_0x8ed3('0x22')](function(_0x3be851){if(_0x3be851){return _0x3be851['addConditions'](_0xaa211e[_0x8ed3('0x47')]['ids'],_[_0x8ed3('0x4a')](_0xaa211e[_0x8ed3('0x47')],[_0x8ed3('0x4b'),'id'])||{});}})[_0x8ed3('0x22')](respondWithResult(_0x40a7c0,null))['catch'](handleError(_0x40a7c0,null));};exports[_0x8ed3('0x4c')]=function(_0x9d21a5,_0x4dfece,_0x367368){var _0x2e790d={};var _0xe3e002={};var _0x4141c1;var _0x349e05;return db['Automation'][_0x8ed3('0x4d')]({'where':{'id':_0x9d21a5['params']['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x4dfece,null))[_0x8ed3('0x22')](function(_0xc70e7c){if(_0xc70e7c){_0x4141c1=_0xc70e7c;_0xe3e002[_0x8ed3('0x30')]=_[_0x8ed3('0x2d')](db[_0x8ed3('0x49')]['rawAttributes']);_0xe3e002['query']=_['keys'](_0x9d21a5[_0x8ed3('0x2c')]);_0xe3e002['filters']=_[_0x8ed3('0x2f')](_0xe3e002[_0x8ed3('0x30')],_0xe3e002[_0x8ed3('0x2c')]);_0x2e790d[_0x8ed3('0x32')]=_['intersection'](_0xe3e002[_0x8ed3('0x30')],qs[_0x8ed3('0x31')](_0x9d21a5[_0x8ed3('0x2c')][_0x8ed3('0x31')]));_0x2e790d[_0x8ed3('0x32')]=_0x2e790d[_0x8ed3('0x32')][_0x8ed3('0x33')]?_0x2e790d[_0x8ed3('0x32')]:_0xe3e002[_0x8ed3('0x30')];_0x2e790d['order']=qs[_0x8ed3('0x37')](_0x9d21a5['query'][_0x8ed3('0x37')]);_0x2e790d[_0x8ed3('0x38')]=qs['filters'](_[_0x8ed3('0x4e')](_0x9d21a5['query'],_0xe3e002[_0x8ed3('0x2e')]));if(_0x9d21a5[_0x8ed3('0x2c')][_0x8ed3('0x39')]){_0x2e790d['where']=_[_0x8ed3('0x3b')](_0x2e790d['where'],{'$or':_[_0x8ed3('0x28')](_0x2e790d[_0x8ed3('0x32')],function(_0x23933f){var _0x3c6c6c={};_0x3c6c6c[_0x23933f]={'$like':'%'+_0x9d21a5[_0x8ed3('0x2c')][_0x8ed3('0x39')]+'%'};return _0x3c6c6c;})});}_0x2e790d=_[_0x8ed3('0x3b')]({},_0x2e790d,_0x9d21a5[_0x8ed3('0x3c')]);return _0x4141c1[_0x8ed3('0x4c')](_0x2e790d);}})['then'](function(_0x5ce163){if(_0x5ce163){_0x349e05=_0x5ce163[_0x8ed3('0x33')];if(!_0x9d21a5[_0x8ed3('0x2c')]['hasOwnProperty'](_0x8ed3('0x35'))){_0x2e790d['limit']=qs['limit'](_0x9d21a5[_0x8ed3('0x2c')][_0x8ed3('0x19')]);_0x2e790d[_0x8ed3('0x18')]=qs[_0x8ed3('0x18')](_0x9d21a5['query']['offset']);}return _0x4141c1[_0x8ed3('0x4c')](_0x2e790d);}})[_0x8ed3('0x22')](function(_0x1b3d19){if(_0x1b3d19){return _0x1b3d19?{'count':_0x349e05,'rows':_0x1b3d19}:null;}})['then'](respondWithResult(_0x4dfece,null))[_0x8ed3('0x41')](handleError(_0x4dfece,null));};exports['addActions']=function(_0x368e84,_0x38e776,_0xbfa1d3){return db['Action'][_0x8ed3('0x45')]({'where':{'id':_0x368e84[_0x8ed3('0x43')]['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x38e776,null))[_0x8ed3('0x22')](function(_0x50c8c5){if(_0x50c8c5){return _0x50c8c5['addActions'](_0x368e84[_0x8ed3('0x47')][_0x8ed3('0x4b')],_[_0x8ed3('0x4a')](_0x368e84['body'],[_0x8ed3('0x4b'),'id'])||{});}})[_0x8ed3('0x22')](respondWithResult(_0x38e776,null))[_0x8ed3('0x41')](handleError(_0x38e776,null));};exports[_0x8ed3('0x4f')]=function(_0x149ef8,_0x2a19a2,_0x424e53){var _0x28e3a9={};var _0x254fcd={};var _0x5157ae;var _0x5ecaca;return db[_0x8ed3('0x3d')]['findOne']({'where':{'id':_0x149ef8[_0x8ed3('0x43')]['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x2a19a2,null))[_0x8ed3('0x22')](function(_0x397a49){if(_0x397a49){_0x5157ae=_0x397a49;_0x254fcd[_0x8ed3('0x30')]=_[_0x8ed3('0x2d')](db[_0x8ed3('0x50')][_0x8ed3('0x51')]);_0x254fcd[_0x8ed3('0x2c')]=_[_0x8ed3('0x2d')](_0x149ef8[_0x8ed3('0x2c')]);_0x254fcd[_0x8ed3('0x2e')]=_[_0x8ed3('0x2f')](_0x254fcd[_0x8ed3('0x30')],_0x254fcd[_0x8ed3('0x2c')]);_0x28e3a9[_0x8ed3('0x32')]=_[_0x8ed3('0x2f')](_0x254fcd[_0x8ed3('0x30')],qs[_0x8ed3('0x31')](_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x31')]));_0x28e3a9[_0x8ed3('0x32')]=_0x28e3a9[_0x8ed3('0x32')][_0x8ed3('0x33')]?_0x28e3a9['attributes']:_0x254fcd[_0x8ed3('0x30')];_0x28e3a9['order']=qs[_0x8ed3('0x37')](_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x37')]);_0x28e3a9[_0x8ed3('0x38')]=qs[_0x8ed3('0x2e')](_[_0x8ed3('0x4e')](_0x149ef8[_0x8ed3('0x2c')],_0x254fcd['filters']));if(_0x149ef8['query'][_0x8ed3('0x39')]){_0x28e3a9['where']=_[_0x8ed3('0x3b')](_0x28e3a9['where'],{'$or':_[_0x8ed3('0x28')](_0x28e3a9[_0x8ed3('0x32')],function(_0x782c0f){var _0x12f54e={};_0x12f54e[_0x782c0f]={'$like':'%'+_0x149ef8['query'][_0x8ed3('0x39')]+'%'};return _0x12f54e;})});}_0x28e3a9=_[_0x8ed3('0x3b')]({},_0x28e3a9,_0x149ef8[_0x8ed3('0x3c')]);return _0x5157ae[_0x8ed3('0x4f')](_0x28e3a9);}})[_0x8ed3('0x22')](function(_0x48b3d9){if(_0x48b3d9){_0x5ecaca=_0x48b3d9[_0x8ed3('0x33')];if(!_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x34')](_0x8ed3('0x35'))){_0x28e3a9[_0x8ed3('0x19')]=qs[_0x8ed3('0x19')](_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x19')]);_0x28e3a9['offset']=qs[_0x8ed3('0x18')](_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x18')]);}return _0x5157ae[_0x8ed3('0x4f')](_0x28e3a9);}})[_0x8ed3('0x22')](function(_0x4a6577){if(_0x4a6577){return _0x4a6577?{'count':_0x5ecaca,'rows':_0x4a6577}:null;}})[_0x8ed3('0x22')](respondWithResult(_0x2a19a2,null))[_0x8ed3('0x41')](handleError(_0x2a19a2,null));};
\ No newline at end of file
+var _0x0753=['rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','filter','where','type','VIRTUAL','merge','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','addConditions','ids','omit','findOne','Condition','order','sort','pick','getConditions','hasOwnProperty','addActions','Action','getActions','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','stack','name','send','map','Automation'];(function(_0x164166,_0x537687){var _0x16d491=function(_0x3b1a02){while(--_0x3b1a02){_0x164166['push'](_0x164166['shift']());}};_0x16d491(++_0x537687);}(_0x0753,0x115));var _0x3075=function(_0x38500f,_0x31c484){_0x38500f=_0x38500f-0x0;var _0x486365=_0x0753[_0x38500f];return _0x486365;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3075('0x0'));var zipdir=require(_0x3075('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3075('0x2'));var moment=require(_0x3075('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3075('0x4'));var util=require(_0x3075('0x5'));var path=require(_0x3075('0x6'));var sox=require('sox');var csv=require(_0x3075('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3075('0x8'));var _=require(_0x3075('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3075('0xa'));var toCsv=require(_0x3075('0x7'));var querystring=require(_0x3075('0xb'));var Papa=require(_0x3075('0xc'));var Redis=require(_0x3075('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3075('0xe'));var as=require(_0x3075('0xf'));var hardwareService=require(_0x3075('0x10'));var logger=require('../../config/logger')(_0x3075('0x11'));var utils=require('../../config/utils');var config=require(_0x3075('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3075('0x13'))['db'];function respondWithStatusCode(_0x915cfa,_0xe42f0f){_0xe42f0f=_0xe42f0f||0xcc;return function(_0x35a8cc){if(_0x35a8cc){return _0x915cfa[_0x3075('0x14')](_0xe42f0f);}return _0x915cfa[_0x3075('0x15')](_0xe42f0f)[_0x3075('0x16')]();};}function respondWithResult(_0x1b73b0,_0x56e83c){_0x56e83c=_0x56e83c||0xc8;return function(_0x92710f){if(_0x92710f){return _0x1b73b0['status'](_0x56e83c)[_0x3075('0x17')](_0x92710f);}};}function respondWithFilteredResult(_0x74144a,_0x310abb){return function(_0x3da7bc){if(_0x3da7bc){var _0x2f3d1b=typeof _0x310abb[_0x3075('0x18')]==='undefined'&&typeof _0x310abb['limit']===_0x3075('0x19');var _0x10215d=_0x3da7bc['count'];var _0x2c893d=_0x2f3d1b?0x0:_0x310abb[_0x3075('0x18')];var _0x5e811a=_0x2f3d1b?_0x3da7bc[_0x3075('0x1a')]:_0x310abb['offset']+_0x310abb[_0x3075('0x1b')];var _0x133401;if(_0x5e811a>=_0x10215d){_0x5e811a=_0x10215d;_0x133401=0xc8;}else{_0x133401=0xce;}_0x74144a['status'](_0x133401);return _0x74144a[_0x3075('0x1c')](_0x3075('0x1d'),_0x2c893d+'-'+_0x5e811a+'/'+_0x10215d)['json'](_0x3da7bc);}return null;};}function patchUpdates(_0x12afb1){return function(_0x18899b){try{jsonpatch['apply'](_0x18899b,_0x12afb1,!![]);}catch(_0x1a353a){return BPromise[_0x3075('0x1e')](_0x1a353a);}return _0x18899b['save']();};}function saveUpdates(_0x325fa8,_0x45c1d3){return function(_0x5beb0d){if(_0x5beb0d){return _0x5beb0d[_0x3075('0x1f')](_0x325fa8)['then'](function(_0x55e01b){return _0x55e01b;});}return null;};}function removeEntity(_0x161666,_0x1814cd){return function(_0x5585f1){if(_0x5585f1){return _0x5585f1['destroy']()[_0x3075('0x20')](function(){_0x161666[_0x3075('0x15')](0xcc)[_0x3075('0x16')]();});}};}function handleEntityNotFound(_0x3d84bd,_0x396ccd){return function(_0x5cd104){if(!_0x5cd104){_0x3d84bd['sendStatus'](0x194);}return _0x5cd104;};}function handleError(_0x405732,_0x5beba9){_0x5beba9=_0x5beba9||0x1f4;return function(_0x46113f){logger[_0x3075('0x21')](_0x46113f[_0x3075('0x22')]);if(_0x46113f[_0x3075('0x23')]){delete _0x46113f['name'];}_0x405732[_0x3075('0x15')](_0x5beba9)[_0x3075('0x24')](_0x46113f);};}exports['index']=function(_0x18f73b,_0x5634f4){var _0x5054ff={},_0x4c926d={},_0x1a30c3={'count':0x0,'rows':[]};var _0xf9350a=_[_0x3075('0x25')](db[_0x3075('0x26')][_0x3075('0x27')],function(_0xa5f71a){return{'name':_0xa5f71a[_0x3075('0x28')],'type':_0xa5f71a['type']['key']};});_0x4c926d[_0x3075('0x29')]=_[_0x3075('0x25')](_0xf9350a,_0x3075('0x23'));_0x4c926d[_0x3075('0x2a')]=_[_0x3075('0x2b')](_0x18f73b[_0x3075('0x2a')]);_0x4c926d[_0x3075('0x2c')]=_[_0x3075('0x2d')](_0x4c926d[_0x3075('0x29')],_0x4c926d[_0x3075('0x2a')]);_0x5054ff[_0x3075('0x2e')]=_[_0x3075('0x2d')](_0x4c926d[_0x3075('0x29')],qs[_0x3075('0x2f')](_0x18f73b['query'][_0x3075('0x2f')]));_0x5054ff['attributes']=_0x5054ff['attributes'][_0x3075('0x30')]?_0x5054ff[_0x3075('0x2e')]:_0x4c926d[_0x3075('0x29')];if(!_0x18f73b['query']['hasOwnProperty'](_0x3075('0x31'))){_0x5054ff[_0x3075('0x1b')]=qs[_0x3075('0x1b')](_0x18f73b['query'][_0x3075('0x1b')]);_0x5054ff[_0x3075('0x18')]=qs[_0x3075('0x18')](_0x18f73b[_0x3075('0x2a')][_0x3075('0x18')]);}_0x5054ff['order']=qs['sort'](_0x18f73b['query']['sort']);_0x5054ff['where']=qs[_0x3075('0x2c')](_['pick'](_0x18f73b[_0x3075('0x2a')],_0x4c926d[_0x3075('0x2c')]),_0xf9350a);if(_0x18f73b[_0x3075('0x2a')][_0x3075('0x32')]){_0x5054ff['where']=_['merge'](_0x5054ff[_0x3075('0x33')],{'$or':_[_0x3075('0x25')](_0xf9350a,function(_0x1e5412){if(_0x1e5412[_0x3075('0x34')]!==_0x3075('0x35')){var _0x52af4b={};_0x52af4b[_0x1e5412[_0x3075('0x23')]]={'$like':'%'+_0x18f73b[_0x3075('0x2a')][_0x3075('0x32')]+'%'};return _0x52af4b;}})});}_0x5054ff=_[_0x3075('0x36')]({},_0x5054ff,_0x18f73b['options']);var _0x186a14={'where':_0x5054ff[_0x3075('0x33')]};return db[_0x3075('0x26')][_0x3075('0x1a')](_0x186a14)['then'](function(_0x154c7f){_0x1a30c3['count']=_0x154c7f;if(_0x18f73b[_0x3075('0x2a')][_0x3075('0x37')]){_0x5054ff['include']=[{'all':!![]}];}return db[_0x3075('0x26')][_0x3075('0x38')](_0x5054ff);})[_0x3075('0x20')](function(_0x3b08ce){_0x1a30c3[_0x3075('0x39')]=_0x3b08ce;return _0x1a30c3;})[_0x3075('0x20')](respondWithFilteredResult(_0x5634f4,_0x5054ff))['catch'](handleError(_0x5634f4,null));};exports[_0x3075('0x3a')]=function(_0x51eea3,_0x313ca5){var _0x51697a={'raw':![],'where':{'id':_0x51eea3[_0x3075('0x3b')]['id']}},_0x54c97c={};_0x54c97c['model']=_[_0x3075('0x2b')](db['Automation'][_0x3075('0x27')]);_0x54c97c[_0x3075('0x2a')]=_[_0x3075('0x2b')](_0x51eea3[_0x3075('0x2a')]);_0x54c97c['filters']=_[_0x3075('0x2d')](_0x54c97c['model'],_0x54c97c[_0x3075('0x2a')]);_0x51697a[_0x3075('0x2e')]=_[_0x3075('0x2d')](_0x54c97c[_0x3075('0x29')],qs[_0x3075('0x2f')](_0x51eea3[_0x3075('0x2a')]['fields']));_0x51697a['attributes']=_0x51697a[_0x3075('0x2e')]['length']?_0x51697a[_0x3075('0x2e')]:_0x54c97c[_0x3075('0x29')];if(_0x51eea3['query'][_0x3075('0x37')]){_0x51697a[_0x3075('0x3c')]=[{'all':!![]}];}_0x51697a=_[_0x3075('0x36')]({},_0x51697a,_0x51eea3['options']);return db[_0x3075('0x26')][_0x3075('0x3d')](_0x51697a)[_0x3075('0x20')](handleEntityNotFound(_0x313ca5,null))['then'](respondWithResult(_0x313ca5,null))[_0x3075('0x3e')](handleError(_0x313ca5,null));};exports[_0x3075('0x3f')]=function(_0x1f7bc5,_0x1496ad){return db['Automation'][_0x3075('0x3f')](_0x1f7bc5['body'],{})[_0x3075('0x20')](respondWithResult(_0x1496ad,0xc9))['catch'](handleError(_0x1496ad,null));};exports[_0x3075('0x1f')]=function(_0xc176d4,_0x38aeab){if(_0xc176d4[_0x3075('0x40')]['id']){delete _0xc176d4['body']['id'];}return db['Automation'][_0x3075('0x3d')]({'where':{'id':_0xc176d4[_0x3075('0x3b')]['id']}})['then'](handleEntityNotFound(_0x38aeab,null))[_0x3075('0x20')](saveUpdates(_0xc176d4[_0x3075('0x40')],null))[_0x3075('0x20')](respondWithResult(_0x38aeab,null))[_0x3075('0x3e')](handleError(_0x38aeab,null));};exports[_0x3075('0x41')]=function(_0x3aef56,_0x20e5a1){return db[_0x3075('0x26')][_0x3075('0x3d')]({'where':{'id':_0x3aef56[_0x3075('0x3b')]['id']}})[_0x3075('0x20')](handleEntityNotFound(_0x20e5a1,null))[_0x3075('0x20')](removeEntity(_0x20e5a1,null))[_0x3075('0x3e')](handleError(_0x20e5a1,null));};exports[_0x3075('0x42')]=function(_0x4c4c18,_0x528091,_0xebcb12){return db['Condition']['find']({'where':{'id':_0x4c4c18[_0x3075('0x3b')]['id']}})[_0x3075('0x20')](handleEntityNotFound(_0x528091,null))[_0x3075('0x20')](function(_0xc78af9){if(_0xc78af9){return _0xc78af9[_0x3075('0x42')](_0x4c4c18[_0x3075('0x40')][_0x3075('0x43')],_[_0x3075('0x44')](_0x4c4c18[_0x3075('0x40')],[_0x3075('0x43'),'id'])||{});}})[_0x3075('0x20')](respondWithResult(_0x528091,null))[_0x3075('0x3e')](handleError(_0x528091,null));};exports['getConditions']=function(_0x3b0fdd,_0x436738,_0x3fa49f){var _0x3d1548={};var _0x38e144={};var _0x1d8e2a;var _0x496ec1;return db['Automation'][_0x3075('0x45')]({'where':{'id':_0x3b0fdd[_0x3075('0x3b')]['id']}})['then'](handleEntityNotFound(_0x436738,null))[_0x3075('0x20')](function(_0xc62089){if(_0xc62089){_0x1d8e2a=_0xc62089;_0x38e144[_0x3075('0x29')]=_[_0x3075('0x2b')](db[_0x3075('0x46')][_0x3075('0x27')]);_0x38e144[_0x3075('0x2a')]=_['keys'](_0x3b0fdd[_0x3075('0x2a')]);_0x38e144[_0x3075('0x2c')]=_[_0x3075('0x2d')](_0x38e144[_0x3075('0x29')],_0x38e144[_0x3075('0x2a')]);_0x3d1548[_0x3075('0x2e')]=_[_0x3075('0x2d')](_0x38e144[_0x3075('0x29')],qs[_0x3075('0x2f')](_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x2f')]));_0x3d1548[_0x3075('0x2e')]=_0x3d1548[_0x3075('0x2e')]['length']?_0x3d1548['attributes']:_0x38e144[_0x3075('0x29')];_0x3d1548[_0x3075('0x47')]=qs[_0x3075('0x48')](_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x48')]);_0x3d1548['where']=qs[_0x3075('0x2c')](_[_0x3075('0x49')](_0x3b0fdd[_0x3075('0x2a')],_0x38e144[_0x3075('0x2c')]));if(_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x32')]){_0x3d1548[_0x3075('0x33')]=_[_0x3075('0x36')](_0x3d1548['where'],{'$or':_[_0x3075('0x25')](_0x3d1548['attributes'],function(_0x4f4921){var _0x202472={};_0x202472[_0x4f4921]={'$like':'%'+_0x3b0fdd['query'][_0x3075('0x32')]+'%'};return _0x202472;})});}_0x3d1548=_['merge']({},_0x3d1548,_0x3b0fdd['options']);return _0x1d8e2a[_0x3075('0x4a')](_0x3d1548);}})[_0x3075('0x20')](function(_0x163ca0){if(_0x163ca0){_0x496ec1=_0x163ca0[_0x3075('0x30')];if(!_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x4b')]('nolimit')){_0x3d1548[_0x3075('0x1b')]=qs[_0x3075('0x1b')](_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x1b')]);_0x3d1548[_0x3075('0x18')]=qs[_0x3075('0x18')](_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x18')]);}return _0x1d8e2a[_0x3075('0x4a')](_0x3d1548);}})['then'](function(_0x57f709){if(_0x57f709){return _0x57f709?{'count':_0x496ec1,'rows':_0x57f709}:null;}})[_0x3075('0x20')](respondWithResult(_0x436738,null))[_0x3075('0x3e')](handleError(_0x436738,null));};exports[_0x3075('0x4c')]=function(_0x772d56,_0x1a2d52,_0x238c9f){return db[_0x3075('0x4d')]['find']({'where':{'id':_0x772d56[_0x3075('0x3b')]['id']}})[_0x3075('0x20')](handleEntityNotFound(_0x1a2d52,null))['then'](function(_0x3158be){if(_0x3158be){return _0x3158be[_0x3075('0x4c')](_0x772d56[_0x3075('0x40')][_0x3075('0x43')],_['omit'](_0x772d56[_0x3075('0x40')],[_0x3075('0x43'),'id'])||{});}})[_0x3075('0x20')](respondWithResult(_0x1a2d52,null))['catch'](handleError(_0x1a2d52,null));};exports[_0x3075('0x4e')]=function(_0x308671,_0x276c25,_0x598a22){var _0x5d0aec={};var _0x52d0c8={};var _0x48642f;var _0x274714;return db['Automation']['findOne']({'where':{'id':_0x308671['params']['id']}})[_0x3075('0x20')](handleEntityNotFound(_0x276c25,null))[_0x3075('0x20')](function(_0x109358){if(_0x109358){_0x48642f=_0x109358;_0x52d0c8[_0x3075('0x29')]=_[_0x3075('0x2b')](db[_0x3075('0x4d')][_0x3075('0x27')]);_0x52d0c8[_0x3075('0x2a')]=_[_0x3075('0x2b')](_0x308671[_0x3075('0x2a')]);_0x52d0c8['filters']=_[_0x3075('0x2d')](_0x52d0c8['model'],_0x52d0c8[_0x3075('0x2a')]);_0x5d0aec['attributes']=_[_0x3075('0x2d')](_0x52d0c8[_0x3075('0x29')],qs['fields'](_0x308671['query'][_0x3075('0x2f')]));_0x5d0aec[_0x3075('0x2e')]=_0x5d0aec[_0x3075('0x2e')][_0x3075('0x30')]?_0x5d0aec[_0x3075('0x2e')]:_0x52d0c8[_0x3075('0x29')];_0x5d0aec[_0x3075('0x47')]=qs[_0x3075('0x48')](_0x308671[_0x3075('0x2a')][_0x3075('0x48')]);_0x5d0aec[_0x3075('0x33')]=qs[_0x3075('0x2c')](_[_0x3075('0x49')](_0x308671['query'],_0x52d0c8['filters']));if(_0x308671['query'][_0x3075('0x32')]){_0x5d0aec[_0x3075('0x33')]=_[_0x3075('0x36')](_0x5d0aec['where'],{'$or':_['map'](_0x5d0aec['attributes'],function(_0x371615){var _0x15216c={};_0x15216c[_0x371615]={'$like':'%'+_0x308671[_0x3075('0x2a')][_0x3075('0x32')]+'%'};return _0x15216c;})});}_0x5d0aec=_[_0x3075('0x36')]({},_0x5d0aec,_0x308671['options']);return _0x48642f[_0x3075('0x4e')](_0x5d0aec);}})['then'](function(_0x3ceb3b){if(_0x3ceb3b){_0x274714=_0x3ceb3b[_0x3075('0x30')];if(!_0x308671[_0x3075('0x2a')][_0x3075('0x4b')](_0x3075('0x31'))){_0x5d0aec[_0x3075('0x1b')]=qs['limit'](_0x308671['query'][_0x3075('0x1b')]);_0x5d0aec['offset']=qs[_0x3075('0x18')](_0x308671['query'][_0x3075('0x18')]);}return _0x48642f[_0x3075('0x4e')](_0x5d0aec);}})[_0x3075('0x20')](function(_0xa13619){if(_0xa13619){return _0xa13619?{'count':_0x274714,'rows':_0xa13619}:null;}})[_0x3075('0x20')](respondWithResult(_0x276c25,null))[_0x3075('0x3e')](handleError(_0x276c25,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index ca02aaa..311b246 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 _0xba5a=['bluebird','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xba5a,0x110));var _0xaba5=function(_0x5ec365,_0x49930c){_0x5ec365=_0x5ec365-0x0;var _0xab187d=_0xba5a[_0x5ec365];return _0xab187d;};'use strict';var _=require(_0xaba5('0x0'));var util=require('util');var logger=require(_0xaba5('0x1'))(_0xaba5('0x2'));var moment=require('moment');var BPromise=require(_0xaba5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaba5('0x4'));var config=require(_0xaba5('0x5'));var attributes=require(_0xaba5('0x6'));module[_0xaba5('0x7')]=function(_0x279666,_0x82dd65){return _0x279666[_0xaba5('0x8')](_0xaba5('0x9'),attributes,{'tableName':_0xaba5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7efd=['Automation','tools_automations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x495ca6,_0x2bc5d4){var _0x3855c6=function(_0x838c01){while(--_0x838c01){_0x495ca6['push'](_0x495ca6['shift']());}};_0x3855c6(++_0x2bc5d4);}(_0x7efd,0x18e));var _0xd7ef=function(_0x1ba7f6,_0x4c763a){_0x1ba7f6=_0x1ba7f6-0x0;var _0x656e55=_0x7efd[_0x1ba7f6];return _0x656e55;};'use strict';var _=require('lodash');var util=require(_0xd7ef('0x0'));var logger=require(_0xd7ef('0x1'))(_0xd7ef('0x2'));var moment=require(_0xd7ef('0x3'));var BPromise=require(_0xd7ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7ef('0x5'));var rimraf=require(_0xd7ef('0x6'));var config=require(_0xd7ef('0x7'));var attributes=require('./automation.attributes');module[_0xd7ef('0x8')]=function(_0x159b40,_0x830234){return _0x159b40[_0xd7ef('0x9')](_0xd7ef('0xa'),attributes,{'tableName':_0xd7ef('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 913f599..c601102 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 _0x1c01=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x39e85c,_0x3bca61){var _0xf96780=function(_0x3b0708){while(--_0x3b0708){_0x39e85c['push'](_0x39e85c['shift']());}};_0xf96780(++_0x3bca61);}(_0x1c01,0x190));var _0x11c0=function(_0x1433a3,_0x11380c){_0x1433a3=_0x1433a3-0x0;var _0x463084=_0x1c01[_0x1433a3];return _0x463084;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var moment=require(_0x11c0('0x2'));var BPromise=require(_0x11c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x11c0('0x5'))(_0x11c0('0x6'));var config=require(_0x11c0('0x7'));var jayson=require(_0x11c0('0x8'));var client=jayson[_0x11c0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b0c3,_0x599423,_0x1d0199){return new BPromise(function(_0x558a37,_0x127b2f){return client['request'](_0x41b0c3,_0x1d0199)[_0x11c0('0xa')](function(_0x5578e8){logger['info'](_0x11c0('0xb'),_0x599423,'request\x20sent');logger[_0x11c0('0xc')](_0x11c0('0xd'),_0x599423,_0x11c0('0xe'),JSON[_0x11c0('0xf')](_0x5578e8));if(_0x5578e8[_0x11c0('0x10')]){if(_0x5578e8['error'][_0x11c0('0x11')]===0x1f4){logger[_0x11c0('0x10')](_0x11c0('0xb'),_0x599423,_0x5578e8[_0x11c0('0x10')]['message']);return _0x127b2f(_0x5578e8['error'][_0x11c0('0x12')]);}logger[_0x11c0('0x10')](_0x11c0('0xb'),_0x599423,_0x5578e8[_0x11c0('0x10')][_0x11c0('0x12')]);return _0x558a37(_0x5578e8[_0x11c0('0x10')][_0x11c0('0x12')]);}else{logger['info'](_0x11c0('0xb'),_0x599423,'request\x20sent');_0x558a37(_0x5578e8[_0x11c0('0x13')]['message']);}})[_0x11c0('0x14')](function(_0x45131a){logger[_0x11c0('0x10')]('Automation,\x20%s,\x20%s',_0x599423,_0x45131a);_0x127b2f(_0x45131a);});});}
\ No newline at end of file
+var _0xbcff=['../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x19a7cb,_0x1384f7){var _0x455ed2=function(_0x4b6306){while(--_0x4b6306){_0x19a7cb['push'](_0x19a7cb['shift']());}};_0x455ed2(++_0x1384f7);}(_0xbcff,0x12e));var _0xfbcf=function(_0x13d65a,_0x285d92){_0x13d65a=_0x13d65a-0x0;var _0x74d27b=_0xbcff[_0x13d65a];return _0x74d27b;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var moment=require(_0xfbcf('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcf('0x3'));var fs=require('fs');var Redis=require(_0xfbcf('0x4'));var db=require(_0xfbcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbcf('0x6'))(_0xfbcf('0x7'));var config=require(_0xfbcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbcf('0x9')][_0xfbcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b87de,_0x51ee67,_0x470fa8){return new BPromise(function(_0x520d5f,_0x1481ba){return client['request'](_0x4b87de,_0x470fa8)[_0xfbcf('0xb')](function(_0xc63f23){logger['info']('Automation,\x20%s,\x20%s',_0x51ee67,_0xfbcf('0xc'));logger[_0xfbcf('0xd')](_0xfbcf('0xe'),_0x51ee67,_0xfbcf('0xc'),JSON['stringify'](_0xc63f23));if(_0xc63f23[_0xfbcf('0xf')]){if(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x10')]===0x1f4){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x1481ba(_0xc63f23['error'][_0xfbcf('0x12')]);}logger['error'](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x520d5f(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);}else{logger[_0xfbcf('0x13')](_0xfbcf('0x11'),_0x51ee67,_0xfbcf('0xc'));_0x520d5f(_0xc63f23[_0xfbcf('0x14')]['message']);}})[_0xfbcf('0x15')](function(_0xdb7a6a){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xdb7a6a);_0x1481ba(_0xdb7a6a);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 69f5986..0afe991 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 _0xc300=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','/:id/actions','getActions','post','addActions','put','delete','/:id','destroy','exports','multer','util'];(function(_0x36f19c,_0x5f2ab9){var _0x244075=function(_0x27971d){while(--_0x27971d){_0x36f19c['push'](_0x36f19c['shift']());}};_0x244075(++_0x5f2ab9);}(_0xc300,0x132));var _0x0c30=function(_0x23284c,_0x57bd57){_0x23284c=_0x23284c-0x0;var _0x3fdfbf=_0xc300[_0x23284c];return _0x3fdfbf;};'use strict';var multer=require(_0x0c30('0x0'));var util=require(_0x0c30('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c30('0x2'));var router=express[_0x0c30('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0c30('0x4'));var interaction=require(_0x0c30('0x5'));var config=require(_0x0c30('0x6'));var controller=require(_0x0c30('0x7'));router[_0x0c30('0x8')]('/',auth[_0x0c30('0x9')](),controller[_0x0c30('0xa')]);router[_0x0c30('0x8')]('/:id',auth[_0x0c30('0x9')](),controller[_0x0c30('0xb')]);router['get'](_0x0c30('0xc'),auth[_0x0c30('0x9')](),controller['getConditions']);router[_0x0c30('0x8')](_0x0c30('0xd'),auth[_0x0c30('0x9')](),controller[_0x0c30('0xe')]);router[_0x0c30('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c30('0xf')](_0x0c30('0xc'),auth['isAuthenticated'](),controller['addConditions']);router[_0x0c30('0xf')](_0x0c30('0xd'),auth[_0x0c30('0x9')](),controller[_0x0c30('0x10')]);router[_0x0c30('0x11')]('/:id',auth[_0x0c30('0x9')](),controller['update']);router[_0x0c30('0x12')](_0x0c30('0x13'),auth[_0x0c30('0x9')](),controller[_0x0c30('0x14')]);module[_0x0c30('0x15')]=router;
\ No newline at end of file
+var _0x607b=['getActions','create','addConditions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','get','/:id/conditions','getConditions','/:id/actions'];(function(_0xbf691b,_0x1abd86){var _0x25932e=function(_0x1f1c44){while(--_0x1f1c44){_0xbf691b['push'](_0xbf691b['shift']());}};_0x25932e(++_0x1abd86);}(_0x607b,0x18f));var _0xb607=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x607b[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xb607('0x0'));var util=require('util');var path=require(_0xb607('0x1'));var timeout=require(_0xb607('0x2'));var express=require(_0xb607('0x3'));var router=express[_0xb607('0x4')]();var fs_extra=require(_0xb607('0x5'));var auth=require(_0xb607('0x6'));var interaction=require(_0xb607('0x7'));var config=require(_0xb607('0x8'));var controller=require('./automation.controller');router['get']('/',auth[_0xb607('0x9')](),controller['index']);router['get'](_0xb607('0xa'),auth[_0xb607('0x9')](),controller['show']);router[_0xb607('0xb')](_0xb607('0xc'),auth[_0xb607('0x9')](),controller[_0xb607('0xd')]);router['get'](_0xb607('0xe'),auth[_0xb607('0x9')](),controller[_0xb607('0xf')]);router['post']('/',auth[_0xb607('0x9')](),controller[_0xb607('0x10')]);router['post'](_0xb607('0xc'),auth['isAuthenticated'](),controller[_0xb607('0x11')]);router['post'](_0xb607('0xe'),auth[_0xb607('0x9')](),controller['addActions']);router[_0xb607('0x12')](_0xb607('0xa'),auth[_0xb607('0x9')](),controller[_0xb607('0x13')]);router[_0xb607('0x14')](_0xb607('0xa'),auth[_0xb607('0x9')](),controller[_0xb607('0x15')]);module[_0xb607('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index dabb7c5..55e004e 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 _0x9da6=['#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x9da6,0xff));var _0x69da=function(_0x8f01e3,_0x17e763){_0x8f01e3=_0x8f01e3-0x0;var _0xf866d=_0x9da6[_0x8f01e3];return _0xf866d;};'use strict';var Sequelize=require(_0x69da('0x0'));module[_0x69da('0x1')]={'name':{'type':Sequelize[_0x69da('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x69da('0x3')](_0x69da('0x4')),'allowNull':![],'defaultValue':_0x69da('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x69da('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x69da('0x6')](0x4)[_0x69da('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x69da('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x69da('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'comment':_0x69da('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x69da('0x6')](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x69da('0xf')},'dialTimezone':{'type':Sequelize[_0x69da('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x69da('0x10'),_0x69da('0x11'),'onlyIfOpen'),'defaultValue':_0x69da('0x10')},'dialAMDActive':{'type':Sequelize[_0x69da('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x69da('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x69da('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x69da('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x69da('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x69da('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x69da('0x6')](0x5)[_0x69da('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x69da('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x69da('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x69da('0x3')]('DESC',_0x69da('0x17')),'defaultValue':_0x69da('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x69da('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x69da('0x19')},'dialCutDigit':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x69da('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x69da('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x69da('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x17c1=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','ASC','DESC','Random\x20Last\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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x17c1,0x184));var _0x117c=function(_0x1f279a,_0x1dd9d5){_0x1f279a=_0x1f279a-0x0;var _0x52f122=_0x17c1[_0x1f279a];return _0x52f122;};'use strict';var Sequelize=require(_0x117c('0x0'));module[_0x117c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x117c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x117c('0x3')),'allowNull':![],'defaultValue':_0x117c('0x3')},'description':{'type':Sequelize[_0x117c('0x4')]},'active':{'type':Sequelize[_0x117c('0x5')],'defaultValue':0x0,'comment':_0x117c('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x117c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x117c('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x117c('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x117c('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x117c('0x7')],'defaultValue':0x3,'comment':_0x117c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x117c('0xe')},'dialTimezone':{'type':Sequelize[_0x117c('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x117c('0x4')],'defaultValue':_0x117c('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x117c('0x10')](_0x117c('0x11'),_0x117c('0x12'),'onlyIfOpen'),'defaultValue':_0x117c('0x11')},'dialAMDActive':{'type':Sequelize[_0x117c('0x5')],'defaultValue':0x0,'comment':_0x117c('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x117c('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x117c('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x117c('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x117c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x117c('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x117c('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x117c('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x117c('0x10')]('DESC',_0x117c('0x1a')),'defaultValue':_0x117c('0x1b')},'dialPrefix':{'type':Sequelize[_0x117c('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x117c('0x1c')},'dialCutDigit':{'type':Sequelize[_0x117c('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index e64d3cd..0b64953 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 _0xd820=['params','includeAll','include','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','omit','createdAt','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','CampaignId','filter','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','phone\x20IS\x20NOT\x20NULL','into','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','Campaign','findAll','rows','catch','show'];(function(_0x138b26,_0x5bcac8){var _0x285001=function(_0x529618){while(--_0x529618){_0x138b26['push'](_0x138b26['shift']());}};_0x285001(++_0x5bcac8);}(_0xd820,0x16f));var _0x0d82=function(_0x15e0ad,_0x3626a4){_0x15e0ad=_0x15e0ad-0x0;var _0x5c4c30=_0xd820[_0x15e0ad];return _0x5c4c30;};'use strict';var emlformat=require(_0x0d82('0x0'));var rimraf=require(_0x0d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d82('0x2'));var rp=require(_0x0d82('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d82('0x4'));var util=require(_0x0d82('0x5'));var path=require(_0x0d82('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d82('0x7'));var fs=require('fs');var fs_extra=require(_0x0d82('0x8'));var _=require(_0x0d82('0x9'));var squel=require(_0x0d82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d82('0xb'));var deskjs=require(_0x0d82('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d82('0xd'));var Redis=require(_0x0d82('0xe'));var authService=require(_0x0d82('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d82('0x10'));var logger=require(_0x0d82('0x11'))(_0x0d82('0x12'));var utils=require(_0x0d82('0x13'));var config=require(_0x0d82('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x851dbc,_0x7fdd7a){_0x7fdd7a=_0x7fdd7a||0xcc;return function(_0x103e1d){if(_0x103e1d){return _0x851dbc['sendStatus'](_0x7fdd7a);}return _0x851dbc[_0x0d82('0x15')](_0x7fdd7a)[_0x0d82('0x16')]();};}function respondWithResult(_0x8fe5e1,_0x3ad9dd){_0x3ad9dd=_0x3ad9dd||0xc8;return function(_0x288020){if(_0x288020){return _0x8fe5e1[_0x0d82('0x15')](_0x3ad9dd)[_0x0d82('0x17')](_0x288020);}};}function respondWithFilteredResult(_0x39c982,_0x2b2d47){return function(_0x55415f){if(_0x55415f){var _0x1e9024=typeof _0x2b2d47['offset']===_0x0d82('0x18')&&typeof _0x2b2d47['limit']===_0x0d82('0x18');var _0x31397a=_0x55415f[_0x0d82('0x19')];var _0x3383d8=_0x1e9024?0x0:_0x2b2d47[_0x0d82('0x1a')];var _0x16f941=_0x1e9024?_0x55415f[_0x0d82('0x19')]:_0x2b2d47[_0x0d82('0x1a')]+_0x2b2d47[_0x0d82('0x1b')];var _0x1007be;if(_0x16f941>=_0x31397a){_0x16f941=_0x31397a;_0x1007be=0xc8;}else{_0x1007be=0xce;}_0x39c982[_0x0d82('0x15')](_0x1007be);return _0x39c982[_0x0d82('0x1c')](_0x0d82('0x1d'),_0x3383d8+'-'+_0x16f941+'/'+_0x31397a)[_0x0d82('0x17')](_0x55415f);}return null;};}function patchUpdates(_0x5a0e1c){return function(_0x517997){try{jsonpatch[_0x0d82('0x1e')](_0x517997,_0x5a0e1c,!![]);}catch(_0x365404){return BPromise[_0x0d82('0x1f')](_0x365404);}return _0x517997['save']();};}function saveUpdates(_0x5def00,_0x2e332d){return function(_0x20d5eb){if(_0x20d5eb){return _0x20d5eb[_0x0d82('0x20')](_0x5def00)[_0x0d82('0x21')](function(_0x1f99ba){return _0x1f99ba;});}return null;};}function removeEntity(_0x18c248,_0x4a2d4d){return function(_0xb04794){if(_0xb04794){return _0xb04794[_0x0d82('0x22')]()[_0x0d82('0x21')](function(){var _0x5beeec=_0xb04794[_0x0d82('0x23')]({'plain':!![]});var _0x105c9a=_0x0d82('0x24');return db['UserProfileResource'][_0x0d82('0x22')]({'where':{'type':_0x105c9a,'resourceId':_0x5beeec['id']}})[_0x0d82('0x21')](function(){return _0xb04794;});})[_0x0d82('0x21')](function(){_0x18c248['status'](0xcc)[_0x0d82('0x16')]();});}};}function handleEntityNotFound(_0xc4f851,_0x46751f){return function(_0x389623){if(!_0x389623){_0xc4f851[_0x0d82('0x25')](0x194);}return _0x389623;};}function handleError(_0x3dcbed,_0x578037){_0x578037=_0x578037||0x1f4;return function(_0x5fd0dd){logger[_0x0d82('0x26')](_0x5fd0dd[_0x0d82('0x27')]);if(_0x5fd0dd[_0x0d82('0x28')]){delete _0x5fd0dd['name'];}_0x3dcbed[_0x0d82('0x15')](_0x578037)[_0x0d82('0x29')](_0x5fd0dd);};}exports[_0x0d82('0x2a')]=function(_0x3db80d,_0x30477f){var _0x730ed9={},_0x37f7f9={},_0x4ae2ce={'count':0x0,'rows':[]};var _0x20e2a2=_[_0x0d82('0x2b')](db['Campaign'][_0x0d82('0x2c')],function(_0x55b457){return{'name':_0x55b457[_0x0d82('0x2d')],'type':_0x55b457[_0x0d82('0x2e')][_0x0d82('0x2f')]};});_0x37f7f9['model']=_[_0x0d82('0x2b')](_0x20e2a2,_0x0d82('0x28'));_0x37f7f9[_0x0d82('0x30')]=_['keys'](_0x3db80d[_0x0d82('0x30')]);_0x37f7f9[_0x0d82('0x31')]=_[_0x0d82('0x32')](_0x37f7f9['model'],_0x37f7f9[_0x0d82('0x30')]);_0x730ed9[_0x0d82('0x33')]=_['intersection'](_0x37f7f9[_0x0d82('0x34')],qs['fields'](_0x3db80d[_0x0d82('0x30')][_0x0d82('0x35')]));_0x730ed9[_0x0d82('0x33')]=_0x730ed9[_0x0d82('0x33')][_0x0d82('0x36')]?_0x730ed9[_0x0d82('0x33')]:_0x37f7f9[_0x0d82('0x34')];if(!_0x3db80d[_0x0d82('0x30')][_0x0d82('0x37')](_0x0d82('0x38'))){_0x730ed9[_0x0d82('0x1b')]=qs[_0x0d82('0x1b')](_0x3db80d[_0x0d82('0x30')][_0x0d82('0x1b')]);_0x730ed9[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x3db80d[_0x0d82('0x30')][_0x0d82('0x1a')]);}_0x730ed9[_0x0d82('0x39')]=qs[_0x0d82('0x3a')](_0x3db80d[_0x0d82('0x30')]['sort']);_0x730ed9[_0x0d82('0x3b')]=qs['filters'](_[_0x0d82('0x3c')](_0x3db80d[_0x0d82('0x30')],_0x37f7f9[_0x0d82('0x31')]),_0x20e2a2);if(_0x3db80d['query']['filter']){_0x730ed9[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x730ed9[_0x0d82('0x3b')],{'$or':_[_0x0d82('0x2b')](_0x20e2a2,function(_0x51d103){if(_0x51d103[_0x0d82('0x2e')]!=='VIRTUAL'){var _0x124cd6={};_0x124cd6[_0x51d103[_0x0d82('0x28')]]={'$like':'%'+_0x3db80d[_0x0d82('0x30')]['filter']+'%'};return _0x124cd6;}})});}_0x730ed9=_[_0x0d82('0x3d')]({},_0x730ed9,_0x3db80d[_0x0d82('0x3e')]);var _0x116fef={'where':_0x730ed9[_0x0d82('0x3b')]};return db[_0x0d82('0x3f')]['count'](_0x116fef)[_0x0d82('0x21')](function(_0x244db0){_0x4ae2ce[_0x0d82('0x19')]=_0x244db0;if(_0x3db80d[_0x0d82('0x30')]['includeAll']){_0x730ed9['include']=[{'all':!![]}];}return db[_0x0d82('0x3f')][_0x0d82('0x40')](_0x730ed9);})['then'](function(_0x45e109){_0x4ae2ce[_0x0d82('0x41')]=_0x45e109;return _0x4ae2ce;})['then'](respondWithFilteredResult(_0x30477f,_0x730ed9))[_0x0d82('0x42')](handleError(_0x30477f,null));};exports[_0x0d82('0x43')]=function(_0x50248b,_0xc0f038){var _0x1089a2={'raw':![],'where':{'id':_0x50248b[_0x0d82('0x44')]['id']}},_0x4768a5={};_0x4768a5['model']=_['keys'](db['Campaign'][_0x0d82('0x2c')]);_0x4768a5[_0x0d82('0x30')]=_['keys'](_0x50248b['query']);_0x4768a5[_0x0d82('0x31')]=_['intersection'](_0x4768a5[_0x0d82('0x34')],_0x4768a5['query']);_0x1089a2[_0x0d82('0x33')]=_[_0x0d82('0x32')](_0x4768a5[_0x0d82('0x34')],qs['fields'](_0x50248b[_0x0d82('0x30')][_0x0d82('0x35')]));_0x1089a2[_0x0d82('0x33')]=_0x1089a2[_0x0d82('0x33')]['length']?_0x1089a2[_0x0d82('0x33')]:_0x4768a5[_0x0d82('0x34')];if(_0x50248b[_0x0d82('0x30')][_0x0d82('0x45')]){_0x1089a2[_0x0d82('0x46')]=[{'all':!![]}];}_0x1089a2=_['merge']({},_0x1089a2,_0x50248b[_0x0d82('0x3e')]);return db[_0x0d82('0x3f')][_0x0d82('0x47')](_0x1089a2)['then'](handleEntityNotFound(_0xc0f038,null))[_0x0d82('0x21')](respondWithResult(_0xc0f038,null))[_0x0d82('0x42')](handleError(_0xc0f038,null));};exports[_0x0d82('0x48')]=function(_0x7dff5a,_0x55461e){return db[_0x0d82('0x3f')]['create'](_0x7dff5a[_0x0d82('0x49')],{})['then'](function(_0x315125){var _0x3fd517=_0x7dff5a['user']['get']({'plain':!![]});if(!_0x3fd517)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fd517[_0x0d82('0x4a')]==='user'){var _0x2475b1=_0x315125[_0x0d82('0x23')]({'plain':!![]});var _0x22d539='IvrCampaigns';return db[_0x0d82('0x4b')]['find']({'where':{'name':_0x22d539,'userProfileId':_0x3fd517[_0x0d82('0x4c')]},'raw':!![]})[_0x0d82('0x21')](function(_0x29db52){if(_0x29db52&&_0x29db52[_0x0d82('0x4d')]===0x0){return db[_0x0d82('0x4e')][_0x0d82('0x48')]({'name':_0x2475b1['name'],'resourceId':_0x2475b1['id'],'type':_0x29db52['name'],'sectionId':_0x29db52['id']},{})['then'](function(){return _0x315125;});}else{return _0x315125;}})[_0x0d82('0x42')](function(_0x2e32d0){logger[_0x0d82('0x26')](_0x0d82('0x4f'),_0x2e32d0);throw _0x2e32d0;});}return _0x315125;})[_0x0d82('0x21')](respondWithResult(_0x55461e,0xc9))[_0x0d82('0x42')](handleError(_0x55461e,null));};exports[_0x0d82('0x50')]=function(_0x7cbaf6,_0x2020f6){var _0xba38d7={'where':{'id':_0x7cbaf6[_0x0d82('0x44')]['id']}},_0x35172c={};_0x35172c[_0x0d82('0x34')]=_[_0x0d82('0x51')](db[_0x0d82('0x3f')][_0x0d82('0x2c')]);_0xba38d7['attributes']=_[_0x0d82('0x32')](_0x35172c[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x7cbaf6[_0x0d82('0x30')][_0x0d82('0x35')]));_0xba38d7[_0x0d82('0x33')]=_0xba38d7['attributes'][_0x0d82('0x36')]?_0xba38d7[_0x0d82('0x33')]:_0x35172c[_0x0d82('0x34')];if(_0x7cbaf6[_0x0d82('0x30')][_0x0d82('0x45')]){_0xba38d7['include']=[{'all':!![]}];}_0xba38d7=_[_0x0d82('0x3d')]({},_0xba38d7,_0x7cbaf6[_0x0d82('0x3e')]);return db['Campaign']['find'](_0xba38d7)[_0x0d82('0x21')](handleEntityNotFound(_0x2020f6,null))[_0x0d82('0x21')](function(_0x1d1dce){if(_0x1d1dce){var _0x924fc7=_0x1d1dce[_0x0d82('0x23')]({'plain':!![]});_0x924fc7=qs[_0x0d82('0x52')](_0x924fc7,['id',_0x0d82('0x53'),_0x0d82('0x54')]);_0x7cbaf6['body']=_[_0x0d82('0x52')](_0x7cbaf6['body'],['id',_0x0d82('0x53'),_0x0d82('0x54')]);return db[_0x0d82('0x3f')][_0x0d82('0x48')](_[_0x0d82('0x3d')](_0x924fc7,_0x7cbaf6['body']),{'include':_0x7cbaf6[_0x0d82('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x0d82('0x21')](function(_0x32ec72){var _0x2757e0=_0x7cbaf6[_0x0d82('0x55')][_0x0d82('0x23')]({'plain':!![]});if(!_0x2757e0)throw new Error(_0x0d82('0x56'));if(_0x2757e0['role']===_0x0d82('0x55')){var _0x34daea=_0x32ec72[_0x0d82('0x23')]({'plain':!![]});var _0x1eefd9=_0x0d82('0x24');return db[_0x0d82('0x4b')]['find']({'where':{'name':_0x1eefd9,'userProfileId':_0x2757e0[_0x0d82('0x4c')]},'raw':!![]})[_0x0d82('0x21')](function(_0x5557c2){if(_0x5557c2&&_0x5557c2[_0x0d82('0x4d')]===0x0){return db[_0x0d82('0x4e')][_0x0d82('0x48')]({'name':_0x34daea[_0x0d82('0x28')],'resourceId':_0x34daea['id'],'type':_0x5557c2[_0x0d82('0x28')],'sectionId':_0x5557c2['id']},{})['then'](function(){return _0x32ec72;});}else{return _0x32ec72;}})[_0x0d82('0x42')](function(_0x341a76){logger['error'](_0x0d82('0x4f'),_0x341a76);throw _0x341a76;});}return _0x32ec72;});}})['then'](respondWithResult(_0x2020f6,0xc9))[_0x0d82('0x42')](handleError(_0x2020f6,null));};exports[_0x0d82('0x20')]=function(_0x2cbbb8,_0x2d7875){if(_0x2cbbb8[_0x0d82('0x49')]['id']){delete _0x2cbbb8[_0x0d82('0x49')]['id'];}return db['Campaign'][_0x0d82('0x47')]({'where':{'id':_0x2cbbb8['params']['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x2d7875,null))[_0x0d82('0x21')](saveUpdates(_0x2cbbb8['body'],null))[_0x0d82('0x21')](respondWithResult(_0x2d7875,null))[_0x0d82('0x42')](handleError(_0x2d7875,null));};exports[_0x0d82('0x22')]=function(_0x31a389,_0x216e12){return db[_0x0d82('0x3f')][_0x0d82('0x47')]({'where':{'id':_0x31a389[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x216e12,null))['then'](removeEntity(_0x216e12,null))['catch'](handleError(_0x216e12,null));};exports[_0x0d82('0x57')]=function(_0x23946d,_0x47e2bc,_0x45a836){var _0x33c0f8={'raw':!![],'where':{}};var _0x2542d8={};var _0x413ee2={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x23946d[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x47e2bc,null))[_0x0d82('0x21')](function(_0x5958a1){if(_0x5958a1){_0x2542d8['model']=_[_0x0d82('0x51')](db[_0x0d82('0x58')][_0x0d82('0x2c')]);_0x2542d8['query']=_[_0x0d82('0x51')](_0x23946d[_0x0d82('0x30')]);_0x2542d8['filters']=_['intersection'](_0x2542d8['model'],_0x2542d8[_0x0d82('0x30')]);_0x33c0f8['attributes']=_[_0x0d82('0x32')](_0x2542d8[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x23946d[_0x0d82('0x30')][_0x0d82('0x35')]));_0x33c0f8[_0x0d82('0x33')]=_0x33c0f8[_0x0d82('0x33')]['length']?_0x33c0f8[_0x0d82('0x33')]:_0x2542d8[_0x0d82('0x34')];if(!_0x23946d['query']['hasOwnProperty'](_0x0d82('0x38'))){_0x33c0f8[_0x0d82('0x1b')]=qs['limit'](_0x23946d['query'][_0x0d82('0x1b')]);_0x33c0f8[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x23946d[_0x0d82('0x30')][_0x0d82('0x1a')]);}_0x33c0f8['order']=qs['sort'](_0x23946d[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x33c0f8[_0x0d82('0x3b')]=qs[_0x0d82('0x31')](_[_0x0d82('0x3c')](_0x23946d[_0x0d82('0x30')],_0x2542d8['filters']));_0x33c0f8[_0x0d82('0x3b')][_0x0d82('0x59')]=_0x5958a1['id'];if(_0x23946d[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x33c0f8[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x33c0f8[_0x0d82('0x3b')],{'$or':_[_0x0d82('0x2b')](_0x33c0f8['attributes'],function(_0x27108c){var _0x1fc992={};_0x1fc992[_0x27108c]={'$like':'%'+_0x23946d[_0x0d82('0x30')]['filter']+'%'};return _0x1fc992;})});}_0x33c0f8=_[_0x0d82('0x3d')]({},_0x33c0f8,_0x23946d[_0x0d82('0x3e')]);return db['CmHopper'][_0x0d82('0x19')]({'where':_0x33c0f8['where']})[_0x0d82('0x21')](function(_0x5bf58a){_0x413ee2['count']=_0x5bf58a;if(_0x23946d[_0x0d82('0x30')]['includeAll']){_0x33c0f8[_0x0d82('0x46')]=[{'all':!![]}];}return db[_0x0d82('0x58')][_0x0d82('0x40')](_0x33c0f8);})['then'](function(_0x48ce2f){_0x413ee2[_0x0d82('0x41')]=_0x48ce2f;return _0x413ee2;});}})[_0x0d82('0x21')](respondWithFilteredResult(_0x47e2bc,_0x33c0f8))[_0x0d82('0x42')](handleError(_0x47e2bc,null));};exports[_0x0d82('0x5b')]=function(_0x58c321,_0x5d0329,_0x3240b5){var _0x12d52c={'raw':!![],'where':{}};var _0x38bc9a={};var _0x44a257={'count':0x0,'rows':[]};return db[_0x0d82('0x3f')][_0x0d82('0x5c')]({'where':{'id':_0x58c321['params']['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x5d0329,null))[_0x0d82('0x21')](function(_0x1bb5c0){if(_0x1bb5c0){_0x38bc9a[_0x0d82('0x34')]=_['keys'](db[_0x0d82('0x5d')][_0x0d82('0x2c')]);_0x38bc9a[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x58c321[_0x0d82('0x30')]);_0x38bc9a[_0x0d82('0x31')]=_[_0x0d82('0x32')](_0x38bc9a[_0x0d82('0x34')],_0x38bc9a['query']);_0x12d52c[_0x0d82('0x33')]=_[_0x0d82('0x32')](_0x38bc9a[_0x0d82('0x34')],qs['fields'](_0x58c321[_0x0d82('0x30')][_0x0d82('0x35')]));_0x12d52c[_0x0d82('0x33')]=_0x12d52c[_0x0d82('0x33')][_0x0d82('0x36')]?_0x12d52c[_0x0d82('0x33')]:_0x38bc9a[_0x0d82('0x34')];if(!_0x58c321[_0x0d82('0x30')][_0x0d82('0x37')](_0x0d82('0x38'))){_0x12d52c['limit']=qs[_0x0d82('0x1b')](_0x58c321['query'][_0x0d82('0x1b')]);_0x12d52c[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x58c321[_0x0d82('0x30')]['offset']);}_0x12d52c[_0x0d82('0x39')]=qs['sort'](_0x58c321[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x12d52c[_0x0d82('0x3b')]=qs[_0x0d82('0x31')](_[_0x0d82('0x3c')](_0x58c321[_0x0d82('0x30')],_0x38bc9a['filters']));_0x12d52c['where'][_0x0d82('0x59')]=_0x1bb5c0['id'];if(_0x58c321['query'][_0x0d82('0x5a')]){_0x12d52c['where']=_[_0x0d82('0x3d')](_0x12d52c['where'],{'$or':_[_0x0d82('0x2b')](_0x12d52c['attributes'],function(_0x419b3a){var _0x5250b9={};_0x5250b9[_0x419b3a]={'$like':'%'+_0x58c321[_0x0d82('0x30')][_0x0d82('0x5a')]+'%'};return _0x5250b9;})});}_0x12d52c=_[_0x0d82('0x3d')]({},_0x12d52c,_0x58c321[_0x0d82('0x3e')]);return db[_0x0d82('0x5d')][_0x0d82('0x19')]({'where':_0x12d52c[_0x0d82('0x3b')]})[_0x0d82('0x21')](function(_0xf6e55){_0x44a257[_0x0d82('0x19')]=_0xf6e55;if(_0x58c321[_0x0d82('0x30')][_0x0d82('0x45')]){_0x12d52c[_0x0d82('0x46')]=[{'all':!![]}];}return db[_0x0d82('0x5d')][_0x0d82('0x40')](_0x12d52c);})[_0x0d82('0x21')](function(_0x3def6b){_0x44a257[_0x0d82('0x41')]=_0x3def6b;return _0x44a257;});}})[_0x0d82('0x21')](respondWithFilteredResult(_0x5d0329,_0x12d52c))[_0x0d82('0x42')](handleError(_0x5d0329,null));};exports['getHopperFinals']=function(_0x399a95,_0x4a5736,_0x6a884){var _0x2e92f1={'raw':!![],'where':{}};var _0x1a4d74={};var _0x48009d={'count':0x0,'rows':[]};return db[_0x0d82('0x3f')]['findOne']({'where':{'id':_0x399a95['params']['id']}})['then'](handleEntityNotFound(_0x4a5736,null))[_0x0d82('0x21')](function(_0x26f5ee){if(_0x26f5ee){_0x1a4d74['model']=_[_0x0d82('0x51')](db[_0x0d82('0x5e')][_0x0d82('0x2c')]);_0x1a4d74[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x399a95[_0x0d82('0x30')]);_0x1a4d74[_0x0d82('0x31')]=_['intersection'](_0x1a4d74[_0x0d82('0x34')],_0x1a4d74[_0x0d82('0x30')]);_0x2e92f1[_0x0d82('0x33')]=_[_0x0d82('0x32')](_0x1a4d74[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x399a95['query'][_0x0d82('0x35')]));_0x2e92f1[_0x0d82('0x33')]=_0x2e92f1['attributes'][_0x0d82('0x36')]?_0x2e92f1[_0x0d82('0x33')]:_0x1a4d74[_0x0d82('0x34')];if(!_0x399a95[_0x0d82('0x30')][_0x0d82('0x37')]('nolimit')){_0x2e92f1[_0x0d82('0x1b')]=qs['limit'](_0x399a95[_0x0d82('0x30')]['limit']);_0x2e92f1[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x399a95['query'][_0x0d82('0x1a')]);}_0x2e92f1[_0x0d82('0x39')]=qs['sort'](_0x399a95[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x2e92f1[_0x0d82('0x3b')]=qs[_0x0d82('0x31')](_[_0x0d82('0x3c')](_0x399a95[_0x0d82('0x30')],_0x1a4d74[_0x0d82('0x31')]));_0x2e92f1[_0x0d82('0x3b')][_0x0d82('0x59')]=_0x26f5ee['id'];if(_0x399a95[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x2e92f1[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x2e92f1[_0x0d82('0x3b')],{'$or':_[_0x0d82('0x2b')](_0x2e92f1[_0x0d82('0x33')],function(_0x581239){var _0x2e1ebd={};_0x2e1ebd[_0x581239]={'$like':'%'+_0x399a95[_0x0d82('0x30')][_0x0d82('0x5a')]+'%'};return _0x2e1ebd;})});}_0x2e92f1=_['merge']({},_0x2e92f1,_0x399a95[_0x0d82('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x2e92f1[_0x0d82('0x3b')]})[_0x0d82('0x21')](function(_0x2e538f){_0x48009d[_0x0d82('0x19')]=_0x2e538f;if(_0x399a95[_0x0d82('0x30')][_0x0d82('0x45')]){_0x2e92f1[_0x0d82('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0d82('0x40')](_0x2e92f1);})[_0x0d82('0x21')](function(_0x4f6a38){_0x48009d[_0x0d82('0x41')]=_0x4f6a38;return _0x48009d;});}})[_0x0d82('0x21')](respondWithFilteredResult(_0x4a5736,_0x2e92f1))[_0x0d82('0x42')](handleError(_0x4a5736,null));};exports[_0x0d82('0x5f')]=function(_0x765e57,_0x4da48c,_0x39fd5b){var _0x2f2f94={'raw':!![],'where':{}};var _0x323e4={};var _0x371012={'count':0x0,'rows':[]};return db['Campaign'][_0x0d82('0x5c')]({'where':{'id':_0x765e57[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x4da48c,null))[_0x0d82('0x21')](function(_0x14cf87){if(_0x14cf87){_0x323e4[_0x0d82('0x34')]=_[_0x0d82('0x51')](db['CmHopperBlack'][_0x0d82('0x2c')]);_0x323e4[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x765e57['query']);_0x323e4['filters']=_[_0x0d82('0x32')](_0x323e4[_0x0d82('0x34')],_0x323e4['query']);_0x2f2f94['attributes']=_[_0x0d82('0x32')](_0x323e4[_0x0d82('0x34')],qs['fields'](_0x765e57[_0x0d82('0x30')][_0x0d82('0x35')]));_0x2f2f94[_0x0d82('0x33')]=_0x2f2f94[_0x0d82('0x33')][_0x0d82('0x36')]?_0x2f2f94[_0x0d82('0x33')]:_0x323e4['model'];if(!_0x765e57[_0x0d82('0x30')][_0x0d82('0x37')](_0x0d82('0x38'))){_0x2f2f94[_0x0d82('0x1b')]=qs[_0x0d82('0x1b')](_0x765e57[_0x0d82('0x30')][_0x0d82('0x1b')]);_0x2f2f94[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x765e57['query'][_0x0d82('0x1a')]);}_0x2f2f94['order']=qs['sort'](_0x765e57['query'][_0x0d82('0x3a')]);_0x2f2f94[_0x0d82('0x3b')]=qs['filters'](_[_0x0d82('0x3c')](_0x765e57[_0x0d82('0x30')],_0x323e4['filters']));_0x2f2f94[_0x0d82('0x3b')]['CampaignId']=_0x14cf87['id'];if(_0x765e57[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x2f2f94[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x2f2f94[_0x0d82('0x3b')],{'$or':_['map'](_0x2f2f94['attributes'],function(_0x281b62){var _0x5d0d32={};_0x5d0d32[_0x281b62]={'$like':'%'+_0x765e57[_0x0d82('0x30')][_0x0d82('0x5a')]+'%'};return _0x5d0d32;})});}_0x2f2f94=_[_0x0d82('0x3d')]({},_0x2f2f94,_0x765e57[_0x0d82('0x3e')]);return db[_0x0d82('0x60')][_0x0d82('0x19')]({'where':_0x2f2f94['where']})['then'](function(_0x1e7d67){_0x371012[_0x0d82('0x19')]=_0x1e7d67;if(_0x765e57[_0x0d82('0x30')]['includeAll']){_0x2f2f94[_0x0d82('0x46')]=[{'all':!![]}];}return db[_0x0d82('0x60')]['findAll'](_0x2f2f94);})['then'](function(_0x203f66){_0x371012[_0x0d82('0x41')]=_0x203f66;return _0x371012;});}})[_0x0d82('0x21')](respondWithFilteredResult(_0x4da48c,_0x2f2f94))[_0x0d82('0x42')](handleError(_0x4da48c,null));};exports[_0x0d82('0x61')]=function(_0x5d2702,_0x158d08,_0x33f8e3){var _0x2a82a0={};var _0x2abaa0={};var _0x5bec95;var _0x46c48d;return db['Campaign'][_0x0d82('0x5c')]({'where':{'id':_0x5d2702[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x158d08,null))[_0x0d82('0x21')](function(_0x450b10){if(_0x450b10){_0x5bec95=_0x450b10;_0x2abaa0[_0x0d82('0x34')]=_[_0x0d82('0x51')](db[_0x0d82('0x62')][_0x0d82('0x2c')]);_0x2abaa0[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x5d2702[_0x0d82('0x30')]);_0x2abaa0[_0x0d82('0x31')]=_[_0x0d82('0x32')](_0x2abaa0[_0x0d82('0x34')],_0x2abaa0['query']);_0x2a82a0[_0x0d82('0x33')]=_[_0x0d82('0x32')](_0x2abaa0[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x5d2702[_0x0d82('0x30')][_0x0d82('0x35')]));_0x2a82a0[_0x0d82('0x33')]=_0x2a82a0[_0x0d82('0x33')][_0x0d82('0x36')]?_0x2a82a0['attributes']:_0x2abaa0[_0x0d82('0x34')];_0x2a82a0[_0x0d82('0x39')]=qs[_0x0d82('0x3a')](_0x5d2702[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x2a82a0['where']=qs[_0x0d82('0x31')](_[_0x0d82('0x3c')](_0x5d2702[_0x0d82('0x30')],_0x2abaa0[_0x0d82('0x31')]));if(_0x5d2702[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x2a82a0[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x2a82a0[_0x0d82('0x3b')],{'$or':_[_0x0d82('0x2b')](_0x2a82a0[_0x0d82('0x33')],function(_0x729ec4){var _0x3abc1b={};_0x3abc1b[_0x729ec4]={'$like':'%'+_0x5d2702['query'][_0x0d82('0x5a')]+'%'};return _0x3abc1b;})});}_0x2a82a0=_['merge']({},_0x2a82a0,_0x5d2702['options']);return _0x5bec95[_0x0d82('0x61')](_0x2a82a0);}})[_0x0d82('0x21')](function(_0x23efb3){if(_0x23efb3){_0x46c48d=_0x23efb3[_0x0d82('0x36')];if(!_0x5d2702[_0x0d82('0x30')][_0x0d82('0x37')](_0x0d82('0x38'))){_0x2a82a0['limit']=qs[_0x0d82('0x1b')](_0x5d2702[_0x0d82('0x30')][_0x0d82('0x1b')]);_0x2a82a0['offset']=qs[_0x0d82('0x1a')](_0x5d2702[_0x0d82('0x30')][_0x0d82('0x1a')]);}return _0x5bec95[_0x0d82('0x61')](_0x2a82a0);}})['then'](function(_0x28c1ed){if(_0x28c1ed){return _0x28c1ed?{'count':_0x46c48d,'rows':_0x28c1ed}:null;}})[_0x0d82('0x21')](respondWithResult(_0x158d08,null))[_0x0d82('0x42')](handleError(_0x158d08,null));};exports[_0x0d82('0x63')]=function(_0x1e1a08,_0x4bc2fe,_0x367c0e){var _0x37bf7e,_0x362972;var _0x85588a=[];var _0x3f0fc8=moment()[_0x0d82('0x64')](_0x0d82('0x65'));return db['Campaign'][_0x0d82('0x47')]({'where':{'id':_0x1e1a08[_0x0d82('0x44')]['id']}})['then'](handleEntityNotFound(_0x4bc2fe,null))['then'](function(_0x4de527){if(_0x4de527){_0x362972=_0x4de527;return _0x4de527[_0x0d82('0x63')](_0x1e1a08['body'][_0x0d82('0x66')],_['omit'](_0x1e1a08[_0x0d82('0x49')],['ids','id'])||{});}return null;})[_0x0d82('0x67')](function(_0x9802c3){var _0x3a84ed;var _0x170515;_0x37bf7e=_0x9802c3||[];var _0x377bbf=[];if(_0x9802c3){for(var _0x3a2d8e=0x0;_0x3a2d8e<_0x9802c3[_0x0d82('0x36')];_0x3a2d8e+=0x1){var _0x14f350=_0x9802c3[_0x3a2d8e][_0x0d82('0x23')]({'plain':!![]});_0x362972[_0x0d82('0x68')]=_0x1e1a08['body']['dialCheckDuplicateType']?_0x1e1a08['body'][_0x0d82('0x68')]:_0x362972[_0x0d82('0x68')];switch(_0x362972[_0x0d82('0x68')]){case'always':_0x3a84ed=squel[_0x0d82('0x69')]()['into'](_0x0d82('0x6a'))[_0x0d82('0x6b')]([_0x0d82('0x6c'),'scheduledAt',_0x0d82('0x6d'),_0x0d82('0x6e'),_0x0d82('0x59'),_0x0d82('0x53'),_0x0d82('0x54')],squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x6c'),_0x0d82('0x6c'))['field'](_0x0d82('0x71'),_0x0d82('0x72'))['field']('id',_0x0d82('0x6d'))['field'](_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')](),_0x0d82('0x6e'))['field'](_0x1e1a08[_0x0d82('0x44')]['id']['toString'](),_0x0d82('0x59'))['field']('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x53'))[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x54'))[_0x0d82('0x75')]('cm_contacts')[_0x0d82('0x3b')](_0x0d82('0x76'))['where'](_0x0d82('0x77'),_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')]())[_0x0d82('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x0d82('0x3b')](_0x0d82('0x78'),squel['select']()[_0x0d82('0x70')](_0x0d82('0x79'))['from'](_0x0d82('0x7a'))[_0x0d82('0x3b')]('CampaignId\x20=\x20?',_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')]()))[_0x0d82('0x3b')](_0x0d82('0x78'),squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x7b'))[_0x0d82('0x75')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')]())))['toString']();break;case _0x0d82('0x7c'):_0x3a84ed=squel[_0x0d82('0x69')]()['into'](_0x0d82('0x6a'))[_0x0d82('0x6b')](['phone',_0x0d82('0x72'),'ContactId',_0x0d82('0x6e'),'CampaignId',_0x0d82('0x53'),_0x0d82('0x54')],squel['select']()[_0x0d82('0x70')](_0x0d82('0x6c'),'phone')[_0x0d82('0x70')](_0x0d82('0x71'),_0x0d82('0x72'))['field']('id',_0x0d82('0x6d'))['field'](_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')](),_0x0d82('0x6e'))[_0x0d82('0x70')](_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')](),'CampaignId')[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x53'))[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x54'))[_0x0d82('0x75')](_0x0d82('0x7d'))[_0x0d82('0x3b')](_0x0d82('0x76'))['where'](_0x0d82('0x77'),_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')]())[_0x0d82('0x3b')](_0x0d82('0x7e'))[_0x0d82('0x3b')](_0x0d82('0x78'),squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x7b'))['from'](_0x0d82('0x6a'))[_0x0d82('0x3b')]('CampaignId\x20=\x20?',_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')]())))['toString']();break;default:_0x3a84ed=squel[_0x0d82('0x69')]()[_0x0d82('0x7f')]('cm_hopper')['fromQuery']([_0x0d82('0x6c'),_0x0d82('0x72'),_0x0d82('0x6d'),'ListId',_0x0d82('0x59'),_0x0d82('0x53'),_0x0d82('0x54')],squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x6c'),_0x0d82('0x6c'))[_0x0d82('0x70')](_0x0d82('0x71'),_0x0d82('0x72'))[_0x0d82('0x70')]('id','ContactId')[_0x0d82('0x70')](_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')](),'ListId')['field'](_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')](),_0x0d82('0x59'))[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27','createdAt')[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x54'))['from'](_0x0d82('0x7d'))[_0x0d82('0x3b')](_0x0d82('0x76'))[_0x0d82('0x3b')](_0x0d82('0x77'),_0x14f350['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d82('0x74')]();}_0x170515=squel['insert']()[_0x0d82('0x7f')](_0x0d82('0x80'))[_0x0d82('0x6b')](['cmHopperId',_0x0d82('0x72'),'phone',_0x0d82('0x81'),'createdAt',_0x0d82('0x54')],squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x82'),'id')['field'](_0x0d82('0x71'),_0x0d82('0x72'))[_0x0d82('0x70')](_0x0d82('0x83'),'phone')[_0x0d82('0x70')](_0x0d82('0x84'),_0x0d82('0x81'))['field']('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x53'))[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x54'))[_0x0d82('0x75')]('cm_contact_has_items','ci')[_0x0d82('0x85')]('cm_hopper','h',_0x0d82('0x86'))[_0x0d82('0x3b')](_0x0d82('0x87'),_0x14f350['CmListId']['toString']())[_0x0d82('0x3b')]('h.CampaignId=?',_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')]())['where'](_0x0d82('0x88'),_0x3f0fc8))[_0x0d82('0x74')]();_0x377bbf[_0x0d82('0x89')](db[_0x0d82('0x8a')][_0x0d82('0x30')](_0x3a84ed));_0x85588a[_0x0d82('0x89')](db[_0x0d82('0x8a')][_0x0d82('0x30')](_0x170515));}return BPromise[_0x0d82('0x8b')](_0x377bbf);}})[_0x0d82('0x21')](function(){return BPromise[_0x0d82('0x8b')](_0x85588a);})[_0x0d82('0x21')](function(){return _0x37bf7e;})['then'](respondWithResult(_0x4bc2fe,null))['catch'](handleError(_0x4bc2fe,null));};exports['removeLists']=function(_0x430e86,_0x5b9b5e,_0x54a35c){return db[_0x0d82('0x3f')][_0x0d82('0x47')]({'where':{'id':_0x430e86[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x5b9b5e,null))[_0x0d82('0x21')](function(_0x2136c4){if(_0x2136c4){return _0x2136c4[_0x0d82('0x8c')](_0x430e86[_0x0d82('0x30')][_0x0d82('0x66')]);}})[_0x0d82('0x21')](function(_0x12ceec){if(_0x12ceec){return db[_0x0d82('0x58')][_0x0d82('0x22')]({'where':{'ListId':_0x430e86[_0x0d82('0x30')][_0x0d82('0x66')],'CampaignId':_0x430e86['params']['id']}})[_0x0d82('0x21')](function(){return _0x12ceec;});}})[_0x0d82('0x21')](respondWithStatusCode(_0x5b9b5e,null))[_0x0d82('0x42')](handleError(_0x5b9b5e,null));};exports['getBlackLists']=function(_0x35ef66,_0x12adcb,_0x47fbdb){var _0x4d7a44={};var _0x22d6a1={};var _0x3d9b77;var _0x36c438;return db[_0x0d82('0x3f')]['findOne']({'where':{'id':_0x35ef66['params']['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x12adcb,null))[_0x0d82('0x21')](function(_0x56d2f7){if(_0x56d2f7){_0x3d9b77=_0x56d2f7;_0x22d6a1[_0x0d82('0x34')]=_[_0x0d82('0x51')](db[_0x0d82('0x62')][_0x0d82('0x2c')]);_0x22d6a1[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x35ef66[_0x0d82('0x30')]);_0x22d6a1[_0x0d82('0x31')]=_[_0x0d82('0x32')](_0x22d6a1[_0x0d82('0x34')],_0x22d6a1[_0x0d82('0x30')]);_0x4d7a44['attributes']=_[_0x0d82('0x32')](_0x22d6a1[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x35ef66[_0x0d82('0x30')][_0x0d82('0x35')]));_0x4d7a44[_0x0d82('0x33')]=_0x4d7a44[_0x0d82('0x33')][_0x0d82('0x36')]?_0x4d7a44['attributes']:_0x22d6a1[_0x0d82('0x34')];_0x4d7a44[_0x0d82('0x39')]=qs[_0x0d82('0x3a')](_0x35ef66[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x4d7a44['where']=qs[_0x0d82('0x31')](_['pick'](_0x35ef66[_0x0d82('0x30')],_0x22d6a1[_0x0d82('0x31')]));if(_0x35ef66[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x4d7a44[_0x0d82('0x3b')]=_['merge'](_0x4d7a44[_0x0d82('0x3b')],{'$or':_['map'](_0x4d7a44['attributes'],function(_0x5ad7ee){var _0x15e754={};_0x15e754[_0x5ad7ee]={'$like':'%'+_0x35ef66['query']['filter']+'%'};return _0x15e754;})});}_0x4d7a44=_[_0x0d82('0x3d')]({},_0x4d7a44,_0x35ef66[_0x0d82('0x3e')]);return _0x3d9b77['getBlackLists'](_0x4d7a44);}})['then'](function(_0x282361){if(_0x282361){_0x36c438=_0x282361['length'];if(!_0x35ef66[_0x0d82('0x30')]['hasOwnProperty'](_0x0d82('0x38'))){_0x4d7a44[_0x0d82('0x1b')]=qs['limit'](_0x35ef66[_0x0d82('0x30')][_0x0d82('0x1b')]);_0x4d7a44['offset']=qs[_0x0d82('0x1a')](_0x35ef66[_0x0d82('0x30')]['offset']);}return _0x3d9b77[_0x0d82('0x8d')](_0x4d7a44);}})[_0x0d82('0x21')](function(_0x4f09ef){if(_0x4f09ef){return _0x4f09ef?{'count':_0x36c438,'rows':_0x4f09ef}:null;}})[_0x0d82('0x21')](respondWithResult(_0x12adcb,null))[_0x0d82('0x42')](handleError(_0x12adcb,null));};exports[_0x0d82('0x8e')]=function(_0x597113,_0x16eb56,_0x9e468d){var _0x5df13e,_0x2d29be;var _0x4fbbf5=[];var _0x7fb2da=moment()[_0x0d82('0x64')](_0x0d82('0x65'));return db[_0x0d82('0x3f')][_0x0d82('0x47')]({'where':{'id':_0x597113[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x16eb56,null))[_0x0d82('0x21')](function(_0x34c443){if(_0x34c443){_0x2d29be=_0x34c443;return _0x34c443[_0x0d82('0x8e')](_0x597113[_0x0d82('0x49')][_0x0d82('0x66')],_['omit'](_0x597113[_0x0d82('0x49')],[_0x0d82('0x66'),'id'])||{});}return null;})[_0x0d82('0x67')](function(_0x2d5ce9){var _0xc30053;var _0x2df72d;_0x5df13e=_0x2d5ce9||[];var _0x56527f=[];if(_0x2d5ce9){for(var _0x299ebe=0x0;_0x299ebe<_0x2d5ce9[_0x0d82('0x36')];_0x299ebe+=0x1){var _0x57f83c=_0x2d5ce9[_0x299ebe][_0x0d82('0x23')]({'plain':!![]});_0xc30053=squel[_0x0d82('0x69')]()[_0x0d82('0x7f')](_0x0d82('0x8f'))[_0x0d82('0x6b')]([_0x0d82('0x6c'),_0x0d82('0x6d'),_0x0d82('0x6e'),_0x0d82('0x59'),_0x0d82('0x53'),_0x0d82('0x54')],squel['select']()[_0x0d82('0x70')]('phone',_0x0d82('0x6c'))[_0x0d82('0x70')]('id',_0x0d82('0x6d'))['field'](_0x57f83c['CmListId'][_0x0d82('0x74')](),_0x0d82('0x6e'))[_0x0d82('0x70')](_0x597113[_0x0d82('0x44')]['id'][_0x0d82('0x74')](),'CampaignId')[_0x0d82('0x70')](_0x0d82('0x71'),_0x0d82('0x53'))[_0x0d82('0x70')](_0x0d82('0x71'),'updatedAt')['from']('cm_contacts')[_0x0d82('0x3b')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x57f83c[_0x0d82('0x73')][_0x0d82('0x74')]())[_0x0d82('0x3b')](_0x0d82('0x7e')))[_0x0d82('0x74')]();_0x56527f['push'](db['sequelize'][_0x0d82('0x30')](_0xc30053));}return BPromise['all'](_0x56527f);}})[_0x0d82('0x21')](function(){return _0x5df13e;})[_0x0d82('0x21')](respondWithResult(_0x16eb56,null))[_0x0d82('0x42')](handleError(_0x16eb56,null));};exports[_0x0d82('0x90')]=function(_0x2ea2df,_0x61f297,_0x520ae5){return db['Campaign'][_0x0d82('0x47')]({'where':{'id':_0x2ea2df[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x61f297,null))[_0x0d82('0x21')](function(_0x33b527){if(_0x33b527){return _0x33b527[_0x0d82('0x90')](_0x2ea2df[_0x0d82('0x30')][_0x0d82('0x66')]);}})[_0x0d82('0x21')](function(_0x4b56e8){if(_0x4b56e8){return db[_0x0d82('0x60')][_0x0d82('0x22')]({'where':{'ListId':_0x2ea2df['query'][_0x0d82('0x66')],'CampaignId':_0x2ea2df[_0x0d82('0x44')]['id']}})['then'](function(){return _0x4b56e8;});}})[_0x0d82('0x21')](respondWithStatusCode(_0x61f297,null))[_0x0d82('0x42')](handleError(_0x61f297,null));};
\ No newline at end of file
+var _0x9bb4=['clone','createdAt','omit','updatedAt','user','error','getHoppers','findOne','CmHopper','hasOwnProperty','order','pick','CampaignId','findAll','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','cmHopperId','h.id','join','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','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','IvrCampaigns','UserProfileResource','destroy','stack','name','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x579acd,_0x9ea719){var _0xcd9df9=function(_0x1b634b){while(--_0x1b634b){_0x579acd['push'](_0x579acd['shift']());}};_0xcd9df9(++_0x9ea719);}(_0x9bb4,0xd5));var _0x49bb=function(_0x1198f3,_0x4b7a07){_0x1198f3=_0x1198f3-0x0;var _0x32ad65=_0x9bb4[_0x1198f3];return _0x32ad65;};'use strict';var emlformat=require(_0x49bb('0x0'));var rimraf=require(_0x49bb('0x1'));var zipdir=require(_0x49bb('0x2'));var jsonpatch=require(_0x49bb('0x3'));var rp=require(_0x49bb('0x4'));var moment=require(_0x49bb('0x5'));var BPromise=require(_0x49bb('0x6'));var Mustache=require(_0x49bb('0x7'));var util=require(_0x49bb('0x8'));var path=require('path');var sox=require(_0x49bb('0x9'));var csv=require(_0x49bb('0xa'));var ejs=require(_0x49bb('0xb'));var fs=require('fs');var fs_extra=require(_0x49bb('0xc'));var _=require('lodash');var squel=require(_0x49bb('0xd'));var crypto=require(_0x49bb('0xe'));var jsforce=require(_0x49bb('0xf'));var deskjs=require(_0x49bb('0x10'));var toCsv=require(_0x49bb('0xa'));var querystring=require('querystring');var Papa=require(_0x49bb('0x11'));var Redis=require('ioredis');var authService=require(_0x49bb('0x12'));var qs=require(_0x49bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49bb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x49bb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x49bb('0x16'));var db=require(_0x49bb('0x17'))['db'];function respondWithStatusCode(_0xfab080,_0x3b85fc){_0x3b85fc=_0x3b85fc||0xcc;return function(_0x1ff6d1){if(_0x1ff6d1){return _0xfab080[_0x49bb('0x18')](_0x3b85fc);}return _0xfab080[_0x49bb('0x19')](_0x3b85fc)[_0x49bb('0x1a')]();};}function respondWithResult(_0x3beb36,_0x59472f){_0x59472f=_0x59472f||0xc8;return function(_0x13c850){if(_0x13c850){return _0x3beb36['status'](_0x59472f)[_0x49bb('0x1b')](_0x13c850);}};}function respondWithFilteredResult(_0x1f7573,_0x1f0210){return function(_0x230f20){if(_0x230f20){var _0x145d52=typeof _0x1f0210[_0x49bb('0x1c')]===_0x49bb('0x1d')&&typeof _0x1f0210[_0x49bb('0x1e')]==='undefined';var _0x2d76be=_0x230f20[_0x49bb('0x1f')];var _0x5b45c0=_0x145d52?0x0:_0x1f0210[_0x49bb('0x1c')];var _0x3d41f2=_0x145d52?_0x230f20['count']:_0x1f0210[_0x49bb('0x1c')]+_0x1f0210[_0x49bb('0x1e')];var _0x4af5e0;if(_0x3d41f2>=_0x2d76be){_0x3d41f2=_0x2d76be;_0x4af5e0=0xc8;}else{_0x4af5e0=0xce;}_0x1f7573[_0x49bb('0x19')](_0x4af5e0);return _0x1f7573[_0x49bb('0x20')]('Content-Range',_0x5b45c0+'-'+_0x3d41f2+'/'+_0x2d76be)[_0x49bb('0x1b')](_0x230f20);}return null;};}function patchUpdates(_0x5387ed){return function(_0x1728e9){try{jsonpatch['apply'](_0x1728e9,_0x5387ed,!![]);}catch(_0x47918a){return BPromise[_0x49bb('0x21')](_0x47918a);}return _0x1728e9['save']();};}function saveUpdates(_0x5b18f0,_0x16b8fa){return function(_0x1ade8b){if(_0x1ade8b){return _0x1ade8b[_0x49bb('0x22')](_0x5b18f0)[_0x49bb('0x23')](function(_0x4f2764){return _0x4f2764;});}return null;};}function removeEntity(_0x490c3e,_0x5cacdb){return function(_0x4eae24){if(_0x4eae24){return _0x4eae24['destroy']()[_0x49bb('0x23')](function(){var _0x570847=_0x4eae24['get']({'plain':!![]});var _0x6dac61=_0x49bb('0x24');return db[_0x49bb('0x25')][_0x49bb('0x26')]({'where':{'type':_0x6dac61,'resourceId':_0x570847['id']}})[_0x49bb('0x23')](function(){return _0x4eae24;});})['then'](function(){_0x490c3e[_0x49bb('0x19')](0xcc)[_0x49bb('0x1a')]();});}};}function handleEntityNotFound(_0x1a6afb,_0x712959){return function(_0x5370d7){if(!_0x5370d7){_0x1a6afb[_0x49bb('0x18')](0x194);}return _0x5370d7;};}function handleError(_0x3d025d,_0x3985a6){_0x3985a6=_0x3985a6||0x1f4;return function(_0x47540c){logger['error'](_0x47540c[_0x49bb('0x27')]);if(_0x47540c[_0x49bb('0x28')]){delete _0x47540c[_0x49bb('0x28')];}_0x3d025d[_0x49bb('0x19')](_0x3985a6)['send'](_0x47540c);};}exports[_0x49bb('0x29')]=function(_0x1537ef,_0x5cd7c2){var _0x38108d={},_0x56b65b={},_0x2fbea2={'count':0x0,'rows':[]};var _0x242371=_['map'](db[_0x49bb('0x2a')][_0x49bb('0x2b')],function(_0x521e09){return{'name':_0x521e09[_0x49bb('0x2c')],'type':_0x521e09[_0x49bb('0x2d')][_0x49bb('0x2e')]};});_0x56b65b[_0x49bb('0x2f')]=_[_0x49bb('0x30')](_0x242371,_0x49bb('0x28'));_0x56b65b[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x1537ef['query']);_0x56b65b[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x56b65b[_0x49bb('0x2f')],_0x56b65b[_0x49bb('0x31')]);_0x38108d['attributes']=_[_0x49bb('0x34')](_0x56b65b['model'],qs[_0x49bb('0x35')](_0x1537ef['query'][_0x49bb('0x35')]));_0x38108d['attributes']=_0x38108d[_0x49bb('0x36')][_0x49bb('0x37')]?_0x38108d['attributes']:_0x56b65b['model'];if(!_0x1537ef['query']['hasOwnProperty']('nolimit')){_0x38108d[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x1537ef[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x38108d[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x1537ef[_0x49bb('0x31')]['offset']);}_0x38108d['order']=qs[_0x49bb('0x38')](_0x1537ef[_0x49bb('0x31')]['sort']);_0x38108d[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_['pick'](_0x1537ef['query'],_0x56b65b[_0x49bb('0x33')]),_0x242371);if(_0x1537ef['query'][_0x49bb('0x3a')]){_0x38108d[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x38108d[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x242371,function(_0x72d90e){if(_0x72d90e[_0x49bb('0x2d')]!==_0x49bb('0x3c')){var _0x783852={};_0x783852[_0x72d90e[_0x49bb('0x28')]]={'$like':'%'+_0x1537ef[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x783852;}})});}_0x38108d=_[_0x49bb('0x3b')]({},_0x38108d,_0x1537ef[_0x49bb('0x3d')]);var _0x25c70e={'where':_0x38108d[_0x49bb('0x39')]};return db[_0x49bb('0x2a')][_0x49bb('0x1f')](_0x25c70e)[_0x49bb('0x23')](function(_0x41b969){_0x2fbea2[_0x49bb('0x1f')]=_0x41b969;if(_0x1537ef[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x38108d['include']=[{'all':!![]}];}return db[_0x49bb('0x2a')]['findAll'](_0x38108d);})[_0x49bb('0x23')](function(_0x1eac94){_0x2fbea2[_0x49bb('0x3f')]=_0x1eac94;return _0x2fbea2;})[_0x49bb('0x23')](respondWithFilteredResult(_0x5cd7c2,_0x38108d))[_0x49bb('0x40')](handleError(_0x5cd7c2,null));};exports['show']=function(_0x445e15,_0x31aaee){var _0x138f2b={'raw':![],'where':{'id':_0x445e15[_0x49bb('0x41')]['id']}},_0x46912f={};_0x46912f['model']=_[_0x49bb('0x32')](db[_0x49bb('0x2a')][_0x49bb('0x2b')]);_0x46912f[_0x49bb('0x31')]=_['keys'](_0x445e15['query']);_0x46912f[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x46912f[_0x49bb('0x2f')],_0x46912f[_0x49bb('0x31')]);_0x138f2b[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x46912f['model'],qs[_0x49bb('0x35')](_0x445e15['query'][_0x49bb('0x35')]));_0x138f2b[_0x49bb('0x36')]=_0x138f2b['attributes']['length']?_0x138f2b['attributes']:_0x46912f['model'];if(_0x445e15[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x138f2b[_0x49bb('0x42')]=[{'all':!![]}];}_0x138f2b=_[_0x49bb('0x3b')]({},_0x138f2b,_0x445e15['options']);return db['Campaign'][_0x49bb('0x43')](_0x138f2b)[_0x49bb('0x23')](handleEntityNotFound(_0x31aaee,null))[_0x49bb('0x23')](respondWithResult(_0x31aaee,null))[_0x49bb('0x40')](handleError(_0x31aaee,null));};exports['create']=function(_0x3b0f01,_0x382bc4){return db['Campaign'][_0x49bb('0x44')](_0x3b0f01[_0x49bb('0x45')],{})[_0x49bb('0x23')](function(_0x46bb56){var _0xbad45a=_0x3b0f01['user'][_0x49bb('0x46')]({'plain':!![]});if(!_0xbad45a)throw new Error(_0x49bb('0x47'));if(_0xbad45a[_0x49bb('0x48')]==='user'){var _0x266abf=_0x46bb56[_0x49bb('0x46')]({'plain':!![]});var _0x144a77=_0x49bb('0x24');return db[_0x49bb('0x49')]['find']({'where':{'name':_0x144a77,'userProfileId':_0xbad45a[_0x49bb('0x4a')]},'raw':!![]})[_0x49bb('0x23')](function(_0xfae9ab){if(_0xfae9ab&&_0xfae9ab[_0x49bb('0x4b')]===0x0){return db[_0x49bb('0x25')][_0x49bb('0x44')]({'name':_0x266abf[_0x49bb('0x28')],'resourceId':_0x266abf['id'],'type':_0xfae9ab[_0x49bb('0x28')],'sectionId':_0xfae9ab['id']},{})[_0x49bb('0x23')](function(){return _0x46bb56;});}else{return _0x46bb56;}})[_0x49bb('0x40')](function(_0x2ead0f){logger['error'](_0x49bb('0x4c'),_0x2ead0f);throw _0x2ead0f;});}return _0x46bb56;})[_0x49bb('0x23')](respondWithResult(_0x382bc4,0xc9))[_0x49bb('0x40')](handleError(_0x382bc4,null));};exports[_0x49bb('0x4d')]=function(_0x10327c,_0x3fc2f1){var _0x4151c5={'where':{'id':_0x10327c[_0x49bb('0x41')]['id']}},_0x23e8bc={};_0x23e8bc[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x2a')][_0x49bb('0x2b')]);_0x4151c5[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x23e8bc[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x10327c[_0x49bb('0x31')][_0x49bb('0x35')]));_0x4151c5[_0x49bb('0x36')]=_0x4151c5[_0x49bb('0x36')][_0x49bb('0x37')]?_0x4151c5[_0x49bb('0x36')]:_0x23e8bc['model'];if(_0x10327c[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x4151c5[_0x49bb('0x42')]=[{'all':!![]}];}_0x4151c5=_[_0x49bb('0x3b')]({},_0x4151c5,_0x10327c[_0x49bb('0x3d')]);return db[_0x49bb('0x2a')][_0x49bb('0x43')](_0x4151c5)[_0x49bb('0x23')](handleEntityNotFound(_0x3fc2f1,null))[_0x49bb('0x23')](function(_0x348da4){if(_0x348da4){var _0x48a8d6=_0x348da4['get']({'plain':!![]});_0x48a8d6=qs['omit'](_0x48a8d6,['id',_0x49bb('0x4e'),'updatedAt']);_0x10327c[_0x49bb('0x45')]=_[_0x49bb('0x4f')](_0x10327c[_0x49bb('0x45')],['id',_0x49bb('0x4e'),_0x49bb('0x50')]);return db[_0x49bb('0x2a')][_0x49bb('0x44')](_[_0x49bb('0x3b')](_0x48a8d6,_0x10327c['body']),{'include':_0x10327c[_0x49bb('0x31')][_0x49bb('0x3e')]?[{'all':!![]}]:undefined})[_0x49bb('0x23')](function(_0x435761){var _0x225341=_0x10327c[_0x49bb('0x51')][_0x49bb('0x46')]({'plain':!![]});if(!_0x225341)throw new Error(_0x49bb('0x47'));if(_0x225341['role']===_0x49bb('0x51')){var _0x35bb5b=_0x435761[_0x49bb('0x46')]({'plain':!![]});var _0xb2d741='IvrCampaigns';return db[_0x49bb('0x49')][_0x49bb('0x43')]({'where':{'name':_0xb2d741,'userProfileId':_0x225341['userProfileId']},'raw':!![]})[_0x49bb('0x23')](function(_0x36ff04){if(_0x36ff04&&_0x36ff04[_0x49bb('0x4b')]===0x0){return db[_0x49bb('0x25')][_0x49bb('0x44')]({'name':_0x35bb5b['name'],'resourceId':_0x35bb5b['id'],'type':_0x36ff04[_0x49bb('0x28')],'sectionId':_0x36ff04['id']},{})[_0x49bb('0x23')](function(){return _0x435761;});}else{return _0x435761;}})[_0x49bb('0x40')](function(_0x1f273a){logger[_0x49bb('0x52')](_0x49bb('0x4c'),_0x1f273a);throw _0x1f273a;});}return _0x435761;});}})['then'](respondWithResult(_0x3fc2f1,0xc9))[_0x49bb('0x40')](handleError(_0x3fc2f1,null));};exports[_0x49bb('0x22')]=function(_0x56b2e7,_0x4b13e5){if(_0x56b2e7[_0x49bb('0x45')]['id']){delete _0x56b2e7[_0x49bb('0x45')]['id'];}return db['Campaign'][_0x49bb('0x43')]({'where':{'id':_0x56b2e7[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b13e5,null))[_0x49bb('0x23')](saveUpdates(_0x56b2e7[_0x49bb('0x45')],null))[_0x49bb('0x23')](respondWithResult(_0x4b13e5,null))['catch'](handleError(_0x4b13e5,null));};exports[_0x49bb('0x26')]=function(_0x4a3906,_0x4478f4){return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x4a3906[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4478f4,null))[_0x49bb('0x23')](removeEntity(_0x4478f4,null))[_0x49bb('0x40')](handleError(_0x4478f4,null));};exports[_0x49bb('0x53')]=function(_0xcc062f,_0x52ac3b,_0x29a1b7){var _0x28da4a={'raw':!![],'where':{}};var _0x277e04={};var _0x193259={'count':0x0,'rows':[]};return db['Campaign'][_0x49bb('0x54')]({'where':{'id':_0xcc062f[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x52ac3b,null))[_0x49bb('0x23')](function(_0x437d3b){if(_0x437d3b){_0x277e04['model']=_[_0x49bb('0x32')](db[_0x49bb('0x55')][_0x49bb('0x2b')]);_0x277e04[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0xcc062f[_0x49bb('0x31')]);_0x277e04[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x277e04['model'],_0x277e04[_0x49bb('0x31')]);_0x28da4a[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x277e04[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0xcc062f[_0x49bb('0x31')][_0x49bb('0x35')]));_0x28da4a['attributes']=_0x28da4a[_0x49bb('0x36')][_0x49bb('0x37')]?_0x28da4a[_0x49bb('0x36')]:_0x277e04[_0x49bb('0x2f')];if(!_0xcc062f['query'][_0x49bb('0x56')]('nolimit')){_0x28da4a[_0x49bb('0x1e')]=qs['limit'](_0xcc062f['query']['limit']);_0x28da4a[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0xcc062f['query']['offset']);}_0x28da4a[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0xcc062f[_0x49bb('0x31')][_0x49bb('0x38')]);_0x28da4a[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0xcc062f[_0x49bb('0x31')],_0x277e04[_0x49bb('0x33')]));_0x28da4a[_0x49bb('0x39')][_0x49bb('0x59')]=_0x437d3b['id'];if(_0xcc062f['query'][_0x49bb('0x3a')]){_0x28da4a[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x28da4a[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x28da4a[_0x49bb('0x36')],function(_0x3454be){var _0x500af1={};_0x500af1[_0x3454be]={'$like':'%'+_0xcc062f[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x500af1;})});}_0x28da4a=_['merge']({},_0x28da4a,_0xcc062f[_0x49bb('0x3d')]);return db[_0x49bb('0x55')]['count']({'where':_0x28da4a[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x37f97b){_0x193259[_0x49bb('0x1f')]=_0x37f97b;if(_0xcc062f[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x28da4a['include']=[{'all':!![]}];}return db['CmHopper'][_0x49bb('0x5a')](_0x28da4a);})[_0x49bb('0x23')](function(_0x1499b6){_0x193259[_0x49bb('0x3f')]=_0x1499b6;return _0x193259;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x52ac3b,_0x28da4a))[_0x49bb('0x40')](handleError(_0x52ac3b,null));};exports[_0x49bb('0x5b')]=function(_0xc7016a,_0x136726,_0x36db19){var _0x3459de={'raw':!![],'where':{}};var _0x426505={};var _0x81e179={'count':0x0,'rows':[]};return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0xc7016a['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x136726,null))['then'](function(_0x7897dd){if(_0x7897dd){_0x426505[_0x49bb('0x2f')]=_['keys'](db['CmHopperHistory'][_0x49bb('0x2b')]);_0x426505[_0x49bb('0x31')]=_['keys'](_0xc7016a[_0x49bb('0x31')]);_0x426505[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x426505[_0x49bb('0x2f')],_0x426505[_0x49bb('0x31')]);_0x3459de[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x426505[_0x49bb('0x2f')],qs['fields'](_0xc7016a[_0x49bb('0x31')]['fields']));_0x3459de[_0x49bb('0x36')]=_0x3459de[_0x49bb('0x36')][_0x49bb('0x37')]?_0x3459de['attributes']:_0x426505[_0x49bb('0x2f')];if(!_0xc7016a[_0x49bb('0x31')][_0x49bb('0x56')](_0x49bb('0x5c'))){_0x3459de[_0x49bb('0x1e')]=qs['limit'](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x3459de[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x1c')]);}_0x3459de[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x38')]);_0x3459de[_0x49bb('0x39')]=qs['filters'](_[_0x49bb('0x58')](_0xc7016a[_0x49bb('0x31')],_0x426505[_0x49bb('0x33')]));_0x3459de[_0x49bb('0x39')]['CampaignId']=_0x7897dd['id'];if(_0xc7016a[_0x49bb('0x31')]['filter']){_0x3459de[_0x49bb('0x39')]=_['merge'](_0x3459de[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x3459de[_0x49bb('0x36')],function(_0x2b953a){var _0x5d4c93={};_0x5d4c93[_0x2b953a]={'$like':'%'+_0xc7016a[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x5d4c93;})});}_0x3459de=_[_0x49bb('0x3b')]({},_0x3459de,_0xc7016a[_0x49bb('0x3d')]);return db[_0x49bb('0x5d')]['count']({'where':_0x3459de[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x46fcc5){_0x81e179['count']=_0x46fcc5;if(_0xc7016a[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x3459de['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x49bb('0x5a')](_0x3459de);})[_0x49bb('0x23')](function(_0x2a40aa){_0x81e179[_0x49bb('0x3f')]=_0x2a40aa;return _0x81e179;});}})['then'](respondWithFilteredResult(_0x136726,_0x3459de))[_0x49bb('0x40')](handleError(_0x136726,null));};exports[_0x49bb('0x5e')]=function(_0x535bed,_0x137965,_0x208e1b){var _0x1c9cfb={'raw':!![],'where':{}};var _0x4157ae={};var _0x1b0529={'count':0x0,'rows':[]};return db['Campaign'][_0x49bb('0x54')]({'where':{'id':_0x535bed['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x137965,null))['then'](function(_0x36bf90){if(_0x36bf90){_0x4157ae[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x5f')][_0x49bb('0x2b')]);_0x4157ae[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x535bed['query']);_0x4157ae[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x4157ae['model'],_0x4157ae[_0x49bb('0x31')]);_0x1c9cfb[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x4157ae[_0x49bb('0x2f')],qs['fields'](_0x535bed['query'][_0x49bb('0x35')]));_0x1c9cfb['attributes']=_0x1c9cfb[_0x49bb('0x36')]['length']?_0x1c9cfb[_0x49bb('0x36')]:_0x4157ae[_0x49bb('0x2f')];if(!_0x535bed[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x1c9cfb[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x535bed['query']['limit']);_0x1c9cfb[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x535bed['query'][_0x49bb('0x1c')]);}_0x1c9cfb[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0x535bed['query'][_0x49bb('0x38')]);_0x1c9cfb[_0x49bb('0x39')]=qs['filters'](_['pick'](_0x535bed['query'],_0x4157ae[_0x49bb('0x33')]));_0x1c9cfb[_0x49bb('0x39')][_0x49bb('0x59')]=_0x36bf90['id'];if(_0x535bed[_0x49bb('0x31')][_0x49bb('0x3a')]){_0x1c9cfb['where']=_['merge'](_0x1c9cfb[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x1c9cfb['attributes'],function(_0x5b1f07){var _0x378128={};_0x378128[_0x5b1f07]={'$like':'%'+_0x535bed[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x378128;})});}_0x1c9cfb=_['merge']({},_0x1c9cfb,_0x535bed[_0x49bb('0x3d')]);return db[_0x49bb('0x5f')]['count']({'where':_0x1c9cfb[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x3b7d47){_0x1b0529[_0x49bb('0x1f')]=_0x3b7d47;if(_0x535bed['query'][_0x49bb('0x3e')]){_0x1c9cfb[_0x49bb('0x42')]=[{'all':!![]}];}return db[_0x49bb('0x5f')][_0x49bb('0x5a')](_0x1c9cfb);})['then'](function(_0x2ccf78){_0x1b0529[_0x49bb('0x3f')]=_0x2ccf78;return _0x1b0529;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x137965,_0x1c9cfb))[_0x49bb('0x40')](handleError(_0x137965,null));};exports[_0x49bb('0x60')]=function(_0x4e6e43,_0x5a4f59,_0x251fc8){var _0x382bf9={'raw':!![],'where':{}};var _0x5bdf3d={};var _0x1dcaac={'count':0x0,'rows':[]};return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x4e6e43[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a4f59,null))['then'](function(_0xe5a2){if(_0xe5a2){_0x5bdf3d[_0x49bb('0x2f')]=_['keys'](db['CmHopperBlack'][_0x49bb('0x2b')]);_0x5bdf3d[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x4e6e43['query']);_0x5bdf3d[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x5bdf3d[_0x49bb('0x2f')],_0x5bdf3d[_0x49bb('0x31')]);_0x382bf9[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x5bdf3d[_0x49bb('0x2f')],qs['fields'](_0x4e6e43[_0x49bb('0x31')]['fields']));_0x382bf9[_0x49bb('0x36')]=_0x382bf9[_0x49bb('0x36')][_0x49bb('0x37')]?_0x382bf9['attributes']:_0x5bdf3d[_0x49bb('0x2f')];if(!_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x382bf9[_0x49bb('0x1e')]=qs['limit'](_0x4e6e43['query'][_0x49bb('0x1e')]);_0x382bf9['offset']=qs[_0x49bb('0x1c')](_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x1c')]);}_0x382bf9[_0x49bb('0x57')]=qs['sort'](_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x38')]);_0x382bf9[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x4e6e43[_0x49bb('0x31')],_0x5bdf3d[_0x49bb('0x33')]));_0x382bf9[_0x49bb('0x39')][_0x49bb('0x59')]=_0xe5a2['id'];if(_0x4e6e43[_0x49bb('0x31')]['filter']){_0x382bf9[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x382bf9['where'],{'$or':_[_0x49bb('0x30')](_0x382bf9[_0x49bb('0x36')],function(_0x12b674){var _0x2822f7={};_0x2822f7[_0x12b674]={'$like':'%'+_0x4e6e43['query']['filter']+'%'};return _0x2822f7;})});}_0x382bf9=_[_0x49bb('0x3b')]({},_0x382bf9,_0x4e6e43[_0x49bb('0x3d')]);return db[_0x49bb('0x61')]['count']({'where':_0x382bf9['where']})[_0x49bb('0x23')](function(_0xf5c477){_0x1dcaac['count']=_0xf5c477;if(_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x382bf9[_0x49bb('0x42')]=[{'all':!![]}];}return db[_0x49bb('0x61')]['findAll'](_0x382bf9);})['then'](function(_0x1770bc){_0x1dcaac[_0x49bb('0x3f')]=_0x1770bc;return _0x1dcaac;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x5a4f59,_0x382bf9))['catch'](handleError(_0x5a4f59,null));};exports[_0x49bb('0x62')]=function(_0x9f2ff7,_0x3f93bd,_0x504b4f){var _0x582b42={};var _0x2948a0={};var _0x5a861f;var _0xaf6237;return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x9f2ff7[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x3f93bd,null))[_0x49bb('0x23')](function(_0x59e5c1){if(_0x59e5c1){_0x5a861f=_0x59e5c1;_0x2948a0[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x63')][_0x49bb('0x2b')]);_0x2948a0[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x9f2ff7[_0x49bb('0x31')]);_0x2948a0[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x2948a0[_0x49bb('0x2f')],_0x2948a0['query']);_0x582b42[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x2948a0[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x9f2ff7[_0x49bb('0x31')]['fields']));_0x582b42[_0x49bb('0x36')]=_0x582b42[_0x49bb('0x36')][_0x49bb('0x37')]?_0x582b42[_0x49bb('0x36')]:_0x2948a0[_0x49bb('0x2f')];_0x582b42[_0x49bb('0x57')]=qs['sort'](_0x9f2ff7['query']['sort']);_0x582b42[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x9f2ff7[_0x49bb('0x31')],_0x2948a0[_0x49bb('0x33')]));if(_0x9f2ff7[_0x49bb('0x31')][_0x49bb('0x3a')]){_0x582b42[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x582b42['where'],{'$or':_[_0x49bb('0x30')](_0x582b42[_0x49bb('0x36')],function(_0x42b52f){var _0x22a2e3={};_0x22a2e3[_0x42b52f]={'$like':'%'+_0x9f2ff7[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x22a2e3;})});}_0x582b42=_[_0x49bb('0x3b')]({},_0x582b42,_0x9f2ff7['options']);return _0x5a861f['getLists'](_0x582b42);}})['then'](function(_0x521567){if(_0x521567){_0xaf6237=_0x521567[_0x49bb('0x37')];if(!_0x9f2ff7['query'][_0x49bb('0x56')](_0x49bb('0x5c'))){_0x582b42[_0x49bb('0x1e')]=qs['limit'](_0x9f2ff7['query']['limit']);_0x582b42[_0x49bb('0x1c')]=qs['offset'](_0x9f2ff7['query']['offset']);}return _0x5a861f[_0x49bb('0x62')](_0x582b42);}})[_0x49bb('0x23')](function(_0x5eec09){if(_0x5eec09){return _0x5eec09?{'count':_0xaf6237,'rows':_0x5eec09}:null;}})['then'](respondWithResult(_0x3f93bd,null))['catch'](handleError(_0x3f93bd,null));};exports['addLists']=function(_0x333a64,_0x4742be,_0x3ef899){var _0x29e5f9,_0x38a3d5;var _0xd2cd1a=[];var _0x3d761d=moment()[_0x49bb('0x64')](_0x49bb('0x65'));return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x333a64[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4742be,null))[_0x49bb('0x23')](function(_0x4092df){if(_0x4092df){_0x38a3d5=_0x4092df;return _0x4092df[_0x49bb('0x66')](_0x333a64[_0x49bb('0x45')][_0x49bb('0x67')],_[_0x49bb('0x4f')](_0x333a64[_0x49bb('0x45')],[_0x49bb('0x67'),'id'])||{});}return null;})[_0x49bb('0x68')](function(_0x534677){var _0x5b27b1;var _0x3d1da9;_0x29e5f9=_0x534677||[];var _0x20a650=[];if(_0x534677){for(var _0x33c254=0x0;_0x33c254<_0x534677[_0x49bb('0x37')];_0x33c254+=0x1){var _0x403726=_0x534677[_0x33c254]['get']({'plain':!![]});_0x38a3d5[_0x49bb('0x69')]=_0x333a64[_0x49bb('0x45')][_0x49bb('0x69')]?_0x333a64[_0x49bb('0x45')][_0x49bb('0x69')]:_0x38a3d5['dialCheckDuplicateType'];switch(_0x38a3d5[_0x49bb('0x69')]){case _0x49bb('0x6a'):_0x5b27b1=squel[_0x49bb('0x6b')]()['into'](_0x49bb('0x6c'))[_0x49bb('0x6d')]([_0x49bb('0x6e'),_0x49bb('0x6f'),'ContactId',_0x49bb('0x70'),_0x49bb('0x59'),_0x49bb('0x4e'),'updatedAt'],squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('phone','phone')[_0x49bb('0x72')](_0x49bb('0x73'),_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),_0x49bb('0x59'))['field']('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))['from'](_0x49bb('0x77'))['where'](_0x49bb('0x78'))[_0x49bb('0x39')](_0x49bb('0x79'),_0x403726['CmListId'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x7a'))[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()['field'](_0x49bb('0x7c'))[_0x49bb('0x7d')](_0x49bb('0x7e'))[_0x49bb('0x39')](_0x49bb('0x7f'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]()))[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('COALESCE(phone,\x27\x27)')[_0x49bb('0x7d')](_0x49bb('0x6c'))['where'](_0x49bb('0x7f'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]())))[_0x49bb('0x76')]();break;case _0x49bb('0x80'):_0x5b27b1=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')](_0x49bb('0x6c'))[_0x49bb('0x6d')](['phone',_0x49bb('0x6f'),_0x49bb('0x74'),_0x49bb('0x70'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x49bb('0x72')](_0x49bb('0x6e'),_0x49bb('0x6e'))['field']('NOW()',_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),_0x49bb('0x59'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')](_0x49bb('0x77'))[_0x49bb('0x39')](_0x49bb('0x78'))['where'](_0x49bb('0x79'),_0x403726[_0x49bb('0x75')]['toString']())[_0x49bb('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('COALESCE(phone,\x27\x27)')['from'](_0x49bb('0x6c'))[_0x49bb('0x39')](_0x49bb('0x7f'),_0x333a64['params']['id'][_0x49bb('0x76')]())))['toString']();break;default:_0x5b27b1=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')]('cm_hopper')['fromQuery']([_0x49bb('0x6e'),_0x49bb('0x6f'),_0x49bb('0x74'),_0x49bb('0x70'),_0x49bb('0x59'),_0x49bb('0x4e'),_0x49bb('0x50')],squel[_0x49bb('0x71')]()[_0x49bb('0x72')](_0x49bb('0x6e'),'phone')[_0x49bb('0x72')]('NOW()',_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')]['toString'](),_0x49bb('0x70'))['field'](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),'CampaignId')[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contacts')[_0x49bb('0x39')](_0x49bb('0x78'))[_0x49bb('0x39')]('ListId\x20=\x20?',_0x403726['CmListId'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x7a')))[_0x49bb('0x76')]();}_0x3d1da9=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')]('cm_hopper_additional_phones')[_0x49bb('0x6d')]([_0x49bb('0x82'),_0x49bb('0x6f'),_0x49bb('0x6e'),'OrderBy',_0x49bb('0x4e'),_0x49bb('0x50')],squel[_0x49bb('0x71')]()[_0x49bb('0x72')](_0x49bb('0x83'),'id')['field'](_0x49bb('0x73'),_0x49bb('0x6f'))['field']('ci.item',_0x49bb('0x6e'))[_0x49bb('0x72')]('ci.OrderBY','OrderBy')[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contact_has_items','ci')[_0x49bb('0x84')](_0x49bb('0x6c'),'h',_0x49bb('0x85'))[_0x49bb('0x39')](_0x49bb('0x86'),_0x403726[_0x49bb('0x75')][_0x49bb('0x76')]())['where'](_0x49bb('0x87'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x88'),_0x3d761d))[_0x49bb('0x76')]();_0x20a650['push'](db['sequelize'][_0x49bb('0x31')](_0x5b27b1));_0xd2cd1a[_0x49bb('0x89')](db[_0x49bb('0x8a')][_0x49bb('0x31')](_0x3d1da9));}return BPromise[_0x49bb('0x8b')](_0x20a650);}})[_0x49bb('0x23')](function(){return BPromise[_0x49bb('0x8b')](_0xd2cd1a);})[_0x49bb('0x23')](function(){return _0x29e5f9;})[_0x49bb('0x23')](respondWithResult(_0x4742be,null))[_0x49bb('0x40')](handleError(_0x4742be,null));};exports[_0x49bb('0x8c')]=function(_0x463ed6,_0x4f887c,_0x6cfddb){return db['Campaign'][_0x49bb('0x43')]({'where':{'id':_0x463ed6[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4f887c,null))['then'](function(_0x2e2e87){if(_0x2e2e87){return _0x2e2e87[_0x49bb('0x8c')](_0x463ed6[_0x49bb('0x31')]['ids']);}})['then'](function(_0x45957b){if(_0x45957b){return db[_0x49bb('0x55')][_0x49bb('0x26')]({'where':{'ListId':_0x463ed6[_0x49bb('0x31')][_0x49bb('0x67')],'CampaignId':_0x463ed6[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](function(){return _0x45957b;});}})[_0x49bb('0x23')](respondWithStatusCode(_0x4f887c,null))[_0x49bb('0x40')](handleError(_0x4f887c,null));};exports[_0x49bb('0x8d')]=function(_0x5418e4,_0x4e133b,_0x460091){var _0x1346fa={};var _0x52a9d4={};var _0x7f3477;var _0x3b0592;return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x5418e4[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4e133b,null))[_0x49bb('0x23')](function(_0x1036f0){if(_0x1036f0){_0x7f3477=_0x1036f0;_0x52a9d4[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db['CmList'][_0x49bb('0x2b')]);_0x52a9d4['query']=_[_0x49bb('0x32')](_0x5418e4[_0x49bb('0x31')]);_0x52a9d4[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x52a9d4[_0x49bb('0x2f')],_0x52a9d4[_0x49bb('0x31')]);_0x1346fa[_0x49bb('0x36')]=_['intersection'](_0x52a9d4[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x5418e4['query'][_0x49bb('0x35')]));_0x1346fa[_0x49bb('0x36')]=_0x1346fa[_0x49bb('0x36')][_0x49bb('0x37')]?_0x1346fa[_0x49bb('0x36')]:_0x52a9d4['model'];_0x1346fa[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0x5418e4['query'][_0x49bb('0x38')]);_0x1346fa[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x5418e4[_0x49bb('0x31')],_0x52a9d4['filters']));if(_0x5418e4[_0x49bb('0x31')]['filter']){_0x1346fa['where']=_[_0x49bb('0x3b')](_0x1346fa[_0x49bb('0x39')],{'$or':_['map'](_0x1346fa[_0x49bb('0x36')],function(_0x38bac0){var _0x1021ea={};_0x1021ea[_0x38bac0]={'$like':'%'+_0x5418e4[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x1021ea;})});}_0x1346fa=_['merge']({},_0x1346fa,_0x5418e4[_0x49bb('0x3d')]);return _0x7f3477[_0x49bb('0x8d')](_0x1346fa);}})['then'](function(_0x162884){if(_0x162884){_0x3b0592=_0x162884[_0x49bb('0x37')];if(!_0x5418e4[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x1346fa[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x5418e4[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x1346fa[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x5418e4[_0x49bb('0x31')][_0x49bb('0x1c')]);}return _0x7f3477[_0x49bb('0x8d')](_0x1346fa);}})['then'](function(_0x5bd052){if(_0x5bd052){return _0x5bd052?{'count':_0x3b0592,'rows':_0x5bd052}:null;}})[_0x49bb('0x23')](respondWithResult(_0x4e133b,null))[_0x49bb('0x40')](handleError(_0x4e133b,null));};exports[_0x49bb('0x8e')]=function(_0x5cc812,_0x308a85,_0x526469){var _0x2e4be8,_0x139929;var _0x17f942=[];var _0x4456b3=moment()[_0x49bb('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x5cc812[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x308a85,null))[_0x49bb('0x23')](function(_0xac35e6){if(_0xac35e6){_0x139929=_0xac35e6;return _0xac35e6[_0x49bb('0x8e')](_0x5cc812[_0x49bb('0x45')][_0x49bb('0x67')],_['omit'](_0x5cc812[_0x49bb('0x45')],[_0x49bb('0x67'),'id'])||{});}return null;})['spread'](function(_0x2caab6){var _0x5cc412;var _0x34e4bb;_0x2e4be8=_0x2caab6||[];var _0x1c7a91=[];if(_0x2caab6){for(var _0x44ef98=0x0;_0x44ef98<_0x2caab6[_0x49bb('0x37')];_0x44ef98+=0x1){var _0x526e52=_0x2caab6[_0x44ef98][_0x49bb('0x46')]({'plain':!![]});_0x5cc412=squel['insert']()[_0x49bb('0x81')](_0x49bb('0x8f'))[_0x49bb('0x6d')]([_0x49bb('0x6e'),_0x49bb('0x74'),_0x49bb('0x70'),_0x49bb('0x59'),'createdAt',_0x49bb('0x50')],squel['select']()[_0x49bb('0x72')]('phone',_0x49bb('0x6e'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x526e52[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x5cc812[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),'CampaignId')['field']('NOW()',_0x49bb('0x4e'))[_0x49bb('0x72')](_0x49bb('0x73'),_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contacts')[_0x49bb('0x39')]('deletedAt\x20IS\x20NULL')[_0x49bb('0x39')]('ListId\x20=\x20?',_0x526e52[_0x49bb('0x75')]['toString']())[_0x49bb('0x39')](_0x49bb('0x7a')))[_0x49bb('0x76')]();_0x1c7a91[_0x49bb('0x89')](db['sequelize']['query'](_0x5cc412));}return BPromise[_0x49bb('0x8b')](_0x1c7a91);}})[_0x49bb('0x23')](function(){return _0x2e4be8;})[_0x49bb('0x23')](respondWithResult(_0x308a85,null))['catch'](handleError(_0x308a85,null));};exports[_0x49bb('0x90')]=function(_0x423817,_0xbf83a4,_0x2084e3){return db[_0x49bb('0x2a')]['find']({'where':{'id':_0x423817[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0xbf83a4,null))[_0x49bb('0x23')](function(_0x32ebdd){if(_0x32ebdd){return _0x32ebdd[_0x49bb('0x90')](_0x423817['query']['ids']);}})[_0x49bb('0x23')](function(_0x8a44b6){if(_0x8a44b6){return db[_0x49bb('0x61')][_0x49bb('0x26')]({'where':{'ListId':_0x423817[_0x49bb('0x31')]['ids'],'CampaignId':_0x423817[_0x49bb('0x41')]['id']}})['then'](function(){return _0x8a44b6;});}})[_0x49bb('0x23')](respondWithStatusCode(_0xbf83a4,null))[_0x49bb('0x40')](handleError(_0xbf83a4,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7237e88..479415b 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x7a54,0x106));var _0x47a5=function(_0x4c5445,_0x3d94dd){_0x4c5445=_0x4c5445-0x0;var _0x5600de=_0x7a54[_0x4c5445];return _0x5600de;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x518db2,_0x7af163){var _0x2f00b4=function(_0x23a129){while(--_0x23a129){_0x518db2['push'](_0x518db2['shift']());}};_0x2f00b4(++_0x7af163);}(_0x7a54,0x106));var _0x47a5=function(_0x439efb,_0x2dcca8){_0x439efb=_0x439efb-0x0;var _0x531305=_0x7a54[_0x439efb];return _0x531305;};'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 5f3c4b4..ac6f8d7 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 _0xd110=['options','raw','attributes','include','map','model','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','GetCampaign','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd110,0x1e8));var _0x0d11=function(_0xa01ab8,_0x918083){_0xa01ab8=_0xa01ab8-0x0;var _0x46e583=_0xd110[_0xa01ab8];return _0x46e583;};'use strict';var _=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var moment=require(_0x0d11('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d11('0x3'));var fs=require('fs');var Redis=require(_0x0d11('0x4'));var db=require(_0x0d11('0x5'))['db'];var utils=require(_0x0d11('0x6'));var logger=require(_0x0d11('0x7'))(_0x0d11('0x8'));var config=require(_0x0d11('0x9'));var jayson=require(_0x0d11('0xa'));var client=jayson['client'][_0x0d11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a889c,_0x33c46e,_0x4f3f3f){return new BPromise(function(_0x47a493,_0x3f9f5a){return client[_0x0d11('0xc')](_0x5a889c,_0x4f3f3f)[_0x0d11('0xd')](function(_0x4c6a59){logger[_0x0d11('0xe')]('Campaign,\x20%s,\x20%s',_0x33c46e,_0x0d11('0xf'));logger['debug'](_0x0d11('0x10'),_0x33c46e,_0x0d11('0xf'),JSON[_0x0d11('0x11')](_0x4c6a59));if(_0x4c6a59[_0x0d11('0x12')]){if(_0x4c6a59['error'][_0x0d11('0x13')]===0x1f4){logger[_0x0d11('0x12')]('Campaign,\x20%s,\x20%s',_0x33c46e,_0x4c6a59[_0x0d11('0x12')][_0x0d11('0x14')]);return _0x3f9f5a(_0x4c6a59[_0x0d11('0x12')]['message']);}logger[_0x0d11('0x12')](_0x0d11('0x15'),_0x33c46e,_0x4c6a59['error'][_0x0d11('0x14')]);return _0x47a493(_0x4c6a59[_0x0d11('0x12')][_0x0d11('0x14')]);}else{logger[_0x0d11('0xe')](_0x0d11('0x15'),_0x33c46e,'request\x20sent');_0x47a493(_0x4c6a59['result'][_0x0d11('0x14')]);}})['catch'](function(_0x46aa4f){logger[_0x0d11('0x12')]('Campaign,\x20%s,\x20%s',_0x33c46e,_0x46aa4f);_0x3f9f5a(_0x46aa4f);});});}exports[_0x0d11('0x16')]=function(_0x57df83){var _0x2e4c05=this;return new Promise(function(_0x2a29db,_0x5e3bd3){return db['Campaign'][_0x0d11('0x17')]({'raw':_0x57df83[_0x0d11('0x18')]?_0x57df83[_0x0d11('0x18')][_0x0d11('0x19')]===undefined?!![]:![]:!![],'where':_0x57df83[_0x0d11('0x18')]?_0x57df83[_0x0d11('0x18')]['where']||null:null,'attributes':_0x57df83[_0x0d11('0x18')]?_0x57df83[_0x0d11('0x18')][_0x0d11('0x1a')]||null:null,'limit':_0x57df83[_0x0d11('0x18')]?_0x57df83[_0x0d11('0x18')]['limit']||null:null,'include':_0x57df83[_0x0d11('0x18')]?_0x57df83['options'][_0x0d11('0x1b')]?_[_0x0d11('0x1c')](_0x57df83[_0x0d11('0x18')]['include'],function(_0x304f7f){return{'model':db[_0x304f7f[_0x0d11('0x1d')]],'as':_0x304f7f['as'],'attributes':_0x304f7f['attributes'],'include':_0x304f7f[_0x0d11('0x1b')]?_['map'](_0x304f7f[_0x0d11('0x1b')],function(_0x510bf5){return{'model':db[_0x510bf5['model']],'as':_0x510bf5['as'],'attributes':_0x510bf5[_0x0d11('0x1a')],'include':_0x510bf5[_0x0d11('0x1b')]?_[_0x0d11('0x1c')](_0x510bf5[_0x0d11('0x1b')],function(_0x7be5a3){return{'model':db[_0x7be5a3['model']],'as':_0x7be5a3['as'],'attributes':_0x7be5a3[_0x0d11('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25e7fc){logger['info'](_0x0d11('0x16'),_0x57df83);logger[_0x0d11('0x1e')](_0x0d11('0x16'),_0x57df83,JSON[_0x0d11('0x11')](_0x25e7fc));_0x2a29db(_0x25e7fc);})[_0x0d11('0x1f')](function(_0x17a668){logger[_0x0d11('0x12')](_0x0d11('0x16'),_0x17a668[_0x0d11('0x14')],_0x57df83);_0x5e3bd3(_0x2e4c05[_0x0d11('0x12')](0x1f4,_0x17a668[_0x0d11('0x14')]));});});};
\ No newline at end of file
+var _0x22a4=['limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes'];(function(_0x5017ba,_0x2c0229){var _0x194d2=function(_0x2d0307){while(--_0x2d0307){_0x5017ba['push'](_0x5017ba['shift']());}};_0x194d2(++_0x2c0229);}(_0x22a4,0x1cb));var _0x422a=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0x22a4[_0x2341c6];return _0x54c34d;};'use strict';var _=require(_0x422a('0x0'));var util=require(_0x422a('0x1'));var moment=require(_0x422a('0x2'));var BPromise=require(_0x422a('0x3'));var rs=require(_0x422a('0x4'));var fs=require('fs');var Redis=require(_0x422a('0x5'));var db=require(_0x422a('0x6'))['db'];var utils=require(_0x422a('0x7'));var logger=require('../../config/logger')(_0x422a('0x8'));var config=require(_0x422a('0x9'));var jayson=require(_0x422a('0xa'));var client=jayson[_0x422a('0xb')][_0x422a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e8fe2,_0x3b5c92,_0x1b4b08){return new BPromise(function(_0x23b1b0,_0x392224){return client[_0x422a('0xd')](_0x5e8fe2,_0x1b4b08)[_0x422a('0xe')](function(_0x317466){logger[_0x422a('0xf')]('Campaign,\x20%s,\x20%s',_0x3b5c92,'request\x20sent');logger[_0x422a('0x10')](_0x422a('0x11'),_0x3b5c92,_0x422a('0x12'),JSON[_0x422a('0x13')](_0x317466));if(_0x317466[_0x422a('0x14')]){if(_0x317466[_0x422a('0x14')]['code']===0x1f4){logger['error'](_0x422a('0x15'),_0x3b5c92,_0x317466['error']['message']);return _0x392224(_0x317466['error'][_0x422a('0x16')]);}logger[_0x422a('0x14')](_0x422a('0x15'),_0x3b5c92,_0x317466[_0x422a('0x14')][_0x422a('0x16')]);return _0x23b1b0(_0x317466[_0x422a('0x14')][_0x422a('0x16')]);}else{logger[_0x422a('0xf')](_0x422a('0x15'),_0x3b5c92,_0x422a('0x12'));_0x23b1b0(_0x317466[_0x422a('0x17')][_0x422a('0x16')]);}})[_0x422a('0x18')](function(_0x3d5033){logger[_0x422a('0x14')](_0x422a('0x15'),_0x3b5c92,_0x3d5033);_0x392224(_0x3d5033);});});}exports[_0x422a('0x19')]=function(_0x5e2507){var _0x30847a=this;return new Promise(function(_0x3c5d86,_0x5b29fc){return db[_0x422a('0x1a')]['findAll']({'raw':_0x5e2507['options']?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e2507[_0x422a('0x1b')]?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1d')]||null:null,'attributes':_0x5e2507[_0x422a('0x1b')]?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1e')]||null:null,'limit':_0x5e2507['options']?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1f')]||null:null,'include':_0x5e2507[_0x422a('0x1b')]?_0x5e2507[_0x422a('0x1b')][_0x422a('0x20')]?_['map'](_0x5e2507[_0x422a('0x1b')][_0x422a('0x20')],function(_0x6e209d){return{'model':db[_0x6e209d['model']],'as':_0x6e209d['as'],'attributes':_0x6e209d[_0x422a('0x1e')],'include':_0x6e209d[_0x422a('0x20')]?_[_0x422a('0x21')](_0x6e209d[_0x422a('0x20')],function(_0xfc8699){return{'model':db[_0xfc8699[_0x422a('0x22')]],'as':_0xfc8699['as'],'attributes':_0xfc8699[_0x422a('0x1e')],'include':_0xfc8699[_0x422a('0x20')]?_['map'](_0xfc8699[_0x422a('0x20')],function(_0x15d2ab){return{'model':db[_0x15d2ab['model']],'as':_0x15d2ab['as'],'attributes':_0x15d2ab[_0x422a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b88ae){logger[_0x422a('0xf')](_0x422a('0x19'),_0x5e2507);logger[_0x422a('0x10')]('GetCampaign',_0x5e2507,JSON[_0x422a('0x13')](_0x1b88ae));_0x3c5d86(_0x1b88ae);})[_0x422a('0x18')](function(_0x50cc29){logger['error'](_0x422a('0x19'),_0x50cc29[_0x422a('0x16')],_0x5e2507);_0x5b29fc(_0x30847a['error'](0x1f4,_0x50cc29['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 08335b8..126c4ad 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 _0xdee8=['removeBlackLists','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/lists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists'];(function(_0x39feb0,_0x5e91e4){var _0xae50fa=function(_0x1c990a){while(--_0x1c990a){_0x39feb0['push'](_0x39feb0['shift']());}};_0xae50fa(++_0x5e91e4);}(_0xdee8,0x157));var _0x8dee=function(_0x4a7178,_0x3d0b6e){_0x4a7178=_0x4a7178-0x0;var _0x2c3d14=_0xdee8[_0x4a7178];return _0x2c3d14;};'use strict';var multer=require(_0x8dee('0x0'));var util=require('util');var path=require(_0x8dee('0x1'));var timeout=require('connect-timeout');var express=require(_0x8dee('0x2'));var router=express[_0x8dee('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8dee('0x4'));var interaction=require(_0x8dee('0x5'));var config=require(_0x8dee('0x6'));var controller=require(_0x8dee('0x7'));router[_0x8dee('0x8')]('/',auth[_0x8dee('0x9')](),controller[_0x8dee('0xa')]);router['get'](_0x8dee('0xb'),auth[_0x8dee('0x9')](),controller['show']);router[_0x8dee('0x8')](_0x8dee('0xc'),auth['isAuthenticated'](),controller[_0x8dee('0xd')]);router[_0x8dee('0x8')](_0x8dee('0xe'),auth[_0x8dee('0x9')](),controller['getHopperHistories']);router[_0x8dee('0x8')]('/:id/hopper_finals',auth[_0x8dee('0x9')](),controller[_0x8dee('0xf')]);router[_0x8dee('0x8')](_0x8dee('0x10'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x8dee('0x8')](_0x8dee('0x11'),auth[_0x8dee('0x9')](),controller['getLists']);router[_0x8dee('0x8')]('/:id/blacklists',auth[_0x8dee('0x9')](),controller['getBlackLists']);router[_0x8dee('0x12')]('/',auth[_0x8dee('0x9')](),controller[_0x8dee('0x13')]);router[_0x8dee('0x12')](_0x8dee('0x14'),auth[_0x8dee('0x9')](),controller[_0x8dee('0x15')]);router[_0x8dee('0x12')](_0x8dee('0x11'),auth[_0x8dee('0x9')](),controller['addLists']);router[_0x8dee('0x12')](_0x8dee('0x16'),auth['isAuthenticated'](),controller[_0x8dee('0x17')]);router[_0x8dee('0x18')](_0x8dee('0xb'),auth[_0x8dee('0x9')](),controller[_0x8dee('0x19')]);router[_0x8dee('0x1a')](_0x8dee('0xb'),auth['isAuthenticated'](),controller[_0x8dee('0x1b')]);router[_0x8dee('0x1a')](_0x8dee('0x11'),auth[_0x8dee('0x9')](),controller[_0x8dee('0x1c')]);router[_0x8dee('0x1a')]('/:id/blacklists',auth[_0x8dee('0x9')](),controller[_0x8dee('0x1d')]);module[_0x8dee('0x1e')]=router;
\ No newline at end of file
+var _0x0d7d=['update','delete','removeLists','removeBlackLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','addBlackLists'];(function(_0x4c536b,_0x58690d){var _0x58d9d6=function(_0x21a87b){while(--_0x21a87b){_0x4c536b['push'](_0x4c536b['shift']());}};_0x58d9d6(++_0x58690d);}(_0x0d7d,0x191));var _0xd0d7=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x0d7d[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xd0d7('0x0'));var util=require(_0xd0d7('0x1'));var path=require(_0xd0d7('0x2'));var timeout=require('connect-timeout');var express=require(_0xd0d7('0x3'));var router=express[_0xd0d7('0x4')]();var fs_extra=require(_0xd0d7('0x5'));var auth=require(_0xd0d7('0x6'));var interaction=require(_0xd0d7('0x7'));var config=require('../../config/environment');var controller=require(_0xd0d7('0x8'));router['get']('/',auth[_0xd0d7('0x9')](),controller[_0xd0d7('0xa')]);router[_0xd0d7('0xb')](_0xd0d7('0xc'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0xd')]);router[_0xd0d7('0xb')](_0xd0d7('0xe'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0xf')]);router[_0xd0d7('0xb')](_0xd0d7('0x10'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x11')]);router['get'](_0xd0d7('0x12'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0xd0d7('0x13'),auth['isAuthenticated'](),controller[_0xd0d7('0x14')]);router[_0xd0d7('0xb')](_0xd0d7('0x15'),auth['isAuthenticated'](),controller['getLists']);router[_0xd0d7('0xb')](_0xd0d7('0x16'),auth['isAuthenticated'](),controller[_0xd0d7('0x17')]);router[_0xd0d7('0x18')]('/',auth[_0xd0d7('0x9')](),controller['create']);router[_0xd0d7('0x18')](_0xd0d7('0x19'),auth['isAuthenticated'](),controller['clone']);router['post'](_0xd0d7('0x15'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x1a')]);router[_0xd0d7('0x18')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd0d7('0x1b')]);router['put'](_0xd0d7('0xc'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x1c')]);router[_0xd0d7('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xd0d7('0x1d')](_0xd0d7('0x15'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x1e')]);router['delete']('/:id/blacklists',auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x1f')]);module[_0xd0d7('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 9c0068b..b6543bb 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 _0x2c77=['key','exports','STRING','VIRTUAL'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x2c77,0x10d));var _0x72c7=function(_0x195486,_0x6149e1){_0x195486=_0x195486-0x0;var _0x1f234f=_0x2c77[_0x195486];return _0x1f234f;};'use strict';var Sequelize=require('sequelize');module[_0x72c7('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x72c7('0x1')]},'name':{'type':Sequelize[_0x72c7('0x2')],'get':function(){return this['getDataValue'](_0x72c7('0x3'));}}};
\ No newline at end of file
+var _0x3c54=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x36387b,_0x5b495b){var _0x3eeb83=function(_0x17b0fe){while(--_0x17b0fe){_0x36387b['push'](_0x36387b['shift']());}};_0x3eeb83(++_0x5b495b);}(_0x3c54,0x75));var _0x43c5=function(_0x30067e,_0x56f207){_0x30067e=_0x30067e-0x0;var _0x5c048d=_0x3c54[_0x30067e];return _0x5c048d;};'use strict';var Sequelize=require(_0x43c5('0x0'));module[_0x43c5('0x1')]={'key':{'type':Sequelize[_0x43c5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x43c5('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x43c5('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x43c5('0x4')](_0x43c5('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 38a25e1..1649541 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 _0x1eb8=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','include','CannedAnswer','findAll','rows','catch','show','find','params','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xb8996b,_0x264773){var _0x1b61f=function(_0x1d972b){while(--_0x1d972b){_0xb8996b['push'](_0xb8996b['shift']());}};_0x1b61f(++_0x264773);}(_0x1eb8,0x16b));var _0x81eb=function(_0x447306,_0x74533c){_0x447306=_0x447306-0x0;var _0x29c3de=_0x1eb8[_0x447306];return _0x29c3de;};'use strict';var emlformat=require(_0x81eb('0x0'));var rimraf=require(_0x81eb('0x1'));var zipdir=require(_0x81eb('0x2'));var jsonpatch=require(_0x81eb('0x3'));var rp=require(_0x81eb('0x4'));var moment=require(_0x81eb('0x5'));var BPromise=require(_0x81eb('0x6'));var Mustache=require(_0x81eb('0x7'));var util=require(_0x81eb('0x8'));var path=require(_0x81eb('0x9'));var sox=require(_0x81eb('0xa'));var csv=require(_0x81eb('0xb'));var ejs=require(_0x81eb('0xc'));var fs=require('fs');var fs_extra=require(_0x81eb('0xd'));var _=require(_0x81eb('0xe'));var squel=require(_0x81eb('0xf'));var crypto=require(_0x81eb('0x10'));var jsforce=require(_0x81eb('0x11'));var deskjs=require(_0x81eb('0x12'));var toCsv=require(_0x81eb('0xb'));var querystring=require(_0x81eb('0x13'));var Papa=require(_0x81eb('0x14'));var Redis=require(_0x81eb('0x15'));var authService=require(_0x81eb('0x16'));var qs=require(_0x81eb('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81eb('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x81eb('0x19'));var config=require(_0x81eb('0x1a'));var licenseUtil=require(_0x81eb('0x1b'));var db=require(_0x81eb('0x1c'))['db'];function respondWithStatusCode(_0x27a5cf,_0x1527a5){_0x1527a5=_0x1527a5||0xcc;return function(_0x58071c){if(_0x58071c){return _0x27a5cf[_0x81eb('0x1d')](_0x1527a5);}return _0x27a5cf[_0x81eb('0x1e')](_0x1527a5)[_0x81eb('0x1f')]();};}function respondWithResult(_0x18b464,_0x5ab0fa){_0x5ab0fa=_0x5ab0fa||0xc8;return function(_0x503f27){if(_0x503f27){return _0x18b464[_0x81eb('0x1e')](_0x5ab0fa)[_0x81eb('0x20')](_0x503f27);}};}function respondWithFilteredResult(_0x50dd1b,_0x330dbd){return function(_0xde0758){if(_0xde0758){var _0x166867=typeof _0x330dbd['offset']==='undefined'&&typeof _0x330dbd[_0x81eb('0x21')]===_0x81eb('0x22');var _0x1b3742=_0xde0758[_0x81eb('0x23')];var _0x5117f2=_0x166867?0x0:_0x330dbd[_0x81eb('0x24')];var _0x46d5e8=_0x166867?_0xde0758[_0x81eb('0x23')]:_0x330dbd[_0x81eb('0x24')]+_0x330dbd[_0x81eb('0x21')];var _0x2cb091;if(_0x46d5e8>=_0x1b3742){_0x46d5e8=_0x1b3742;_0x2cb091=0xc8;}else{_0x2cb091=0xce;}_0x50dd1b[_0x81eb('0x1e')](_0x2cb091);return _0x50dd1b[_0x81eb('0x25')](_0x81eb('0x26'),_0x5117f2+'-'+_0x46d5e8+'/'+_0x1b3742)['json'](_0xde0758);}return null;};}function patchUpdates(_0x467bd5){return function(_0x53d9b7){try{jsonpatch[_0x81eb('0x27')](_0x53d9b7,_0x467bd5,!![]);}catch(_0x52bb60){return BPromise[_0x81eb('0x28')](_0x52bb60);}return _0x53d9b7[_0x81eb('0x29')]();};}function saveUpdates(_0x5a6984,_0x509fbd){return function(_0x4f8cba){if(_0x4f8cba){return _0x4f8cba[_0x81eb('0x2a')](_0x5a6984)[_0x81eb('0x2b')](function(_0x292af3){return _0x292af3;});}return null;};}function removeEntity(_0x27a1a2,_0x1f850a){return function(_0xf13b2b){if(_0xf13b2b){return _0xf13b2b[_0x81eb('0x2c')]()[_0x81eb('0x2b')](function(){var _0x59ef10=_0xf13b2b[_0x81eb('0x2d')]({'plain':!![]});var _0x35c316='CannedAnswers';return db[_0x81eb('0x2e')][_0x81eb('0x2c')]({'where':{'type':_0x35c316,'resourceId':_0x59ef10['id']}})['then'](function(){return _0xf13b2b;});})['then'](function(){_0x27a1a2[_0x81eb('0x1e')](0xcc)[_0x81eb('0x1f')]();});}};}function handleEntityNotFound(_0xa49a1f,_0x2f9873){return function(_0x3dbfbb){if(!_0x3dbfbb){_0xa49a1f[_0x81eb('0x1d')](0x194);}return _0x3dbfbb;};}function handleError(_0x39a800,_0x885557){_0x885557=_0x885557||0x1f4;return function(_0x376c91){logger['error'](_0x376c91[_0x81eb('0x2f')]);if(_0x376c91[_0x81eb('0x30')]){delete _0x376c91[_0x81eb('0x30')];}_0x39a800[_0x81eb('0x1e')](_0x885557)['send'](_0x376c91);};}exports['index']=function(_0x1fec26,_0x589652){var _0x304213={},_0x3844ee={},_0x4efe6c={'count':0x0,'rows':[]};var _0xe66b86=_[_0x81eb('0x31')](db['CannedAnswer'][_0x81eb('0x32')],function(_0x433b8b){return{'name':_0x433b8b[_0x81eb('0x33')],'type':_0x433b8b['type']['key']};});_0x3844ee[_0x81eb('0x34')]=_[_0x81eb('0x31')](_0xe66b86,_0x81eb('0x30'));_0x3844ee[_0x81eb('0x35')]=_[_0x81eb('0x36')](_0x1fec26[_0x81eb('0x35')]);_0x3844ee[_0x81eb('0x37')]=_[_0x81eb('0x38')](_0x3844ee[_0x81eb('0x34')],_0x3844ee[_0x81eb('0x35')]);_0x304213[_0x81eb('0x39')]=_['intersection'](_0x3844ee['model'],qs[_0x81eb('0x3a')](_0x1fec26[_0x81eb('0x35')][_0x81eb('0x3a')]));_0x304213['attributes']=_0x304213[_0x81eb('0x39')][_0x81eb('0x3b')]?_0x304213[_0x81eb('0x39')]:_0x3844ee[_0x81eb('0x34')];if(!_0x1fec26[_0x81eb('0x35')]['hasOwnProperty'](_0x81eb('0x3c'))){_0x304213[_0x81eb('0x21')]=qs[_0x81eb('0x21')](_0x1fec26[_0x81eb('0x35')]['limit']);_0x304213[_0x81eb('0x24')]=qs[_0x81eb('0x24')](_0x1fec26[_0x81eb('0x35')][_0x81eb('0x24')]);}_0x304213[_0x81eb('0x3d')]=qs[_0x81eb('0x3e')](_0x1fec26['query'][_0x81eb('0x3e')]);_0x304213['where']=qs[_0x81eb('0x37')](_[_0x81eb('0x3f')](_0x1fec26[_0x81eb('0x35')],_0x3844ee[_0x81eb('0x37')]),_0xe66b86);if(_0x1fec26['query'][_0x81eb('0x40')]){_0x304213['where']=_['merge'](_0x304213[_0x81eb('0x41')],{'$or':[{'key':{'$like':'%'+_0x1fec26[_0x81eb('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x1fec26[_0x81eb('0x35')][_0x81eb('0x40')]+'%'}}]});}_0x304213=_[_0x81eb('0x42')]({},_0x304213,_0x1fec26[_0x81eb('0x43')]);var _0x409599={'where':_0x304213[_0x81eb('0x41')]};return db['CannedAnswer']['count'](_0x409599)[_0x81eb('0x2b')](function(_0x10e374){_0x4efe6c['count']=_0x10e374;if(_0x1fec26[_0x81eb('0x35')]['includeAll']){_0x304213[_0x81eb('0x44')]=[{'all':!![]}];}return db[_0x81eb('0x45')][_0x81eb('0x46')](_0x304213);})['then'](function(_0x48707d){_0x4efe6c[_0x81eb('0x47')]=_0x48707d;return _0x4efe6c;})[_0x81eb('0x2b')](respondWithFilteredResult(_0x589652,_0x304213))[_0x81eb('0x48')](handleError(_0x589652,null));};exports[_0x81eb('0x49')]=function(_0x3deb96,_0x4a7a4b){var _0x436402={'raw':!![],'where':{'id':_0x3deb96['params']['id']}},_0x408898={};_0x408898['model']=_[_0x81eb('0x36')](db[_0x81eb('0x45')][_0x81eb('0x32')]);_0x408898['query']=_[_0x81eb('0x36')](_0x3deb96[_0x81eb('0x35')]);_0x408898[_0x81eb('0x37')]=_[_0x81eb('0x38')](_0x408898[_0x81eb('0x34')],_0x408898['query']);_0x436402[_0x81eb('0x39')]=_[_0x81eb('0x38')](_0x408898[_0x81eb('0x34')],qs[_0x81eb('0x3a')](_0x3deb96[_0x81eb('0x35')][_0x81eb('0x3a')]));_0x436402[_0x81eb('0x39')]=_0x436402[_0x81eb('0x39')]['length']?_0x436402[_0x81eb('0x39')]:_0x408898[_0x81eb('0x34')];if(_0x3deb96[_0x81eb('0x35')]['includeAll']){_0x436402['include']=[{'all':!![]}];}_0x436402=_[_0x81eb('0x42')]({},_0x436402,_0x3deb96[_0x81eb('0x43')]);return db[_0x81eb('0x45')]['find'](_0x436402)[_0x81eb('0x2b')](handleEntityNotFound(_0x4a7a4b,null))[_0x81eb('0x2b')](respondWithResult(_0x4a7a4b,null))[_0x81eb('0x48')](handleError(_0x4a7a4b,null));};exports[_0x81eb('0x2a')]=function(_0x4ee255,_0x505d09){if(_0x4ee255['body']['id']){delete _0x4ee255['body']['id'];}return db[_0x81eb('0x45')][_0x81eb('0x4a')]({'where':{'id':_0x4ee255[_0x81eb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x505d09,null))[_0x81eb('0x2b')](saveUpdates(_0x4ee255[_0x81eb('0x4c')],null))[_0x81eb('0x2b')](respondWithResult(_0x505d09,null))[_0x81eb('0x48')](handleError(_0x505d09,null));};exports[_0x81eb('0x2c')]=function(_0xddc027,_0x49ff92){return db['CannedAnswer']['find']({'where':{'id':_0xddc027[_0x81eb('0x4b')]['id']}})[_0x81eb('0x2b')](handleEntityNotFound(_0x49ff92,null))[_0x81eb('0x2b')](removeEntity(_0x49ff92,null))[_0x81eb('0x48')](handleError(_0x49ff92,null));};exports['create']=function(_0x44bb41,_0x2bc03b){var _0x46b342={'key':_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x4d')]};if(_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x4e')]){_0x46b342[_0x81eb('0x4e')]=_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x4e')];}else if(_0x44bb41['body'][_0x81eb('0x4f')]){_0x46b342[_0x81eb('0x4f')]=_0x44bb41['body'][_0x81eb('0x4f')];}else if(_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x50')]){_0x46b342[_0x81eb('0x50')]=_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x50')];}else if(_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x51')]){_0x46b342[_0x81eb('0x51')]=_0x44bb41['body'][_0x81eb('0x51')];}return db[_0x81eb('0x45')][_0x81eb('0x4a')]({'where':_0x46b342})[_0x81eb('0x2b')](function(_0x58c741){if(_0x58c741){throw new db[(_0x81eb('0x52'))][(_0x81eb('0x53'))](_0x81eb('0x54'));}return db[_0x81eb('0x45')][_0x81eb('0x55')](_0x44bb41[_0x81eb('0x4c')]);})[_0x81eb('0x2b')](function(_0x5393da){var _0x3a8876=_0x44bb41[_0x81eb('0x56')][_0x81eb('0x2d')]({'plain':!![]});if(!_0x3a8876)throw new Error(_0x81eb('0x57'));if(_0x3a8876[_0x81eb('0x58')]===_0x81eb('0x56')){var _0x7af777=_0x5393da[_0x81eb('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0x81eb('0x4a')]({'where':{'name':_0x81eb('0x59'),'userProfileId':_0x3a8876[_0x81eb('0x5a')]},'raw':!![]})['then'](function(_0x4b6e95){if(_0x4b6e95&&_0x4b6e95['autoAssociation']===0x0){return db[_0x81eb('0x2e')][_0x81eb('0x55')]({'name':_0x7af777['name'],'resourceId':_0x7af777['id'],'type':_0x4b6e95['name'],'sectionId':_0x4b6e95['id']},{})[_0x81eb('0x2b')](function(){return _0x5393da;});}else{return _0x5393da;}})[_0x81eb('0x48')](function(_0x508363){logger[_0x81eb('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x508363);throw _0x508363;});}return _0x5393da;})[_0x81eb('0x2b')](respondWithResult(_0x2bc03b,0xc9))[_0x81eb('0x48')](handleError(_0x2bc03b,null));};
\ No newline at end of file
+var _0xd22b=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','CannedAnswer','rows','show','rawAttributes','includeAll','find','catch','update','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','then','destroy','get','CannedAnswers','end','error','name','send','index','map','key'];(function(_0x598f21,_0x122523){var _0x127aab=function(_0x1860b8){while(--_0x1860b8){_0x598f21['push'](_0x598f21['shift']());}};_0x127aab(++_0x122523);}(_0xd22b,0x129));var _0xbd22=function(_0x2c2067,_0x8d6bce){_0x2c2067=_0x2c2067-0x0;var _0x20f3b3=_0xd22b[_0x2c2067];return _0x20f3b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd22('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbd22('0x1'));var moment=require(_0xbd22('0x2'));var BPromise=require(_0xbd22('0x3'));var Mustache=require(_0xbd22('0x4'));var util=require(_0xbd22('0x5'));var path=require(_0xbd22('0x6'));var sox=require(_0xbd22('0x7'));var csv=require(_0xbd22('0x8'));var ejs=require(_0xbd22('0x9'));var fs=require('fs');var fs_extra=require(_0xbd22('0xa'));var _=require(_0xbd22('0xb'));var squel=require(_0xbd22('0xc'));var crypto=require(_0xbd22('0xd'));var jsforce=require(_0xbd22('0xe'));var deskjs=require(_0xbd22('0xf'));var toCsv=require(_0xbd22('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd22('0x10'));var authService=require(_0xbd22('0x11'));var qs=require(_0xbd22('0x12'));var as=require(_0xbd22('0x13'));var hardwareService=require(_0xbd22('0x14'));var logger=require(_0xbd22('0x15'))(_0xbd22('0x16'));var utils=require(_0xbd22('0x17'));var config=require(_0xbd22('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd22('0x19'))['db'];function respondWithStatusCode(_0xb36394,_0x1c481a){_0x1c481a=_0x1c481a||0xcc;return function(_0x120a51){if(_0x120a51){return _0xb36394[_0xbd22('0x1a')](_0x1c481a);}return _0xb36394[_0xbd22('0x1b')](_0x1c481a)['end']();};}function respondWithResult(_0x1d9797,_0x7f25a8){_0x7f25a8=_0x7f25a8||0xc8;return function(_0x413ce6){if(_0x413ce6){return _0x1d9797[_0xbd22('0x1b')](_0x7f25a8)[_0xbd22('0x1c')](_0x413ce6);}};}function respondWithFilteredResult(_0x29591b,_0x3490bd){return function(_0x21c799){if(_0x21c799){var _0x582e47=typeof _0x3490bd['offset']===_0xbd22('0x1d')&&typeof _0x3490bd[_0xbd22('0x1e')]==='undefined';var _0xcb0b55=_0x21c799[_0xbd22('0x1f')];var _0x350106=_0x582e47?0x0:_0x3490bd[_0xbd22('0x20')];var _0x4edfba=_0x582e47?_0x21c799[_0xbd22('0x1f')]:_0x3490bd[_0xbd22('0x20')]+_0x3490bd[_0xbd22('0x1e')];var _0x5ec25c;if(_0x4edfba>=_0xcb0b55){_0x4edfba=_0xcb0b55;_0x5ec25c=0xc8;}else{_0x5ec25c=0xce;}_0x29591b[_0xbd22('0x1b')](_0x5ec25c);return _0x29591b[_0xbd22('0x21')](_0xbd22('0x22'),_0x350106+'-'+_0x4edfba+'/'+_0xcb0b55)[_0xbd22('0x1c')](_0x21c799);}return null;};}function patchUpdates(_0x1a49da){return function(_0x25e6b4){try{jsonpatch['apply'](_0x25e6b4,_0x1a49da,!![]);}catch(_0x5e42e9){return BPromise['reject'](_0x5e42e9);}return _0x25e6b4[_0xbd22('0x23')]();};}function saveUpdates(_0x373968,_0x2365c8){return function(_0x123936){if(_0x123936){return _0x123936['update'](_0x373968)[_0xbd22('0x24')](function(_0x4d6467){return _0x4d6467;});}return null;};}function removeEntity(_0x541098,_0x3b3118){return function(_0x35bce1){if(_0x35bce1){return _0x35bce1[_0xbd22('0x25')]()[_0xbd22('0x24')](function(){var _0x181847=_0x35bce1[_0xbd22('0x26')]({'plain':!![]});var _0x34c911=_0xbd22('0x27');return db['UserProfileResource'][_0xbd22('0x25')]({'where':{'type':_0x34c911,'resourceId':_0x181847['id']}})['then'](function(){return _0x35bce1;});})[_0xbd22('0x24')](function(){_0x541098['status'](0xcc)[_0xbd22('0x28')]();});}};}function handleEntityNotFound(_0x3871d7,_0x36906d){return function(_0xc8dcd7){if(!_0xc8dcd7){_0x3871d7[_0xbd22('0x1a')](0x194);}return _0xc8dcd7;};}function handleError(_0x3a5e75,_0x59e2d2){_0x59e2d2=_0x59e2d2||0x1f4;return function(_0x12a3c8){logger[_0xbd22('0x29')](_0x12a3c8['stack']);if(_0x12a3c8['name']){delete _0x12a3c8[_0xbd22('0x2a')];}_0x3a5e75[_0xbd22('0x1b')](_0x59e2d2)[_0xbd22('0x2b')](_0x12a3c8);};}exports[_0xbd22('0x2c')]=function(_0x4bbf52,_0x4d29bf){var _0xe2f363={},_0x475c32={},_0x22d7fc={'count':0x0,'rows':[]};var _0x309236=_[_0xbd22('0x2d')](db['CannedAnswer']['rawAttributes'],function(_0x315c86){return{'name':_0x315c86['fieldName'],'type':_0x315c86['type'][_0xbd22('0x2e')]};});_0x475c32[_0xbd22('0x2f')]=_[_0xbd22('0x2d')](_0x309236,_0xbd22('0x2a'));_0x475c32[_0xbd22('0x30')]=_[_0xbd22('0x31')](_0x4bbf52[_0xbd22('0x30')]);_0x475c32['filters']=_[_0xbd22('0x32')](_0x475c32['model'],_0x475c32[_0xbd22('0x30')]);_0xe2f363[_0xbd22('0x33')]=_[_0xbd22('0x32')](_0x475c32[_0xbd22('0x2f')],qs[_0xbd22('0x34')](_0x4bbf52[_0xbd22('0x30')][_0xbd22('0x34')]));_0xe2f363[_0xbd22('0x33')]=_0xe2f363[_0xbd22('0x33')][_0xbd22('0x35')]?_0xe2f363[_0xbd22('0x33')]:_0x475c32[_0xbd22('0x2f')];if(!_0x4bbf52['query'][_0xbd22('0x36')](_0xbd22('0x37'))){_0xe2f363[_0xbd22('0x1e')]=qs[_0xbd22('0x1e')](_0x4bbf52[_0xbd22('0x30')][_0xbd22('0x1e')]);_0xe2f363[_0xbd22('0x20')]=qs[_0xbd22('0x20')](_0x4bbf52[_0xbd22('0x30')]['offset']);}_0xe2f363['order']=qs[_0xbd22('0x38')](_0x4bbf52[_0xbd22('0x30')]['sort']);_0xe2f363[_0xbd22('0x39')]=qs[_0xbd22('0x3a')](_[_0xbd22('0x3b')](_0x4bbf52[_0xbd22('0x30')],_0x475c32['filters']),_0x309236);if(_0x4bbf52[_0xbd22('0x30')][_0xbd22('0x3c')]){_0xe2f363[_0xbd22('0x39')]=_[_0xbd22('0x3d')](_0xe2f363[_0xbd22('0x39')],{'$or':[{'key':{'$like':'%'+_0x4bbf52[_0xbd22('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x4bbf52['query']['filter']+'%'}}]});}_0xe2f363=_[_0xbd22('0x3d')]({},_0xe2f363,_0x4bbf52[_0xbd22('0x3e')]);var _0x36d2b3={'where':_0xe2f363['where']};return db['CannedAnswer'][_0xbd22('0x1f')](_0x36d2b3)['then'](function(_0x2d0d9b){_0x22d7fc['count']=_0x2d0d9b;if(_0x4bbf52['query']['includeAll']){_0xe2f363[_0xbd22('0x3f')]=[{'all':!![]}];}return db[_0xbd22('0x40')]['findAll'](_0xe2f363);})['then'](function(_0x57fef0){_0x22d7fc[_0xbd22('0x41')]=_0x57fef0;return _0x22d7fc;})[_0xbd22('0x24')](respondWithFilteredResult(_0x4d29bf,_0xe2f363))['catch'](handleError(_0x4d29bf,null));};exports[_0xbd22('0x42')]=function(_0x17c8a4,_0x2f7e44){var _0x4b1e27={'raw':!![],'where':{'id':_0x17c8a4['params']['id']}},_0x1f91c4={};_0x1f91c4[_0xbd22('0x2f')]=_[_0xbd22('0x31')](db[_0xbd22('0x40')][_0xbd22('0x43')]);_0x1f91c4[_0xbd22('0x30')]=_[_0xbd22('0x31')](_0x17c8a4['query']);_0x1f91c4[_0xbd22('0x3a')]=_[_0xbd22('0x32')](_0x1f91c4[_0xbd22('0x2f')],_0x1f91c4[_0xbd22('0x30')]);_0x4b1e27[_0xbd22('0x33')]=_[_0xbd22('0x32')](_0x1f91c4[_0xbd22('0x2f')],qs[_0xbd22('0x34')](_0x17c8a4[_0xbd22('0x30')]['fields']));_0x4b1e27[_0xbd22('0x33')]=_0x4b1e27['attributes'][_0xbd22('0x35')]?_0x4b1e27[_0xbd22('0x33')]:_0x1f91c4[_0xbd22('0x2f')];if(_0x17c8a4[_0xbd22('0x30')][_0xbd22('0x44')]){_0x4b1e27[_0xbd22('0x3f')]=[{'all':!![]}];}_0x4b1e27=_[_0xbd22('0x3d')]({},_0x4b1e27,_0x17c8a4[_0xbd22('0x3e')]);return db['CannedAnswer'][_0xbd22('0x45')](_0x4b1e27)[_0xbd22('0x24')](handleEntityNotFound(_0x2f7e44,null))[_0xbd22('0x24')](respondWithResult(_0x2f7e44,null))[_0xbd22('0x46')](handleError(_0x2f7e44,null));};exports[_0xbd22('0x47')]=function(_0x375132,_0x6d897b){if(_0x375132[_0xbd22('0x48')]['id']){delete _0x375132[_0xbd22('0x48')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x375132[_0xbd22('0x49')]['id']}})['then'](handleEntityNotFound(_0x6d897b,null))['then'](saveUpdates(_0x375132[_0xbd22('0x48')],null))[_0xbd22('0x24')](respondWithResult(_0x6d897b,null))[_0xbd22('0x46')](handleError(_0x6d897b,null));};exports[_0xbd22('0x25')]=function(_0x3a5c8c,_0x3a996d){return db[_0xbd22('0x40')][_0xbd22('0x45')]({'where':{'id':_0x3a5c8c['params']['id']}})[_0xbd22('0x24')](handleEntityNotFound(_0x3a996d,null))[_0xbd22('0x24')](removeEntity(_0x3a996d,null))[_0xbd22('0x46')](handleError(_0x3a996d,null));};exports['create']=function(_0x14a7b4,_0x480d84){var _0x1eb49c={'key':_0x14a7b4[_0xbd22('0x48')]['key']};if(_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4a')]){_0x1eb49c[_0xbd22('0x4a')]=_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4a')];}else if(_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4b')]){_0x1eb49c[_0xbd22('0x4b')]=_0x14a7b4['body']['SmsAccountId'];}else if(_0x14a7b4['body'][_0xbd22('0x4c')]){_0x1eb49c['OpenchannelAccountId']=_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4c')];}else if(_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4d')]){_0x1eb49c[_0xbd22('0x4d')]=_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4d')];}return db[_0xbd22('0x40')]['find']({'where':_0x1eb49c})[_0xbd22('0x24')](function(_0x332372){if(_0x332372){throw new db['Sequelize']['ValidationError'](_0xbd22('0x4e'));}return db[_0xbd22('0x40')][_0xbd22('0x4f')](_0x14a7b4[_0xbd22('0x48')]);})[_0xbd22('0x24')](function(_0x461552){var _0x1498f9=_0x14a7b4[_0xbd22('0x50')][_0xbd22('0x26')]({'plain':!![]});if(!_0x1498f9)throw new Error(_0xbd22('0x51'));if(_0x1498f9[_0xbd22('0x52')]===_0xbd22('0x50')){var _0x43feb2=_0x461552[_0xbd22('0x26')]({'plain':!![]});return db[_0xbd22('0x53')][_0xbd22('0x45')]({'where':{'name':'CannedAnswers','userProfileId':_0x1498f9[_0xbd22('0x54')]},'raw':!![]})['then'](function(_0x1cd209){if(_0x1cd209&&_0x1cd209['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x43feb2[_0xbd22('0x2a')],'resourceId':_0x43feb2['id'],'type':_0x1cd209[_0xbd22('0x2a')],'sectionId':_0x1cd209['id']},{})[_0xbd22('0x24')](function(){return _0x461552;});}else{return _0x461552;}})[_0xbd22('0x46')](function(_0xd31ee4){logger[_0xbd22('0x29')](_0xbd22('0x55'),_0xd31ee4);throw _0xd31ee4;});}return _0x461552;})[_0xbd22('0x24')](respondWithResult(_0x480d84,0xc9))[_0xbd22('0x46')](handleError(_0x480d84,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index dcd690c..ad4b43e 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 _0xbafb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x55bd12,_0x3ccb52){var _0x1941dd=function(_0x22fa61){while(--_0x22fa61){_0x55bd12['push'](_0x55bd12['shift']());}};_0x1941dd(++_0x3ccb52);}(_0xbafb,0xf0));var _0xbbaf=function(_0x237610,_0x2955a6){_0x237610=_0x237610-0x0;var _0xfb9744=_0xbafb[_0x237610];return _0xfb9744;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbbaf('0x0'));var moment=require(_0xbbaf('0x1'));var BPromise=require(_0xbbaf('0x2'));var rp=require(_0xbbaf('0x3'));var fs=require('fs');var path=require(_0xbbaf('0x4'));var rimraf=require(_0xbbaf('0x5'));var config=require(_0xbbaf('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xbbaf('0x7')]=function(_0x54760c,_0x25f0ba){return _0x54760c[_0xbbaf('0x8')](_0xbbaf('0x9'),attributes,{'tableName':_0xbbaf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbbaf('0xb')});};
\ No newline at end of file
+var _0x9997=['request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x167f6e,_0x534613){var _0x2bf5e6=function(_0x1435f3){while(--_0x1435f3){_0x167f6e['push'](_0x167f6e['shift']());}};_0x2bf5e6(++_0x534613);}(_0x9997,0xf8));var _0x7999=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x9997[_0x52ea08];return _0x28d546;};'use strict';var _=require('lodash');var util=require(_0x7999('0x0'));var logger=require(_0x7999('0x1'))(_0x7999('0x2'));var moment=require('moment');var BPromise=require(_0x7999('0x3'));var rp=require(_0x7999('0x4'));var fs=require('fs');var path=require(_0x7999('0x5'));var rimraf=require(_0x7999('0x6'));var config=require(_0x7999('0x7'));var attributes=require(_0x7999('0x8'));module[_0x7999('0x9')]=function(_0x4d80f1,_0x118c5a){return _0x4d80f1['define'](_0x7999('0xa'),attributes,{'tableName':_0x7999('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7999('0xc'),'collate':_0x7999('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 34e6dc6..b71957a 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(_0x5f248,_0x33b1ed){var _0x2c7486=function(_0x3fd619){while(--_0x3fd619){_0x5f248['push'](_0x5f248['shift']());}};_0x2c7486(++_0x33b1ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x40867c,_0x3aa861){var _0x201b20=function(_0x8d092d){while(--_0x8d092d){_0x40867c['push'](_0x40867c['shift']());}};_0x201b20(++_0x3aa861);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 2b72b3a..3b13f0c 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 _0xcecf=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0xcecf,0x12f));var _0xfcec=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xcecf[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xfcec('0x0'));var util=require(_0xfcec('0x1'));var path=require(_0xfcec('0x2'));var timeout=require(_0xfcec('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfcec('0x4'));var auth=require(_0xfcec('0x5'));var interaction=require(_0xfcec('0x6'));var config=require(_0xfcec('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xfcec('0x8')](),controller[_0xfcec('0x9')]);router[_0xfcec('0xa')]('/:id',auth[_0xfcec('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfcec('0xb')](_0xfcec('0xc'),auth[_0xfcec('0x8')](),controller[_0xfcec('0xd')]);router[_0xfcec('0xe')]('/:id',auth[_0xfcec('0x8')](),controller[_0xfcec('0xf')]);module[_0xfcec('0x10')]=router;
\ No newline at end of file
+var _0xdf7e=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xdf7e,0x142));var _0xedf7=function(_0x350e4b,_0x19661a){_0x350e4b=_0x350e4b-0x0;var _0x5955b4=_0xdf7e[_0x350e4b];return _0x5955b4;};'use strict';var multer=require(_0xedf7('0x0'));var util=require(_0xedf7('0x1'));var path=require('path');var timeout=require(_0xedf7('0x2'));var express=require(_0xedf7('0x3'));var router=express[_0xedf7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xedf7('0x5'));var interaction=require(_0xedf7('0x6'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xedf7('0x7')]('/',auth[_0xedf7('0x8')](),controller[_0xedf7('0x9')]);router[_0xedf7('0x7')](_0xedf7('0xa'),auth[_0xedf7('0x8')](),controller[_0xedf7('0xb')]);router[_0xedf7('0xc')]('/',auth[_0xedf7('0x8')](),controller[_0xedf7('0xd')]);router[_0xedf7('0xe')](_0xedf7('0xa'),auth[_0xedf7('0x8')](),controller[_0xedf7('0xf')]);router['delete'](_0xedf7('0xa'),auth['isAuthenticated'](),controller[_0xedf7('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 18af401..90d1b18 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 _0x520e=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x520e,0x90));var _0xe520=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0x520e[_0x3f59b1];return _0x11d2e8;};'use strict';var Sequelize=require(_0xe520('0x0'));module[_0xe520('0x1')]={'calldate':{'type':Sequelize[_0xe520('0x2')],'allowNull':![],'defaultValue':_0xe520('0x3')},'clid':{'type':Sequelize[_0xe520('0x4')]},'src':{'type':Sequelize[_0xe520('0x4')]},'dst':{'type':Sequelize[_0xe520('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe520('0x4')]},'dstchannel':{'type':Sequelize[_0xe520('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe520('0x4')]},'duration':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe520('0x4')]},'amaflags':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe520('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe520('0x4')]},'linkedid':{'type':Sequelize[_0xe520('0x4')]},'sequence':{'type':Sequelize[_0xe520('0x4')]},'peeraccount':{'type':Sequelize[_0xe520('0x4')]},'type':{'type':Sequelize[_0xe520('0x4')]},'tag':{'type':Sequelize[_0xe520('0x4')]}};
\ No newline at end of file
+var _0x18e0=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x351406,_0x3310c3){var _0x5af45d=function(_0x1e8c2c){while(--_0x1e8c2c){_0x351406['push'](_0x351406['shift']());}};_0x5af45d(++_0x3310c3);}(_0x18e0,0xa2));var _0x018e=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x18e0[_0x3070dc];return _0x431489;};'use strict';var Sequelize=require('sequelize');module[_0x018e('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x018e('0x1')},'clid':{'type':Sequelize[_0x018e('0x2')]},'src':{'type':Sequelize[_0x018e('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x018e('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x018e('0x2')]},'lastdata':{'type':Sequelize[_0x018e('0x2')]},'duration':{'type':Sequelize[_0x018e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x018e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x018e('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x018e('0x2')]},'linkedid':{'type':Sequelize[_0x018e('0x2')]},'sequence':{'type':Sequelize[_0x018e('0x2')]},'peeraccount':{'type':Sequelize[_0x018e('0x2')]},'type':{'type':Sequelize[_0x018e('0x2')]},'tag':{'type':Sequelize[_0x018e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 67fd738..176043d 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 _0xe015=['type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','name','send','index','Cdr','rawAttributes'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xe015,0x13b));var _0x5e01=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe015[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x5e01('0x0'));var rimraf=require(_0x5e01('0x1'));var zipdir=require(_0x5e01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5e01('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5e01('0x4'));var util=require(_0x5e01('0x5'));var path=require(_0x5e01('0x6'));var sox=require(_0x5e01('0x7'));var csv=require('to-csv');var ejs=require(_0x5e01('0x8'));var fs=require('fs');var fs_extra=require(_0x5e01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e01('0xa'));var jsforce=require(_0x5e01('0xb'));var deskjs=require(_0x5e01('0xc'));var toCsv=require(_0x5e01('0xd'));var querystring=require(_0x5e01('0xe'));var Papa=require(_0x5e01('0xf'));var Redis=require('ioredis');var authService=require(_0x5e01('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e01('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e01('0x12'))(_0x5e01('0x13'));var utils=require('../../config/utils');var config=require(_0x5e01('0x14'));var licenseUtil=require(_0x5e01('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x560ae2,_0x3d0b04){_0x3d0b04=_0x3d0b04||0xcc;return function(_0x160f79){if(_0x160f79){return _0x560ae2[_0x5e01('0x16')](_0x3d0b04);}return _0x560ae2[_0x5e01('0x17')](_0x3d0b04)[_0x5e01('0x18')]();};}function respondWithResult(_0x16bc8f,_0x4bd426){_0x4bd426=_0x4bd426||0xc8;return function(_0x36da26){if(_0x36da26){return _0x16bc8f['status'](_0x4bd426)['json'](_0x36da26);}};}function respondWithFilteredResult(_0x1df2e0,_0x2dd70c){return function(_0x494b8a){if(_0x494b8a){var _0x27c6e7=typeof _0x2dd70c['offset']===_0x5e01('0x19')&&typeof _0x2dd70c['limit']===_0x5e01('0x19');var _0x5d85e3=_0x494b8a[_0x5e01('0x1a')];var _0x5eda1d=_0x27c6e7?0x0:_0x2dd70c['offset'];var _0x35a002=_0x27c6e7?_0x494b8a[_0x5e01('0x1a')]:_0x2dd70c['offset']+_0x2dd70c[_0x5e01('0x1b')];var _0x2df752;if(_0x35a002>=_0x5d85e3){_0x35a002=_0x5d85e3;_0x2df752=0xc8;}else{_0x2df752=0xce;}_0x1df2e0[_0x5e01('0x17')](_0x2df752);return _0x1df2e0[_0x5e01('0x1c')](_0x5e01('0x1d'),_0x5eda1d+'-'+_0x35a002+'/'+_0x5d85e3)[_0x5e01('0x1e')](_0x494b8a);}return null;};}function patchUpdates(_0x173410){return function(_0x153eb1){try{jsonpatch['apply'](_0x153eb1,_0x173410,!![]);}catch(_0x150ebf){return BPromise[_0x5e01('0x1f')](_0x150ebf);}return _0x153eb1['save']();};}function saveUpdates(_0xf6fe3f,_0x306cff){return function(_0x337ad2){if(_0x337ad2){return _0x337ad2[_0x5e01('0x20')](_0xf6fe3f)[_0x5e01('0x21')](function(_0x284803){return _0x284803;});}return null;};}function removeEntity(_0x5efff9,_0x329315){return function(_0x720922){if(_0x720922){return _0x720922[_0x5e01('0x22')]()[_0x5e01('0x21')](function(){_0x5efff9['status'](0xcc)[_0x5e01('0x18')]();});}};}function handleEntityNotFound(_0x23264f,_0x31eb7f){return function(_0x4f94d0){if(!_0x4f94d0){_0x23264f[_0x5e01('0x16')](0x194);}return _0x4f94d0;};}function handleError(_0x23454e,_0x12a19a){_0x12a19a=_0x12a19a||0x1f4;return function(_0x28344a){logger['error'](_0x28344a['stack']);if(_0x28344a[_0x5e01('0x23')]){delete _0x28344a['name'];}_0x23454e[_0x5e01('0x17')](_0x12a19a)[_0x5e01('0x24')](_0x28344a);};}exports[_0x5e01('0x25')]=function(_0xc26cf8,_0x592a61){var _0x531f0a={},_0x4a4a9f={},_0x51a98d={'count':0x0,'rows':[]};var _0x350ab4=_['map'](db[_0x5e01('0x26')][_0x5e01('0x27')],function(_0xc6d3c2){return{'name':_0xc6d3c2['fieldName'],'type':_0xc6d3c2[_0x5e01('0x28')][_0x5e01('0x29')]};});_0x4a4a9f[_0x5e01('0x2a')]=_[_0x5e01('0x2b')](_0x350ab4,'name');_0x4a4a9f['query']=_[_0x5e01('0x2c')](_0xc26cf8[_0x5e01('0x2d')]);_0x4a4a9f[_0x5e01('0x2e')]=_[_0x5e01('0x2f')](_0x4a4a9f[_0x5e01('0x2a')],_0x4a4a9f[_0x5e01('0x2d')]);_0x531f0a[_0x5e01('0x30')]=_[_0x5e01('0x2f')](_0x4a4a9f[_0x5e01('0x2a')],qs[_0x5e01('0x31')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x31')]));_0x531f0a['attributes']=_0x531f0a[_0x5e01('0x30')][_0x5e01('0x32')]?_0x531f0a[_0x5e01('0x30')]:_0x4a4a9f['model'];if(!_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x33')]('nolimit')){_0x531f0a[_0x5e01('0x1b')]=qs[_0x5e01('0x1b')](_0xc26cf8[_0x5e01('0x2d')]['limit']);_0x531f0a[_0x5e01('0x34')]=qs[_0x5e01('0x34')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x34')]);}_0x531f0a[_0x5e01('0x35')]=qs[_0x5e01('0x36')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x36')]);_0x531f0a[_0x5e01('0x37')]=qs[_0x5e01('0x2e')](_[_0x5e01('0x38')](_0xc26cf8[_0x5e01('0x2d')],_0x4a4a9f[_0x5e01('0x2e')]),_0x350ab4);if(_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x39')]){_0x531f0a['where']=_[_0x5e01('0x3a')](_0x531f0a['where'],{'$or':_['map'](_0x350ab4,function(_0x34e8f5){if(_0x34e8f5[_0x5e01('0x28')]!==_0x5e01('0x3b')){var _0x117fb3={};_0x117fb3[_0x34e8f5[_0x5e01('0x23')]]={'$like':'%'+_0xc26cf8['query'][_0x5e01('0x39')]+'%'};return _0x117fb3;}})});}_0x531f0a=_[_0x5e01('0x3a')]({},_0x531f0a,_0xc26cf8['options']);var _0x3c37d5={'where':_0x531f0a[_0x5e01('0x37')]};return db[_0x5e01('0x26')]['count'](_0x3c37d5)[_0x5e01('0x21')](function(_0xfed2d2){_0x51a98d['count']=_0xfed2d2;if(_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x3c')]){_0x531f0a['include']=[{'all':!![]}];}return db['Cdr'][_0x5e01('0x3d')](_0x531f0a);})['then'](function(_0x2d7423){_0x51a98d[_0x5e01('0x3e')]=_0x2d7423;return _0x51a98d;})[_0x5e01('0x21')](respondWithFilteredResult(_0x592a61,_0x531f0a))[_0x5e01('0x3f')](handleError(_0x592a61,null));};exports['show']=function(_0x296d33,_0xb93846){var _0x23275f={'raw':!![],'where':{'id':_0x296d33[_0x5e01('0x40')]['id']}},_0x44a5e4={};_0x44a5e4[_0x5e01('0x2a')]=_[_0x5e01('0x2c')](db['Cdr'][_0x5e01('0x27')]);_0x44a5e4[_0x5e01('0x2d')]=_[_0x5e01('0x2c')](_0x296d33[_0x5e01('0x2d')]);_0x44a5e4[_0x5e01('0x2e')]=_['intersection'](_0x44a5e4[_0x5e01('0x2a')],_0x44a5e4[_0x5e01('0x2d')]);_0x23275f[_0x5e01('0x30')]=_[_0x5e01('0x2f')](_0x44a5e4[_0x5e01('0x2a')],qs[_0x5e01('0x31')](_0x296d33[_0x5e01('0x2d')]['fields']));_0x23275f[_0x5e01('0x30')]=_0x23275f['attributes'][_0x5e01('0x32')]?_0x23275f[_0x5e01('0x30')]:_0x44a5e4[_0x5e01('0x2a')];if(_0x296d33[_0x5e01('0x2d')][_0x5e01('0x3c')]){_0x23275f[_0x5e01('0x41')]=[{'all':!![]}];}_0x23275f=_['merge']({},_0x23275f,_0x296d33[_0x5e01('0x42')]);return db['Cdr'][_0x5e01('0x43')](_0x23275f)[_0x5e01('0x21')](handleEntityNotFound(_0xb93846,null))[_0x5e01('0x21')](respondWithResult(_0xb93846,null))[_0x5e01('0x3f')](handleError(_0xb93846,null));};exports[_0x5e01('0x44')]=function(_0x1fbb1f,_0x555204){return db['Cdr'][_0x5e01('0x44')](_0x1fbb1f[_0x5e01('0x45')],{})[_0x5e01('0x21')](respondWithResult(_0x555204,0xc9))[_0x5e01('0x3f')](handleError(_0x555204,null));};exports[_0x5e01('0x20')]=function(_0x389520,_0x661d){if(_0x389520[_0x5e01('0x45')]['id']){delete _0x389520[_0x5e01('0x45')]['id'];}return db[_0x5e01('0x26')][_0x5e01('0x43')]({'where':{'id':_0x389520['params']['id']}})[_0x5e01('0x21')](handleEntityNotFound(_0x661d,null))[_0x5e01('0x21')](saveUpdates(_0x389520[_0x5e01('0x45')],null))['then'](respondWithResult(_0x661d,null))[_0x5e01('0x3f')](handleError(_0x661d,null));};exports[_0x5e01('0x22')]=function(_0x3fd5ac,_0xa8ff1b){return db[_0x5e01('0x26')]['find']({'where':{'id':_0x3fd5ac[_0x5e01('0x40')]['id']}})['then'](handleEntityNotFound(_0xa8ff1b,null))[_0x5e01('0x21')](removeEntity(_0xa8ff1b,null))[_0x5e01('0x3f')](handleError(_0xa8ff1b,null));};exports[_0x5e01('0x46')]=function(_0x4c368c,_0x11b36f){return db[_0x5e01('0x26')][_0x5e01('0x46')]()[_0x5e01('0x21')](respondWithResult(_0x11b36f,null))[_0x5e01('0x3f')](handleError(_0x11b36f,null));};
\ No newline at end of file
+var _0x8c46=['filter','VIRTUAL','merge','options','include','Cdr','rows','catch','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick'];(function(_0x974739,_0x45ace0){var _0x566a02=function(_0x2d936d){while(--_0x2d936d){_0x974739['push'](_0x974739['shift']());}};_0x566a02(++_0x45ace0);}(_0x8c46,0x171));var _0x68c4=function(_0x4295fd,_0x1f2573){_0x4295fd=_0x4295fd-0x0;var _0x96f34e=_0x8c46[_0x4295fd];return _0x96f34e;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];function respondWithStatusCode(_0x48783b,_0x3a432a){_0x3a432a=_0x3a432a||0xcc;return function(_0x1f5f42){if(_0x1f5f42){return _0x48783b[_0x68c4('0x16')](_0x3a432a);}return _0x48783b['status'](_0x3a432a)[_0x68c4('0x17')]();};}function respondWithResult(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xc8;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x18')](_0x5e1341)[_0x68c4('0x19')](_0x52f031);}};}function respondWithFilteredResult(_0x5be0de,_0xc25f7b){return function(_0x4ea2a4){if(_0x4ea2a4){var _0x1a7045=typeof _0xc25f7b['offset']==='undefined'&&typeof _0xc25f7b[_0x68c4('0x1a')]===_0x68c4('0x1b');var _0x4f4797=_0x4ea2a4[_0x68c4('0x1c')];var _0x1d757c=_0x1a7045?0x0:_0xc25f7b[_0x68c4('0x1d')];var _0x33c5c5=_0x1a7045?_0x4ea2a4[_0x68c4('0x1c')]:_0xc25f7b[_0x68c4('0x1d')]+_0xc25f7b[_0x68c4('0x1a')];var _0x415ef2;if(_0x33c5c5>=_0x4f4797){_0x33c5c5=_0x4f4797;_0x415ef2=0xc8;}else{_0x415ef2=0xce;}_0x5be0de[_0x68c4('0x18')](_0x415ef2);return _0x5be0de[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x33c5c5+'/'+_0x4f4797)['json'](_0x4ea2a4);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff4a5,_0x55355d){return function(_0xf16a78){if(!_0xf16a78){_0x2ff4a5[_0x68c4('0x16')](0x194);}return _0xf16a78;};}function handleError(_0x57f32,_0x4f9d32){_0x4f9d32=_0x4f9d32||0x1f4;return function(_0x1e14db){logger[_0x68c4('0x25')](_0x1e14db[_0x68c4('0x26')]);if(_0x1e14db[_0x68c4('0x27')]){delete _0x1e14db[_0x68c4('0x27')];}_0x57f32[_0x68c4('0x18')](_0x4f9d32)[_0x68c4('0x28')](_0x1e14db);};}exports['index']=function(_0x26d56b,_0x4b4634){var _0x3772b3={},_0x1442ba={},_0x56ed70={'count':0x0,'rows':[]};var _0x2847d1=_[_0x68c4('0x29')](db['Cdr'][_0x68c4('0x2a')],function(_0x3a1b69){return{'name':_0x3a1b69[_0x68c4('0x2b')],'type':_0x3a1b69[_0x68c4('0x2c')][_0x68c4('0x2d')]};});_0x1442ba[_0x68c4('0x2e')]=_[_0x68c4('0x29')](_0x2847d1,_0x68c4('0x27'));_0x1442ba[_0x68c4('0x2f')]=_[_0x68c4('0x30')](_0x26d56b[_0x68c4('0x2f')]);_0x1442ba[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],_0x1442ba[_0x68c4('0x2f')]);_0x3772b3[_0x68c4('0x33')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],qs['fields'](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x34')]));_0x3772b3[_0x68c4('0x33')]=_0x3772b3[_0x68c4('0x33')][_0x68c4('0x35')]?_0x3772b3['attributes']:_0x1442ba[_0x68c4('0x2e')];if(!_0x26d56b['query']['hasOwnProperty']('nolimit')){_0x3772b3[_0x68c4('0x1a')]=qs[_0x68c4('0x1a')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1a')]);_0x3772b3['offset']=qs[_0x68c4('0x1d')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1d')]);}_0x3772b3['order']=qs[_0x68c4('0x36')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x36')]);_0x3772b3[_0x68c4('0x37')]=qs[_0x68c4('0x31')](_[_0x68c4('0x38')](_0x26d56b[_0x68c4('0x2f')],_0x1442ba[_0x68c4('0x31')]),_0x2847d1);if(_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]){_0x3772b3['where']=_['merge'](_0x3772b3[_0x68c4('0x37')],{'$or':_[_0x68c4('0x29')](_0x2847d1,function(_0x460e11){if(_0x460e11[_0x68c4('0x2c')]!==_0x68c4('0x3a')){var _0x13386d={};_0x13386d[_0x460e11[_0x68c4('0x27')]]={'$like':'%'+_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]+'%'};return _0x13386d;}})});}_0x3772b3=_[_0x68c4('0x3b')]({},_0x3772b3,_0x26d56b[_0x68c4('0x3c')]);var _0x30a1cd={'where':_0x3772b3[_0x68c4('0x37')]};return db['Cdr']['count'](_0x30a1cd)[_0x68c4('0x24')](function(_0x2785b4){_0x56ed70[_0x68c4('0x1c')]=_0x2785b4;if(_0x26d56b[_0x68c4('0x2f')]['includeAll']){_0x3772b3[_0x68c4('0x3d')]=[{'all':!![]}];}return db[_0x68c4('0x3e')]['findAll'](_0x3772b3);})['then'](function(_0x4c564a){_0x56ed70[_0x68c4('0x3f')]=_0x4c564a;return _0x56ed70;})['then'](respondWithFilteredResult(_0x4b4634,_0x3772b3))[_0x68c4('0x40')](handleError(_0x4b4634,null));};exports['show']=function(_0x18da6f,_0x2406b1){var _0xbd848f={'raw':!![],'where':{'id':_0x18da6f['params']['id']}},_0xefe68d={};_0xefe68d[_0x68c4('0x2e')]=_[_0x68c4('0x30')](db[_0x68c4('0x3e')][_0x68c4('0x2a')]);_0xefe68d['query']=_[_0x68c4('0x30')](_0x18da6f[_0x68c4('0x2f')]);_0xefe68d[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0xefe68d[_0x68c4('0x2e')],_0xefe68d['query']);_0xbd848f['attributes']=_['intersection'](_0xefe68d[_0x68c4('0x2e')],qs[_0x68c4('0x34')](_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x34')]));_0xbd848f['attributes']=_0xbd848f[_0x68c4('0x33')][_0x68c4('0x35')]?_0xbd848f[_0x68c4('0x33')]:_0xefe68d[_0x68c4('0x2e')];if(_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x41')]){_0xbd848f[_0x68c4('0x3d')]=[{'all':!![]}];}_0xbd848f=_[_0x68c4('0x3b')]({},_0xbd848f,_0x18da6f[_0x68c4('0x3c')]);return db[_0x68c4('0x3e')][_0x68c4('0x42')](_0xbd848f)['then'](handleEntityNotFound(_0x2406b1,null))[_0x68c4('0x24')](respondWithResult(_0x2406b1,null))['catch'](handleError(_0x2406b1,null));};exports[_0x68c4('0x43')]=function(_0x44e3c9,_0x463a6b){return db[_0x68c4('0x3e')]['create'](_0x44e3c9[_0x68c4('0x44')],{})['then'](respondWithResult(_0x463a6b,0xc9))[_0x68c4('0x40')](handleError(_0x463a6b,null));};exports[_0x68c4('0x22')]=function(_0x570e25,_0x250941){if(_0x570e25[_0x68c4('0x44')]['id']){delete _0x570e25[_0x68c4('0x44')]['id'];}return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x570e25[_0x68c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x250941,null))[_0x68c4('0x24')](saveUpdates(_0x570e25[_0x68c4('0x44')],null))[_0x68c4('0x24')](respondWithResult(_0x250941,null))[_0x68c4('0x40')](handleError(_0x250941,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x40ecf6[_0x68c4('0x45')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x40')](handleError(_0x19aec2,null));};exports[_0x68c4('0x46')]=function(_0x3db854,_0x51db14){return db[_0x68c4('0x3e')][_0x68c4('0x46')]()['then'](respondWithResult(_0x51db14,null))['catch'](handleError(_0x51db14,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index c27ae6c..c41af2c 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(_0x1391da,_0x5bf609){var _0x41bff5=function(_0x1157d4){while(--_0x1157d4){_0x1391da['push'](_0x1391da['shift']());}};_0x41bff5(++_0x5bf609);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3c7775,_0x5aa6d8){var _0x525c8a=function(_0x33de4a){while(--_0x33de4a){_0x3c7775['push'](_0x3c7775['shift']());}};_0x525c8a(++_0x5aa6d8);}(_0x7a54,0x106));var _0x47a5=function(_0x891c6c,_0x508728){_0x891c6c=_0x891c6c-0x0;var _0x13007f=_0x7a54[_0x891c6c];return _0x13007f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 54d7aed..7566faa 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 _0xf0fa=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0xf0fa,0x1de));var _0xaf0f=function(_0x24e027,_0x1f16f2){_0x24e027=_0x24e027-0x0;var _0xf6ec3c=_0xf0fa[_0x24e027];return _0xf6ec3c;};'use strict';var _=require(_0xaf0f('0x0'));var util=require(_0xaf0f('0x1'));var moment=require(_0xaf0f('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf0f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf0f('0x4'))['db'];var utils=require(_0xaf0f('0x5'));var logger=require(_0xaf0f('0x6'))(_0xaf0f('0x7'));var config=require(_0xaf0f('0x8'));var jayson=require(_0xaf0f('0x9'));var client=jayson[_0xaf0f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd62a,_0x52c53f,_0xe5fe50){return new BPromise(function(_0x56f5f1,_0x584b2e){return client[_0xaf0f('0xb')](_0x2fd62a,_0xe5fe50)[_0xaf0f('0xc')](function(_0x8b69cf){logger[_0xaf0f('0xd')]('Cdr,\x20%s,\x20%s',_0x52c53f,_0xaf0f('0xe'));logger['debug'](_0xaf0f('0xf'),_0x52c53f,'request\x20sent',JSON['stringify'](_0x8b69cf));if(_0x8b69cf[_0xaf0f('0x10')]){if(_0x8b69cf[_0xaf0f('0x10')][_0xaf0f('0x11')]===0x1f4){logger['error'](_0xaf0f('0x12'),_0x52c53f,_0x8b69cf[_0xaf0f('0x10')][_0xaf0f('0x13')]);return _0x584b2e(_0x8b69cf[_0xaf0f('0x10')][_0xaf0f('0x13')]);}logger[_0xaf0f('0x10')](_0xaf0f('0x12'),_0x52c53f,_0x8b69cf['error'][_0xaf0f('0x13')]);return _0x56f5f1(_0x8b69cf[_0xaf0f('0x10')][_0xaf0f('0x13')]);}else{logger[_0xaf0f('0xd')](_0xaf0f('0x12'),_0x52c53f,_0xaf0f('0xe'));_0x56f5f1(_0x8b69cf[_0xaf0f('0x14')][_0xaf0f('0x13')]);}})[_0xaf0f('0x15')](function(_0x6ca010){logger[_0xaf0f('0x10')]('Cdr,\x20%s,\x20%s',_0x52c53f,_0x6ca010);_0x584b2e(_0x6ca010);});});}
\ No newline at end of file
+var _0xb534=['../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x2c20ef,_0x1611d8){var _0x15b51a=function(_0xef02fd){while(--_0xef02fd){_0x2c20ef['push'](_0x2c20ef['shift']());}};_0x15b51a(++_0x1611d8);}(_0xb534,0x19e));var _0x4b53=function(_0x41c037,_0x3c36c8){_0x41c037=_0x41c037-0x0;var _0x3e32f0=_0xb534[_0x41c037];return _0x3e32f0;};'use strict';var _=require(_0x4b53('0x0'));var util=require(_0x4b53('0x1'));var moment=require('moment');var BPromise=require(_0x4b53('0x2'));var rs=require(_0x4b53('0x3'));var fs=require('fs');var Redis=require(_0x4b53('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4b53('0x5'))('rpc');var config=require(_0x4b53('0x6'));var jayson=require(_0x4b53('0x7'));var client=jayson[_0x4b53('0x8')][_0x4b53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ea697,_0x454024,_0x2adc07){return new BPromise(function(_0x278f85,_0x2082a8){return client[_0x4b53('0xa')](_0x5ea697,_0x2adc07)[_0x4b53('0xb')](function(_0x1b56da){logger[_0x4b53('0xc')](_0x4b53('0xd'),_0x454024,_0x4b53('0xe'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x454024,_0x4b53('0xe'),JSON[_0x4b53('0xf')](_0x1b56da));if(_0x1b56da[_0x4b53('0x10')]){if(_0x1b56da[_0x4b53('0x10')][_0x4b53('0x11')]===0x1f4){logger[_0x4b53('0x10')](_0x4b53('0xd'),_0x454024,_0x1b56da[_0x4b53('0x10')][_0x4b53('0x12')]);return _0x2082a8(_0x1b56da[_0x4b53('0x10')][_0x4b53('0x12')]);}logger[_0x4b53('0x10')](_0x4b53('0xd'),_0x454024,_0x1b56da[_0x4b53('0x10')]['message']);return _0x278f85(_0x1b56da[_0x4b53('0x10')][_0x4b53('0x12')]);}else{logger[_0x4b53('0xc')]('Cdr,\x20%s,\x20%s',_0x454024,'request\x20sent');_0x278f85(_0x1b56da[_0x4b53('0x13')]['message']);}})[_0x4b53('0x14')](function(_0x3065a0){logger['error'](_0x4b53('0xd'),_0x454024,_0x3065a0);_0x2082a8(_0x3065a0);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 870f929..3d64a2d 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 364ff06..ca5adea 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 _0x38d5=['noop','*,*,*,*','sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x38d5,0xda));var _0x538d=function(_0x251b9d,_0x2932b1){_0x251b9d=_0x251b9d-0x0;var _0x2ffcd3=_0x38d5[_0x251b9d];return _0x2ffcd3;};'use strict';var Sequelize=require(_0x538d('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x538d('0x1')],'allowNull':![],'defaultValue':_0x538d('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x538d('0x1')]},'interval':{'type':Sequelize[_0x538d('0x1')],'defaultValue':_0x538d('0x3')}};
\ No newline at end of file
+var _0x40b6=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x4acbe8,_0x1f340f){var _0x1562d4=function(_0x3f7d72){while(--_0x3f7d72){_0x4acbe8['push'](_0x4acbe8['shift']());}};_0x1562d4(++_0x1f340f);}(_0x40b6,0x7b));var _0x640b=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x40b6[_0x313df3];return _0x241d59;};'use strict';var Sequelize=require(_0x640b('0x0'));module[_0x640b('0x1')]={'priority':{'type':Sequelize[_0x640b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x640b('0x3')],'allowNull':![],'defaultValue':_0x640b('0x4')},'appdata':{'type':Sequelize[_0x640b('0x5')]()},'description':{'type':Sequelize[_0x640b('0x3')]},'interval':{'type':Sequelize[_0x640b('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c88f9d1..f4902e4 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 _0x4f3c=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','show','params','ChatApplication','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','includeAll','options','find','catch','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api'];(function(_0x4fa9fe,_0x14c353){var _0x558d00=function(_0x361b85){while(--_0x361b85){_0x4fa9fe['push'](_0x4fa9fe['shift']());}};_0x558d00(++_0x14c353);}(_0x4f3c,0x15d));var _0xc4f3=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0x4f3c[_0x3438cf];return _0x278698;};'use strict';var emlformat=require(_0xc4f3('0x0'));var rimraf=require(_0xc4f3('0x1'));var zipdir=require(_0xc4f3('0x2'));var jsonpatch=require(_0xc4f3('0x3'));var rp=require(_0xc4f3('0x4'));var moment=require(_0xc4f3('0x5'));var BPromise=require(_0xc4f3('0x6'));var Mustache=require(_0xc4f3('0x7'));var util=require(_0xc4f3('0x8'));var path=require(_0xc4f3('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4f3('0xa'));var fs=require('fs');var fs_extra=require(_0xc4f3('0xb'));var _=require(_0xc4f3('0xc'));var squel=require(_0xc4f3('0xd'));var crypto=require(_0xc4f3('0xe'));var jsforce=require(_0xc4f3('0xf'));var deskjs=require(_0xc4f3('0x10'));var toCsv=require(_0xc4f3('0x11'));var querystring=require(_0xc4f3('0x12'));var Papa=require(_0xc4f3('0x13'));var Redis=require('ioredis');var authService=require(_0xc4f3('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4f3('0x15'));var logger=require('../../config/logger')(_0xc4f3('0x16'));var utils=require(_0xc4f3('0x17'));var config=require(_0xc4f3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4f3('0x19'))['db'];function respondWithStatusCode(_0x4e869e,_0x498374){_0x498374=_0x498374||0xcc;return function(_0x4d1c74){if(_0x4d1c74){return _0x4e869e[_0xc4f3('0x1a')](_0x498374);}return _0x4e869e[_0xc4f3('0x1b')](_0x498374)[_0xc4f3('0x1c')]();};}function respondWithResult(_0x3ffd95,_0x53e5c4){_0x53e5c4=_0x53e5c4||0xc8;return function(_0x12981d){if(_0x12981d){return _0x3ffd95[_0xc4f3('0x1b')](_0x53e5c4)[_0xc4f3('0x1d')](_0x12981d);}};}function respondWithFilteredResult(_0x47814f,_0x5583fa){return function(_0x927b26){if(_0x927b26){var _0x3a4ff3=typeof _0x5583fa['offset']===_0xc4f3('0x1e')&&typeof _0x5583fa[_0xc4f3('0x1f')]===_0xc4f3('0x1e');var _0x53b0b6=_0x927b26['count'];var _0xbc5595=_0x3a4ff3?0x0:_0x5583fa[_0xc4f3('0x20')];var _0x1dc5a8=_0x3a4ff3?_0x927b26[_0xc4f3('0x21')]:_0x5583fa['offset']+_0x5583fa[_0xc4f3('0x1f')];var _0x41e2bd;if(_0x1dc5a8>=_0x53b0b6){_0x1dc5a8=_0x53b0b6;_0x41e2bd=0xc8;}else{_0x41e2bd=0xce;}_0x47814f[_0xc4f3('0x1b')](_0x41e2bd);return _0x47814f[_0xc4f3('0x22')](_0xc4f3('0x23'),_0xbc5595+'-'+_0x1dc5a8+'/'+_0x53b0b6)[_0xc4f3('0x1d')](_0x927b26);}return null;};}function patchUpdates(_0x35111f){return function(_0x2bacbc){try{jsonpatch[_0xc4f3('0x24')](_0x2bacbc,_0x35111f,!![]);}catch(_0x16e4e7){return BPromise[_0xc4f3('0x25')](_0x16e4e7);}return _0x2bacbc['save']();};}function saveUpdates(_0x27f7e1,_0xb9b864){return function(_0x4b19a3){if(_0x4b19a3){return _0x4b19a3['update'](_0x27f7e1)[_0xc4f3('0x26')](function(_0x154729){return _0x154729;});}return null;};}function removeEntity(_0x561ea3,_0x5b3ac3){return function(_0x1f04a7){if(_0x1f04a7){return _0x1f04a7[_0xc4f3('0x27')]()[_0xc4f3('0x26')](function(){_0x561ea3['status'](0xcc)[_0xc4f3('0x1c')]();});}};}function handleEntityNotFound(_0x460ee7,_0x8a828e){return function(_0x11ea96){if(!_0x11ea96){_0x460ee7['sendStatus'](0x194);}return _0x11ea96;};}function handleError(_0x378194,_0x46f5c6){_0x46f5c6=_0x46f5c6||0x1f4;return function(_0x26c737){logger[_0xc4f3('0x28')](_0x26c737[_0xc4f3('0x29')]);if(_0x26c737[_0xc4f3('0x2a')]){delete _0x26c737[_0xc4f3('0x2a')];}_0x378194['status'](_0x46f5c6)[_0xc4f3('0x2b')](_0x26c737);};}exports[_0xc4f3('0x2c')]=function(_0x7e4227,_0x4125be){var _0x5aa950={'raw':!![],'where':{'id':_0x7e4227[_0xc4f3('0x2d')]['id']}},_0x2731a5={};_0x2731a5['model']=_['keys'](db[_0xc4f3('0x2e')][_0xc4f3('0x2f')]);_0x2731a5['query']=_[_0xc4f3('0x30')](_0x7e4227[_0xc4f3('0x31')]);_0x2731a5[_0xc4f3('0x32')]=_[_0xc4f3('0x33')](_0x2731a5['model'],_0x2731a5[_0xc4f3('0x31')]);_0x5aa950[_0xc4f3('0x34')]=_[_0xc4f3('0x33')](_0x2731a5[_0xc4f3('0x35')],qs[_0xc4f3('0x36')](_0x7e4227[_0xc4f3('0x31')][_0xc4f3('0x36')]));_0x5aa950['attributes']=_0x5aa950[_0xc4f3('0x34')][_0xc4f3('0x37')]?_0x5aa950['attributes']:_0x2731a5[_0xc4f3('0x35')];if(_0x7e4227[_0xc4f3('0x31')][_0xc4f3('0x38')]){_0x5aa950['include']=[{'all':!![]}];}_0x5aa950=_['merge']({},_0x5aa950,_0x7e4227[_0xc4f3('0x39')]);return db[_0xc4f3('0x2e')][_0xc4f3('0x3a')](_0x5aa950)[_0xc4f3('0x26')](handleEntityNotFound(_0x4125be,null))[_0xc4f3('0x26')](respondWithResult(_0x4125be,null))[_0xc4f3('0x3b')](handleError(_0x4125be,null));};exports[_0xc4f3('0x3c')]=function(_0xcd9767,_0x46f897){if(_0xcd9767[_0xc4f3('0x3d')]['id']){delete _0xcd9767[_0xc4f3('0x3d')]['id'];}return db[_0xc4f3('0x2e')]['find']({'where':{'id':_0xcd9767['params']['id']}})[_0xc4f3('0x26')](handleEntityNotFound(_0x46f897,null))[_0xc4f3('0x26')](saveUpdates(_0xcd9767[_0xc4f3('0x3d')],null))[_0xc4f3('0x26')](respondWithResult(_0x46f897,null))[_0xc4f3('0x3b')](handleError(_0x46f897,null));};exports[_0xc4f3('0x27')]=function(_0x2d35ae,_0x15456e){return db[_0xc4f3('0x2e')]['find']({'where':{'id':_0x2d35ae[_0xc4f3('0x2d')]['id']}})[_0xc4f3('0x26')](handleEntityNotFound(_0x15456e,null))['then'](removeEntity(_0x15456e,null))['catch'](handleError(_0x15456e,null));};
\ No newline at end of file
+var _0x4345=['rimraf','fast-json-patch','request-promise','moment','bluebird','util','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','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','error','stack','name','show','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','then','catch','body','params','eml-format'];(function(_0x341aca,_0x265689){var _0x265000=function(_0x3630ea){while(--_0x3630ea){_0x341aca['push'](_0x341aca['shift']());}};_0x265000(++_0x265689);}(_0x4345,0x77));var _0x5434=function(_0x2864f9,_0x53903d){_0x2864f9=_0x2864f9-0x0;var _0x4903e7=_0x4345[_0x2864f9];return _0x4903e7;};'use strict';var emlformat=require(_0x5434('0x0'));var rimraf=require(_0x5434('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5434('0x2'));var rp=require(_0x5434('0x3'));var moment=require(_0x5434('0x4'));var BPromise=require(_0x5434('0x5'));var Mustache=require('mustache');var util=require(_0x5434('0x6'));var path=require('path');var sox=require(_0x5434('0x7'));var csv=require(_0x5434('0x8'));var ejs=require(_0x5434('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5434('0xa'));var squel=require('squel');var crypto=require(_0x5434('0xb'));var jsforce=require(_0x5434('0xc'));var deskjs=require(_0x5434('0xd'));var toCsv=require(_0x5434('0x8'));var querystring=require(_0x5434('0xe'));var Papa=require(_0x5434('0xf'));var Redis=require(_0x5434('0x10'));var authService=require(_0x5434('0x11'));var qs=require(_0x5434('0x12'));var as=require(_0x5434('0x13'));var hardwareService=require(_0x5434('0x14'));var logger=require(_0x5434('0x15'))(_0x5434('0x16'));var utils=require(_0x5434('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5434('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36a2d9,_0xf27177){_0xf27177=_0xf27177||0xcc;return function(_0x13a13f){if(_0x13a13f){return _0x36a2d9[_0x5434('0x19')](_0xf27177);}return _0x36a2d9['status'](_0xf27177)[_0x5434('0x1a')]();};}function respondWithResult(_0x223766,_0x5aa606){_0x5aa606=_0x5aa606||0xc8;return function(_0x44ea26){if(_0x44ea26){return _0x223766[_0x5434('0x1b')](_0x5aa606)[_0x5434('0x1c')](_0x44ea26);}};}function respondWithFilteredResult(_0x1a7a2c,_0x48be48){return function(_0x2b88c4){if(_0x2b88c4){var _0x437664=typeof _0x48be48['offset']===_0x5434('0x1d')&&typeof _0x48be48['limit']===_0x5434('0x1d');var _0x42a118=_0x2b88c4[_0x5434('0x1e')];var _0x148b3c=_0x437664?0x0:_0x48be48[_0x5434('0x1f')];var _0x2d60be=_0x437664?_0x2b88c4[_0x5434('0x1e')]:_0x48be48['offset']+_0x48be48[_0x5434('0x20')];var _0x5a4570;if(_0x2d60be>=_0x42a118){_0x2d60be=_0x42a118;_0x5a4570=0xc8;}else{_0x5a4570=0xce;}_0x1a7a2c[_0x5434('0x1b')](_0x5a4570);return _0x1a7a2c['set'](_0x5434('0x21'),_0x148b3c+'-'+_0x2d60be+'/'+_0x42a118)[_0x5434('0x1c')](_0x2b88c4);}return null;};}function patchUpdates(_0x240787){return function(_0x4d34d6){try{jsonpatch[_0x5434('0x22')](_0x4d34d6,_0x240787,!![]);}catch(_0x2513e9){return BPromise[_0x5434('0x23')](_0x2513e9);}return _0x4d34d6[_0x5434('0x24')]();};}function saveUpdates(_0x1da16d,_0x5c43ef){return function(_0x5e92d0){if(_0x5e92d0){return _0x5e92d0[_0x5434('0x25')](_0x1da16d)['then'](function(_0x4524f9){return _0x4524f9;});}return null;};}function removeEntity(_0x85a5a1,_0x464093){return function(_0xd83da2){if(_0xd83da2){return _0xd83da2['destroy']()['then'](function(){_0x85a5a1[_0x5434('0x1b')](0xcc)[_0x5434('0x1a')]();});}};}function handleEntityNotFound(_0x27ea93,_0x417dc1){return function(_0x2c8fb1){if(!_0x2c8fb1){_0x27ea93[_0x5434('0x19')](0x194);}return _0x2c8fb1;};}function handleError(_0xaa9184,_0xa0f1b2){_0xa0f1b2=_0xa0f1b2||0x1f4;return function(_0x1b827f){logger[_0x5434('0x26')](_0x1b827f[_0x5434('0x27')]);if(_0x1b827f[_0x5434('0x28')]){delete _0x1b827f['name'];}_0xaa9184['status'](_0xa0f1b2)['send'](_0x1b827f);};}exports[_0x5434('0x29')]=function(_0x124371,_0x4189f9){var _0x1330ff={'raw':!![],'where':{'id':_0x124371['params']['id']}},_0x4598bd={};_0x4598bd[_0x5434('0x2a')]=_[_0x5434('0x2b')](db['ChatApplication'][_0x5434('0x2c')]);_0x4598bd[_0x5434('0x2d')]=_['keys'](_0x124371['query']);_0x4598bd['filters']=_[_0x5434('0x2e')](_0x4598bd[_0x5434('0x2a')],_0x4598bd[_0x5434('0x2d')]);_0x1330ff[_0x5434('0x2f')]=_[_0x5434('0x2e')](_0x4598bd[_0x5434('0x2a')],qs['fields'](_0x124371[_0x5434('0x2d')][_0x5434('0x30')]));_0x1330ff[_0x5434('0x2f')]=_0x1330ff[_0x5434('0x2f')][_0x5434('0x31')]?_0x1330ff[_0x5434('0x2f')]:_0x4598bd[_0x5434('0x2a')];if(_0x124371['query'][_0x5434('0x32')]){_0x1330ff[_0x5434('0x33')]=[{'all':!![]}];}_0x1330ff=_[_0x5434('0x34')]({},_0x1330ff,_0x124371[_0x5434('0x35')]);return db[_0x5434('0x36')][_0x5434('0x37')](_0x1330ff)['then'](handleEntityNotFound(_0x4189f9,null))[_0x5434('0x38')](respondWithResult(_0x4189f9,null))[_0x5434('0x39')](handleError(_0x4189f9,null));};exports[_0x5434('0x25')]=function(_0x168db5,_0x24f907){if(_0x168db5[_0x5434('0x3a')]['id']){delete _0x168db5[_0x5434('0x3a')]['id'];}return db[_0x5434('0x36')][_0x5434('0x37')]({'where':{'id':_0x168db5[_0x5434('0x3b')]['id']}})['then'](handleEntityNotFound(_0x24f907,null))[_0x5434('0x38')](saveUpdates(_0x168db5[_0x5434('0x3a')],null))[_0x5434('0x38')](respondWithResult(_0x24f907,null))[_0x5434('0x39')](handleError(_0x24f907,null));};exports['destroy']=function(_0x243163,_0x1fe399){return db['ChatApplication']['find']({'where':{'id':_0x243163[_0x5434('0x3b')]['id']}})[_0x5434('0x38')](handleEntityNotFound(_0x1fe399,null))['then'](removeEntity(_0x1fe399,null))[_0x5434('0x39')](handleError(_0x1fe399,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d18fc60..76defa0 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 _0x871a=['../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','path'];(function(_0x346362,_0x44cedd){var _0x213899=function(_0x4d53f6){while(--_0x4d53f6){_0x346362['push'](_0x346362['shift']());}};_0x213899(++_0x44cedd);}(_0x871a,0x16e));var _0xa871=function(_0x2633c7,_0x4db8b3){_0x2633c7=_0x2633c7-0x0;var _0xbb644=_0x871a[_0x2633c7];return _0xbb644;};'use strict';var _=require(_0xa871('0x0'));var util=require(_0xa871('0x1'));var logger=require(_0xa871('0x2'))(_0xa871('0x3'));var moment=require(_0xa871('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa871('0x5'));var rimraf=require('rimraf');var config=require(_0xa871('0x6'));var attributes=require(_0xa871('0x7'));module['exports']=function(_0x588f95,_0x42a8a0){return _0x588f95[_0xa871('0x8')](_0xa871('0x9'),attributes,{'tableName':_0xa871('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa871('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6625=['./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6625,0x191));var _0x5662=function(_0x450aa8,_0x1436ee){_0x450aa8=_0x450aa8-0x0;var _0x5854ec=_0x6625[_0x450aa8];return _0x5854ec;};'use strict';var _=require('lodash');var util=require(_0x5662('0x0'));var logger=require(_0x5662('0x1'))(_0x5662('0x2'));var moment=require(_0x5662('0x3'));var BPromise=require(_0x5662('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5662('0x5'));var rimraf=require('rimraf');var config=require(_0x5662('0x6'));var attributes=require(_0x5662('0x7'));module[_0x5662('0x8')]=function(_0x5d367f,_0x298433){return _0x5d367f['define'](_0x5662('0x9'),attributes,{'tableName':_0x5662('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5662('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0b4d288..677876a 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 _0x4c2d=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x1c83d6,_0x59dfb5){var _0x8131c0=function(_0x4602cd){while(--_0x4602cd){_0x1c83d6['push'](_0x1c83d6['shift']());}};_0x8131c0(++_0x59dfb5);}(_0x4c2d,0x7b));var _0xd4c2=function(_0x51f5aa,_0x4826dc){_0x51f5aa=_0x51f5aa-0x0;var _0x166d4b=_0x4c2d[_0x51f5aa];return _0x166d4b;};'use strict';var _=require(_0xd4c2('0x0'));var util=require(_0xd4c2('0x1'));var moment=require(_0xd4c2('0x2'));var BPromise=require(_0xd4c2('0x3'));var rs=require(_0xd4c2('0x4'));var fs=require('fs');var Redis=require(_0xd4c2('0x5'));var db=require(_0xd4c2('0x6'))['db'];var utils=require(_0xd4c2('0x7'));var logger=require(_0xd4c2('0x8'))(_0xd4c2('0x9'));var config=require(_0xd4c2('0xa'));var jayson=require(_0xd4c2('0xb'));var client=jayson[_0xd4c2('0xc')][_0xd4c2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4027e9,_0x449136,_0x2a311d){return new BPromise(function(_0x222896,_0x1fe349){return client['request'](_0x4027e9,_0x2a311d)['then'](function(_0x391efa){logger[_0xd4c2('0xe')](_0xd4c2('0xf'),_0x449136,_0xd4c2('0x10'));logger[_0xd4c2('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x449136,'request\x20sent',JSON['stringify'](_0x391efa));if(_0x391efa['error']){if(_0x391efa[_0xd4c2('0x12')][_0xd4c2('0x13')]===0x1f4){logger[_0xd4c2('0x12')]('ChatApplication,\x20%s,\x20%s',_0x449136,_0x391efa[_0xd4c2('0x12')][_0xd4c2('0x14')]);return _0x1fe349(_0x391efa['error'][_0xd4c2('0x14')]);}logger['error'](_0xd4c2('0xf'),_0x449136,_0x391efa[_0xd4c2('0x12')]['message']);return _0x222896(_0x391efa[_0xd4c2('0x12')][_0xd4c2('0x14')]);}else{logger[_0xd4c2('0xe')](_0xd4c2('0xf'),_0x449136,_0xd4c2('0x10'));_0x222896(_0x391efa[_0xd4c2('0x15')]['message']);}})[_0xd4c2('0x16')](function(_0x1aa1b4){logger[_0xd4c2('0x12')](_0xd4c2('0xf'),_0x449136,_0x1aa1b4);_0x1fe349(_0x1aa1b4);});});}
\ No newline at end of file
+var _0xa76a=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1e0c10,_0x33130a){var _0x2533a4=function(_0x1803d1){while(--_0x1803d1){_0x1e0c10['push'](_0x1e0c10['shift']());}};_0x2533a4(++_0x33130a);}(_0xa76a,0x10a));var _0xaa76=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xa76a[_0x5466ab];return _0x40751a;};'use strict';var _=require('lodash');var util=require(_0xaa76('0x0'));var moment=require(_0xaa76('0x1'));var BPromise=require(_0xaa76('0x2'));var rs=require(_0xaa76('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa76('0x4'))['db'];var utils=require(_0xaa76('0x5'));var logger=require(_0xaa76('0x6'))(_0xaa76('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa76('0x8'));var client=jayson['client'][_0xaa76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b6a8c,_0x25bb24,_0x84a21d){return new BPromise(function(_0x23f7ea,_0x133ac8){return client[_0xaa76('0xa')](_0x1b6a8c,_0x84a21d)['then'](function(_0xeebff7){logger['info'](_0xaa76('0xb'),_0x25bb24,_0xaa76('0xc'));logger[_0xaa76('0xd')](_0xaa76('0xe'),_0x25bb24,_0xaa76('0xc'),JSON[_0xaa76('0xf')](_0xeebff7));if(_0xeebff7[_0xaa76('0x10')]){if(_0xeebff7[_0xaa76('0x10')][_0xaa76('0x11')]===0x1f4){logger[_0xaa76('0x10')](_0xaa76('0xb'),_0x25bb24,_0xeebff7[_0xaa76('0x10')]['message']);return _0x133ac8(_0xeebff7[_0xaa76('0x10')][_0xaa76('0x12')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x25bb24,_0xeebff7[_0xaa76('0x10')][_0xaa76('0x12')]);return _0x23f7ea(_0xeebff7[_0xaa76('0x10')]['message']);}else{logger[_0xaa76('0x13')]('ChatApplication,\x20%s,\x20%s',_0x25bb24,_0xaa76('0xc'));_0x23f7ea(_0xeebff7[_0xaa76('0x14')][_0xaa76('0x12')]);}})[_0xaa76('0x15')](function(_0x2e44cc){logger[_0xaa76('0x10')](_0xaa76('0xb'),_0x25bb24,_0x2e44cc);_0x133ac8(_0x2e44cc);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 8879036..b55c186 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 _0x0d1c=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','destroy','exports','multer','util'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0d1c,0x141));var _0xc0d1=function(_0x42fcf2,_0x78099b){_0x42fcf2=_0x42fcf2-0x0;var _0x3c8efb=_0x0d1c[_0x42fcf2];return _0x3c8efb;};'use strict';var multer=require(_0xc0d1('0x0'));var util=require(_0xc0d1('0x1'));var path=require(_0xc0d1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0d1('0x3'));var router=express[_0xc0d1('0x4')]();var fs_extra=require(_0xc0d1('0x5'));var auth=require(_0xc0d1('0x6'));var interaction=require(_0xc0d1('0x7'));var config=require(_0xc0d1('0x8'));var controller=require(_0xc0d1('0x9'));router[_0xc0d1('0xa')](_0xc0d1('0xb'),auth['isAuthenticated'](),controller[_0xc0d1('0xc')]);router[_0xc0d1('0xd')](_0xc0d1('0xb'),auth[_0xc0d1('0xe')](),controller['update']);router['delete']('/:id',auth[_0xc0d1('0xe')](),controller[_0xc0d1('0xf')]);module[_0xc0d1('0x10')]=router;
\ No newline at end of file
+var _0xe3e3=['put','/:id','isAuthenticated','update','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show'];(function(_0x4b6f5c,_0x56f7ce){var _0x55548b=function(_0x125619){while(--_0x125619){_0x4b6f5c['push'](_0x4b6f5c['shift']());}};_0x55548b(++_0x56f7ce);}(_0xe3e3,0x105));var _0x3e3e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe3e3[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x3e3e('0x0'));var path=require('path');var timeout=require(_0x3e3e('0x1'));var express=require('express');var router=express[_0x3e3e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3e3e('0x3'));var interaction=require(_0x3e3e('0x4'));var config=require(_0x3e3e('0x5'));var controller=require(_0x3e3e('0x6'));router[_0x3e3e('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3e3e('0x8')]);router[_0x3e3e('0x9')](_0x3e3e('0xa'),auth[_0x3e3e('0xb')](),controller[_0x3e3e('0xc')]);router[_0x3e3e('0xd')](_0x3e3e('0xa'),auth[_0x3e3e('0xb')](),controller[_0x3e3e('0xe')]);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 8146b0b..5c8d865 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 _0x7409=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1370f2,_0xfdb711){var _0x161aa4=function(_0x4b206b){while(--_0x4b206b){_0x1370f2['push'](_0x1370f2['shift']());}};_0x161aa4(++_0xfdb711);}(_0x7409,0x6e));var _0x9740=function(_0x7fab38,_0x501063){_0x7fab38=_0x7fab38-0x0;var _0xb5c718=_0x7409[_0x7fab38];return _0xb5c718;};'use strict';var Sequelize=require(_0x9740('0x0'));module[_0x9740('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9740('0x2')]},'write':{'type':Sequelize[_0x9740('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe8b1=['sequelize','exports','STRING'];(function(_0x4e9f87,_0x4914ae){var _0x5104c9=function(_0x5ac31e){while(--_0x5ac31e){_0x4e9f87['push'](_0x4e9f87['shift']());}};_0x5104c9(++_0x4914ae);}(_0xe8b1,0x17a));var _0x1e8b=function(_0x2b78e5,_0x3126f8){_0x2b78e5=_0x2b78e5-0x0;var _0xa8d52d=_0xe8b1[_0x2b78e5];return _0xa8d52d;};'use strict';var Sequelize=require(_0x1e8b('0x0'));module[_0x1e8b('0x1')]={'name':{'type':Sequelize[_0x1e8b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1e8b('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 0478cc6..fae57af 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 _0x7cc3=['where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x13e2b1,_0x271a51){var _0x3467c2=function(_0x2f4939){while(--_0x2f4939){_0x13e2b1['push'](_0x13e2b1['shift']());}};_0x3467c2(++_0x271a51);}(_0x7cc3,0x7f));var _0x37cc=function(_0x4434c6,_0x11d834){_0x4434c6=_0x4434c6-0x0;var _0x5ddd6d=_0x7cc3[_0x4434c6];return _0x5ddd6d;};'use strict';var emlformat=require(_0x37cc('0x0'));var rimraf=require(_0x37cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37cc('0x2'));var rp=require('request-promise');var moment=require(_0x37cc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x37cc('0x4'));var util=require(_0x37cc('0x5'));var path=require(_0x37cc('0x6'));var sox=require(_0x37cc('0x7'));var csv=require('to-csv');var ejs=require(_0x37cc('0x8'));var fs=require('fs');var fs_extra=require(_0x37cc('0x9'));var _=require('lodash');var squel=require(_0x37cc('0xa'));var crypto=require(_0x37cc('0xb'));var jsforce=require(_0x37cc('0xc'));var deskjs=require(_0x37cc('0xd'));var toCsv=require(_0x37cc('0xe'));var querystring=require(_0x37cc('0xf'));var Papa=require(_0x37cc('0x10'));var Redis=require('ioredis');var authService=require(_0x37cc('0x11'));var qs=require(_0x37cc('0x12'));var as=require(_0x37cc('0x13'));var hardwareService=require(_0x37cc('0x14'));var logger=require('../../config/logger')(_0x37cc('0x15'));var utils=require(_0x37cc('0x16'));var config=require(_0x37cc('0x17'));var licenseUtil=require(_0x37cc('0x18'));var db=require(_0x37cc('0x19'))['db'];config['redis']=_['defaults'](config[_0x37cc('0x1a')],{'host':_0x37cc('0x1b'),'port':0x18eb});var socket=require(_0x37cc('0x1c'))(new Redis(config[_0x37cc('0x1a')]));require(_0x37cc('0x1d'))[_0x37cc('0x1e')](socket);function respondWithStatusCode(_0x34f386,_0x3e8f38){_0x3e8f38=_0x3e8f38||0xcc;return function(_0x43cfa2){if(_0x43cfa2){return _0x34f386[_0x37cc('0x1f')](_0x3e8f38);}return _0x34f386['status'](_0x3e8f38)[_0x37cc('0x20')]();};}function respondWithResult(_0x6c8549,_0x443883){_0x443883=_0x443883||0xc8;return function(_0x47ab30){if(_0x47ab30){return _0x6c8549[_0x37cc('0x21')](_0x443883)[_0x37cc('0x22')](_0x47ab30);}};}function respondWithFilteredResult(_0x2b18b3,_0x12893b){return function(_0x253572){if(_0x253572){var _0x2af8e5=typeof _0x12893b[_0x37cc('0x23')]===_0x37cc('0x24')&&typeof _0x12893b[_0x37cc('0x25')]===_0x37cc('0x24');var _0x3c50b1=_0x253572[_0x37cc('0x26')];var _0x59fe68=_0x2af8e5?0x0:_0x12893b[_0x37cc('0x23')];var _0x316dbe=_0x2af8e5?_0x253572[_0x37cc('0x26')]:_0x12893b[_0x37cc('0x23')]+_0x12893b[_0x37cc('0x25')];var _0x5d29e0;if(_0x316dbe>=_0x3c50b1){_0x316dbe=_0x3c50b1;_0x5d29e0=0xc8;}else{_0x5d29e0=0xce;}_0x2b18b3[_0x37cc('0x21')](_0x5d29e0);return _0x2b18b3[_0x37cc('0x27')](_0x37cc('0x28'),_0x59fe68+'-'+_0x316dbe+'/'+_0x3c50b1)[_0x37cc('0x22')](_0x253572);}return null;};}function patchUpdates(_0x16eab7){return function(_0x454ee9){try{jsonpatch[_0x37cc('0x29')](_0x454ee9,_0x16eab7,!![]);}catch(_0x1cfcdd){return BPromise[_0x37cc('0x2a')](_0x1cfcdd);}return _0x454ee9[_0x37cc('0x2b')]();};}function saveUpdates(_0x2f4de8,_0x1b3189){return function(_0x152a2b){if(_0x152a2b){return _0x152a2b[_0x37cc('0x2c')](_0x2f4de8)['then'](function(_0x4fb6f6){return _0x4fb6f6;});}return null;};}function removeEntity(_0x3413a9,_0x1830d7){return function(_0x25e7c5){if(_0x25e7c5){return _0x25e7c5[_0x37cc('0x2d')]()[_0x37cc('0x2e')](function(){_0x3413a9[_0x37cc('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c24f6,_0x11b1cb){return function(_0x28ce48){if(!_0x28ce48){_0x5c24f6[_0x37cc('0x1f')](0x194);}return _0x28ce48;};}function handleError(_0x3a01b1,_0x440784){_0x440784=_0x440784||0x1f4;return function(_0x59b4cf){logger[_0x37cc('0x2f')](_0x59b4cf[_0x37cc('0x30')]);if(_0x59b4cf[_0x37cc('0x31')]){delete _0x59b4cf[_0x37cc('0x31')];}_0x3a01b1['status'](_0x440784)[_0x37cc('0x32')](_0x59b4cf);};}exports[_0x37cc('0x33')]=function(_0x5f4ac6,_0x5468bf){var _0x113c18={},_0x4c9117={},_0x4cc403={'count':0x0,'rows':[]};var _0x33a892=_['map'](db[_0x37cc('0x34')][_0x37cc('0x35')],function(_0x5ac021){return{'name':_0x5ac021[_0x37cc('0x36')],'type':_0x5ac021[_0x37cc('0x37')]['key']};});_0x4c9117[_0x37cc('0x38')]=_[_0x37cc('0x39')](_0x33a892,_0x37cc('0x31'));_0x4c9117[_0x37cc('0x3a')]=_[_0x37cc('0x3b')](_0x5f4ac6[_0x37cc('0x3a')]);_0x4c9117[_0x37cc('0x3c')]=_['intersection'](_0x4c9117[_0x37cc('0x38')],_0x4c9117[_0x37cc('0x3a')]);_0x113c18['attributes']=_[_0x37cc('0x3d')](_0x4c9117[_0x37cc('0x38')],qs['fields'](_0x5f4ac6[_0x37cc('0x3a')][_0x37cc('0x3e')]));_0x113c18[_0x37cc('0x3f')]=_0x113c18[_0x37cc('0x3f')][_0x37cc('0x40')]?_0x113c18[_0x37cc('0x3f')]:_0x4c9117[_0x37cc('0x38')];if(!_0x5f4ac6['query'][_0x37cc('0x41')](_0x37cc('0x42'))){_0x113c18['limit']=qs[_0x37cc('0x25')](_0x5f4ac6['query'][_0x37cc('0x25')]);_0x113c18['offset']=qs[_0x37cc('0x23')](_0x5f4ac6['query']['offset']);}_0x113c18[_0x37cc('0x43')]=qs[_0x37cc('0x44')](_0x5f4ac6[_0x37cc('0x3a')][_0x37cc('0x44')]);_0x113c18[_0x37cc('0x45')]=qs[_0x37cc('0x3c')](_[_0x37cc('0x46')](_0x5f4ac6['query'],_0x4c9117[_0x37cc('0x3c')]),_0x33a892);if(_0x5f4ac6[_0x37cc('0x3a')][_0x37cc('0x47')]){_0x113c18[_0x37cc('0x45')]=_[_0x37cc('0x48')](_0x113c18[_0x37cc('0x45')],{'$or':_['map'](_0x33a892,function(_0x3b808d){if(_0x3b808d[_0x37cc('0x37')]!==_0x37cc('0x49')){var _0x38a6d7={};_0x38a6d7[_0x3b808d[_0x37cc('0x31')]]={'$like':'%'+_0x5f4ac6[_0x37cc('0x3a')]['filter']+'%'};return _0x38a6d7;}})});}_0x113c18=_[_0x37cc('0x48')]({},_0x113c18,_0x5f4ac6['options']);var _0x33be19={'where':_0x113c18['where']};return db[_0x37cc('0x34')][_0x37cc('0x26')](_0x33be19)[_0x37cc('0x2e')](function(_0xaf8210){_0x4cc403[_0x37cc('0x26')]=_0xaf8210;if(_0x5f4ac6[_0x37cc('0x3a')]['includeAll']){_0x113c18[_0x37cc('0x4a')]=[{'all':!![]}];}return db[_0x37cc('0x34')][_0x37cc('0x4b')](_0x113c18);})[_0x37cc('0x2e')](function(_0x38da07){_0x4cc403[_0x37cc('0x4c')]=_0x38da07;return _0x4cc403;})[_0x37cc('0x2e')](respondWithFilteredResult(_0x5468bf,_0x113c18))[_0x37cc('0x4d')](handleError(_0x5468bf,null));};exports[_0x37cc('0x4e')]=function(_0x43820a,_0x40113b){var _0x827f1e={'raw':!![],'where':{'id':_0x43820a[_0x37cc('0x4f')]['id']}},_0x5d2371={};_0x5d2371[_0x37cc('0x38')]=_[_0x37cc('0x3b')](db[_0x37cc('0x34')][_0x37cc('0x35')]);_0x5d2371[_0x37cc('0x3a')]=_[_0x37cc('0x3b')](_0x43820a[_0x37cc('0x3a')]);_0x5d2371[_0x37cc('0x3c')]=_['intersection'](_0x5d2371['model'],_0x5d2371[_0x37cc('0x3a')]);_0x827f1e['attributes']=_['intersection'](_0x5d2371[_0x37cc('0x38')],qs[_0x37cc('0x3e')](_0x43820a['query']['fields']));_0x827f1e[_0x37cc('0x3f')]=_0x827f1e['attributes'][_0x37cc('0x40')]?_0x827f1e['attributes']:_0x5d2371['model'];if(_0x43820a[_0x37cc('0x3a')]['includeAll']){_0x827f1e['include']=[{'all':!![]}];}_0x827f1e=_[_0x37cc('0x48')]({},_0x827f1e,_0x43820a[_0x37cc('0x50')]);return db[_0x37cc('0x34')][_0x37cc('0x51')](_0x827f1e)[_0x37cc('0x2e')](handleEntityNotFound(_0x40113b,null))['then'](respondWithResult(_0x40113b,null))[_0x37cc('0x4d')](handleError(_0x40113b,null));};exports[_0x37cc('0x52')]=function(_0x49afdb,_0x40d10c){return db[_0x37cc('0x34')][_0x37cc('0x52')](_0x49afdb[_0x37cc('0x53')],{})[_0x37cc('0x2e')](respondWithResult(_0x40d10c,0xc9))['catch'](handleError(_0x40d10c,null));};exports[_0x37cc('0x2c')]=function(_0x297ff6,_0x2e60c8){if(_0x297ff6[_0x37cc('0x53')]['id']){delete _0x297ff6[_0x37cc('0x53')]['id'];}return db[_0x37cc('0x34')][_0x37cc('0x51')]({'where':{'id':_0x297ff6['params']['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x2e60c8,null))[_0x37cc('0x2e')](saveUpdates(_0x297ff6['body'],null))[_0x37cc('0x2e')](respondWithResult(_0x2e60c8,null))['catch'](handleError(_0x2e60c8,null));};exports['destroy']=function(_0x20a0b9,_0x4627bb){return db[_0x37cc('0x34')]['find']({'where':{'id':_0x20a0b9['params']['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x4627bb,null))[_0x37cc('0x2e')](removeEntity(_0x4627bb,null))[_0x37cc('0x4d')](handleError(_0x4627bb,null));};exports[_0x37cc('0x54')]=function(_0x4dc488,_0x416068){return db[_0x37cc('0x34')][_0x37cc('0x54')]()[_0x37cc('0x2e')](respondWithResult(_0x416068,null))['catch'](handleError(_0x416068,null));};exports[_0x37cc('0x55')]=function(_0xd74e6e,_0x582c4e,_0x19de61){return db[_0x37cc('0x56')][_0x37cc('0x26')]({'where':{'ChatGroupId':_0xd74e6e[_0x37cc('0x4f')]['id'],'ToId':_0xd74e6e[_0x37cc('0x57')]['id'],'read':![]}})[_0x37cc('0x2e')](function(_0x230de3){return{'id':_['toInteger'](_0xd74e6e['params']['id']),'count':_0x230de3};})[_0x37cc('0x2e')](respondWithResult(_0x582c4e,null))[_0x37cc('0x4d')](handleError(_0x582c4e,null));};exports[_0x37cc('0x58')]=function(_0x27acb9,_0x3a574c,_0x4a1d56){return db['ChatGroup'][_0x37cc('0x51')]({'where':{'id':_0x27acb9[_0x37cc('0x4f')]['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x3a574c,null))[_0x37cc('0x2e')](function(_0x3af27d){if(_0x3af27d){return _0x3af27d[_0x37cc('0x58')](_0x27acb9[_0x37cc('0x53')][_0x37cc('0x59')],_['omit'](_0x27acb9['body'],[_0x37cc('0x59'),'id'])||{});}})[_0x37cc('0x2e')](respondWithResult(_0x3a574c,null))[_0x37cc('0x4d')](handleError(_0x3a574c,null));};exports['getMembers']=function(_0x29bb96,_0x102de0,_0x3349a0){var _0x36a3f5={};var _0x2381c1={};var _0x3a089e;var _0x35d179;return db[_0x37cc('0x34')]['findOne']({'where':{'id':_0x29bb96[_0x37cc('0x4f')]['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x102de0,null))[_0x37cc('0x2e')](function(_0x151a6e){if(_0x151a6e){_0x3a089e=_0x151a6e;_0x2381c1['model']=_['keys'](db['User']['rawAttributes']);_0x2381c1[_0x37cc('0x3a')]=_[_0x37cc('0x3b')](_0x29bb96['query']);_0x2381c1['filters']=_[_0x37cc('0x3d')](_0x2381c1[_0x37cc('0x38')],_0x2381c1[_0x37cc('0x3a')]);_0x36a3f5[_0x37cc('0x3f')]=_['intersection'](_0x2381c1[_0x37cc('0x38')],qs[_0x37cc('0x3e')](_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x3e')]));_0x36a3f5[_0x37cc('0x3f')]=_0x36a3f5['attributes'][_0x37cc('0x40')]?_0x36a3f5[_0x37cc('0x3f')]:_0x2381c1[_0x37cc('0x38')];_0x36a3f5[_0x37cc('0x43')]=qs[_0x37cc('0x44')](_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x44')]);_0x36a3f5['where']=qs['filters'](_[_0x37cc('0x46')](_0x29bb96['query'],_0x2381c1[_0x37cc('0x3c')]));if(_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x47')]){_0x36a3f5[_0x37cc('0x45')]=_[_0x37cc('0x48')](_0x36a3f5[_0x37cc('0x45')],{'$or':_[_0x37cc('0x39')](_0x36a3f5[_0x37cc('0x3f')],function(_0x16a34c){var _0x1aaf7d={};_0x1aaf7d[_0x16a34c]={'$like':'%'+_0x29bb96[_0x37cc('0x3a')]['filter']+'%'};return _0x1aaf7d;})});}_0x36a3f5=_[_0x37cc('0x48')]({},_0x36a3f5,_0x29bb96[_0x37cc('0x50')]);return _0x3a089e['getMembers'](_0x36a3f5);}})['then'](function(_0x5ba630){if(_0x5ba630){_0x35d179=_0x5ba630[_0x37cc('0x40')];if(!_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x41')](_0x37cc('0x42'))){_0x36a3f5[_0x37cc('0x25')]=qs[_0x37cc('0x25')](_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x25')]);_0x36a3f5['offset']=qs[_0x37cc('0x23')](_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x23')]);}return _0x3a089e['getMembers'](_0x36a3f5);}})[_0x37cc('0x2e')](function(_0x364094){if(_0x364094){return _0x364094?{'count':_0x35d179,'rows':_0x364094}:null;}})['then'](respondWithResult(_0x102de0,null))[_0x37cc('0x4d')](handleError(_0x102de0,null));};exports[_0x37cc('0x5a')]=function(_0x508fe3,_0x299534,_0xfd1324){return db[_0x37cc('0x34')][_0x37cc('0x51')]({'where':{'id':_0x508fe3['params']['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x299534,null))[_0x37cc('0x2e')](function(_0x25a35d){if(_0x25a35d){return _0x25a35d[_0x37cc('0x5a')](_0x508fe3[_0x37cc('0x3a')][_0x37cc('0x59')]);}})[_0x37cc('0x2e')](respondWithStatusCode(_0x299534,null))[_0x37cc('0x4d')](handleError(_0x299534,null));};exports[_0x37cc('0x5b')]=function(_0x2f5729,_0x43688a,_0x7d0f47){if(_0x2f5729['body']['id']){delete _0x2f5729['body']['id'];}return db['ChatGroup'][_0x37cc('0x51')]({'where':{'id':_0x2f5729[_0x37cc('0x4f')]['id']}})['then'](handleEntityNotFound(_0x43688a,null))['then'](function(_0x4e6b52){if(_0x4e6b52){_0x2f5729[_0x37cc('0x53')][_0x37cc('0x5c')]=_0x4e6b52['id'];return db[_0x37cc('0x56')]['create'](_0x2f5729[_0x37cc('0x53')]);}})[_0x37cc('0x2e')](respondWithResult(_0x43688a,null))['catch'](handleError(_0x43688a,null));};exports[_0x37cc('0x5d')]=function(_0x52888c,_0x51b52a,_0x38028d){var _0xa1d80c={};var _0x4b17be={};var _0x278efa;var _0x3b64d6;return db['ChatGroup'][_0x37cc('0x5e')]({'where':{'id':_0x52888c['params']['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x51b52a,null))[_0x37cc('0x2e')](function(_0xc1bee5){if(_0xc1bee5){_0x278efa=_0xc1bee5;_0x4b17be[_0x37cc('0x38')]=_[_0x37cc('0x3b')](db['ChatInternalMessage'][_0x37cc('0x35')]);_0x4b17be['query']=_[_0x37cc('0x3b')](_0x52888c[_0x37cc('0x3a')]);_0x4b17be[_0x37cc('0x3c')]=_[_0x37cc('0x3d')](_0x4b17be[_0x37cc('0x38')],_0x4b17be[_0x37cc('0x3a')]);_0xa1d80c[_0x37cc('0x3f')]=_[_0x37cc('0x3d')](_0x4b17be[_0x37cc('0x38')],qs['fields'](_0x52888c['query'][_0x37cc('0x3e')]));_0xa1d80c[_0x37cc('0x3f')]=_0xa1d80c[_0x37cc('0x3f')][_0x37cc('0x40')]?_0xa1d80c['attributes']:_0x4b17be[_0x37cc('0x38')];_0xa1d80c['order']=qs[_0x37cc('0x44')](_0x52888c[_0x37cc('0x3a')][_0x37cc('0x44')]);_0xa1d80c[_0x37cc('0x45')]=qs[_0x37cc('0x3c')](_['pick'](_0x52888c['query'],_0x4b17be[_0x37cc('0x3c')]));if(_0x52888c[_0x37cc('0x3a')][_0x37cc('0x47')]){_0xa1d80c[_0x37cc('0x45')]=_['merge'](_0xa1d80c['where'],{'$or':_[_0x37cc('0x39')](_0xa1d80c[_0x37cc('0x3f')],function(_0xad8ccb){var _0x19b139={};_0x19b139[_0xad8ccb]={'$like':'%'+_0x52888c[_0x37cc('0x3a')][_0x37cc('0x47')]+'%'};return _0x19b139;})});}if(_0x52888c[_0x37cc('0x3a')][_0x37cc('0x5f')]){var _0x1d8163=_0x52888c[_0x37cc('0x3a')][_0x37cc('0x5f')][_0x37cc('0x60')](',');var _0x484d39={};_0x484d39[_0x1d8163[0x0]]={'$gte':moment(_0x1d8163[0x1])['format'](_0x37cc('0x61'))};_0xa1d80c[_0x37cc('0x45')]=_['merge'](_0xa1d80c[_0x37cc('0x45')],_0x484d39);}_0xa1d80c=_[_0x37cc('0x48')]({},_0xa1d80c,_0x52888c[_0x37cc('0x50')]);return _0x278efa[_0x37cc('0x5d')](_0xa1d80c);}})[_0x37cc('0x2e')](function(_0x3ffead){if(_0x3ffead){_0x3b64d6=_0x3ffead['length'];if(!_0x52888c[_0x37cc('0x3a')][_0x37cc('0x41')](_0x37cc('0x42'))){_0xa1d80c[_0x37cc('0x25')]=qs['limit'](_0x52888c[_0x37cc('0x3a')]['limit']);_0xa1d80c['offset']=qs['offset'](_0x52888c[_0x37cc('0x3a')][_0x37cc('0x23')]);}return _0x278efa[_0x37cc('0x5d')](_0xa1d80c);}})[_0x37cc('0x2e')](function(_0x13c4f5){if(_0x13c4f5){return _0x13c4f5?{'count':_0x3b64d6,'rows':_0x13c4f5}:null;}})[_0x37cc('0x2e')](respondWithResult(_0x51b52a,null))[_0x37cc('0x4d')](handleError(_0x51b52a,null));};
\ No newline at end of file
+var _0x0088=['nolimit','order','sort','where','pick','merge','options','ChatGroup','includeAll','findAll','catch','show','params','length','include','find','create','body','describe','getUnread','user','addMembers','ids','omit','getMembers','findOne','User','filter','removeMembers','addMessage','ChatGroupId','getMessages','ChatInternalMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','status','json','offset','undefined','count','limit','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x2b5dc9,_0x5bc895){var _0x4de799=function(_0x11f6e7){while(--_0x11f6e7){_0x2b5dc9['push'](_0x2b5dc9['shift']());}};_0x4de799(++_0x5bc895);}(_0x0088,0x1f0));var _0x8008=function(_0xdfbdd6,_0xbbf179){_0xdfbdd6=_0xdfbdd6-0x0;var _0x3e8d3a=_0x0088[_0xdfbdd6];return _0x3e8d3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8008('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8008('0x1'));var moment=require(_0x8008('0x2'));var BPromise=require(_0x8008('0x3'));var Mustache=require(_0x8008('0x4'));var util=require('util');var path=require(_0x8008('0x5'));var sox=require(_0x8008('0x6'));var csv=require(_0x8008('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8008('0x8'));var _=require('lodash');var squel=require(_0x8008('0x9'));var crypto=require(_0x8008('0xa'));var jsforce=require(_0x8008('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8008('0x7'));var querystring=require(_0x8008('0xc'));var Papa=require(_0x8008('0xd'));var Redis=require(_0x8008('0xe'));var authService=require(_0x8008('0xf'));var qs=require(_0x8008('0x10'));var as=require(_0x8008('0x11'));var hardwareService=require(_0x8008('0x12'));var logger=require('../../config/logger')(_0x8008('0x13'));var utils=require('../../config/utils');var config=require(_0x8008('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8008('0x15'))['db'];config['redis']=_['defaults'](config[_0x8008('0x16')],{'host':_0x8008('0x17'),'port':0x18eb});var socket=require(_0x8008('0x18'))(new Redis(config[_0x8008('0x16')]));require(_0x8008('0x19'))['register'](socket);function respondWithStatusCode(_0x555c06,_0x19cc5a){_0x19cc5a=_0x19cc5a||0xcc;return function(_0x2ba8d7){if(_0x2ba8d7){return _0x555c06[_0x8008('0x1a')](_0x19cc5a);}return _0x555c06['status'](_0x19cc5a)[_0x8008('0x1b')]();};}function respondWithResult(_0x2864e0,_0x5372e6){_0x5372e6=_0x5372e6||0xc8;return function(_0x55eba6){if(_0x55eba6){return _0x2864e0[_0x8008('0x1c')](_0x5372e6)[_0x8008('0x1d')](_0x55eba6);}};}function respondWithFilteredResult(_0x205bd1,_0x167863){return function(_0x3d3127){if(_0x3d3127){var _0x2da342=typeof _0x167863[_0x8008('0x1e')]===_0x8008('0x1f')&&typeof _0x167863['limit']===_0x8008('0x1f');var _0x4b8659=_0x3d3127['count'];var _0x590a90=_0x2da342?0x0:_0x167863[_0x8008('0x1e')];var _0x5d7063=_0x2da342?_0x3d3127[_0x8008('0x20')]:_0x167863[_0x8008('0x1e')]+_0x167863[_0x8008('0x21')];var _0x44887a;if(_0x5d7063>=_0x4b8659){_0x5d7063=_0x4b8659;_0x44887a=0xc8;}else{_0x44887a=0xce;}_0x205bd1[_0x8008('0x1c')](_0x44887a);return _0x205bd1['set']('Content-Range',_0x590a90+'-'+_0x5d7063+'/'+_0x4b8659)[_0x8008('0x1d')](_0x3d3127);}return null;};}function patchUpdates(_0x766fb6){return function(_0x3a7747){try{jsonpatch[_0x8008('0x22')](_0x3a7747,_0x766fb6,!![]);}catch(_0x51f5ff){return BPromise['reject'](_0x51f5ff);}return _0x3a7747[_0x8008('0x23')]();};}function saveUpdates(_0x3c1944,_0xaed04c){return function(_0x4d98a9){if(_0x4d98a9){return _0x4d98a9[_0x8008('0x24')](_0x3c1944)[_0x8008('0x25')](function(_0x8f4c65){return _0x8f4c65;});}return null;};}function removeEntity(_0x362843,_0x71974c){return function(_0x12091d){if(_0x12091d){return _0x12091d['destroy']()['then'](function(){_0x362843[_0x8008('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37b555,_0x4ab731){return function(_0x35499c){if(!_0x35499c){_0x37b555[_0x8008('0x1a')](0x194);}return _0x35499c;};}function handleError(_0x9cb0e7,_0x15207e){_0x15207e=_0x15207e||0x1f4;return function(_0x174e99){logger[_0x8008('0x26')](_0x174e99[_0x8008('0x27')]);if(_0x174e99[_0x8008('0x28')]){delete _0x174e99[_0x8008('0x28')];}_0x9cb0e7[_0x8008('0x1c')](_0x15207e)[_0x8008('0x29')](_0x174e99);};}exports[_0x8008('0x2a')]=function(_0x200a73,_0x1fdea3){var _0x42ca56={},_0x54b558={},_0x567a7f={'count':0x0,'rows':[]};var _0x13f035=_[_0x8008('0x2b')](db['ChatGroup'][_0x8008('0x2c')],function(_0x1a641a){return{'name':_0x1a641a[_0x8008('0x2d')],'type':_0x1a641a[_0x8008('0x2e')][_0x8008('0x2f')]};});_0x54b558[_0x8008('0x30')]=_[_0x8008('0x2b')](_0x13f035,_0x8008('0x28'));_0x54b558[_0x8008('0x31')]=_[_0x8008('0x32')](_0x200a73[_0x8008('0x31')]);_0x54b558[_0x8008('0x33')]=_[_0x8008('0x34')](_0x54b558[_0x8008('0x30')],_0x54b558[_0x8008('0x31')]);_0x42ca56[_0x8008('0x35')]=_['intersection'](_0x54b558[_0x8008('0x30')],qs[_0x8008('0x36')](_0x200a73[_0x8008('0x31')][_0x8008('0x36')]));_0x42ca56[_0x8008('0x35')]=_0x42ca56[_0x8008('0x35')]['length']?_0x42ca56[_0x8008('0x35')]:_0x54b558[_0x8008('0x30')];if(!_0x200a73[_0x8008('0x31')][_0x8008('0x37')](_0x8008('0x38'))){_0x42ca56[_0x8008('0x21')]=qs['limit'](_0x200a73[_0x8008('0x31')][_0x8008('0x21')]);_0x42ca56[_0x8008('0x1e')]=qs[_0x8008('0x1e')](_0x200a73[_0x8008('0x31')]['offset']);}_0x42ca56[_0x8008('0x39')]=qs[_0x8008('0x3a')](_0x200a73['query'][_0x8008('0x3a')]);_0x42ca56[_0x8008('0x3b')]=qs[_0x8008('0x33')](_[_0x8008('0x3c')](_0x200a73[_0x8008('0x31')],_0x54b558[_0x8008('0x33')]),_0x13f035);if(_0x200a73[_0x8008('0x31')]['filter']){_0x42ca56[_0x8008('0x3b')]=_['merge'](_0x42ca56[_0x8008('0x3b')],{'$or':_['map'](_0x13f035,function(_0x5c3419){if(_0x5c3419['type']!=='VIRTUAL'){var _0x4b5a6d={};_0x4b5a6d[_0x5c3419[_0x8008('0x28')]]={'$like':'%'+_0x200a73[_0x8008('0x31')]['filter']+'%'};return _0x4b5a6d;}})});}_0x42ca56=_[_0x8008('0x3d')]({},_0x42ca56,_0x200a73[_0x8008('0x3e')]);var _0x1de576={'where':_0x42ca56['where']};return db[_0x8008('0x3f')][_0x8008('0x20')](_0x1de576)[_0x8008('0x25')](function(_0x39599b){_0x567a7f[_0x8008('0x20')]=_0x39599b;if(_0x200a73[_0x8008('0x31')][_0x8008('0x40')]){_0x42ca56['include']=[{'all':!![]}];}return db[_0x8008('0x3f')][_0x8008('0x41')](_0x42ca56);})['then'](function(_0x2f824c){_0x567a7f['rows']=_0x2f824c;return _0x567a7f;})['then'](respondWithFilteredResult(_0x1fdea3,_0x42ca56))[_0x8008('0x42')](handleError(_0x1fdea3,null));};exports[_0x8008('0x43')]=function(_0x10b0c4,_0x5b3751){var _0x1dc8c3={'raw':!![],'where':{'id':_0x10b0c4[_0x8008('0x44')]['id']}},_0x36d248={};_0x36d248['model']=_[_0x8008('0x32')](db[_0x8008('0x3f')][_0x8008('0x2c')]);_0x36d248[_0x8008('0x31')]=_[_0x8008('0x32')](_0x10b0c4[_0x8008('0x31')]);_0x36d248[_0x8008('0x33')]=_[_0x8008('0x34')](_0x36d248[_0x8008('0x30')],_0x36d248[_0x8008('0x31')]);_0x1dc8c3[_0x8008('0x35')]=_[_0x8008('0x34')](_0x36d248['model'],qs['fields'](_0x10b0c4['query'][_0x8008('0x36')]));_0x1dc8c3[_0x8008('0x35')]=_0x1dc8c3[_0x8008('0x35')][_0x8008('0x45')]?_0x1dc8c3[_0x8008('0x35')]:_0x36d248[_0x8008('0x30')];if(_0x10b0c4[_0x8008('0x31')][_0x8008('0x40')]){_0x1dc8c3[_0x8008('0x46')]=[{'all':!![]}];}_0x1dc8c3=_[_0x8008('0x3d')]({},_0x1dc8c3,_0x10b0c4[_0x8008('0x3e')]);return db[_0x8008('0x3f')][_0x8008('0x47')](_0x1dc8c3)['then'](handleEntityNotFound(_0x5b3751,null))['then'](respondWithResult(_0x5b3751,null))[_0x8008('0x42')](handleError(_0x5b3751,null));};exports[_0x8008('0x48')]=function(_0x520291,_0x36d1b8){return db[_0x8008('0x3f')][_0x8008('0x48')](_0x520291[_0x8008('0x49')],{})[_0x8008('0x25')](respondWithResult(_0x36d1b8,0xc9))[_0x8008('0x42')](handleError(_0x36d1b8,null));};exports[_0x8008('0x24')]=function(_0x1c1481,_0xfd4740){if(_0x1c1481[_0x8008('0x49')]['id']){delete _0x1c1481[_0x8008('0x49')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1c1481[_0x8008('0x44')]['id']}})[_0x8008('0x25')](handleEntityNotFound(_0xfd4740,null))[_0x8008('0x25')](saveUpdates(_0x1c1481[_0x8008('0x49')],null))['then'](respondWithResult(_0xfd4740,null))[_0x8008('0x42')](handleError(_0xfd4740,null));};exports['destroy']=function(_0x510a04,_0x1c2412){return db['ChatGroup'][_0x8008('0x47')]({'where':{'id':_0x510a04[_0x8008('0x44')]['id']}})[_0x8008('0x25')](handleEntityNotFound(_0x1c2412,null))[_0x8008('0x25')](removeEntity(_0x1c2412,null))[_0x8008('0x42')](handleError(_0x1c2412,null));};exports[_0x8008('0x4a')]=function(_0x27c508,_0x1bd2bb){return db[_0x8008('0x3f')][_0x8008('0x4a')]()[_0x8008('0x25')](respondWithResult(_0x1bd2bb,null))[_0x8008('0x42')](handleError(_0x1bd2bb,null));};exports[_0x8008('0x4b')]=function(_0x18a338,_0x35106e,_0x1bb172){return db['ChatInternalMessage'][_0x8008('0x20')]({'where':{'ChatGroupId':_0x18a338[_0x8008('0x44')]['id'],'ToId':_0x18a338[_0x8008('0x4c')]['id'],'read':![]}})[_0x8008('0x25')](function(_0x31bc78){return{'id':_['toInteger'](_0x18a338['params']['id']),'count':_0x31bc78};})[_0x8008('0x25')](respondWithResult(_0x35106e,null))[_0x8008('0x42')](handleError(_0x35106e,null));};exports[_0x8008('0x4d')]=function(_0x2f95e7,_0x1f5600,_0x5e3ae6){return db[_0x8008('0x3f')][_0x8008('0x47')]({'where':{'id':_0x2f95e7['params']['id']}})[_0x8008('0x25')](handleEntityNotFound(_0x1f5600,null))[_0x8008('0x25')](function(_0x3627b5){if(_0x3627b5){return _0x3627b5[_0x8008('0x4d')](_0x2f95e7[_0x8008('0x49')][_0x8008('0x4e')],_[_0x8008('0x4f')](_0x2f95e7[_0x8008('0x49')],[_0x8008('0x4e'),'id'])||{});}})[_0x8008('0x25')](respondWithResult(_0x1f5600,null))[_0x8008('0x42')](handleError(_0x1f5600,null));};exports[_0x8008('0x50')]=function(_0x291469,_0x15b492,_0x4bdb7a){var _0x443b97={};var _0x18911a={};var _0x16d859;var _0x571cb6;return db[_0x8008('0x3f')][_0x8008('0x51')]({'where':{'id':_0x291469[_0x8008('0x44')]['id']}})['then'](handleEntityNotFound(_0x15b492,null))[_0x8008('0x25')](function(_0x1b9500){if(_0x1b9500){_0x16d859=_0x1b9500;_0x18911a[_0x8008('0x30')]=_[_0x8008('0x32')](db[_0x8008('0x52')][_0x8008('0x2c')]);_0x18911a['query']=_[_0x8008('0x32')](_0x291469['query']);_0x18911a['filters']=_[_0x8008('0x34')](_0x18911a['model'],_0x18911a['query']);_0x443b97[_0x8008('0x35')]=_[_0x8008('0x34')](_0x18911a[_0x8008('0x30')],qs[_0x8008('0x36')](_0x291469['query']['fields']));_0x443b97[_0x8008('0x35')]=_0x443b97['attributes']['length']?_0x443b97['attributes']:_0x18911a[_0x8008('0x30')];_0x443b97['order']=qs[_0x8008('0x3a')](_0x291469[_0x8008('0x31')]['sort']);_0x443b97[_0x8008('0x3b')]=qs[_0x8008('0x33')](_[_0x8008('0x3c')](_0x291469[_0x8008('0x31')],_0x18911a[_0x8008('0x33')]));if(_0x291469[_0x8008('0x31')][_0x8008('0x53')]){_0x443b97[_0x8008('0x3b')]=_[_0x8008('0x3d')](_0x443b97['where'],{'$or':_[_0x8008('0x2b')](_0x443b97['attributes'],function(_0x442a7b){var _0x3d37be={};_0x3d37be[_0x442a7b]={'$like':'%'+_0x291469[_0x8008('0x31')]['filter']+'%'};return _0x3d37be;})});}_0x443b97=_[_0x8008('0x3d')]({},_0x443b97,_0x291469[_0x8008('0x3e')]);return _0x16d859['getMembers'](_0x443b97);}})['then'](function(_0x81ac8d){if(_0x81ac8d){_0x571cb6=_0x81ac8d[_0x8008('0x45')];if(!_0x291469[_0x8008('0x31')][_0x8008('0x37')](_0x8008('0x38'))){_0x443b97[_0x8008('0x21')]=qs[_0x8008('0x21')](_0x291469['query']['limit']);_0x443b97['offset']=qs[_0x8008('0x1e')](_0x291469[_0x8008('0x31')][_0x8008('0x1e')]);}return _0x16d859[_0x8008('0x50')](_0x443b97);}})[_0x8008('0x25')](function(_0x3a2c7a){if(_0x3a2c7a){return _0x3a2c7a?{'count':_0x571cb6,'rows':_0x3a2c7a}:null;}})[_0x8008('0x25')](respondWithResult(_0x15b492,null))[_0x8008('0x42')](handleError(_0x15b492,null));};exports[_0x8008('0x54')]=function(_0x480a57,_0x3259d4,_0x216f5b){return db[_0x8008('0x3f')][_0x8008('0x47')]({'where':{'id':_0x480a57[_0x8008('0x44')]['id']}})[_0x8008('0x25')](handleEntityNotFound(_0x3259d4,null))[_0x8008('0x25')](function(_0x1efe48){if(_0x1efe48){return _0x1efe48[_0x8008('0x54')](_0x480a57[_0x8008('0x31')][_0x8008('0x4e')]);}})[_0x8008('0x25')](respondWithStatusCode(_0x3259d4,null))[_0x8008('0x42')](handleError(_0x3259d4,null));};exports[_0x8008('0x55')]=function(_0xc015e9,_0x1c19a8,_0x31c0cb){if(_0xc015e9[_0x8008('0x49')]['id']){delete _0xc015e9[_0x8008('0x49')]['id'];}return db['ChatGroup'][_0x8008('0x47')]({'where':{'id':_0xc015e9[_0x8008('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c19a8,null))[_0x8008('0x25')](function(_0x16cdc1){if(_0x16cdc1){_0xc015e9['body'][_0x8008('0x56')]=_0x16cdc1['id'];return db['ChatInternalMessage'][_0x8008('0x48')](_0xc015e9[_0x8008('0x49')]);}})[_0x8008('0x25')](respondWithResult(_0x1c19a8,null))[_0x8008('0x42')](handleError(_0x1c19a8,null));};exports[_0x8008('0x57')]=function(_0x2aae00,_0x542c5c,_0x49493b){var _0x1bb845={};var _0x562e70={};var _0x4c4c92;var _0x522db1;return db['ChatGroup'][_0x8008('0x51')]({'where':{'id':_0x2aae00[_0x8008('0x44')]['id']}})[_0x8008('0x25')](handleEntityNotFound(_0x542c5c,null))['then'](function(_0x77209){if(_0x77209){_0x4c4c92=_0x77209;_0x562e70[_0x8008('0x30')]=_[_0x8008('0x32')](db[_0x8008('0x58')]['rawAttributes']);_0x562e70[_0x8008('0x31')]=_[_0x8008('0x32')](_0x2aae00[_0x8008('0x31')]);_0x562e70['filters']=_[_0x8008('0x34')](_0x562e70[_0x8008('0x30')],_0x562e70[_0x8008('0x31')]);_0x1bb845[_0x8008('0x35')]=_[_0x8008('0x34')](_0x562e70[_0x8008('0x30')],qs[_0x8008('0x36')](_0x2aae00[_0x8008('0x31')][_0x8008('0x36')]));_0x1bb845[_0x8008('0x35')]=_0x1bb845['attributes'][_0x8008('0x45')]?_0x1bb845['attributes']:_0x562e70[_0x8008('0x30')];_0x1bb845[_0x8008('0x39')]=qs[_0x8008('0x3a')](_0x2aae00[_0x8008('0x31')][_0x8008('0x3a')]);_0x1bb845[_0x8008('0x3b')]=qs[_0x8008('0x33')](_[_0x8008('0x3c')](_0x2aae00['query'],_0x562e70['filters']));if(_0x2aae00[_0x8008('0x31')]['filter']){_0x1bb845[_0x8008('0x3b')]=_[_0x8008('0x3d')](_0x1bb845['where'],{'$or':_[_0x8008('0x2b')](_0x1bb845['attributes'],function(_0x2fb94a){var _0x10d7eb={};_0x10d7eb[_0x2fb94a]={'$like':'%'+_0x2aae00[_0x8008('0x31')][_0x8008('0x53')]+'%'};return _0x10d7eb;})});}if(_0x2aae00[_0x8008('0x31')]['$gte']){var _0x2d1dcf=_0x2aae00[_0x8008('0x31')]['$gte'][_0x8008('0x59')](',');var _0x59b697={};_0x59b697[_0x2d1dcf[0x0]]={'$gte':moment(_0x2d1dcf[0x1])[_0x8008('0x5a')](_0x8008('0x5b'))};_0x1bb845[_0x8008('0x3b')]=_[_0x8008('0x3d')](_0x1bb845[_0x8008('0x3b')],_0x59b697);}_0x1bb845=_[_0x8008('0x3d')]({},_0x1bb845,_0x2aae00[_0x8008('0x3e')]);return _0x4c4c92[_0x8008('0x57')](_0x1bb845);}})['then'](function(_0x1a4320){if(_0x1a4320){_0x522db1=_0x1a4320[_0x8008('0x45')];if(!_0x2aae00[_0x8008('0x31')][_0x8008('0x37')](_0x8008('0x38'))){_0x1bb845[_0x8008('0x21')]=qs[_0x8008('0x21')](_0x2aae00[_0x8008('0x31')]['limit']);_0x1bb845[_0x8008('0x1e')]=qs[_0x8008('0x1e')](_0x2aae00['query']['offset']);}return _0x4c4c92[_0x8008('0x57')](_0x1bb845);}})[_0x8008('0x25')](function(_0x384b3c){if(_0x384b3c){return _0x384b3c?{'count':_0x522db1,'rows':_0x384b3c}:null;}})['then'](respondWithResult(_0x542c5c,null))[_0x8008('0x42')](handleError(_0x542c5c,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 919c190..fef0147 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 _0x5046=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x24ddc2,_0x4aa4cf){var _0x710070=function(_0x4eab22){while(--_0x4eab22){_0x24ddc2['push'](_0x24ddc2['shift']());}};_0x710070(++_0x4aa4cf);}(_0x5046,0x6d));var _0x6504=function(_0x51df7e,_0x15baff){_0x51df7e=_0x51df7e-0x0;var _0x5de5cb=_0x5046[_0x51df7e];return _0x5de5cb;};'use strict';var EventEmitter=require(_0x6504('0x0'));var ChatGroup=require(_0x6504('0x1'))['db'][_0x6504('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6504('0x3')](0x0);var events={'afterCreate':_0x6504('0x4'),'afterUpdate':_0x6504('0x5'),'afterDestroy':_0x6504('0x6')};function emitEvent(_0x468e95){return function(_0x28d61b,_0x430fa8,_0x50c5ec){ChatGroupEvents[_0x6504('0x7')](_0x468e95+':'+_0x28d61b['id'],_0x28d61b);ChatGroupEvents[_0x6504('0x7')](_0x468e95,_0x28d61b);_0x50c5ec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x6504('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xe3da=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xfd777b,_0xe87db4){var _0x4e8fd3=function(_0x2897b8){while(--_0x2897b8){_0xfd777b['push'](_0xfd777b['shift']());}};_0x4e8fd3(++_0xe87db4);}(_0xe3da,0x1cd));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xae3d('0x0'));var ChatGroup=require(_0xae3d('0x1'))['db'][_0xae3d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xae3d('0x3')](0x0);var events={'afterCreate':_0xae3d('0x4'),'afterUpdate':_0xae3d('0x5'),'afterDestroy':_0xae3d('0x6')};function emitEvent(_0x17952f){return function(_0xb2dfd3,_0x22bacf,_0x1b9397){ChatGroupEvents[_0xae3d('0x7')](_0x17952f+':'+_0xb2dfd3['id'],_0xb2dfd3);ChatGroupEvents[_0xae3d('0x7')](_0x17952f,_0xb2dfd3);_0x1b9397(null);};}for(var e in events){if(events[_0xae3d('0x8')](e)){var event=events[e];ChatGroup[_0xae3d('0x9')](e,emitEvent(event));}}module[_0xae3d('0xa')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 636cbaa..d362992 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 _0xfe77=['../../config/environment','./chatGroup.attributes','define','ChatGroup','util','api','moment','request-promise','rimraf'];(function(_0x2a83d1,_0x294fca){var _0x4bcf2f=function(_0x491e09){while(--_0x491e09){_0x2a83d1['push'](_0x2a83d1['shift']());}};_0x4bcf2f(++_0x294fca);}(_0xfe77,0x11b));var _0x7fe7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe77[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7fe7('0x0'));var logger=require('../../config/logger')(_0x7fe7('0x1'));var moment=require(_0x7fe7('0x2'));var BPromise=require('bluebird');var rp=require(_0x7fe7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fe7('0x4'));var config=require(_0x7fe7('0x5'));var attributes=require(_0x7fe7('0x6'));module['exports']=function(_0x28f64e,_0x2184dc){return _0x28f64e[_0x7fe7('0x7')](_0x7fe7('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fab=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x59e0b8,_0x4029e6){var _0x4414b0=function(_0x3212ec){while(--_0x3212ec){_0x59e0b8['push'](_0x59e0b8['shift']());}};_0x4414b0(++_0x4029e6);}(_0x3fab,0x1f4));var _0xb3fa=function(_0xc78766,_0x434038){_0xc78766=_0xc78766-0x0;var _0x52f405=_0x3fab[_0xc78766];return _0x52f405;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb3fa('0x0'))(_0xb3fa('0x1'));var moment=require(_0xb3fa('0x2'));var BPromise=require(_0xb3fa('0x3'));var rp=require(_0xb3fa('0x4'));var fs=require('fs');var path=require(_0xb3fa('0x5'));var rimraf=require(_0xb3fa('0x6'));var config=require(_0xb3fa('0x7'));var attributes=require(_0xb3fa('0x8'));module[_0xb3fa('0x9')]=function(_0xbc9689,_0x282b24){return _0xbc9689[_0xb3fa('0xa')](_0xb3fa('0xb'),attributes,{'tableName':_0xb3fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 5a66573..ffee9a5 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 _0xf2ca=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5decec,_0x4e5761){_0x5decec=_0x5decec-0x0;var _0x35e1b4=_0xf2ca[_0x5decec];return _0x35e1b4;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});config[_0xaf2c('0xc')]=_['defaults'](config[_0xaf2c('0xc')],{'host':_0xaf2c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf2c('0xc')]));require('./chatGroup.socket')[_0xaf2c('0xe')](socket);function respondWithRpcPromise(_0x4a0064,_0x2f5099,_0x144a7a){return new BPromise(function(_0x2e04e5,_0xd891e9){return client['request'](_0x4a0064,_0x144a7a)['then'](function(_0x2c0d88){logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x2f5099,_0xaf2c('0x11'));logger[_0xaf2c('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2f5099,'request\x20sent',JSON[_0xaf2c('0x13')](_0x2c0d88));if(_0x2c0d88[_0xaf2c('0x14')]){if(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x15')]===0x1f4){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0xd891e9(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);}logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0x2e04e5(_0x2c0d88[_0xaf2c('0x14')]['message']);}else{logger[_0xaf2c('0xf')]('ChatGroup,\x20%s,\x20%s',_0x2f5099,_0xaf2c('0x11'));_0x2e04e5(_0x2c0d88[_0xaf2c('0x17')][_0xaf2c('0x16')]);}})['catch'](function(_0x28ae7b){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x28ae7b);_0xd891e9(_0x28ae7b);});});}
\ No newline at end of file
+var _0x4c72=['error','ChatGroup,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4b333a,_0x47d4bb){var _0x2b145a=function(_0x5972df){while(--_0x5972df){_0x4b333a['push'](_0x4b333a['shift']());}};_0x2b145a(++_0x47d4bb);}(_0x4c72,0x1e4));var _0x24c7=function(_0x368c56,_0x51f049){_0x368c56=_0x368c56-0x0;var _0x1ab5eb=_0x4c72[_0x368c56];return _0x1ab5eb;};'use strict';var _=require(_0x24c7('0x0'));var util=require('util');var moment=require(_0x24c7('0x1'));var BPromise=require(_0x24c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x24c7('0x3'))(_0x24c7('0x4'));var config=require('../../config/environment');var jayson=require(_0x24c7('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x24c7('0x6')]=_[_0x24c7('0x7')](config[_0x24c7('0x6')],{'host':_0x24c7('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x24c7('0x6')]));require(_0x24c7('0x9'))[_0x24c7('0xa')](socket);function respondWithRpcPromise(_0x5b5eb2,_0x2a512b,_0x292d4c){return new BPromise(function(_0x13626e,_0x26190a){return client['request'](_0x5b5eb2,_0x292d4c)[_0x24c7('0xb')](function(_0x2118ce){logger[_0x24c7('0xc')]('ChatGroup,\x20%s,\x20%s',_0x2a512b,'request\x20sent');logger['debug'](_0x24c7('0xd'),_0x2a512b,_0x24c7('0xe'),JSON[_0x24c7('0xf')](_0x2118ce));if(_0x2118ce['error']){if(_0x2118ce[_0x24c7('0x10')]['code']===0x1f4){logger[_0x24c7('0x10')](_0x24c7('0x11'),_0x2a512b,_0x2118ce[_0x24c7('0x10')]['message']);return _0x26190a(_0x2118ce[_0x24c7('0x10')][_0x24c7('0x12')]);}logger[_0x24c7('0x10')](_0x24c7('0x11'),_0x2a512b,_0x2118ce['error'][_0x24c7('0x12')]);return _0x13626e(_0x2118ce[_0x24c7('0x10')]['message']);}else{logger[_0x24c7('0xc')](_0x24c7('0x11'),_0x2a512b,_0x24c7('0xe'));_0x13626e(_0x2118ce['result'][_0x24c7('0x12')]);}})[_0x24c7('0x13')](function(_0x256def){logger[_0x24c7('0x10')](_0x24c7('0x11'),_0x2a512b,_0x256def);_0x26190a(_0x256def);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 0b947e9..dfa8697 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 _0xe8a2=['emit','register','chatGroup:','./chatGroup.events','remove','update'];(function(_0x30fe8c,_0x272cb9){var _0x4f1068=function(_0x5f52c7){while(--_0x5f52c7){_0x30fe8c['push'](_0x30fe8c['shift']());}};_0x4f1068(++_0x272cb9);}(_0xe8a2,0x15f));var _0x2e8a=function(_0xcff452,_0x28455){_0xcff452=_0xcff452-0x0;var _0x3ad961=_0xe8a2[_0xcff452];return _0x3ad961;};'use strict';var ChatGroupEvents=require(_0x2e8a('0x0'));var events=['save',_0x2e8a('0x1'),_0x2e8a('0x2')];function createListener(_0x57a1f1,_0x24aaab){return function(_0x3e89ce){_0x24aaab[_0x2e8a('0x3')](_0x57a1f1,_0x3e89ce);};}function removeListener(_0x159c50,_0x57fbb5){return function(){ChatGroupEvents['removeListener'](_0x159c50,_0x57fbb5);};}exports[_0x2e8a('0x4')]=function(_0x1a5ee4){for(var _0x35d8ba=0x0,_0x27c95a=events['length'];_0x35d8ba<_0x27c95a;_0x35d8ba++){var _0x2c6531=events[_0x35d8ba];var _0x3d3125=createListener(_0x2e8a('0x5')+_0x2c6531,_0x1a5ee4);ChatGroupEvents['on'](_0x2c6531,_0x3d3125);}};
\ No newline at end of file
+var _0x5c79=['./chatGroup.events','save','remove','update','emit','removeListener','length','chatGroup:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5c79,0x1c8));var _0x95c7=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x5c79[_0x55d58f];return _0x1ad6e6;};'use strict';var ChatGroupEvents=require(_0x95c7('0x0'));var events=[_0x95c7('0x1'),_0x95c7('0x2'),_0x95c7('0x3')];function createListener(_0x4620bd,_0x3e1f83){return function(_0x1d9e95){_0x3e1f83[_0x95c7('0x4')](_0x4620bd,_0x1d9e95);};}function removeListener(_0x1b0521,_0x4bb4f9){return function(){ChatGroupEvents[_0x95c7('0x5')](_0x1b0521,_0x4bb4f9);};}exports['register']=function(_0x3775f9){for(var _0x3a1fb1=0x0,_0x4d084b=events[_0x95c7('0x6')];_0x3a1fb1<_0x4d084b;_0x3a1fb1++){var _0x367edf=events[_0x3a1fb1];var _0x1190c2=createListener(_0x95c7('0x7')+_0x367edf,_0x3775f9);ChatGroupEvents['on'](_0x367edf,_0x1190c2);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 2c5dbfc..3737408 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 _0xac79=['index','/describe','isAuthenticated','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put','update','destroy','delete','removeMembers','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xac79,0x1e4));var _0x9ac7=function(_0x65e204,_0x3f8857){_0x65e204=_0x65e204-0x0;var _0xd44376=_0xac79[_0x65e204];return _0xd44376;};'use strict';var multer=require(_0x9ac7('0x0'));var util=require('util');var path=require(_0x9ac7('0x1'));var timeout=require(_0x9ac7('0x2'));var express=require(_0x9ac7('0x3'));var router=express['Router']();var fs_extra=require(_0x9ac7('0x4'));var auth=require(_0x9ac7('0x5'));var interaction=require(_0x9ac7('0x6'));var config=require('../../config/environment');var controller=require(_0x9ac7('0x7'));router[_0x9ac7('0x8')]('/',auth['isAuthenticated'](),controller[_0x9ac7('0x9')]);router[_0x9ac7('0x8')](_0x9ac7('0xa'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0xc')]);router[_0x9ac7('0x8')](_0x9ac7('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9ac7('0xe'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0xf')]);router[_0x9ac7('0x8')](_0x9ac7('0x10'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x11')]);router['get'](_0x9ac7('0x12'),auth['isAuthenticated'](),controller['getMessages']);router[_0x9ac7('0x13')]('/',auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x14')]);router[_0x9ac7('0x13')](_0x9ac7('0x10'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x15')]);router['post'](_0x9ac7('0x12'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x16')]);router[_0x9ac7('0x17')](_0x9ac7('0xd'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x18')]);router['delete'](_0x9ac7('0xd'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x19')]);router[_0x9ac7('0x1a')]('/:id/members',auth['isAuthenticated'](),controller[_0x9ac7('0x1b')]);module[_0x9ac7('0x1c')]=router;
\ No newline at end of file
+var _0x2856=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','post','create','/:id/members','addMessage','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express'];(function(_0x388586,_0x276ec0){var _0x2c5762=function(_0x25c327){while(--_0x25c327){_0x388586['push'](_0x388586['shift']());}};_0x2c5762(++_0x276ec0);}(_0x2856,0x1e8));var _0x6285=function(_0x18a772,_0x1a4d3f){_0x18a772=_0x18a772-0x0;var _0xbaac04=_0x2856[_0x18a772];return _0xbaac04;};'use strict';var multer=require(_0x6285('0x0'));var util=require(_0x6285('0x1'));var path=require(_0x6285('0x2'));var timeout=require(_0x6285('0x3'));var express=require(_0x6285('0x4'));var router=express[_0x6285('0x5')]();var fs_extra=require(_0x6285('0x6'));var auth=require(_0x6285('0x7'));var interaction=require(_0x6285('0x8'));var config=require('../../config/environment');var controller=require(_0x6285('0x9'));router['get']('/',auth[_0x6285('0xa')](),controller[_0x6285('0xb')]);router[_0x6285('0xc')](_0x6285('0xd'),auth[_0x6285('0xa')](),controller[_0x6285('0xe')]);router[_0x6285('0xc')](_0x6285('0xf'),auth[_0x6285('0xa')](),controller[_0x6285('0x10')]);router[_0x6285('0xc')](_0x6285('0x11'),auth[_0x6285('0xa')](),controller[_0x6285('0x12')]);router[_0x6285('0xc')]('/:id/members',auth[_0x6285('0xa')](),controller[_0x6285('0x13')]);router[_0x6285('0xc')](_0x6285('0x14'),auth[_0x6285('0xa')](),controller['getMessages']);router[_0x6285('0x15')]('/',auth[_0x6285('0xa')](),controller[_0x6285('0x16')]);router[_0x6285('0x15')](_0x6285('0x17'),auth['isAuthenticated'](),controller['addMembers']);router['post'](_0x6285('0x14'),auth[_0x6285('0xa')](),controller[_0x6285('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6285('0x19')](_0x6285('0xf'),auth['isAuthenticated'](),controller[_0x6285('0x1a')]);router[_0x6285('0x19')](_0x6285('0x17'),auth['isAuthenticated'](),controller[_0x6285('0x1b')]);module[_0x6285('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 2d4516b..79942f9 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 _0x3e22=['ENUM','star','thumb','TEXT','STRING','long','DATE','BOOLEAN','exports','INTEGER'];(function(_0x200953,_0x1b67d4){var _0x3d486e=function(_0x4341c9){while(--_0x4341c9){_0x200953['push'](_0x200953['shift']());}};_0x3d486e(++_0x1b67d4);}(_0x3e22,0xa8));var _0x23e2=function(_0x482918,_0x2503cb){_0x482918=_0x482918-0x0;var _0x31282d=_0x3e22[_0x482918];return _0x31282d;};'use strict';var Sequelize=require('sequelize');module[_0x23e2('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x23e2('0x1')]},'ratingType':{'type':Sequelize[_0x23e2('0x2')](_0x23e2('0x3'),_0x23e2('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x23e2('0x5')]},'mailTranscript':{'type':Sequelize[_0x23e2('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x23e2('0x6')]},'secondDisposition':{'type':Sequelize[_0x23e2('0x6')]},'thirdDisposition':{'type':Sequelize[_0x23e2('0x6')]},'note':{'type':Sequelize[_0x23e2('0x6')]},'browserName':{'type':Sequelize[_0x23e2('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x23e2('0x6')]},'osVersion':{'type':Sequelize[_0x23e2('0x6')]},'deviceModel':{'type':Sequelize[_0x23e2('0x6')]},'deviceVendor':{'type':Sequelize[_0x23e2('0x6')]},'deviceType':{'type':Sequelize[_0x23e2('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x23e2('0x6')]},'formData':{'type':Sequelize[_0x23e2('0x5')](_0x23e2('0x7'))},'read1stAt':{'type':Sequelize[_0x23e2('0x8')]},'lastMsgAt':{'type':Sequelize[_0x23e2('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x23e2('0x6')]},'customerPort':{'type':Sequelize[_0x23e2('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x23e2('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x23e2('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x19e1=['star','TEXT','STRING','long','DATE','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','thumb'];(function(_0x5926d5,_0x3933f8){var _0x2da247=function(_0xaded86){while(--_0xaded86){_0x5926d5['push'](_0x5926d5['shift']());}};_0x2da247(++_0x3933f8);}(_0x19e1,0x163));var _0x119e=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0x19e1[_0x46451c];return _0x12dce4;};'use strict';var Sequelize=require(_0x119e('0x0'));module[_0x119e('0x1')]={'closed':{'type':Sequelize[_0x119e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x119e('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x119e('0x4')),'defaultValue':_0x119e('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x119e('0x6')]},'mailTranscript':{'type':Sequelize[_0x119e('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x119e('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x119e('0x7')]},'note':{'type':Sequelize[_0x119e('0x7')]},'browserName':{'type':Sequelize[_0x119e('0x7')]},'browserVersion':{'type':Sequelize[_0x119e('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x119e('0x7')]},'deviceModel':{'type':Sequelize[_0x119e('0x7')]},'deviceVendor':{'type':Sequelize[_0x119e('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x119e('0x7')]},'formData':{'type':Sequelize[_0x119e('0x6')](_0x119e('0x8'))},'read1stAt':{'type':Sequelize[_0x119e('0x9')]},'lastMsgAt':{'type':Sequelize[_0x119e('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x119e('0xa')]('in',_0x119e('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x119e('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x119e('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x119e('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 89945a2..0aec808 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 _0x6c76=['email','isNull','follow','Sequelize','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','updateAttributes','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','CmContact','Messages','%s%d','System','website_alias','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','getMessages','filters','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','Account','Owner','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','update','destroy','stack','name','send','render','contact','agent','interaction','account','Users','map','fullname','TagIds','split','forEach','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','index','ChatInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','users','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','ChatInteractionId','push','all','rows','show','params','includeAll','include','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings'];(function(_0x469961,_0x4ab14b){var _0x55e9ef=function(_0x565236){while(--_0x565236){_0x469961['push'](_0x469961['shift']());}};_0x55e9ef(++_0x4ab14b);}(_0x6c76,0x184));var _0x66c7=function(_0x3fd737,_0x263d58){_0x3fd737=_0x3fd737-0x0;var _0x4b9e85=_0x6c76[_0x3fd737];return _0x4b9e85;};'use strict';var rimraf=require(_0x66c7('0x0'));var zipdir=require(_0x66c7('0x1'));var rp=require(_0x66c7('0x2'));var moment=require('moment');var BPromise=require(_0x66c7('0x3'));var Mustache=require(_0x66c7('0x4'));var util=require('util');var path=require('path');var ejs=require(_0x66c7('0x5'));var fs=require('fs');var _=require(_0x66c7('0x6'));var squel=require('squel');var Redis=require(_0x66c7('0x7'));var qs=require(_0x66c7('0x8'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x66c7('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x66c7('0xa'));var db=require(_0x66c7('0xb'))['db'];config[_0x66c7('0xc')]=_['defaults'](config[_0x66c7('0xc')],{'host':_0x66c7('0xd'),'port':0x18eb});var socket=require(_0x66c7('0xe'))(new Redis(config[_0x66c7('0xc')]));require('./chatInteraction.socket')[_0x66c7('0xf')](socket);var jayson=require(_0x66c7('0x10'));var client=jayson[_0x66c7('0x11')][_0x66c7('0x12')]({'port':0x232b});var client9004=jayson[_0x66c7('0x11')][_0x66c7('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x174717,_0x5176a3,_0x18c309,_0x760e36){return new BPromise(function(_0x35cbc2,_0xea3f56){var _0x4f6c91=_0x760e36||client;return _0x4f6c91[_0x66c7('0x13')](_0x174717,_0x18c309)[_0x66c7('0x14')](function(_0xf3b04){logger[_0x66c7('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x5176a3,_0x66c7('0x16'));logger['debug'](_0x66c7('0x17'),_0x5176a3,_0x66c7('0x16'),JSON[_0x66c7('0x18')](_0xf3b04));if(_0xf3b04[_0x66c7('0x19')]){if(_0xf3b04[_0x66c7('0x19')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5176a3,_0xf3b04['error'][_0x66c7('0x1a')]);return _0xea3f56(_0xf3b04[_0x66c7('0x19')]['message']);}logger['error'](_0x66c7('0x1b'),_0x5176a3,_0xf3b04[_0x66c7('0x19')][_0x66c7('0x1a')]);return _0x35cbc2(_0xf3b04[_0x66c7('0x19')]['message']);}else{logger['info'](_0x66c7('0x1b'),_0x5176a3,_0x66c7('0x16'));_0x35cbc2(_0xf3b04[_0x66c7('0x1c')][_0x66c7('0x1a')]);}})[_0x66c7('0x1d')](function(_0x75f118){logger['error'](_0x66c7('0x1b'),_0x5176a3,_0x75f118);_0xea3f56(_0x75f118);});});}function respondWithStatusCode(_0x366e9b,_0x4a2b90){_0x4a2b90=_0x4a2b90||0xcc;return function(_0x7462f1){if(_0x7462f1){return _0x366e9b[_0x66c7('0x1e')](_0x4a2b90);}return _0x366e9b[_0x66c7('0x1f')](_0x4a2b90)[_0x66c7('0x20')]();};}function respondWithResult(_0x5bfaf6,_0x2736df){_0x2736df=_0x2736df||0xc8;return function(_0x42ca37){if(_0x42ca37){return _0x5bfaf6['status'](_0x2736df)[_0x66c7('0x21')](_0x42ca37);}};}function respondWithFilteredResult(_0x11a6b9,_0x2bb86d){return function(_0x2ef6a2){if(_0x2ef6a2){var _0x2af0a3=typeof _0x2bb86d['offset']==='undefined'&&typeof _0x2bb86d['limit']===_0x66c7('0x22');var _0x542ff1=_0x2ef6a2['count'];var _0x9afd50=_0x2af0a3?0x0:_0x2bb86d[_0x66c7('0x23')];var _0x205b7e=_0x2af0a3?_0x2ef6a2[_0x66c7('0x24')]:_0x2bb86d[_0x66c7('0x23')]+_0x2bb86d[_0x66c7('0x25')];var _0x570f0d;if(_0x205b7e>=_0x542ff1){_0x205b7e=_0x542ff1;_0x570f0d=0xc8;}else{_0x570f0d=0xce;}_0x11a6b9[_0x66c7('0x1f')](_0x570f0d);return _0x11a6b9[_0x66c7('0x26')](_0x66c7('0x27'),_0x9afd50+'-'+_0x205b7e+'/'+_0x542ff1)[_0x66c7('0x21')](_0x2ef6a2);}return null;};}function saveUpdates(_0x2042ea){return function(_0x592f0e){if(_0x592f0e){return _0x592f0e[_0x66c7('0x28')](_0x2042ea)['then'](function(_0xfbd97){return _0xfbd97;});}return null;};}function removeEntity(_0x543fbf){return function(_0x296875){if(_0x296875){return _0x296875[_0x66c7('0x29')]()[_0x66c7('0x14')](function(){_0x543fbf[_0x66c7('0x1f')](0xcc)[_0x66c7('0x20')]();});}};}function handleEntityNotFound(_0x24e776){return function(_0x559ab9){if(!_0x559ab9){_0x24e776['sendStatus'](0x194);}return _0x559ab9;};}function handleError(_0x367e49,_0x12e7c6){_0x12e7c6=_0x12e7c6||0x1f4;return function(_0x827cbc){logger[_0x66c7('0x19')](_0x827cbc[_0x66c7('0x2a')]);if(_0x827cbc[_0x66c7('0x2b')]){delete _0x827cbc[_0x66c7('0x2b')];}_0x367e49[_0x66c7('0x1f')](_0x12e7c6)[_0x66c7('0x2c')](_0x827cbc);};}function getMustacheRender(_0x301495,_0x1fd460){return Mustache[_0x66c7('0x2d')](_0x301495,_['merge'](_0x1fd460['body'],{'contact':_0x1fd460[_0x66c7('0x2e')],'message':_0x1fd460[_0x66c7('0x1a')],'agent':_0x1fd460[_0x66c7('0x2f')],'interaction':_0x1fd460[_0x66c7('0x30')],'account':_0x1fd460[_0x66c7('0x31')]}))||'';}function getInteractionUsers(_0x2bf7c2,_0x21d0d3){return new BPromise(function(_0x5503c3,_0x30b90f){try{if(_0x21d0d3[_0x2bf7c2['id']]){_0x2bf7c2[_0x66c7('0x32')]=_[_0x66c7('0x33')](_0x21d0d3[_0x2bf7c2['id']],function(_0xd9e0f5){return{'id':_0xd9e0f5['id'],'fullname':_0xd9e0f5[_0x66c7('0x34')]};});}}catch(_0x324696){_0x30b90f(_0x324696);}_0x5503c3(_0x2bf7c2);});}function getInteractionTags(_0x3c8638,_0x2b3ac1){return new BPromise(function(_0x175ee7,_0x274c45){try{if(_0x3c8638[_0x66c7('0x35')]){_0x3c8638['Tags']=[];_0x3c8638['TagIds'][_0x66c7('0x36')](',')[_0x66c7('0x37')](function(_0xc63941){_0x3c8638['Tags']['push'](_0x2b3ac1[_0xc63941]);});}delete _0x3c8638[_0x66c7('0x35')];}catch(_0x96a1f5){_0x274c45(_0x96a1f5);}_0x175ee7(_0x3c8638);});}function updateChatInteraction(_0x501771,_0x2d98e4,_0x6e9796){return new BPromise(function(_0x34acf0,_0x51c92b){return getInteractionUsers(_0x501771,_0x6e9796)[_0x66c7('0x14')](function(_0x16b754){return getInteractionTags(_0x16b754,_0x2d98e4);})[_0x66c7('0x14')](function(_0x14d59c){return getStateInteraction(_0x14d59c);})[_0x66c7('0x14')](function(_0x1903fd){_0x34acf0(_0x1903fd);})[_0x66c7('0x1d')](function(_0x279d27){_0x51c92b(_0x279d27);});});}function getStateInteraction(_0x28ffe9){return new BPromise(function(_0x5f34ed){_0x28ffe9[_0x66c7('0x38')]=0x0;_0x28ffe9[_0x66c7('0x39')]=0x0;_0x28ffe9[_0x66c7('0x3a')]=0x0;_0x28ffe9[_0x66c7('0x3b')]=0x0;_0x28ffe9[_0x66c7('0x3c')]=0x0;_0x28ffe9[_0x66c7('0x3d')]=0x0;if(!_0x28ffe9[_0x66c7('0x3e')]&&!_0x28ffe9[_0x66c7('0x3f')]){_0x28ffe9[_0x66c7('0x38')]+=0x1;}if(!_0x28ffe9[_0x66c7('0x3e')]&&_0x28ffe9['UserId']){_0x28ffe9['talking']+=0x1;if(_0x28ffe9['waiting']){_0x28ffe9[_0x66c7('0x38')]-=0x1;}}if(_0x28ffe9[_0x66c7('0x3e')]&&_0x28ffe9['disposition']==='abandoned'){_0x28ffe9[_0x66c7('0x3c')]+=0x1;if(_0x28ffe9[_0x66c7('0x38')]){_0x28ffe9[_0x66c7('0x38')]-=0x1;}}else if(_0x28ffe9[_0x66c7('0x3e')]&&!_0x28ffe9[_0x66c7('0x3f')]&&_0x28ffe9['disposition']){_0x28ffe9[_0x66c7('0x3b')]+=0x1;if(_0x28ffe9['waiting']){_0x28ffe9['waiting']-=0x1;}}else if(_0x28ffe9[_0x66c7('0x3e')]&&_0x28ffe9[_0x66c7('0x3f')]){_0x28ffe9[_0x66c7('0x3a')]+=0x1;if(_0x28ffe9[_0x66c7('0x39')]){_0x28ffe9['talking']-=0x1;}}_0x28ffe9['total']+=0x1;_0x5f34ed(_0x28ffe9);});}exports[_0x66c7('0x40')]=function(_0x52506a,_0x4e0c89){var _0x1ec272={},_0x230f28={},_0x2b89e1={'count':0x0,'rows':[]};var _0x18408d=_['map'](db[_0x66c7('0x41')][_0x66c7('0x42')],function(_0x2c8ffe){return{'name':_0x2c8ffe['fieldName'],'type':_0x2c8ffe[_0x66c7('0x43')][_0x66c7('0x44')]};});_0x230f28[_0x66c7('0x45')]=_[_0x66c7('0x33')](_0x18408d,_0x66c7('0x2b'));_0x230f28[_0x66c7('0x46')]=_[_0x66c7('0x47')](_0x52506a[_0x66c7('0x46')]);_0x230f28['filters']=_[_0x66c7('0x48')](_0x230f28[_0x66c7('0x45')],_0x230f28[_0x66c7('0x46')]);_0x1ec272[_0x66c7('0x49')]=_[_0x66c7('0x48')](_0x230f28[_0x66c7('0x45')],qs[_0x66c7('0x4a')](_0x52506a[_0x66c7('0x46')][_0x66c7('0x4a')]));_0x1ec272[_0x66c7('0x49')]=_0x1ec272[_0x66c7('0x49')][_0x66c7('0x4b')]?_0x1ec272[_0x66c7('0x49')]:_0x230f28[_0x66c7('0x45')];if(!_0x52506a['query'][_0x66c7('0x4c')](_0x66c7('0x4d'))){_0x1ec272[_0x66c7('0x25')]=qs[_0x66c7('0x25')](_0x52506a['query'][_0x66c7('0x25')]);_0x1ec272[_0x66c7('0x23')]=qs['offset'](_0x52506a[_0x66c7('0x46')][_0x66c7('0x23')]);}_0x1ec272[_0x66c7('0x4e')]=qs[_0x66c7('0x4f')](_0x52506a[_0x66c7('0x46')][_0x66c7('0x4f')]);_0x1ec272[_0x66c7('0x50')]=qs['filters'](_[_0x66c7('0x51')](_0x52506a[_0x66c7('0x46')],_0x230f28['filters']),_0x18408d);var _0x127dfe=[];var _0x2617af=squel[_0x66c7('0x52')]()['field']('id')[_0x66c7('0x53')](_0x66c7('0x2b'))[_0x66c7('0x53')](_0x66c7('0x54'))[_0x66c7('0x55')](_0x66c7('0x56'));var _0x1d8313=squel[_0x66c7('0x52')]()['field'](_0x66c7('0x57'))[_0x66c7('0x53')]('u.fullname')[_0x66c7('0x53')](_0x66c7('0x58'))[_0x66c7('0x55')]('user_has_chat_interactions','ui')['left_join'](_0x66c7('0x59'),'u','u.id\x20=\x20ui.UserId');var _0x3c8fd9=squel[_0x66c7('0x52')]()[_0x66c7('0x55')](_0x66c7('0x5a'),'i')[_0x66c7('0x5b')](_0x66c7('0x5c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x66c7('0x59'),'o',_0x66c7('0x5d'))['left_join']('chat_websites','a',_0x66c7('0x5e'))['left_join'](_0x66c7('0x5f'),'me',_0x66c7('0x60'))[_0x66c7('0x5b')](_0x66c7('0x61'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x66c7('0x5b')](_0x66c7('0x56'),'t',_0x66c7('0x62'));var _0x2659f5=squel[_0x66c7('0x63')]();var _0x137c4f=[];var _0x4ec465=squel[_0x66c7('0x63')]();var _0x39c18e;if(_0x52506a[_0x66c7('0x46')]['search']){_0x39c18e=as[_0x66c7('0x64')](_0x52506a['query'][_0x66c7('0x65')]);var _0x45f5de=_0x39c18e[_0x66c7('0x66')];for(var _0x445af1=0x0;_0x445af1<_0x39c18e[_0x66c7('0x67')][_0x66c7('0x4b')];_0x445af1++){var _0x4b36d2=_0x39c18e[_0x66c7('0x67')][_0x445af1];var _0x2fc1c6='i';var _0x2d9069=_[_0x66c7('0x68')](_0x18408d,[_0x66c7('0x2b'),_0x4b36d2['field']]);if(!_0x2d9069){switch(_0x4b36d2[_0x66c7('0x53')]){case _0x66c7('0x69'):if(_0x4b36d2[_0x66c7('0x6a')]==0x1){_0x3c8fd9[_0x66c7('0x6b')]('`'+_0x4b36d2[_0x66c7('0x53')]+_0x66c7('0x6c'));}else{_0x3c8fd9[_0x66c7('0x6b')]('`'+_0x4b36d2[_0x66c7('0x53')]+_0x66c7('0x6d'));}break;case _0x66c7('0x6e'):if(_0x4b36d2[_0x66c7('0x6f')]===_0x66c7('0x70')){if(_0x4b36d2['value'][_0x66c7('0x36')]('\x20')[_0x66c7('0x4b')]>0x1){_0x2659f5[_0x45f5de](_0x66c7('0x71'),qs[_0x66c7('0x72')](_0x4b36d2[_0x66c7('0x6a')]),null);}else{var _0x419b49='%'+_0x4b36d2[_0x66c7('0x6a')]+'%';_0x2659f5[_0x45f5de]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x419b49,_0x419b49,_0x419b49);}}else{_0x2d9069=_[_0x66c7('0x68')](_0x18408d,[_0x66c7('0x2b'),_0x66c7('0x73')]);_0x4b36d2[_0x66c7('0x53')]=_0x66c7('0x73');_0xd0f389=as[_0x66c7('0x74')](_0x2fc1c6,_0x2d9069[_0x66c7('0x43')],_0x4b36d2);_0x2659f5[_0x45f5de](_0xd0f389[_0x66c7('0x75')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x76')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x20')]);}break;case _0x66c7('0x77'):var _0x1112ec=_0x4b36d2[_0x66c7('0x6a')][_0x66c7('0x36')](',')['map'](function(_0x16d404){return Number(_0x16d404);});_0x1112ec[_0x66c7('0x37')](function(_0x43a623){_0x4ec465['or'](_0x66c7('0x78'),'%,'+_0x43a623+',%');});_0x137c4f=_[_0x66c7('0x79')](_0x137c4f,_0x1112ec);break;case _0x66c7('0x7a'):if(_0x4b36d2[_0x66c7('0x6f')]===_0x66c7('0x70')){_0x2659f5[_0x45f5de](_0x66c7('0x7b'),'%'+_0x4b36d2[_0x66c7('0x6a')]+'%',null);}else{_0x2d9069=_[_0x66c7('0x68')](_0x18408d,[_0x66c7('0x2b'),_0x66c7('0x3f')]);_0x4b36d2[_0x66c7('0x53')]=_0x66c7('0x3f');_0xd0f389=as[_0x66c7('0x74')](_0x2fc1c6,_0x2d9069[_0x66c7('0x43')],_0x4b36d2);_0x2659f5[_0x45f5de](_0xd0f389['text'],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x76')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x20')]);}break;case _0x66c7('0x7c'):_0xd0f389=as[_0x66c7('0x74')]('me',null,_0x4b36d2);_0x2659f5[_0x45f5de](_0xd0f389['text'],_0xd0f389['value'][_0x66c7('0x76')],_0xd0f389['value'][_0x66c7('0x20')]);break;}}else{var _0xd0f389=as[_0x66c7('0x74')](_0x2fc1c6,_0x2d9069[_0x66c7('0x43')],_0x4b36d2);_0x2659f5[_0x45f5de](_0xd0f389[_0x66c7('0x75')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x76')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x20')]);}}}else{var _0x35ad88=_(_0x52506a[_0x66c7('0x46')])[_0x66c7('0x47')]()['map'](function(_0x25f193){return _[_0x66c7('0x7d')](_0x18408d,[_0x66c7('0x2b'),_0x25f193])?_0x25f193:undefined;})[_0x66c7('0x7e')]()['value']();if(!_[_0x66c7('0x7f')](_0x35ad88)){_0x35ad88[_0x66c7('0x37')](function(_0x4e0a54){if(_0x4e0a54===_0x66c7('0x80')){_0x3c8fd9[_0x66c7('0x50')](_0x66c7('0x81'),[][_0x66c7('0x82')](_0x52506a[_0x66c7('0x46')][_0x4e0a54]));}else if(_0x4e0a54===_0x66c7('0x83')){var _0x580212=JSON['parse'](_0x52506a[_0x66c7('0x46')][_0x4e0a54])['$gte'];var _0x570a63=JSON[_0x66c7('0x84')](_0x52506a[_0x66c7('0x46')][_0x4e0a54])[_0x66c7('0x85')];_0x3c8fd9[_0x66c7('0x50')](_0x66c7('0x86'),_0x580212,_0x570a63);}else{if(_0x52506a[_0x66c7('0x46')][_0x4e0a54]===_0x66c7('0x87')){_0x3c8fd9[_0x66c7('0x50')]('i.'+_0x4e0a54+'\x20IS\x20NULL');}else{_0x3c8fd9[_0x66c7('0x50')]('i.'+_0x4e0a54+_0x66c7('0x88'),_0x52506a[_0x66c7('0x46')][_0x4e0a54]);}}});}if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x89')]){if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x89')]==0x1){_0x3c8fd9[_0x66c7('0x6b')](_0x66c7('0x8a'));}else{_0x3c8fd9[_0x66c7('0x6b')](_0x66c7('0x8b'));}}if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x8c')]){_0x137c4f=_[_0x66c7('0x8d')](_0x52506a[_0x66c7('0x46')][_0x66c7('0x8c')])?_0x52506a[_0x66c7('0x46')][_0x66c7('0x8c')]:new Array(_0x52506a[_0x66c7('0x46')][_0x66c7('0x8c')]);_0x137c4f[_0x66c7('0x37')](function(_0x379dc4){_0x4ec465['or'](_0x66c7('0x78'),'%,'+_0x379dc4+',%');});}if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x8e')]){var _0x46d569=_0x52506a[_0x66c7('0x46')]['filter'][_0x66c7('0x8f')]('\x5c','\x5c\x5c')[_0x66c7('0x8f')](/'/g,'\x27\x27');if(qs[_0x66c7('0x90')](_0x46d569)){_0x2659f5['or']('i.id\x20LIKE\x20?',_0x46d569+'%');}else{_0x2659f5['or'](_0x66c7('0x91'),qs[_0x66c7('0x72')](_0x46d569))['or'](_0x66c7('0x92'),_0x46d569+'%');}}}_0x3c8fd9['where'](_0x2659f5);_0x3c8fd9[_0x66c7('0x93')](_0x66c7('0x94'));var _0x3abd74={'type':db['Sequelize'][_0x66c7('0x95')][_0x66c7('0x96')],'raw':!![]};var _0x280cdc=_0x3c8fd9[_0x66c7('0x97')]();_0x280cdc['field'](_0x66c7('0x94'));_0x280cdc[_0x66c7('0x53')](_0x66c7('0x98'),_0x66c7('0x69'));if(_0x1ec272['order']){_0x1ec272['order'][_0x66c7('0x37')](function(_0x2f3f75){var _0x45ccdf=_0x2f3f75[0x0]===_0x66c7('0x99')?_0x2f3f75[0x0]:'i.'+_0x2f3f75[0x0];_0x3c8fd9[_0x66c7('0x4e')](_0x45ccdf,_0x2f3f75[0x1]==='DESC'?![]:!![]);});}if(!_[_0x66c7('0x7f')](_0x137c4f)){_0x3c8fd9[_0x66c7('0x6b')](_0x4ec465);_0x280cdc[_0x66c7('0x50')](_0x66c7('0x9a'),_0x137c4f);}BPromise[_0x66c7('0x9b')]()['then'](function(){if(!_0x39c18e){if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x80')])return;_0x280cdc[_0x66c7('0x50')](_0x66c7('0x9c'));_0x3c8fd9[_0x66c7('0x50')](_0x66c7('0x9c'));return;}if(_0x52506a[_0x66c7('0x9d')][_0x66c7('0x9e')]!=='agent')return;return _0x52506a[_0x66c7('0x9d')][_0x66c7('0x9f')]({'attributes':['id'],'raw':!![]})[_0x66c7('0x14')](function(_0x574e42){if(_[_0x66c7('0x7f')](_0x574e42)){_0x280cdc[_0x66c7('0x50')](_0x66c7('0xa0'));_0x3c8fd9[_0x66c7('0x50')](_0x66c7('0xa0'));}else{_0x280cdc[_0x66c7('0x50')](_0x66c7('0x81'),_[_0x66c7('0x33')](_0x574e42,'id'));_0x3c8fd9['where'](_0x66c7('0x81'),_[_0x66c7('0x33')](_0x574e42,'id'));}});})[_0x66c7('0x14')](function(){if(_0x52506a[_0x66c7('0x9d')][_0x66c7('0x9e')]===_0x66c7('0x2f')&&!_0x39c18e&&!_0x52506a['query'][_0x66c7('0x80')])return[];return db[_0x66c7('0xa1')][_0x66c7('0x46')](_0x280cdc[_0x66c7('0xa2')](),_0x3abd74);})[_0x66c7('0x14')](function(_0x14608f){_0x2b89e1[_0x66c7('0x24')]=_0x14608f[_0x66c7('0x4b')];if(_0x2b89e1['count']===0x0)return[];return db[_0x66c7('0xa1')][_0x66c7('0x46')](_0x2617af[_0x66c7('0xa2')](),_0x3abd74)['then'](function(_0x176d9d){_0x127dfe=_[_0x66c7('0xa3')](_0x176d9d,'id');_0x3abd74=_[_0x66c7('0xa4')](_0x3abd74,{'model':db[_0x66c7('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x4a')]){_0x1ec272[_0x66c7('0x49')]['forEach'](function(_0x315996){_0x3c8fd9['field']('i.'+_0x315996);});}else{_0x3c8fd9['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xa5'),'Account.key');_0x3c8fd9['field'](_0x66c7('0xa6'),_0x66c7('0xa7'));_0x3c8fd9['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x66c7('0x99'));_0x3c8fd9['field']('i.*');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xa8'),'Contact.firstName');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xa9'),_0x66c7('0xaa'));_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xab'),_0x66c7('0xac'));_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xad'),_0x66c7('0xae'));_0x3c8fd9['field'](_0x66c7('0xaf'),'Contact.mobile');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xb0'),'Contact.fax');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xb1'),_0x66c7('0xb2'));_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xb3'),'Owner.internal');_0x3c8fd9[_0x66c7('0x53')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x66c7('0x35'));}if(_0x1ec272[_0x66c7('0x25')])_0x3c8fd9[_0x66c7('0x25')](_0x1ec272[_0x66c7('0x25')]);if(_0x1ec272[_0x66c7('0x23')])_0x3c8fd9[_0x66c7('0x23')](_0x1ec272[_0x66c7('0x23')]);return db['sequelize']['query'](_0x3c8fd9[_0x66c7('0xa2')](),_0x3abd74);})['then'](function(_0x4daa4e){if(_0x4daa4e['length']>0x0)_0x1d8313[_0x66c7('0x50')]('ui.ChatInteractionId\x20IN\x20?',_[_0x66c7('0x33')](_0x4daa4e,'id'));return db[_0x66c7('0xa1')][_0x66c7('0x46')](_0x1d8313['toString'](),_0x3abd74)[_0x66c7('0x14')](function(_0x5376d7){var _0x18f1d6=_['groupBy'](_0x5376d7,_0x66c7('0xb4'));var _0x248b31=[];_0x4daa4e[_0x66c7('0x37')](function(_0x3c8c2b){_0x248b31[_0x66c7('0xb5')](updateChatInteraction(_0x3c8c2b,_0x127dfe,_0x18f1d6));});return BPromise[_0x66c7('0xb6')](_0x248b31);});});})[_0x66c7('0x14')](function(_0x488f98){_0x2b89e1[_0x66c7('0xb7')]=_0x488f98;return _0x2b89e1;})['then'](respondWithFilteredResult(_0x4e0c89,_0x1ec272))['catch'](handleError(_0x4e0c89,null));};exports[_0x66c7('0xb8')]=function(_0xa18dfb,_0x12ee9f){var _0x44bbf2={'raw':![],'where':{'id':_0xa18dfb[_0x66c7('0xb9')]['id']}},_0x2cecc4={};_0x2cecc4[_0x66c7('0x45')]=_[_0x66c7('0x47')](db[_0x66c7('0x41')][_0x66c7('0x42')]);_0x2cecc4[_0x66c7('0x46')]=_[_0x66c7('0x47')](_0xa18dfb[_0x66c7('0x46')]);_0x2cecc4['filters']=_[_0x66c7('0x48')](_0x2cecc4['model'],_0x2cecc4[_0x66c7('0x46')]);_0x44bbf2[_0x66c7('0x49')]=_[_0x66c7('0x48')](_0x2cecc4[_0x66c7('0x45')],qs[_0x66c7('0x4a')](_0xa18dfb[_0x66c7('0x46')]['fields']));_0x44bbf2['attributes']=_0x44bbf2['attributes']['length']?_0x44bbf2['attributes']:_0x2cecc4[_0x66c7('0x45')];if(_0xa18dfb[_0x66c7('0x46')][_0x66c7('0xba')]){_0x44bbf2[_0x66c7('0xbb')]=[{'all':!![]}];}_0x44bbf2=_['merge']({},_0x44bbf2,_0xa18dfb['options']);return db[_0x66c7('0x41')][_0x66c7('0x68')](_0x44bbf2)['then'](handleEntityNotFound(_0x12ee9f,null))[_0x66c7('0x14')](respondWithResult(_0x12ee9f,null))[_0x66c7('0x1d')](handleError(_0x12ee9f,null));};exports['create']=function(_0x16965c,_0x2dfe01){return db[_0x66c7('0x41')][_0x66c7('0xbc')](_0x16965c['body'],{})['then'](respondWithResult(_0x2dfe01,0xc9))[_0x66c7('0x1d')](handleError(_0x2dfe01,null));};exports[_0x66c7('0x28')]=function(_0x433ce2,_0x221d44){if(_0x433ce2[_0x66c7('0x7c')]['id']){delete _0x433ce2[_0x66c7('0x7c')]['id'];}return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0x433ce2[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x221d44,null))['then'](saveUpdates(_0x433ce2[_0x66c7('0x7c')],null))[_0x66c7('0x14')](respondWithResult(_0x221d44,null))[_0x66c7('0x1d')](handleError(_0x221d44,null));};exports[_0x66c7('0x29')]=function(_0xbe4285,_0x3fb5eb){return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0xbe4285[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x3fb5eb,null))['then'](removeEntity(_0x3fb5eb,null))[_0x66c7('0x1d')](handleError(_0x3fb5eb,null));};exports[_0x66c7('0xbd')]=function(_0x140a3d,_0x42ef4c){return db[_0x66c7('0x41')][_0x66c7('0xbd')]()[_0x66c7('0x14')](respondWithResult(_0x42ef4c,null))[_0x66c7('0x1d')](handleError(_0x42ef4c,null));};exports['createVidaooSession']=function(_0x18c58a,_0x2bac63){var _0x4377f1=_0x18c58a[_0x66c7('0xb9')]['id'];var _0x13477f;var _0x433147;var _0x1caa25;return db[_0x66c7('0x41')][_0x66c7('0xbe')]({'where':{'id':_0x4377f1}})[_0x66c7('0x14')](function(_0x3259b1){_0x13477f=_0x3259b1;return db[_0x66c7('0xbf')]['findOne']({'where':{'id':_0x3259b1['ChatWebsiteId']},'attributes':['id',_0x66c7('0xc0'),_0x66c7('0xc1'),_0x66c7('0xc2'),_0x66c7('0xc3'),_0x66c7('0xc4')],'raw':!![]});})[_0x66c7('0x14')](function(_0x39fc6a){if(_0x39fc6a&&_0x39fc6a[_0x66c7('0xc0')]&&_0x39fc6a['vidaooEscalation']){_0x433147=_0x39fc6a;var _0xafdef8={'interaction':{'id':_0x4377f1},'agent':{'id':_0x18c58a[_0x66c7('0x9d')]['id'],'name':_0x18c58a['user'][_0x66c7('0x2b')],'fullname':_0x18c58a[_0x66c7('0x9d')][_0x66c7('0x34')],'email':_0x18c58a[_0x66c7('0x9d')]['email']},'contact':_0x18c58a[_0x66c7('0x7c')][_0x66c7('0x2e')],'account':_0x18c58a[_0x66c7('0x7c')][_0x66c7('0x31')]};var _0x582e85={'rejectUnauthorized':![],'method':'POST','url':_0x66c7('0xc5'),'headers':{'X-APIKEY':_0x39fc6a[_0x66c7('0xc0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x18c58a[_0x66c7('0x9d')][_0x66c7('0xc6')]],'buttons':null,'topic':_0x433147[_0x66c7('0xc2')],'note':_[_0x66c7('0xc7')](_0x433147['vidaooNote'])?null:getMustacheRender(_0x433147[_0x66c7('0xc3')],_0xafdef8),'metadata':null},'redirect':_0x66c7('0xc8'),'json':!![]};try{if(!_[_0x66c7('0xc7')](_0x433147[_0x66c7('0xc4')])){var _0x4f9ac5=getMustacheRender(_0x433147[_0x66c7('0xc4')],_0xafdef8);var _0x4b01ee=JSON[_0x66c7('0x84')](_0x4f9ac5);_0x582e85['body']['metadata']=_0x4b01ee;}}catch(_0x1e8fb4){throw new db[(_0x66c7('0xc9'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x582e85);}else{throw new db[(_0x66c7('0xc9'))]['ValidationError'](_0x66c7('0xca'));}})[_0x66c7('0x14')](function(_0x2358e9){_0x1caa25=_0x2358e9;if(_0x1caa25['id']){var _0xba7a89={'body':_0x1caa25['join_url'],'ChatWebsiteId':_0x433147['id'],'ChatInteractionId':_0x13477f['id'],'direction':_0x66c7('0xcb'),'UserId':_0x18c58a[_0x66c7('0x9d')]['id']};return db[_0x66c7('0xcc')][_0x66c7('0xbc')](_0xba7a89,{});}else{throw new db[(_0x66c7('0xc9'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x66c7('0x14')](function(){return _0x13477f[_0x66c7('0xcd')]({'vidaooSessionId':_0x1caa25['id']});})[_0x66c7('0x14')](respondWithResult(_0x2bac63,null))[_0x66c7('0x1d')](handleError(_0x2bac63,null));};exports[_0x66c7('0xce')]=function(_0x501a80,_0x290fcc){if(_0x501a80[_0x66c7('0x7c')]['id']){delete _0x501a80[_0x66c7('0x7c')]['id'];}return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0x501a80['params']['id']},'include':[{'model':db['CmContact'],'as':_0x66c7('0x6e')}]})[_0x66c7('0x14')](handleEntityNotFound(_0x290fcc,null))['then'](saveUpdates(_0x501a80[_0x66c7('0x7c')],null))['then'](respondWithResult(_0x290fcc,null))[_0x66c7('0x1d')](handleError(_0x290fcc,null));};exports[_0x66c7('0xcf')]=function(_0x38afc7,_0x4dc210){if(_0x38afc7[_0x66c7('0x7c')]['id']){delete _0x38afc7['body']['id'];}return db[_0x66c7('0x41')]['find']({'where':{'id':_0x38afc7[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](function(_0x201893){if(!_0x201893){logger[_0x66c7('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x66c7('0xcf'),0x194,_0x66c7('0xd0'));_0x4dc210['sendStatus'](0x194);}else{if(_0x201893[_0x66c7('0x3f')]){throw new db[(_0x66c7('0xc9'))]['ValidationError'](_0x66c7('0xd1'));}}return _0x201893;})[_0x66c7('0x14')](function(_0x4aadc8){if(_0x4aadc8){return _0x4aadc8[_0x66c7('0x28')]({'closed':_0x38afc7['body']['closed'],'disposition':_0x38afc7[_0x66c7('0x7c')]['disposition']})[_0x66c7('0x14')](function(_0x276cf8){return _0x276cf8;});}})['then'](function(){return respondWithRpcPromise(_0x66c7('0xd2'),'abandon',_0x38afc7[_0x66c7('0x7c')],client9004);})[_0x66c7('0x14')](respondWithResult(_0x4dc210,null))[_0x66c7('0x1d')](handleError(_0x4dc210,null));};exports[_0x66c7('0xd3')]=function(_0x54759e,_0x55781b){_0x54759e[_0x66c7('0x7c')]['name']=_0x54759e[_0x66c7('0xd4')][_0x66c7('0xd5')];_0x54759e[_0x66c7('0x7c')][_0x66c7('0xd6')]=_0x54759e[_0x66c7('0xd4')][_0x66c7('0xd7')];_0x54759e[_0x66c7('0x7c')][_0x66c7('0x43')]=_0x54759e[_0x66c7('0xd4')][_0x66c7('0xd8')];return db[_0x66c7('0xd9')][_0x66c7('0xbc')](_0x54759e[_0x66c7('0x7c')])[_0x66c7('0x14')](respondWithResult(_0x55781b,0xc9))[_0x66c7('0x1d')](handleError(_0x55781b,null));};exports[_0x66c7('0xda')]=function(_0x51f2c8,_0x2f74b6){return db['ChatInteraction']['findOne']({'where':{'id':_0x51f2c8[_0x66c7('0xb9')]['id']},'raw':!![]})[_0x66c7('0x14')](handleEntityNotFound(_0x2f74b6,null))['then'](function(_0x1ad31b){if(_0x1ad31b){if(_0x1ad31b[_0x66c7('0x3e')]){return _0x2f74b6[_0x66c7('0x1f')](0x193)[_0x66c7('0x21')]({'status':0x193,'message':_0x66c7('0xdb')});}return db['Attachment'][_0x66c7('0xbe')]({'where':{'id':_0x51f2c8[_0x66c7('0x46')][_0x66c7('0xdc')]},'raw':!![]})[_0x66c7('0x14')](handleEntityNotFound(_0x2f74b6,null));}})[_0x66c7('0x14')](function(_0x1b677c){if(_0x1b677c){var _0x53a34c=_0x1b677c[_0x66c7('0xdd')]!==null;var _0x598212=path[_0x66c7('0xde')](config['root'],_0x66c7('0xdf'));if(_0x53a34c){_0x598212=path[_0x66c7('0xde')](_0x598212,_0x66c7('0xe0'));}var _0x1f3b38=path[_0x66c7('0xde')](_0x598212,_0x1b677c['basename']);return _0x2f74b6[_0x66c7('0xe1')](_0x1f3b38);}})[_0x66c7('0x1d')](handleError(_0x2f74b6,null));};exports[_0x66c7('0xe2')]=function(_0x56c2ca,_0x22e8f7){var _0x511029=null;var _0x1dcadb=null;var _0x37aace=null;if(_0x56c2ca['body']['id']){delete _0x56c2ca[_0x66c7('0x7c')]['id'];}if(_0x56c2ca[_0x66c7('0x7c')][_0x66c7('0xe3')]){_0x37aace=path['join'](config[_0x66c7('0xe4')],_0x66c7('0xe5'),util[_0x66c7('0xe6')]('transcript-%s.txt',Date['now']()));_0x56c2ca[_0x66c7('0x7c')]['pathTranscript']=_0x37aace;}return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0x56c2ca['params']['id']},'include':[{'model':db[_0x66c7('0xcc')],'as':'Messages','include':[{'model':db['User'],'as':_0x66c7('0x7a')}]}]})[_0x66c7('0x14')](handleEntityNotFound(_0x22e8f7,null))[_0x66c7('0x14')](saveUpdates(_0x56c2ca['body'],null))[_0x66c7('0x14')](function(_0x3fff74){if(_0x3fff74){_0x511029=_0x3fff74;return db[_0x66c7('0xbf')][_0x66c7('0x68')]({'where':{'id':_0x511029[_0x66c7('0x80')]}});}})['then'](function(_0x2ce2c2){if(_0x2ce2c2){_0x1dcadb=_0x2ce2c2;return db[_0x66c7('0xe7')][_0x66c7('0x68')]({'where':{'id':_0x511029['ContactId']}});}})[_0x66c7('0x14')](function(_0x5d6306){if(_0x5d6306){if(_0x37aace){var _0x42119f=null;for(var _0x26894a=0x1;_0x26894a<_0x511029[_0x66c7('0xe8')][_0x66c7('0x4b')];++_0x26894a){_0x42119f=_0x511029[_0x66c7('0xe8')][_0x26894a];var _0x21b78a=_0x42119f['UserId']?util[_0x66c7('0xe6')](_0x66c7('0xe9'),_0x1dcadb['agentAlias'],_0x42119f[_0x66c7('0x3f')]):_0x66c7('0xea');var _0x196ae=_0x56c2ca[_0x66c7('0x7c')]['customer']||util[_0x66c7('0xe6')](_0x66c7('0xe9'),'Visitor',_0x42119f['ContactId']);switch(_0x1dcadb['agentIdentifier']){case _0x66c7('0xeb'):_0x21b78a=_0x42119f[_0x66c7('0x3f')]?util[_0x66c7('0xe6')](_0x66c7('0xe9'),_0x1dcadb[_0x66c7('0xec')],_0x42119f[_0x66c7('0x3f')]):'System';break;case _0x66c7('0xed'):_0x21b78a=_0x42119f[_0x66c7('0x3f')]?_0x42119f[_0x66c7('0x7a')][_0x66c7('0xee')]||_0x42119f[_0x66c7('0x7a')][_0x66c7('0x34')]:_0x66c7('0xea');break;case'agent_fullname':_0x21b78a=_0x42119f[_0x66c7('0x3f')]?_0x42119f['User'][_0x66c7('0x34')]:_0x66c7('0xea');break;default:_0x21b78a=_0x42119f['UserId']?util[_0x66c7('0xe6')](_0x66c7('0xe9'),_0x1dcadb[_0x66c7('0xec')],_0x42119f['UserId']):_0x66c7('0xea');}var _0x1c1023=util[_0x66c7('0xe6')](_0x66c7('0xef'),moment(_0x42119f[_0x66c7('0x83')])['format'](_0x66c7('0xf0')),_0x42119f[_0x66c7('0xf1')]==='in'?_0x196ae:_0x21b78a,_0x42119f[_0x66c7('0x7c')]);if(!_0x42119f[_0x66c7('0xf2')]){fs['appendFileSync'](_0x37aace,_0x1c1023);}}return db[_0x66c7('0xf3')][_0x66c7('0xbe')]({'where':{'service':!![]},'include':[{'model':db[_0x66c7('0xf4')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x66c7('0xf5'),'raw':!![]}]}]});}}})[_0x66c7('0x14')](function(_0x2a5aa1){if(!_0x2a5aa1||!_0x2a5aa1[_0x66c7('0xf6')]||!_0x56c2ca[_0x66c7('0x7c')])return _0x511029;var _0x8401b2=_0x2a5aa1[_0x66c7('0xf7')]();return respondWithRpcPromise(_0x66c7('0xf8'),_0x66c7('0xf9'),{'account':_0x8401b2,'message':{'from':util[_0x66c7('0xe6')]('\x22%s\x22\x20<%s>',_0x2a5aa1['name'],_0x2a5aa1[_0x66c7('0xc6')]||_0x2a5aa1[_0x66c7('0xf6')][_0x66c7('0x9d')]),'to':_0x56c2ca[_0x66c7('0x7c')][_0x66c7('0xe3')],'subject':_0x66c7('0xfa'),'text':util[_0x66c7('0xe6')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x56c2ca['body'][_0x66c7('0xe3')]),'attachments':[{'path':_0x37aace}]}})[_0x66c7('0x14')](function(){return _0x511029;})[_0x66c7('0x1d')](function(_0xb53a79){logger[_0x66c7('0x19')](_0xb53a79);});})[_0x66c7('0x14')](respondWithStatusCode(_0x22e8f7,0xc8))[_0x66c7('0x1d')](handleError(_0x22e8f7,null));};exports['addMessage']=function(_0x90a5c0,_0x471565){return db[_0x66c7('0xcc')][_0x66c7('0x68')]({'where':{'id':_0x90a5c0[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x471565,null))[_0x66c7('0x14')](function(_0x1ab91c){if(_0x1ab91c){return _0x1ab91c[_0x66c7('0xfb')](_0x90a5c0['body'][_0x66c7('0xfc')],_[_0x66c7('0xfd')](_0x90a5c0['body'],[_0x66c7('0xfc'),'id'])||{});}})[_0x66c7('0x14')](respondWithResult(_0x471565,null))[_0x66c7('0x1d')](handleError(_0x471565,null));};exports[_0x66c7('0xfe')]=function(_0x3cbabe,_0x17389b){var _0x51beee={'raw':![],'where':{}};var _0x21681e={};var _0x4fe200={'count':0x0,'rows':[]};return db[_0x66c7('0x41')][_0x66c7('0xbe')]({'where':{'id':_0x3cbabe[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x17389b,null))[_0x66c7('0x14')](function(_0x4ca682){if(_0x4ca682){_0x21681e[_0x66c7('0x45')]=_[_0x66c7('0x47')](db[_0x66c7('0xcc')][_0x66c7('0x42')]);_0x21681e[_0x66c7('0x46')]=_['keys'](_0x3cbabe[_0x66c7('0x46')]);_0x21681e[_0x66c7('0xff')]=_[_0x66c7('0x48')](_0x21681e['model'],_0x21681e[_0x66c7('0x46')]);_0x51beee[_0x66c7('0x49')]=_[_0x66c7('0x48')](_0x21681e[_0x66c7('0x45')],qs[_0x66c7('0x4a')](_0x3cbabe[_0x66c7('0x46')][_0x66c7('0x4a')]));_0x51beee['attributes']=_0x51beee[_0x66c7('0x49')][_0x66c7('0x4b')]?_0x51beee[_0x66c7('0x49')]:_0x21681e[_0x66c7('0x45')];if(!_0x3cbabe[_0x66c7('0x46')]['hasOwnProperty']('nolimit')){_0x51beee[_0x66c7('0x25')]=qs[_0x66c7('0x25')](_0x3cbabe[_0x66c7('0x46')]['limit']);_0x51beee[_0x66c7('0x23')]=qs[_0x66c7('0x23')](_0x3cbabe[_0x66c7('0x46')][_0x66c7('0x23')]);}_0x51beee[_0x66c7('0x4e')]=qs[_0x66c7('0x4f')](_0x3cbabe[_0x66c7('0x46')]['sort']);_0x51beee['where']=qs[_0x66c7('0xff')](_[_0x66c7('0x51')](_0x3cbabe['query'],_0x21681e[_0x66c7('0xff')]));_0x51beee[_0x66c7('0x50')][_0x66c7('0xb4')]=_0x4ca682['id'];if(_0x3cbabe[_0x66c7('0x46')]['filter']){_0x51beee[_0x66c7('0x50')]=_[_0x66c7('0xa4')](_0x51beee['where'],{'$or':_[_0x66c7('0x33')](_0x51beee[_0x66c7('0x49')],function(_0x3c1430){var _0x4b54ed={};_0x4b54ed[_0x3c1430]={'$like':'%'+_0x3cbabe[_0x66c7('0x46')]['filter']+'%'};return _0x4b54ed;})});}if(_0x3cbabe['query'][_0x66c7('0x100')]){var _0x3cff4f=_0x3cbabe[_0x66c7('0x46')][_0x66c7('0x100')][_0x66c7('0x36')](',');var _0x24eb7f={};_0x24eb7f[_0x3cff4f[0x0]]={'$gte':moment(_0x3cff4f[0x1])[_0x66c7('0xe6')](_0x66c7('0x101'))};_0x51beee[_0x66c7('0x50')]=_[_0x66c7('0xa4')](_0x51beee[_0x66c7('0x50')],_0x24eb7f);}_0x51beee=_[_0x66c7('0xa4')]({},_0x51beee,_0x3cbabe[_0x66c7('0x102')]);return db['ChatMessage'][_0x66c7('0x24')]({'where':_0x51beee[_0x66c7('0x50')]})[_0x66c7('0x14')](function(_0x34a021){_0x4fe200[_0x66c7('0x24')]=_0x34a021;if(_0x3cbabe[_0x66c7('0x46')][_0x66c7('0xba')]){_0x51beee['include']=[{'all':!![]}];}return db[_0x66c7('0xcc')][_0x66c7('0x103')](_0x51beee);})[_0x66c7('0x14')](function(_0x11f42d){_0x4fe200[_0x66c7('0xb7')]=_0x11f42d;return _0x4fe200;});}})[_0x66c7('0x14')](respondWithFilteredResult(_0x17389b,_0x51beee))[_0x66c7('0x1d')](handleError(_0x17389b,null));};exports[_0x66c7('0x104')]=function(_0x3d4e33,_0x17cbe7){var _0x18ef7d={'where':{}},_0x4c877a={},_0x3e34ca={'count':0x0,'rows':[]};return db[_0x66c7('0x41')][_0x66c7('0xbe')]({'where':{'id':_0x3d4e33[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x17cbe7,null))[_0x66c7('0x14')](function(_0x555249){if(_0x555249){_0x4c877a[_0x66c7('0x45')]=_['keys'](db[_0x66c7('0xcc')][_0x66c7('0x42')]);_0x4c877a[_0x66c7('0x46')]=_[_0x66c7('0x47')](_0x3d4e33[_0x66c7('0x46')]);_0x4c877a[_0x66c7('0xff')]=_[_0x66c7('0x48')](_0x4c877a[_0x66c7('0x45')],_0x4c877a[_0x66c7('0x46')]);_0x18ef7d[_0x66c7('0x49')]=_[_0x66c7('0x48')](_0x4c877a[_0x66c7('0x45')],qs[_0x66c7('0x4a')](_0x3d4e33[_0x66c7('0x46')][_0x66c7('0x4a')]));_0x18ef7d['attributes']=_0x18ef7d['attributes'][_0x66c7('0x4b')]?_0x18ef7d['attributes']:_0x4c877a['model'];if(!_0x3d4e33['query'][_0x66c7('0x4c')]('nolimit')){_0x18ef7d['limit']=qs['limit'](_0x3d4e33['query']['limit']);_0x18ef7d[_0x66c7('0x23')]=qs[_0x66c7('0x23')](_0x3d4e33[_0x66c7('0x46')][_0x66c7('0x23')]);}_0x18ef7d[_0x66c7('0x4e')]=qs[_0x66c7('0x4f')](_0x3d4e33[_0x66c7('0x46')]['sort']);_0x18ef7d['where']=qs[_0x66c7('0xff')](_[_0x66c7('0x51')](_0x3d4e33[_0x66c7('0x46')],_0x4c877a[_0x66c7('0xff')]));_0x18ef7d[_0x66c7('0x50')][_0x66c7('0xb4')]=_0x555249['id'];if(_0x3d4e33[_0x66c7('0x46')]['filter']){_0x18ef7d[_0x66c7('0x50')]=_[_0x66c7('0xa4')](_0x18ef7d[_0x66c7('0x50')],{'$or':_[_0x66c7('0x33')](_0x18ef7d[_0x66c7('0x49')],function(_0x51cb7c){var _0x28dd5c={};_0x28dd5c[_0x51cb7c]={'$like':'%'+_0x3d4e33[_0x66c7('0x46')]['filter']+'%'};return _0x28dd5c;})});}_0x18ef7d[_0x66c7('0x50')][_0x66c7('0xf2')]=![];if(_0x3d4e33[_0x66c7('0x46')]['id']){_0x18ef7d[_0x66c7('0x50')]['id']={'$gt':_0x3d4e33[_0x66c7('0x46')]['id']};}_0x18ef7d=_['merge']({},_0x18ef7d,_0x3d4e33['options']);return db[_0x66c7('0xcc')]['count']({'where':_0x18ef7d[_0x66c7('0x50')]})[_0x66c7('0x14')](function(_0x4c707c){_0x3e34ca[_0x66c7('0x24')]=_0x4c707c;_0x18ef7d[_0x66c7('0xbb')]=[];if(_0x3d4e33[_0x66c7('0x46')][_0x66c7('0x105')]){_0x18ef7d['include'][_0x66c7('0xb5')]({'model':db[_0x66c7('0x7a')],'as':_0x66c7('0x7a'),'attributes':['id','fullname','alias']});}if(_0x3d4e33['query'][_0x66c7('0xba')]){_0x18ef7d[_0x66c7('0xbb')]=[{'all':!![]}];}return db['ChatMessage'][_0x66c7('0x103')](_0x18ef7d);})[_0x66c7('0x14')](function(_0x31158d){_0x3e34ca[_0x66c7('0xb7')]=_0x31158d;return _0x3e34ca;});}})[_0x66c7('0x14')](respondWithFilteredResult(_0x17cbe7,_0x18ef7d))[_0x66c7('0x1d')](handleError(_0x17cbe7,null));};exports[_0x66c7('0x106')]=function(_0x20babe,_0x25efcd){return db[_0x66c7('0x41')]['find']({'where':{'id':_0x20babe[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x25efcd,null))[_0x66c7('0x14')](function(_0x5745d1){if(_0x5745d1){return _0x5745d1[_0x66c7('0x107')](_0x20babe['body'][_0x66c7('0xfc')],_[_0x66c7('0xfd')](_0x20babe[_0x66c7('0x7c')],['ids','id'])||{})[_0x66c7('0x108')](function(){return db[_0x66c7('0x77')][_0x66c7('0x103')]({'attributes':['id','name',_0x66c7('0x54')],'where':{'id':_0x20babe[_0x66c7('0x7c')]['ids']}});})['then'](function(_0x16db46){socket['emit'](_0x66c7('0x109'),{'id':Number(_0x20babe[_0x66c7('0xb9')]['id']),'tags':_0x16db46||[]});return{'id':Number(_0x20babe[_0x66c7('0xb9')]['id']),'tags':_0x16db46||[]};});}})[_0x66c7('0x14')](respondWithResult(_0x25efcd,null))[_0x66c7('0x1d')](handleError(_0x25efcd,null));};exports[_0x66c7('0x10a')]=function(_0x36d836,_0x93b6a9){return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0x36d836['params']['id']}})['then'](handleEntityNotFound(_0x93b6a9,null))[_0x66c7('0x14')](function(_0x5c6101){if(_0x5c6101){return _0x5c6101['removeTags'](_0x36d836[_0x66c7('0x46')][_0x66c7('0xfc')]);}})[_0x66c7('0x14')](respondWithStatusCode(_0x93b6a9,null))[_0x66c7('0x1d')](handleError(_0x93b6a9,null));};exports[_0x66c7('0xe1')]=function(_0x321ea2,_0x29c394){var _0x2ab0b1=moment()['unix']()[_0x66c7('0xa2')]();var _0xbfa002=path[_0x66c7('0xde')](config[_0x66c7('0xe4')],_0x66c7('0x10b'),_0x66c7('0x10c'),_0x66c7('0x10d'));var _0x3761ba=path['join'](config[_0x66c7('0xe4')],_0x66c7('0x10b'),_0x66c7('0x10c'),'attachments');var _0x395cb3=path['join'](_0xbfa002,_0x2ab0b1);var _0x293766=util[_0x66c7('0xe6')](_0x66c7('0x10e'),_0x321ea2[_0x66c7('0xb9')]['id'],_0x2ab0b1);var _0x3625ea=path[_0x66c7('0xde')](_0xbfa002,_0x293766);var _0x47e832=[];_0x47e832[_0x66c7('0xb5')]({'model':db[_0x66c7('0x7a')],'as':_0x66c7('0x7a'),'attributes':['id',_0x66c7('0x34')],'raw':!![]});_0x47e832[_0x66c7('0xb5')]({'model':db[_0x66c7('0xe7')],'as':_0x66c7('0x6e'),'attributes':['id','firstName',_0x66c7('0x10f')],'raw':!![]});if(_0x321ea2[_0x66c7('0x46')][_0x66c7('0x110')]){_0x47e832[_0x66c7('0xb5')]({'model':db[_0x66c7('0xd9')],'as':_0x66c7('0xd9'),'raw':!![]});}var _0x46d1ba=[{'model':db[_0x66c7('0xcc')],'as':_0x66c7('0xe8'),'attributes':['id',_0x66c7('0x7c'),_0x66c7('0x83'),'direction',_0x66c7('0xf2'),'read'],'include':_0x47e832}];_0x46d1ba['push']({'model':db[_0x66c7('0xbf')],'as':_0x66c7('0x111'),'attributes':['id',_0x66c7('0x2b')]});_0x46d1ba[_0x66c7('0xb5')]({'model':db[_0x66c7('0x7a')],'as':_0x66c7('0x112'),'attributes':['id',_0x66c7('0x34')]});return db[_0x66c7('0x41')]['find']({'where':{'id':_0x321ea2[_0x66c7('0xb9')]['id']},'include':_0x46d1ba})[_0x66c7('0x14')](handleEntityNotFound(_0x29c394,null))['then'](function(_0x862182){if(_0x862182){var _0x37992c=_0x862182['get']({'plain':!![]});fs[_0x66c7('0x113')](_0x395cb3);var _0x288b89={'channel':_0x66c7('0x114'),'account':_0x37992c[_0x66c7('0x111')][_0x66c7('0x2b')],'agent':_0x37992c[_0x66c7('0x112')]?_0x37992c[_0x66c7('0x112')][_0x66c7('0x34')]:_0x66c7('0x115'),'createdAt':moment(_0x37992c[_0x66c7('0x83')])[_0x66c7('0xe6')](_0x66c7('0x101'))[_0x66c7('0xa2')](),'closedAt':_0x37992c[_0x66c7('0x3e')]?moment(_0x37992c[_0x66c7('0x116')])[_0x66c7('0xe6')](_0x66c7('0x101'))[_0x66c7('0xa2')]():'','disposition':_0x37992c[_0x66c7('0x117')],'chatInfo':{'browser':_0x37992c[_0x66c7('0x118')],'os':_0x37992c[_0x66c7('0x119')],'referer':_0x37992c[_0x66c7('0x11a')],'customerIp':_0x37992c[_0x66c7('0x11b')],'customerPort':_0x37992c[_0x66c7('0x11c')]?_0x37992c[_0x66c7('0x11c')]:'N.A.'},'messages':_(_0x37992c['Messages'])[_0x66c7('0x11d')]()[_0x66c7('0x8e')]({'secret':![]})[_0x66c7('0x33')](function(_0x136e37){if(_0x136e37[_0x66c7('0xd9')]){var _0x355c89=path[_0x66c7('0xde')](_0x3761ba,_0x136e37[_0x66c7('0xd9')][_0x66c7('0xd6')]);if(fs[_0x66c7('0x11e')](_0x355c89)){fs[_0x66c7('0x11f')](_0x355c89)['pipe'](fs[_0x66c7('0x120')](path[_0x66c7('0xde')](_0x395cb3,_0x136e37[_0x66c7('0xd9')][_0x66c7('0xd6')])));}}return{'date':moment(_0x136e37[_0x66c7('0x83')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x66c7('0xa2')](),'sender':_0x136e37[_0x66c7('0xf1')]==='out'?_0x136e37[_0x66c7('0x7a')]?_0x136e37[_0x66c7('0x7a')][_0x66c7('0x34')]:'System':_0x136e37[_0x66c7('0x6e')]['firstName']+(_0x136e37[_0x66c7('0x6e')]['lastName']?'\x20'+_0x136e37[_0x66c7('0x6e')][_0x66c7('0x10f')]:''),'body':_0x136e37[_0x66c7('0xd9')]?_0x136e37['Attachment'][_0x66c7('0xd6')]:_0x136e37[_0x66c7('0x7c')],'direction':_0x136e37[_0x66c7('0xf1')]===_0x66c7('0xcb')?'A':'C','secret':_0x136e37[_0x66c7('0xf2')],'read':_0x136e37['read'],'attachment':_0x136e37['Attachment']};})[_0x66c7('0x6a')]()};return ejs['renderFile'](path[_0x66c7('0xde')](config[_0x66c7('0xe4')],_0x66c7('0x10b'),'views',_0x66c7('0x121')),{'interaction':_0x288b89})[_0x66c7('0x14')](function(_0xb321a){var _0x498a86=path['join'](_0x395cb3,_0x66c7('0x122')+_0x37992c['id']+'-'+_0x2ab0b1+_0x66c7('0x123'));var _0x438f04={'path':_0x498a86,'channel':_0x66c7('0x114'),'interactionId':_0x37992c['id']};return pdf[_0x66c7('0x124')](_0xb321a,_0x438f04);})[_0x66c7('0x14')](function(){return new Promise(function(_0x5a912b,_0x53bb0d){zipdir(_0x395cb3,{'saveTo':_0x3625ea},function(_0x555008,_0x513f44){if(_0x555008)return _0x53bb0d(_0x555008);return _0x5a912b(_0x513f44);});})[_0x66c7('0x14')](function(){return new BPromise(function(_0x159dcc,_0x2b7e3a){rimraf(_0x395cb3,function(_0xacf9a4){if(_0xacf9a4)_0x2b7e3a(_0xacf9a4);return _0x159dcc();});});})[_0x66c7('0x14')](function(){return _0x29c394[_0x66c7('0xe1')](_0x3625ea,_0x293766,function(_0x5b41d6){if(_0x5b41d6){logger[_0x66c7('0x19')]('err',_0x5b41d6);}else{fs['unlinkSync'](_0x3625ea);}});});});}else{return _0x29c394[_0x66c7('0x1e')](0xc8);}})[_0x66c7('0x1d')](handleError(_0x29c394,null));};
\ No newline at end of file
+var _0x34e8=['ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','status','end','offset','limit','undefined','count','set','json','update','then','destroy','sendStatus','stack','name','send','render','body','contact','account','Users','TagIds','split','forEach','Tags','talking','unmanaged','abandoned','UserId','waiting','closed','disposition','answered','total','index','map','ChatInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','select','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','$substring','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','follow','isNull','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','filename','mimetype','Attachment','Unauthorized','attachId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','User','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4dd617,_0xf29ffc){var _0x5df97c=function(_0x244470){while(--_0x244470){_0x4dd617['push'](_0x4dd617['shift']());}};_0x5df97c(++_0xf29ffc);}(_0x34e8,0x12c));var _0x834e=function(_0xc8d1b8,_0x3fc6dd){_0xc8d1b8=_0xc8d1b8-0x0;var _0x1ce2e4=_0x34e8[_0xc8d1b8];return _0x1ce2e4;};'use strict';var rimraf=require(_0x834e('0x0'));var zipdir=require(_0x834e('0x1'));var rp=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x834e('0x4'));var util=require(_0x834e('0x5'));var path=require(_0x834e('0x6'));var ejs=require(_0x834e('0x7'));var fs=require('fs');var _=require(_0x834e('0x8'));var squel=require(_0x834e('0x9'));var Redis=require(_0x834e('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x834e('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x834e('0xc'))(_0x834e('0xd'));var config=require(_0x834e('0xe'));var db=require(_0x834e('0xf'))['db'];config[_0x834e('0x10')]=_[_0x834e('0x11')](config[_0x834e('0x10')],{'host':_0x834e('0x12'),'port':0x18eb});var socket=require(_0x834e('0x13'))(new Redis(config[_0x834e('0x10')]));require(_0x834e('0x14'))[_0x834e('0x15')](socket);var jayson=require(_0x834e('0x16'));var client=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232b});var client9004=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x538bb3,_0x5e5b6d,_0x6cd9b9,_0x58a27e){return new BPromise(function(_0x23848e,_0x2d95f2){var _0x28e659=_0x58a27e||client;return _0x28e659[_0x834e('0x19')](_0x538bb3,_0x6cd9b9)['then'](function(_0x43156c){logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));logger['debug'](_0x834e('0x1c'),_0x5e5b6d,_0x834e('0x1b'),JSON['stringify'](_0x43156c));if(_0x43156c[_0x834e('0x1d')]){if(_0x43156c[_0x834e('0x1d')][_0x834e('0x1e')]===0x1f4){logger['error'](_0x834e('0x1f'),_0x5e5b6d,_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);return _0x2d95f2(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}logger[_0x834e('0x1d')](_0x834e('0x1f'),_0x5e5b6d,_0x43156c['error'][_0x834e('0x20')]);return _0x23848e(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}else{logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));_0x23848e(_0x43156c[_0x834e('0x21')]['message']);}})[_0x834e('0x22')](function(_0x28d687){logger[_0x834e('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x28d687);_0x2d95f2(_0x28d687);});});}function respondWithStatusCode(_0x4e3f48,_0x231619){_0x231619=_0x231619||0xcc;return function(_0x34563b){if(_0x34563b){return _0x4e3f48['sendStatus'](_0x231619);}return _0x4e3f48[_0x834e('0x23')](_0x231619)[_0x834e('0x24')]();};}function respondWithResult(_0x58f4fd,_0x3bc4f7){_0x3bc4f7=_0x3bc4f7||0xc8;return function(_0x2e1983){if(_0x2e1983){return _0x58f4fd[_0x834e('0x23')](_0x3bc4f7)['json'](_0x2e1983);}};}function respondWithFilteredResult(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(_0x5e1cc5){var _0x5bef62=typeof _0x3e310f[_0x834e('0x25')]==='undefined'&&typeof _0x3e310f[_0x834e('0x26')]===_0x834e('0x27');var _0x3db026=_0x5e1cc5[_0x834e('0x28')];var _0x3cd928=_0x5bef62?0x0:_0x3e310f[_0x834e('0x25')];var _0x491919=_0x5bef62?_0x5e1cc5['count']:_0x3e310f['offset']+_0x3e310f['limit'];var _0x2c7a8d;if(_0x491919>=_0x3db026){_0x491919=_0x3db026;_0x2c7a8d=0xc8;}else{_0x2c7a8d=0xce;}_0x24fcf7[_0x834e('0x23')](_0x2c7a8d);return _0x24fcf7[_0x834e('0x29')]('Content-Range',_0x3cd928+'-'+_0x491919+'/'+_0x3db026)[_0x834e('0x2a')](_0x5e1cc5);}return null;};}function saveUpdates(_0x11f1ce){return function(_0x1f3671){if(_0x1f3671){return _0x1f3671[_0x834e('0x2b')](_0x11f1ce)[_0x834e('0x2c')](function(_0x390119){return _0x390119;});}return null;};}function removeEntity(_0x3d149d){return function(_0xfaf716){if(_0xfaf716){return _0xfaf716[_0x834e('0x2d')]()['then'](function(){_0x3d149d[_0x834e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c75c2){return function(_0x3787b0){if(!_0x3787b0){_0x2c75c2[_0x834e('0x2e')](0x194);}return _0x3787b0;};}function handleError(_0x2b3418,_0x444366){_0x444366=_0x444366||0x1f4;return function(_0x4689c2){logger[_0x834e('0x1d')](_0x4689c2[_0x834e('0x2f')]);if(_0x4689c2[_0x834e('0x30')]){delete _0x4689c2[_0x834e('0x30')];}_0x2b3418['status'](_0x444366)[_0x834e('0x31')](_0x4689c2);};}function getMustacheRender(_0x2f408a,_0x24a9df){return Mustache[_0x834e('0x32')](_0x2f408a,_['merge'](_0x24a9df[_0x834e('0x33')],{'contact':_0x24a9df[_0x834e('0x34')],'message':_0x24a9df['message'],'agent':_0x24a9df['agent'],'interaction':_0x24a9df['interaction'],'account':_0x24a9df[_0x834e('0x35')]}))||'';}function getInteractionUsers(_0x41bf4d,_0x20c6ae){return new BPromise(function(_0x34fefb,_0x339e28){try{if(_0x20c6ae[_0x41bf4d['id']]){_0x41bf4d[_0x834e('0x36')]=_['map'](_0x20c6ae[_0x41bf4d['id']],function(_0x2c2d94){return{'id':_0x2c2d94['id'],'fullname':_0x2c2d94['fullname']};});}}catch(_0xe103fe){_0x339e28(_0xe103fe);}_0x34fefb(_0x41bf4d);});}function getInteractionTags(_0x6a3ac,_0x47abed){return new BPromise(function(_0x18ac3b,_0x2f56c7){try{if(_0x6a3ac['TagIds']){_0x6a3ac['Tags']=[];_0x6a3ac[_0x834e('0x37')][_0x834e('0x38')](',')[_0x834e('0x39')](function(_0x130c23){_0x6a3ac[_0x834e('0x3a')]['push'](_0x47abed[_0x130c23]);});}delete _0x6a3ac[_0x834e('0x37')];}catch(_0x548d1d){_0x2f56c7(_0x548d1d);}_0x18ac3b(_0x6a3ac);});}function updateChatInteraction(_0x50c243,_0x1b2edf,_0x4a7f76){return new BPromise(function(_0x2e5239,_0x1ba66d){return getInteractionUsers(_0x50c243,_0x4a7f76)[_0x834e('0x2c')](function(_0x3c59af){return getInteractionTags(_0x3c59af,_0x1b2edf);})[_0x834e('0x2c')](function(_0x574ea8){return getStateInteraction(_0x574ea8);})[_0x834e('0x2c')](function(_0x26b847){_0x2e5239(_0x26b847);})[_0x834e('0x22')](function(_0x58c5fb){_0x1ba66d(_0x58c5fb);});});}function getStateInteraction(_0x35380e){return new BPromise(function(_0x16ac45){_0x35380e['waiting']=0x0;_0x35380e[_0x834e('0x3b')]=0x0;_0x35380e['answered']=0x0;_0x35380e[_0x834e('0x3c')]=0x0;_0x35380e[_0x834e('0x3d')]=0x0;_0x35380e['total']=0x0;if(!_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3f')]+=0x1;}if(!_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3b')]+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}if(_0x35380e['closed']&&_0x35380e[_0x834e('0x41')]==='abandoned'){_0x35380e[_0x834e('0x3d')]+=0x1;if(_0x35380e['waiting']){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]&&_0x35380e[_0x834e('0x41')]){_0x35380e['unmanaged']+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x42')]+=0x1;if(_0x35380e[_0x834e('0x3b')]){_0x35380e[_0x834e('0x3b')]-=0x1;}}_0x35380e[_0x834e('0x43')]+=0x1;_0x16ac45(_0x35380e);});}exports[_0x834e('0x44')]=function(_0x279ea1,_0x5f3943){var _0x3124be={},_0x6fff27={},_0x47a8a9={'count':0x0,'rows':[]};var _0x112306=_[_0x834e('0x45')](db[_0x834e('0x46')][_0x834e('0x47')],function(_0x19b5ef){return{'name':_0x19b5ef[_0x834e('0x48')],'type':_0x19b5ef['type']['key']};});_0x6fff27[_0x834e('0x49')]=_[_0x834e('0x45')](_0x112306,_0x834e('0x30'));_0x6fff27[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x279ea1[_0x834e('0x4a')]);_0x6fff27[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],_0x6fff27[_0x834e('0x4a')]);_0x3124be[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]));_0x3124be[_0x834e('0x4e')]=_0x3124be[_0x834e('0x4e')][_0x834e('0x50')]?_0x3124be[_0x834e('0x4e')]:_0x6fff27['model'];if(!_0x279ea1[_0x834e('0x4a')][_0x834e('0x51')]('nolimit')){_0x3124be[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x279ea1['query'][_0x834e('0x26')]);_0x3124be[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x25')]);}_0x3124be[_0x834e('0x52')]=qs[_0x834e('0x53')](_0x279ea1['query'][_0x834e('0x53')]);_0x3124be[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x279ea1[_0x834e('0x4a')],_0x6fff27[_0x834e('0x4c')]),_0x112306);var _0x344b51=[];var _0x1bc975=squel['select']()[_0x834e('0x56')]('id')['field'](_0x834e('0x30'))['field'](_0x834e('0x57'))['from']('tools_tags');var _0x6c0b29=squel[_0x834e('0x58')]()['field']('u.id')[_0x834e('0x56')](_0x834e('0x59'))[_0x834e('0x56')](_0x834e('0x5a'))[_0x834e('0x5b')](_0x834e('0x5c'),'ui')[_0x834e('0x5d')](_0x834e('0x5e'),'u','u.id\x20=\x20ui.UserId');var _0x142334=squel[_0x834e('0x58')]()['from'](_0x834e('0x5f'),'i')['left_join'](_0x834e('0x60'),'c',_0x834e('0x61'))['left_join'](_0x834e('0x5e'),'o',_0x834e('0x62'))[_0x834e('0x5d')](_0x834e('0x63'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x834e('0x5d')](_0x834e('0x64'),'me',_0x834e('0x65'))['left_join'](_0x834e('0x66'),'it',_0x834e('0x67'))[_0x834e('0x5d')](_0x834e('0x68'),'t',_0x834e('0x69'));var _0x125f37=squel[_0x834e('0x6a')]();var _0x1def00=[];var _0x208c21=squel[_0x834e('0x6a')]();var _0x1e4310;if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]){_0x1e4310=as[_0x834e('0x6c')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]);var _0x297cce=_0x1e4310[_0x834e('0x6d')];for(var _0x193a15=0x0;_0x193a15<_0x1e4310[_0x834e('0x6e')][_0x834e('0x50')];_0x193a15++){var _0x2cb233=_0x1e4310['conditions'][_0x193a15];var _0x2145cf='i';var _0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),_0x2cb233['field']]);if(!_0x25d6f4){switch(_0x2cb233[_0x834e('0x56')]){case'unreadMessages':if(_0x2cb233['value']==0x1){_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x71'));}else{_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x72'));}break;case _0x834e('0x73'):if(_0x2cb233[_0x834e('0x74')]==='$substring'){if(_0x2cb233[_0x834e('0x75')]['split']('\x20')[_0x834e('0x50')]>0x1){_0x125f37[_0x297cce](_0x834e('0x76'),qs['getFullTextValue'](_0x2cb233['value']),null);}else{var _0x4a4def='%'+_0x2cb233[_0x834e('0x75')]+'%';_0x125f37[_0x297cce](_0x834e('0x77'),_0x4a4def,_0x4a4def,_0x4a4def);}}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),'ContactId']);_0x2cb233[_0x834e('0x56')]=_0x834e('0x78');_0x11f6f0=as[_0x834e('0x79')](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}break;case _0x834e('0x7d'):var _0x5b2bf6=_0x2cb233[_0x834e('0x75')][_0x834e('0x38')](',')[_0x834e('0x45')](function(_0x5b5d6f){return Number(_0x5b5d6f);});_0x5b2bf6['forEach'](function(_0x46fa0d){_0x208c21['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46fa0d+',%');});_0x1def00=_['union'](_0x1def00,_0x5b2bf6);break;case'User':if(_0x2cb233[_0x834e('0x74')]===_0x834e('0x7e')){_0x125f37[_0x297cce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2cb233[_0x834e('0x75')]+'%',null);}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,['name',_0x834e('0x3e')]);_0x2cb233[_0x834e('0x56')]='UserId';_0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')]['end']);}break;case _0x834e('0x33'):_0x11f6f0=as['buildExpression']('me',null,_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0['value'][_0x834e('0x24')]);break;}}else{var _0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')]['start'],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}}}else{var _0x402692=_(_0x279ea1[_0x834e('0x4a')])[_0x834e('0x4b')]()[_0x834e('0x45')](function(_0x1372dd){return _[_0x834e('0x7f')](_0x112306,[_0x834e('0x30'),_0x1372dd])?_0x1372dd:undefined;})[_0x834e('0x80')]()['value']();if(!_['isEmpty'](_0x402692)){_0x402692['forEach'](function(_0x36ede9){if(_0x36ede9===_0x834e('0x81')){_0x142334[_0x834e('0x54')](_0x834e('0x82'),[][_0x834e('0x83')](_0x279ea1['query'][_0x36ede9]));}else if(_0x36ede9==='createdAt'){var _0x4520fc=JSON[_0x834e('0x84')](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x85')];var _0x40a705=JSON['parse'](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x86')];_0x142334[_0x834e('0x54')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4520fc,_0x40a705);}else{if(_0x279ea1[_0x834e('0x4a')][_0x36ede9]===_0x834e('0x87')){_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+_0x834e('0x88'));}else{_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+'\x20=\x20?',_0x279ea1['query'][_0x36ede9]);}}});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x89')]){if(_0x279ea1['query'][_0x834e('0x89')]==0x1){_0x142334['having'](_0x834e('0x8a'));}else{_0x142334[_0x834e('0x70')](_0x834e('0x8b'));}}if(_0x279ea1['query'][_0x834e('0x8c')]){_0x1def00=_['isArray'](_0x279ea1['query']['tag'])?_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]:new Array(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]);_0x1def00[_0x834e('0x39')](function(_0x2dad55){_0x208c21['or'](_0x834e('0x8d'),'%,'+_0x2dad55+',%');});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8e')]){var _0x53f6e3=_0x279ea1[_0x834e('0x4a')]['filter'][_0x834e('0x8f')]('\x5c','\x5c\x5c')[_0x834e('0x8f')](/'/g,'\x27\x27');if(qs[_0x834e('0x90')](_0x53f6e3)){_0x125f37['or'](_0x834e('0x91'),_0x53f6e3+'%');}else{_0x125f37['or'](_0x834e('0x92'),qs[_0x834e('0x93')](_0x53f6e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x53f6e3+'%');}}}_0x142334['where'](_0x125f37);_0x142334[_0x834e('0x94')](_0x834e('0x95'));var _0x4eff8d={'type':db[_0x834e('0x96')][_0x834e('0x97')][_0x834e('0x98')],'raw':!![]};var _0x1e225f=_0x142334[_0x834e('0x99')]();_0x1e225f['field'](_0x834e('0x95'));_0x1e225f[_0x834e('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3124be['order']){_0x3124be[_0x834e('0x52')][_0x834e('0x39')](function(_0x4f716d){var _0x23ce49=_0x4f716d[0x0]===_0x834e('0x9a')?_0x4f716d[0x0]:'i.'+_0x4f716d[0x0];_0x142334['order'](_0x23ce49,_0x4f716d[0x1]===_0x834e('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x1def00)){_0x142334['having'](_0x208c21);_0x1e225f[_0x834e('0x54')](_0x834e('0x9c'),_0x1def00);}BPromise[_0x834e('0x9d')]()[_0x834e('0x2c')](function(){if(!_0x1e4310){if(_0x279ea1['query'][_0x834e('0x81')])return;_0x1e225f[_0x834e('0x54')](_0x834e('0x9e'));_0x142334[_0x834e('0x54')](_0x834e('0x9e'));return;}if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]!==_0x834e('0xa1'))return;return _0x279ea1[_0x834e('0x9f')][_0x834e('0xa2')]({'attributes':['id'],'raw':!![]})[_0x834e('0x2c')](function(_0x261e3d){if(_[_0x834e('0xa3')](_0x261e3d)){_0x1e225f[_0x834e('0x54')](_0x834e('0xa4'));_0x142334[_0x834e('0x54')](_0x834e('0xa4'));}else{_0x1e225f[_0x834e('0x54')](_0x834e('0x82'),_[_0x834e('0x45')](_0x261e3d,'id'));_0x142334[_0x834e('0x54')](_0x834e('0x82'),_['map'](_0x261e3d,'id'));}});})[_0x834e('0x2c')](function(){if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]===_0x834e('0xa1')&&!_0x1e4310&&!_0x279ea1[_0x834e('0x4a')][_0x834e('0x81')])return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1e225f[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x5ce790){_0x47a8a9['count']=_0x5ce790[_0x834e('0x50')];if(_0x47a8a9['count']===0x0)return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1bc975[_0x834e('0xa6')](),_0x4eff8d)['then'](function(_0xae00f){_0x344b51=_[_0x834e('0xa7')](_0xae00f,'id');_0x4eff8d=_[_0x834e('0xa8')](_0x4eff8d,{'model':db[_0x834e('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]){_0x3124be['attributes'][_0x834e('0x39')](function(_0x27bd2e){_0x142334[_0x834e('0x56')]('i.'+_0x27bd2e);});}else{_0x142334[_0x834e('0x56')](_0x834e('0xa9'),'unreadMessages');_0x142334['field']('a.key','Account.key');_0x142334[_0x834e('0x56')](_0x834e('0xaa'),'Account.mandatoryDisposition');_0x142334[_0x834e('0x56')](_0x834e('0xab'),'contactName');_0x142334[_0x834e('0x56')](_0x834e('0xac'));_0x142334[_0x834e('0x56')](_0x834e('0xad'),_0x834e('0xae'));_0x142334[_0x834e('0x56')]('c.lastName','Contact.lastName');_0x142334[_0x834e('0x56')](_0x834e('0xaf'),_0x834e('0xb0'));_0x142334['field'](_0x834e('0xb1'),_0x834e('0xb2'));_0x142334['field'](_0x834e('0xb3'),_0x834e('0xb4'));_0x142334[_0x834e('0x56')](_0x834e('0xb5'),'Contact.fax');_0x142334[_0x834e('0x56')]('o.fullname','Owner.fullname');_0x142334[_0x834e('0x56')](_0x834e('0xb6'),_0x834e('0xb7'));_0x142334[_0x834e('0x56')](_0x834e('0xb8'),_0x834e('0x37'));}if(_0x3124be['limit'])_0x142334['limit'](_0x3124be[_0x834e('0x26')]);if(_0x3124be[_0x834e('0x25')])_0x142334[_0x834e('0x25')](_0x3124be[_0x834e('0x25')]);return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x142334[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x435a75){if(_0x435a75[_0x834e('0x50')]>0x0)_0x6c0b29['where'](_0x834e('0xb9'),_[_0x834e('0x45')](_0x435a75,'id'));return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x6c0b29[_0x834e('0xa6')](),_0x4eff8d)[_0x834e('0x2c')](function(_0x231f0b){var _0x3b44f3=_[_0x834e('0xba')](_0x231f0b,_0x834e('0xbb'));var _0x496709=[];_0x435a75[_0x834e('0x39')](function(_0x17e922){_0x496709[_0x834e('0xbc')](updateChatInteraction(_0x17e922,_0x344b51,_0x3b44f3));});return BPromise['all'](_0x496709);});});})[_0x834e('0x2c')](function(_0x20fdfd){_0x47a8a9['rows']=_0x20fdfd;return _0x47a8a9;})[_0x834e('0x2c')](respondWithFilteredResult(_0x5f3943,_0x3124be))['catch'](handleError(_0x5f3943,null));};exports[_0x834e('0xbd')]=function(_0x53c483,_0x16a42b){var _0x560d10={'raw':![],'where':{'id':_0x53c483[_0x834e('0xbe')]['id']}},_0x2b6d1={};_0x2b6d1[_0x834e('0x49')]=_[_0x834e('0x4b')](db['ChatInteraction'][_0x834e('0x47')]);_0x2b6d1[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x53c483[_0x834e('0x4a')]);_0x2b6d1[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],_0x2b6d1[_0x834e('0x4a')]);_0x560d10[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x53c483[_0x834e('0x4a')][_0x834e('0x4f')]));_0x560d10[_0x834e('0x4e')]=_0x560d10[_0x834e('0x4e')][_0x834e('0x50')]?_0x560d10['attributes']:_0x2b6d1['model'];if(_0x53c483[_0x834e('0x4a')][_0x834e('0xbf')]){_0x560d10[_0x834e('0xc0')]=[{'all':!![]}];}_0x560d10=_[_0x834e('0xa8')]({},_0x560d10,_0x53c483[_0x834e('0xc1')]);return db[_0x834e('0x46')][_0x834e('0x6f')](_0x560d10)[_0x834e('0x2c')](handleEntityNotFound(_0x16a42b,null))[_0x834e('0x2c')](respondWithResult(_0x16a42b,null))[_0x834e('0x22')](handleError(_0x16a42b,null));};exports[_0x834e('0xc2')]=function(_0x32645e,_0x513d9e){return db[_0x834e('0x46')]['create'](_0x32645e[_0x834e('0x33')],{})[_0x834e('0x2c')](respondWithResult(_0x513d9e,0xc9))[_0x834e('0x22')](handleError(_0x513d9e,null));};exports['update']=function(_0x1a65b4,_0x23a386){if(_0x1a65b4['body']['id']){delete _0x1a65b4['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x1a65b4['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x23a386,null))[_0x834e('0x2c')](saveUpdates(_0x1a65b4[_0x834e('0x33')],null))[_0x834e('0x2c')](respondWithResult(_0x23a386,null))[_0x834e('0x22')](handleError(_0x23a386,null));};exports['destroy']=function(_0x4e7545,_0x453e58){return db['ChatInteraction']['find']({'where':{'id':_0x4e7545['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x453e58,null))[_0x834e('0x2c')](removeEntity(_0x453e58,null))['catch'](handleError(_0x453e58,null));};exports[_0x834e('0xc3')]=function(_0x66cbdc,_0x470568){return db[_0x834e('0x46')]['describe']()[_0x834e('0x2c')](respondWithResult(_0x470568,null))[_0x834e('0x22')](handleError(_0x470568,null));};exports[_0x834e('0xc4')]=function(_0x5633f4,_0x3d8af7){var _0x5f3b7d=_0x5633f4[_0x834e('0xbe')]['id'];var _0x4af2a2;var _0x461420;var _0x108100;return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x5f3b7d}})[_0x834e('0x2c')](function(_0x41e7a8){_0x4af2a2=_0x41e7a8;return db[_0x834e('0xc6')][_0x834e('0xc5')]({'where':{'id':_0x41e7a8[_0x834e('0x81')]},'attributes':['id','vidaooApiKey',_0x834e('0xc7'),_0x834e('0xc8'),_0x834e('0xc9'),_0x834e('0xca')],'raw':!![]});})[_0x834e('0x2c')](function(_0x1b8e67){if(_0x1b8e67&&_0x1b8e67['vidaooApiKey']&&_0x1b8e67[_0x834e('0xc7')]){_0x461420=_0x1b8e67;var _0x490a57={'interaction':{'id':_0x5f3b7d},'agent':{'id':_0x5633f4['user']['id'],'name':_0x5633f4[_0x834e('0x9f')]['name'],'fullname':_0x5633f4['user'][_0x834e('0xcb')],'email':_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]},'contact':_0x5633f4[_0x834e('0x33')][_0x834e('0x34')],'account':_0x5633f4[_0x834e('0x33')][_0x834e('0x35')]};var _0x155f2d={'rejectUnauthorized':![],'method':_0x834e('0xcd'),'url':_0x834e('0xce'),'headers':{'X-APIKEY':_0x1b8e67[_0x834e('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]],'buttons':null,'topic':_0x461420[_0x834e('0xc8')],'note':_['isNull'](_0x461420[_0x834e('0xc9')])?null:getMustacheRender(_0x461420['vidaooNote'],_0x490a57),'metadata':null},'redirect':_0x834e('0xd0'),'json':!![]};try{if(!_[_0x834e('0xd1')](_0x461420[_0x834e('0xca')])){var _0x2cdbe0=getMustacheRender(_0x461420['vidaooMetadata'],_0x490a57);var _0x5f558a=JSON[_0x834e('0x84')](_0x2cdbe0);_0x155f2d[_0x834e('0x33')]['metadata']=_0x5f558a;}}catch(_0x375c35){throw new db[(_0x834e('0x96'))]['ValidationError'](_0x834e('0xd2'));}return rp(_0x155f2d);}else{throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xd4'));}})['then'](function(_0x57ff06){_0x108100=_0x57ff06;if(_0x108100['id']){var _0x4ead1d={'body':_0x108100['join_url'],'ChatWebsiteId':_0x461420['id'],'ChatInteractionId':_0x4af2a2['id'],'direction':_0x834e('0xd5'),'UserId':_0x5633f4[_0x834e('0x9f')]['id']};return db['ChatMessage'][_0x834e('0xc2')](_0x4ead1d,{});}else{throw new db['Sequelize'][(_0x834e('0xd3'))](_0x834e('0xd6'));}})[_0x834e('0x2c')](function(){return _0x4af2a2[_0x834e('0xd7')]({'vidaooSessionId':_0x108100['id']});})[_0x834e('0x2c')](respondWithResult(_0x3d8af7,null))[_0x834e('0x22')](handleError(_0x3d8af7,null));};exports[_0x834e('0xd8')]=function(_0x4fc61d,_0x12a0f3){if(_0x4fc61d[_0x834e('0x33')]['id']){delete _0x4fc61d['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x4fc61d['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x834e('0x2c')](handleEntityNotFound(_0x12a0f3,null))[_0x834e('0x2c')](saveUpdates(_0x4fc61d[_0x834e('0x33')],null))['then'](respondWithResult(_0x12a0f3,null))[_0x834e('0x22')](handleError(_0x12a0f3,null));};exports[_0x834e('0xd9')]=function(_0xbd0346,_0x17e729){if(_0xbd0346[_0x834e('0x33')]['id']){delete _0xbd0346[_0x834e('0x33')]['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0xbd0346[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](function(_0x48b6c4){if(!_0x48b6c4){logger['error'](_0x834e('0xda'),_0x834e('0xd9'),0x194,_0x834e('0xdb'));_0x17e729[_0x834e('0x2e')](0x194);}else{if(_0x48b6c4[_0x834e('0x3e')]){throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xdc'));}}return _0x48b6c4;})[_0x834e('0x2c')](function(_0x97a4b2){if(_0x97a4b2){return _0x97a4b2[_0x834e('0x2b')]({'closed':_0xbd0346[_0x834e('0x33')][_0x834e('0x40')],'disposition':_0xbd0346['body'][_0x834e('0x41')]})[_0x834e('0x2c')](function(_0x3f5b2e){return _0x3f5b2e;});}})[_0x834e('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0xbd0346['body'],client9004);})[_0x834e('0x2c')](respondWithResult(_0x17e729,null))[_0x834e('0x22')](handleError(_0x17e729,null));};exports[_0x834e('0xdd')]=function(_0x23d7e6,_0x181ecd){_0x23d7e6[_0x834e('0x33')][_0x834e('0x30')]=_0x23d7e6[_0x834e('0xde')]['originalname'];_0x23d7e6['body']['basename']=_0x23d7e6['file'][_0x834e('0xdf')];_0x23d7e6[_0x834e('0x33')][_0x834e('0x7a')]=_0x23d7e6[_0x834e('0xde')][_0x834e('0xe0')];return db[_0x834e('0xe1')][_0x834e('0xc2')](_0x23d7e6[_0x834e('0x33')])[_0x834e('0x2c')](respondWithResult(_0x181ecd,0xc9))['catch'](handleError(_0x181ecd,null));};exports['attachmentDownload']=function(_0x4d1545,_0x5dc651){return db[_0x834e('0x46')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0xbe')]['id']},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null))[_0x834e('0x2c')](function(_0xcb9751){if(_0xcb9751){if(_0xcb9751[_0x834e('0x40')]){return _0x5dc651[_0x834e('0x23')](0x193)[_0x834e('0x2a')]({'status':0x193,'message':_0x834e('0xe2')});}return db[_0x834e('0xe1')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0x4a')][_0x834e('0xe3')]},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null));}})[_0x834e('0x2c')](function(_0x5022f2){if(_0x5022f2){var _0x13f473=_0x5022f2['ChatOfflineMessageId']!==null;var _0x1f6bb9=path[_0x834e('0xe4')](config[_0x834e('0xe5')],'server/files/attachments/');if(_0x13f473){_0x1f6bb9=path[_0x834e('0xe4')](_0x1f6bb9,_0x834e('0xe6'));}var _0x4d7fef=path['join'](_0x1f6bb9,_0x5022f2[_0x834e('0xe7')]);return _0x5dc651[_0x834e('0xe8')](_0x4d7fef);}})[_0x834e('0x22')](handleError(_0x5dc651,null));};exports[_0x834e('0xe9')]=function(_0x12d468,_0x2e9116){var _0x3eb2e8=null;var _0x239a4e=null;var _0x569a80=null;if(_0x12d468[_0x834e('0x33')]['id']){delete _0x12d468[_0x834e('0x33')]['id'];}if(_0x12d468[_0x834e('0x33')][_0x834e('0xea')]){_0x569a80=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0xeb'),util['format'](_0x834e('0xec'),Date['now']()));_0x12d468['body'][_0x834e('0xed')]=_0x569a80;}return db[_0x834e('0x46')]['find']({'where':{'id':_0x12d468[_0x834e('0xbe')]['id']},'include':[{'model':db[_0x834e('0xee')],'as':'Messages','include':[{'model':db[_0x834e('0xef')],'as':_0x834e('0xef')}]}]})['then'](handleEntityNotFound(_0x2e9116,null))['then'](saveUpdates(_0x12d468[_0x834e('0x33')],null))[_0x834e('0x2c')](function(_0x4e6525){if(_0x4e6525){_0x3eb2e8=_0x4e6525;return db['ChatWebsite'][_0x834e('0x6f')]({'where':{'id':_0x3eb2e8[_0x834e('0x81')]}});}})['then'](function(_0x480290){if(_0x480290){_0x239a4e=_0x480290;return db['CmContact']['find']({'where':{'id':_0x3eb2e8[_0x834e('0x78')]}});}})['then'](function(_0x3be4c3){if(_0x3be4c3){if(_0x569a80){var _0x52cdcc=null;for(var _0x343348=0x1;_0x343348<_0x3eb2e8[_0x834e('0xf0')][_0x834e('0x50')];++_0x343348){_0x52cdcc=_0x3eb2e8[_0x834e('0xf0')][_0x343348];var _0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc[_0x834e('0x3e')]):_0x834e('0xf4');var _0x3d8abb=_0x12d468[_0x834e('0x33')][_0x834e('0xf5')]||util[_0x834e('0xf1')]('%s%d',_0x834e('0xf6'),_0x52cdcc['ContactId']);switch(_0x239a4e[_0x834e('0xf7')]){case _0x834e('0xf8'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e['agentAlias'],_0x52cdcc[_0x834e('0x3e')]):'System';break;case'agent_alias':_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xf9')]||_0x52cdcc['User'][_0x834e('0xcb')]:_0x834e('0xf4');break;case _0x834e('0xfa'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4');break;default:_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc['UserId']):_0x834e('0xf4');}var _0x121d87=util[_0x834e('0xf1')](_0x834e('0xfb'),moment(_0x52cdcc[_0x834e('0xfc')])[_0x834e('0xf1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x52cdcc[_0x834e('0xfd')]==='in'?_0x3d8abb:_0x4fabe6,_0x52cdcc[_0x834e('0x33')]);if(!_0x52cdcc[_0x834e('0xfe')]){fs[_0x834e('0xff')](_0x569a80,_0x121d87);}}return db[_0x834e('0x100')][_0x834e('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x834e('0x101')],'as':_0x834e('0x102'),'raw':!![],'include':[{'model':db[_0x834e('0x103')],'as':_0x834e('0x103'),'raw':!![]}]}]});}}})['then'](function(_0x571645){if(!_0x571645||!_0x571645[_0x834e('0x102')]||!_0x12d468['body'])return _0x3eb2e8;var _0x4094d5=_0x571645[_0x834e('0x104')]();return respondWithRpcPromise(_0x834e('0x105'),_0x834e('0x106'),{'account':_0x4094d5,'message':{'from':util[_0x834e('0xf1')](_0x834e('0x107'),_0x571645['name'],_0x571645[_0x834e('0xcc')]||_0x571645['Smtp']['user']),'to':_0x12d468['body'][_0x834e('0xea')],'subject':_0x834e('0x108'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12d468['body'][_0x834e('0xea')]),'attachments':[{'path':_0x569a80}]}})[_0x834e('0x2c')](function(){return _0x3eb2e8;})[_0x834e('0x22')](function(_0x5e0bfe){logger[_0x834e('0x1d')](_0x5e0bfe);});})[_0x834e('0x2c')](respondWithStatusCode(_0x2e9116,0xc8))[_0x834e('0x22')](handleError(_0x2e9116,null));};exports[_0x834e('0x109')]=function(_0xb9635a,_0x3c1a19){return db['ChatMessage']['find']({'where':{'id':_0xb9635a['params']['id']}})['then'](handleEntityNotFound(_0x3c1a19,null))[_0x834e('0x2c')](function(_0xf82ca8){if(_0xf82ca8){return _0xf82ca8[_0x834e('0x109')](_0xb9635a[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0xb9635a[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{});}})[_0x834e('0x2c')](respondWithResult(_0x3c1a19,null))[_0x834e('0x22')](handleError(_0x3c1a19,null));};exports[_0x834e('0x10c')]=function(_0x18735a,_0x3446ff){var _0x1e11e0={'raw':![],'where':{}};var _0x38796c={};var _0x59bd0e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x18735a[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3446ff,null))['then'](function(_0xf89b9e){if(_0xf89b9e){_0x38796c[_0x834e('0x49')]=_[_0x834e('0x4b')](db[_0x834e('0xee')][_0x834e('0x47')]);_0x38796c[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x18735a[_0x834e('0x4a')]);_0x38796c[_0x834e('0x4c')]=_['intersection'](_0x38796c[_0x834e('0x49')],_0x38796c[_0x834e('0x4a')]);_0x1e11e0[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x38796c['model'],qs[_0x834e('0x4f')](_0x18735a[_0x834e('0x4a')][_0x834e('0x4f')]));_0x1e11e0[_0x834e('0x4e')]=_0x1e11e0[_0x834e('0x4e')][_0x834e('0x50')]?_0x1e11e0[_0x834e('0x4e')]:_0x38796c[_0x834e('0x49')];if(!_0x18735a[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x1e11e0['limit']=qs[_0x834e('0x26')](_0x18735a['query'][_0x834e('0x26')]);_0x1e11e0[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x18735a[_0x834e('0x4a')][_0x834e('0x25')]);}_0x1e11e0['order']=qs[_0x834e('0x53')](_0x18735a[_0x834e('0x4a')]['sort']);_0x1e11e0['where']=qs[_0x834e('0x4c')](_['pick'](_0x18735a['query'],_0x38796c['filters']));_0x1e11e0[_0x834e('0x54')][_0x834e('0xbb')]=_0xf89b9e['id'];if(_0x18735a[_0x834e('0x4a')][_0x834e('0x8e')]){_0x1e11e0[_0x834e('0x54')]=_[_0x834e('0xa8')](_0x1e11e0[_0x834e('0x54')],{'$or':_['map'](_0x1e11e0[_0x834e('0x4e')],function(_0x278052){var _0x4a428c={};_0x4a428c[_0x278052]={'$like':'%'+_0x18735a['query'][_0x834e('0x8e')]+'%'};return _0x4a428c;})});}if(_0x18735a[_0x834e('0x4a')]['$gte']){var _0x5920f3=_0x18735a[_0x834e('0x4a')][_0x834e('0x85')][_0x834e('0x38')](',');var _0x599664={};_0x599664[_0x5920f3[0x0]]={'$gte':moment(_0x5920f3[0x1])[_0x834e('0xf1')](_0x834e('0x10e'))};_0x1e11e0[_0x834e('0x54')]=_['merge'](_0x1e11e0[_0x834e('0x54')],_0x599664);}_0x1e11e0=_['merge']({},_0x1e11e0,_0x18735a[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x1e11e0[_0x834e('0x54')]})[_0x834e('0x2c')](function(_0x516a53){_0x59bd0e[_0x834e('0x28')]=_0x516a53;if(_0x18735a[_0x834e('0x4a')][_0x834e('0xbf')]){_0x1e11e0[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')]['findAll'](_0x1e11e0);})['then'](function(_0x2ca127){_0x59bd0e[_0x834e('0x10f')]=_0x2ca127;return _0x59bd0e;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x3446ff,_0x1e11e0))['catch'](handleError(_0x3446ff,null));};exports[_0x834e('0x110')]=function(_0x2e3294,_0x28d9c3){var _0x386b73={'where':{}},_0x53faec={},_0x3cc563={'count':0x0,'rows':[]};return db[_0x834e('0x46')]['findOne']({'where':{'id':_0x2e3294[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x28d9c3,null))[_0x834e('0x2c')](function(_0x3e408c){if(_0x3e408c){_0x53faec['model']=_[_0x834e('0x4b')](db['ChatMessage'][_0x834e('0x47')]);_0x53faec[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x2e3294[_0x834e('0x4a')]);_0x53faec[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x53faec['model'],_0x53faec['query']);_0x386b73[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x53faec['model'],qs[_0x834e('0x4f')](_0x2e3294['query'][_0x834e('0x4f')]));_0x386b73[_0x834e('0x4e')]=_0x386b73[_0x834e('0x4e')][_0x834e('0x50')]?_0x386b73[_0x834e('0x4e')]:_0x53faec[_0x834e('0x49')];if(!_0x2e3294[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x386b73[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x26')]);_0x386b73['offset']=qs[_0x834e('0x25')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x25')]);}_0x386b73['order']=qs['sort'](_0x2e3294['query'][_0x834e('0x53')]);_0x386b73[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x2e3294[_0x834e('0x4a')],_0x53faec[_0x834e('0x4c')]));_0x386b73[_0x834e('0x54')][_0x834e('0xbb')]=_0x3e408c['id'];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]){_0x386b73[_0x834e('0x54')]=_['merge'](_0x386b73[_0x834e('0x54')],{'$or':_[_0x834e('0x45')](_0x386b73[_0x834e('0x4e')],function(_0x26534d){var _0x4081a1={};_0x4081a1[_0x26534d]={'$like':'%'+_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]+'%'};return _0x4081a1;})});}_0x386b73[_0x834e('0x54')]['secret']=![];if(_0x2e3294[_0x834e('0x4a')]['id']){_0x386b73[_0x834e('0x54')]['id']={'$gt':_0x2e3294['query']['id']};}_0x386b73=_[_0x834e('0xa8')]({},_0x386b73,_0x2e3294[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x386b73['where']})['then'](function(_0x3d37c8){_0x3cc563['count']=_0x3d37c8;_0x386b73[_0x834e('0xc0')]=[];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x111')]){_0x386b73[_0x834e('0xc0')][_0x834e('0xbc')]({'model':db['User'],'as':_0x834e('0xef'),'attributes':['id','fullname','alias']});}if(_0x2e3294[_0x834e('0x4a')][_0x834e('0xbf')]){_0x386b73[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')][_0x834e('0x112')](_0x386b73);})[_0x834e('0x2c')](function(_0x5912ee){_0x3cc563[_0x834e('0x10f')]=_0x5912ee;return _0x3cc563;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x28d9c3,_0x386b73))['catch'](handleError(_0x28d9c3,null));};exports[_0x834e('0x113')]=function(_0x3b4264,_0x4b070a){return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x3b4264['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x4b070a,null))[_0x834e('0x2c')](function(_0x164170){if(_0x164170){return _0x164170[_0x834e('0x114')](_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0x3b4264[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{})[_0x834e('0x115')](function(){return db['Tag'][_0x834e('0x112')]({'attributes':['id',_0x834e('0x30'),_0x834e('0x57')],'where':{'id':_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')]}});})[_0x834e('0x2c')](function(_0x2d61c1){socket[_0x834e('0x116')](_0x834e('0x117'),{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]});return{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]};});}})[_0x834e('0x2c')](respondWithResult(_0x4b070a,null))['catch'](handleError(_0x4b070a,null));};exports[_0x834e('0x118')]=function(_0x1cd122,_0x49be08){return db['ChatInteraction']['find']({'where':{'id':_0x1cd122[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x49be08,null))[_0x834e('0x2c')](function(_0x3530bc){if(_0x3530bc){return _0x3530bc[_0x834e('0x118')](_0x1cd122[_0x834e('0x4a')][_0x834e('0x10a')]);}})['then'](respondWithStatusCode(_0x49be08,null))['catch'](handleError(_0x49be08,null));};exports['download']=function(_0x47947b,_0x684a97){var _0x3c8fc2=moment()[_0x834e('0x119')]()['toString']();var _0x5776c5=path['join'](config[_0x834e('0xe5')],'server','files',_0x834e('0x11a'));var _0x378bf3=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x11c'),_0x834e('0x11d'));var _0x59a706=path[_0x834e('0xe4')](_0x5776c5,_0x3c8fc2);var _0x11f472=util[_0x834e('0xf1')](_0x834e('0x11e'),_0x47947b[_0x834e('0xbe')]['id'],_0x3c8fc2);var _0x488f82=path[_0x834e('0xe4')](_0x5776c5,_0x11f472);var _0x5a3876=[];_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xef')],'as':_0x834e('0xef'),'attributes':['id','fullname'],'raw':!![]});_0x5a3876['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x834e('0x11f'),_0x834e('0x120')],'raw':!![]});if(_0x47947b['query']['attachments']){_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xe1')],'as':_0x834e('0xe1'),'raw':!![]});}var _0x51f527=[{'model':db[_0x834e('0xee')],'as':_0x834e('0xf0'),'attributes':['id',_0x834e('0x33'),'createdAt',_0x834e('0xfd'),_0x834e('0xfe'),_0x834e('0x89')],'include':_0x5a3876}];_0x51f527[_0x834e('0xbc')]({'model':db[_0x834e('0xc6')],'as':_0x834e('0x121'),'attributes':['id',_0x834e('0x30')]});_0x51f527['push']({'model':db[_0x834e('0xef')],'as':_0x834e('0x122'),'attributes':['id',_0x834e('0xcb')]});return db['ChatInteraction'][_0x834e('0x6f')]({'where':{'id':_0x47947b[_0x834e('0xbe')]['id']},'include':_0x51f527})[_0x834e('0x2c')](handleEntityNotFound(_0x684a97,null))[_0x834e('0x2c')](function(_0x2bbb1a){if(_0x2bbb1a){var _0x1ffed9=_0x2bbb1a[_0x834e('0x123')]({'plain':!![]});fs[_0x834e('0x124')](_0x59a706);var _0x25fa75={'channel':_0x834e('0x125'),'account':_0x1ffed9[_0x834e('0x121')][_0x834e('0x30')],'agent':_0x1ffed9['Owner']?_0x1ffed9[_0x834e('0x122')]['fullname']:_0x834e('0x126'),'createdAt':moment(_0x1ffed9['createdAt'])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'closedAt':_0x1ffed9[_0x834e('0x40')]?moment(_0x1ffed9[_0x834e('0x127')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')]():'','disposition':_0x1ffed9['disposition'],'chatInfo':{'browser':_0x1ffed9['browserName'],'os':_0x1ffed9['osName'],'referer':_0x1ffed9[_0x834e('0x128')],'customerIp':_0x1ffed9[_0x834e('0x129')],'customerPort':_0x1ffed9[_0x834e('0x12a')]?_0x1ffed9[_0x834e('0x12a')]:_0x834e('0x126')},'messages':_(_0x1ffed9[_0x834e('0xf0')])[_0x834e('0x12b')]()[_0x834e('0x8e')]({'secret':![]})['map'](function(_0x5a312e){if(_0x5a312e[_0x834e('0xe1')]){var _0x42e5ee=path[_0x834e('0xe4')](_0x378bf3,_0x5a312e['Attachment']['basename']);if(fs[_0x834e('0x12c')](_0x42e5ee)){fs['createReadStream'](_0x42e5ee)[_0x834e('0x12d')](fs[_0x834e('0x12e')](path[_0x834e('0xe4')](_0x59a706,_0x5a312e['Attachment'][_0x834e('0xe7')])));}}return{'date':moment(_0x5a312e[_0x834e('0xfc')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'sender':_0x5a312e[_0x834e('0xfd')]===_0x834e('0xd5')?_0x5a312e['User']?_0x5a312e[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4'):_0x5a312e[_0x834e('0x73')][_0x834e('0x11f')]+(_0x5a312e[_0x834e('0x73')][_0x834e('0x120')]?'\x20'+_0x5a312e['Contact']['lastName']:''),'body':_0x5a312e[_0x834e('0xe1')]?_0x5a312e['Attachment']['basename']:_0x5a312e[_0x834e('0x33')],'direction':_0x5a312e[_0x834e('0xfd')]==='out'?'A':'C','secret':_0x5a312e[_0x834e('0xfe')],'read':_0x5a312e['read'],'attachment':_0x5a312e['Attachment']};})[_0x834e('0x75')]()};return ejs['renderFile'](path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x12f'),_0x834e('0x130')),{'interaction':_0x25fa75})[_0x834e('0x2c')](function(_0x1a48f9){var _0x196f86=path[_0x834e('0xe4')](_0x59a706,'transcript-'+_0x1ffed9['id']+'-'+_0x3c8fc2+_0x834e('0x131'));var _0x19a42c={'path':_0x196f86,'channel':_0x834e('0x125'),'interactionId':_0x1ffed9['id']};return pdf[_0x834e('0x132')](_0x1a48f9,_0x19a42c);})['then'](function(){return new Promise(function(_0x4b1178,_0x46e533){zipdir(_0x59a706,{'saveTo':_0x488f82},function(_0x13a7e1,_0x5d801a){if(_0x13a7e1)return _0x46e533(_0x13a7e1);return _0x4b1178(_0x5d801a);});})[_0x834e('0x2c')](function(){return new BPromise(function(_0x505821,_0x2f46cf){rimraf(_0x59a706,function(_0x884f38){if(_0x884f38)_0x2f46cf(_0x884f38);return _0x505821();});});})[_0x834e('0x2c')](function(){return _0x684a97[_0x834e('0xe8')](_0x488f82,_0x11f472,function(_0xd7026f){if(_0xd7026f){logger[_0x834e('0x1d')]('err',_0xd7026f);}else{fs['unlinkSync'](_0x488f82);}});});});}else{return _0x684a97['sendStatus'](0xc8);}})[_0x834e('0x22')](handleError(_0x684a97,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 086eb4b..43d7b76 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 _0x5165=['then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3d2a82,_0x5a9e3e){var _0x31c99d=function(_0x2777f3){while(--_0x2777f3){_0x3d2a82['push'](_0x3d2a82['shift']());}};_0x31c99d(++_0x5a9e3e);}(_0x5165,0x160));var _0x5516=function(_0x1293fa,_0x446d6b){_0x1293fa=_0x1293fa-0x0;var _0x1dd054=_0x5165[_0x1293fa];return _0x1dd054;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x5516('0x0')];var ChatMessage=require(_0x5516('0x1'))['db'][_0x5516('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5516('0x3')](0x0);var events={'afterCreate':_0x5516('0x4'),'afterUpdate':_0x5516('0x5'),'afterDestroy':_0x5516('0x6')};function emitEvent(_0x50426f){return function(_0x70e745,_0x3c5cf2,_0x194e2d){_0x70e745[_0x5516('0x7')]({'attributes':['id'],'raw':!![]})[_0x5516('0x8')](function(_0x2f0035){_0x70e745['setDataValue'](_0x5516('0x9'),_0x2f0035[_0x5516('0xa')](function(_0x3d5774){return{'id':_0x3d5774['id']};}));return ChatMessage[_0x5516('0xb')]({'where':{'ChatInteractionId':_0x70e745['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5516('0x8')](function(_0x5f574b){_0x70e745[_0x5516('0xc')](_0x5516('0xd'),_0x5f574b['length']);ChatInteractionEvents[_0x5516('0xe')](_0x50426f+':'+_0x70e745['id'],_0x70e745);ChatInteractionEvents[_0x5516('0xe')](_0x50426f,_0x70e745);_0x194e2d(null);})[_0x5516('0xf')](_0x194e2d(null));};}for(var e in events){if(events[_0x5516('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x5516('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xe17b=['ChatInteraction','ChatMessage','save','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0xe17b,0x152));var _0xbe17=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xe17b[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require(_0xbe17('0x0'));var ChatInteraction=require(_0xbe17('0x1'))['db'][_0xbe17('0x2')];var ChatMessage=require(_0xbe17('0x1'))['db'][_0xbe17('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe17('0x4'),'afterUpdate':_0xbe17('0x5'),'afterDestroy':_0xbe17('0x6')};function emitEvent(_0x12f97c){return function(_0x197ba8,_0x88c097,_0x5bea63){_0x197ba8[_0xbe17('0x7')]({'attributes':['id'],'raw':!![]})[_0xbe17('0x8')](function(_0x13cca2){_0x197ba8['setDataValue'](_0xbe17('0x9'),_0x13cca2[_0xbe17('0xa')](function(_0x13725b){return{'id':_0x13725b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x197ba8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbe17('0x8')](function(_0x1997c9){_0x197ba8[_0xbe17('0xb')](_0xbe17('0xc'),_0x1997c9['length']);ChatInteractionEvents[_0xbe17('0xd')](_0x12f97c+':'+_0x197ba8['id'],_0x197ba8);ChatInteractionEvents[_0xbe17('0xd')](_0x12f97c,_0x197ba8);_0x5bea63(null);})['catch'](_0x5bea63(null));};}for(var e in events){if(events[_0xbe17('0xe')](e)){var event=events[e];ChatInteraction[_0xbe17('0xf')](e,emitEvent(event));}}module[_0xbe17('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 44c5366..23406ab 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 _0xea4e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x215264,_0x5d4324){var _0x1965ed=function(_0x11097f){while(--_0x11097f){_0x215264['push'](_0x215264['shift']());}};_0x1965ed(++_0x5d4324);}(_0xea4e,0x10e));var _0xeea4=function(_0x9d1971,_0x50b82e){_0x9d1971=_0x9d1971-0x0;var _0x203469=_0xea4e[_0x9d1971];return _0x203469;};'use strict';var _=require(_0xeea4('0x0'));var util=require(_0xeea4('0x1'));var logger=require(_0xeea4('0x2'))(_0xeea4('0x3'));var moment=require(_0xeea4('0x4'));var BPromise=require(_0xeea4('0x5'));var rp=require(_0xeea4('0x6'));var fs=require('fs');var path=require(_0xeea4('0x7'));var rimraf=require('rimraf');var config=require(_0xeea4('0x8'));var attributes=require(_0xeea4('0x9'));module[_0xeea4('0xa')]=function(_0x32333a,_0x391a6c){return _0x32333a[_0xeea4('0xb')](_0xeea4('0xc'),attributes,{'tableName':_0xeea4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a4ad9,_0x371c40,_0x116c65){if(_0x5a4ad9[_0xeea4('0xe')]('closed')){_0x5a4ad9['closedAt']=moment()[_0xeea4('0xf')](_0xeea4('0x10'));}_0x116c65(null,_0x5a4ad9);}},'charset':_0xeea4('0x11'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xab38=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','api','moment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xab38,0x13e));var _0x8ab3=function(_0x44435b,_0x1a65f4){_0x44435b=_0x44435b-0x0;var _0x332e3=_0xab38[_0x44435b];return _0x332e3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8ab3('0x0'));var moment=require(_0x8ab3('0x1'));var BPromise=require(_0x8ab3('0x2'));var rp=require(_0x8ab3('0x3'));var fs=require('fs');var path=require(_0x8ab3('0x4'));var rimraf=require(_0x8ab3('0x5'));var config=require(_0x8ab3('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x8ab3('0x7')]=function(_0x5a3009,_0x1a065c){return _0x5a3009[_0x8ab3('0x8')](_0x8ab3('0x9'),attributes,{'tableName':_0x8ab3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x200c43,_0x176ef8,_0x2325db){if(_0x200c43[_0x8ab3('0xb')](_0x8ab3('0xc'))){_0x200c43['closedAt']=moment()[_0x8ab3('0xd')](_0x8ab3('0xe'));}_0x2325db(null,_0x200c43);}},'charset':_0x8ab3('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d8799c9..bd74ba3 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 _0x3d87=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./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','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','catch','addTags','omit','spread','AddTags','lodash','util'];(function(_0x4928f8,_0x10efbb){var _0x38df27=function(_0x30d465){while(--_0x30d465){_0x4928f8['push'](_0x4928f8['shift']());}};_0x38df27(++_0x10efbb);}(_0x3d87,0x18e));var _0x73d8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d87[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x73d8('0x0'));var util=require(_0x73d8('0x1'));var moment=require(_0x73d8('0x2'));var BPromise=require(_0x73d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x73d8('0x5'));var logger=require(_0x73d8('0x6'))(_0x73d8('0x7'));var config=require(_0x73d8('0x8'));var jayson=require(_0x73d8('0x9'));var client=jayson[_0x73d8('0xa')]['http']({'port':0x232a});config['redis']=_[_0x73d8('0xb')](config[_0x73d8('0xc')],{'host':_0x73d8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73d8('0xc')]));require(_0x73d8('0xe'))[_0x73d8('0xf')](socket);function respondWithRpcPromise(_0xe22056,_0x29034b,_0x562eb5){return new BPromise(function(_0x2aee74,_0x3970f2){return client['request'](_0xe22056,_0x562eb5)[_0x73d8('0x10')](function(_0x53b37b){logger[_0x73d8('0x11')](_0x73d8('0x12'),_0x29034b,_0x73d8('0x13'));logger[_0x73d8('0x14')](_0x73d8('0x15'),_0x29034b,_0x73d8('0x13'),JSON[_0x73d8('0x16')](_0x53b37b));if(_0x53b37b[_0x73d8('0x17')]){if(_0x53b37b['error'][_0x73d8('0x18')]===0x1f4){logger[_0x73d8('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x29034b,_0x53b37b[_0x73d8('0x17')][_0x73d8('0x19')]);return _0x3970f2(_0x53b37b[_0x73d8('0x17')][_0x73d8('0x19')]);}logger[_0x73d8('0x17')](_0x73d8('0x12'),_0x29034b,_0x53b37b[_0x73d8('0x17')][_0x73d8('0x19')]);return _0x2aee74(_0x53b37b['error'][_0x73d8('0x19')]);}else{logger[_0x73d8('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x29034b,'request\x20sent');_0x2aee74(_0x53b37b[_0x73d8('0x1a')][_0x73d8('0x19')]);}})['catch'](function(_0x542773){logger[_0x73d8('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x29034b,_0x542773);_0x3970f2(_0x542773);});});}exports[_0x73d8('0x1b')]=function(_0x36e94b){var _0xa8c8d9=this;return new Promise(function(_0x3d0f59,_0x667b4){return db['ChatInteraction'][_0x73d8('0x1c')](_0x36e94b[_0x73d8('0x1d')],{'raw':_0x36e94b['options']?_0x36e94b['options'][_0x73d8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36e94b['options']?_0x36e94b[_0x73d8('0x1f')][_0x73d8('0x20')]||null:null,'attributes':_0x36e94b['options']?_0x36e94b[_0x73d8('0x1f')][_0x73d8('0x21')]||null:null,'limit':_0x36e94b['options']?_0x36e94b[_0x73d8('0x1f')][_0x73d8('0x22')]||null:null})[_0x73d8('0x10')](function(_0x50f3c5){logger['info'](_0x73d8('0x1b'),_0x36e94b);logger['debug']('UpdateChatInteraction',_0x36e94b,JSON['stringify'](_0x50f3c5));_0x3d0f59(_0x50f3c5);})[_0x73d8('0x23')](function(_0x104109){logger[_0x73d8('0x17')](_0x73d8('0x1b'),_0x104109[_0x73d8('0x19')],_0x36e94b);_0x667b4(_0xa8c8d9[_0x73d8('0x17')](0x1f4,_0x104109[_0x73d8('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x132dd1){return new Promise(function(_0x477247,_0x49cc21){return db['ChatInteraction']['find']({'where':_0x132dd1[_0x73d8('0x1f')]?_0x132dd1[_0x73d8('0x1f')][_0x73d8('0x20')]||null:null})[_0x73d8('0x10')](function(_0x5d60df){if(_0x5d60df){return _0x5d60df[_0x73d8('0x24')](_0x132dd1[_0x73d8('0x1d')]['ids'],_[_0x73d8('0x25')](_0x132dd1[_0x73d8('0x1d')],['ids','id'])||{});}})[_0x73d8('0x26')](function(_0x1882d8){logger['info'](_0x73d8('0x27'),_0x132dd1);logger[_0x73d8('0x14')](_0x73d8('0x27'),_0x132dd1,JSON[_0x73d8('0x16')](_0x1882d8));_0x477247(_0x1882d8);})['catch'](function(_0x51ff7d){logger[_0x73d8('0x17')](_0x73d8('0x27'),_0x51ff7d['message'],_0x132dd1);_0x49cc21(_this[_0x73d8('0x17')](0x1f4,_0x51ff7d[_0x73d8('0x19')]));});});};
\ No newline at end of file
+var _0x6159=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','debug','catch','AddTagsToChatInteraction','find','addTags','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21481c,_0x1b51ba){var _0x5dd77a=function(_0x4ee13c){while(--_0x4ee13c){_0x21481c['push'](_0x21481c['shift']());}};_0x5dd77a(++_0x1b51ba);}(_0x6159,0x197));var _0x9615=function(_0x5e8644,_0x1d02d0){_0x5e8644=_0x5e8644-0x0;var _0x353a5e=_0x6159[_0x5e8644];return _0x353a5e;};'use strict';var _=require(_0x9615('0x0'));var util=require(_0x9615('0x1'));var moment=require(_0x9615('0x2'));var BPromise=require(_0x9615('0x3'));var rs=require(_0x9615('0x4'));var fs=require('fs');var Redis=require(_0x9615('0x5'));var db=require(_0x9615('0x6'))['db'];var utils=require(_0x9615('0x7'));var logger=require(_0x9615('0x8'))(_0x9615('0x9'));var config=require(_0x9615('0xa'));var jayson=require(_0x9615('0xb'));var client=jayson[_0x9615('0xc')][_0x9615('0xd')]({'port':0x232a});config[_0x9615('0xe')]=_[_0x9615('0xf')](config[_0x9615('0xe')],{'host':_0x9615('0x10'),'port':0x18eb});var socket=require(_0x9615('0x11'))(new Redis(config[_0x9615('0xe')]));require(_0x9615('0x12'))['register'](socket);function respondWithRpcPromise(_0x300710,_0xedd726,_0x2072b5){return new BPromise(function(_0x1bc77f,_0x12e68a){return client[_0x9615('0x13')](_0x300710,_0x2072b5)[_0x9615('0x14')](function(_0x184e4e){logger[_0x9615('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xedd726,'request\x20sent');logger['debug'](_0x9615('0x16'),_0xedd726,'request\x20sent',JSON[_0x9615('0x17')](_0x184e4e));if(_0x184e4e[_0x9615('0x18')]){if(_0x184e4e['error'][_0x9615('0x19')]===0x1f4){logger[_0x9615('0x18')](_0x9615('0x1a'),_0xedd726,_0x184e4e['error'][_0x9615('0x1b')]);return _0x12e68a(_0x184e4e[_0x9615('0x18')][_0x9615('0x1b')]);}logger[_0x9615('0x18')](_0x9615('0x1a'),_0xedd726,_0x184e4e['error'][_0x9615('0x1b')]);return _0x1bc77f(_0x184e4e[_0x9615('0x18')]['message']);}else{logger[_0x9615('0x15')](_0x9615('0x1a'),_0xedd726,_0x9615('0x1c'));_0x1bc77f(_0x184e4e[_0x9615('0x1d')][_0x9615('0x1b')]);}})['catch'](function(_0x46e90c){logger[_0x9615('0x18')](_0x9615('0x1a'),_0xedd726,_0x46e90c);_0x12e68a(_0x46e90c);});});}exports[_0x9615('0x1e')]=function(_0xe953e8){var _0x4e5cc2=this;return new Promise(function(_0x3a6146,_0x24e885){return db[_0x9615('0x1f')][_0x9615('0x20')](_0xe953e8[_0x9615('0x21')],{'raw':_0xe953e8[_0x9615('0x22')]?_0xe953e8['options'][_0x9615('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe953e8[_0x9615('0x22')]?_0xe953e8['options'][_0x9615('0x24')]||null:null,'attributes':_0xe953e8[_0x9615('0x22')]?_0xe953e8[_0x9615('0x22')][_0x9615('0x25')]||null:null,'limit':_0xe953e8[_0x9615('0x22')]?_0xe953e8['options'][_0x9615('0x26')]||null:null})['then'](function(_0x3125d6){logger[_0x9615('0x15')](_0x9615('0x1e'),_0xe953e8);logger[_0x9615('0x27')]('UpdateChatInteraction',_0xe953e8,JSON[_0x9615('0x17')](_0x3125d6));_0x3a6146(_0x3125d6);})[_0x9615('0x28')](function(_0x556ea9){logger['error'](_0x9615('0x1e'),_0x556ea9[_0x9615('0x1b')],_0xe953e8);_0x24e885(_0x4e5cc2[_0x9615('0x18')](0x1f4,_0x556ea9[_0x9615('0x1b')]));});});};exports[_0x9615('0x29')]=function(_0x52b7a7){return new Promise(function(_0x7552fc,_0xfa705d){return db['ChatInteraction'][_0x9615('0x2a')]({'where':_0x52b7a7['options']?_0x52b7a7[_0x9615('0x22')][_0x9615('0x24')]||null:null})[_0x9615('0x14')](function(_0x8ee7a8){if(_0x8ee7a8){return _0x8ee7a8[_0x9615('0x2b')](_0x52b7a7[_0x9615('0x21')]['ids'],_[_0x9615('0x2c')](_0x52b7a7[_0x9615('0x21')],['ids','id'])||{});}})['spread'](function(_0x4f35a9){logger[_0x9615('0x15')]('AddTags',_0x52b7a7);logger[_0x9615('0x27')](_0x9615('0x2d'),_0x52b7a7,JSON[_0x9615('0x17')](_0x4f35a9));_0x7552fc(_0x4f35a9);})[_0x9615('0x28')](function(_0x467a56){logger[_0x9615('0x18')](_0x9615('0x2d'),_0x467a56[_0x9615('0x1b')],_0x52b7a7);_0xfa705d(_this[_0x9615('0x18')](0x1f4,_0x467a56[_0x9615('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 86c6238..7d8d4e8 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 _0xc560=['./chatInteraction.events','remove','emit','removeListener','length'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc560,0x82));var _0x0c56=function(_0x98cfa6,_0x4513e3){_0x98cfa6=_0x98cfa6-0x0;var _0x3e7e7a=_0xc560[_0x98cfa6];return _0x3e7e7a;};'use strict';var ChatInteractionEvents=require(_0x0c56('0x0'));var events=['save',_0x0c56('0x1'),'update'];function createListener(_0x2c4115,_0x5b4dfe){return function(_0x5c33dd){_0x5b4dfe[_0x0c56('0x2')](_0x2c4115,_0x5c33dd);};}function removeListener(_0x39dbc7,_0x37c584){return function(){ChatInteractionEvents[_0x0c56('0x3')](_0x39dbc7,_0x37c584);};}exports['register']=function(_0x2b5654){for(var _0x2bc0a0=0x0,_0x35b4ee=events[_0x0c56('0x4')];_0x2bc0a0<_0x35b4ee;_0x2bc0a0++){var _0x501a0b=events[_0x2bc0a0];var _0x429ad1=createListener('chatInteraction:'+_0x501a0b,_0x2b5654);ChatInteractionEvents['on'](_0x501a0b,_0x429ad1);}};
\ No newline at end of file
+var _0x4c88=['save','emit','register','length','./chatInteraction.events'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x4c88,0x1c6));var _0x84c8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4c88[_0x2c91e9];return _0x13f0ff;};'use strict';var ChatInteractionEvents=require(_0x84c8('0x0'));var events=[_0x84c8('0x1'),'remove','update'];function createListener(_0xd2bde3,_0x2e112c){return function(_0x1beee5){_0x2e112c[_0x84c8('0x2')](_0xd2bde3,_0x1beee5);};}function removeListener(_0x1bb0b0,_0xb96aca){return function(){ChatInteractionEvents['removeListener'](_0x1bb0b0,_0xb96aca);};}exports[_0x84c8('0x3')]=function(_0x1d0174){for(var _0x3c2909=0x0,_0x3b0d24=events[_0x84c8('0x4')];_0x3c2909<_0x3b0d24;_0x3c2909++){var _0x573d37=events[_0x3c2909];var _0x7acbd6=createListener('chatInteraction:'+_0x573d37,_0x1d0174);ChatInteractionEvents['on'](_0x573d37,_0x7acbd6);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d278b0d..b92c337 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 _0x3c53=['/:id/my_messages','getMyMessages','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','/:id/attachment_upload','file','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages'];(function(_0x559491,_0x4d316d){var _0x4d05b2=function(_0x419719){while(--_0x419719){_0x559491['push'](_0x559491['shift']());}};_0x4d05b2(++_0x4d316d);}(_0x3c53,0x108));var _0x33c5=function(_0x10ac4c,_0x137e61){_0x10ac4c=_0x10ac4c-0x0;var _0x56d383=_0x3c53[_0x10ac4c];return _0x56d383;};'use strict';var multer=require('multer');var util=require(_0x33c5('0x0'));var path=require('path');var timeout=require(_0x33c5('0x1'));var express=require(_0x33c5('0x2'));var router=express[_0x33c5('0x3')]();var fs_extra=require(_0x33c5('0x4'));var auth=require(_0x33c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x33c5('0x6'));var controller=require('./chatInteraction.controller');router[_0x33c5('0x7')]('/',auth[_0x33c5('0x8')](),controller[_0x33c5('0x9')]);router[_0x33c5('0x7')](_0x33c5('0xa'),auth[_0x33c5('0x8')](),controller[_0x33c5('0xb')]);router['get'](_0x33c5('0xc'),auth[_0x33c5('0xd')](),controller[_0x33c5('0xe')]);router['get'](_0x33c5('0xf'),auth[_0x33c5('0xd')](),controller['attachmentDownload']);router[_0x33c5('0x7')](_0x33c5('0x10'),auth[_0x33c5('0x8')](),controller[_0x33c5('0x11')]);router[_0x33c5('0x7')](_0x33c5('0x12'),auth[_0x33c5('0xd')](),controller[_0x33c5('0x13')]);router['get']('/:id/download',auth[_0x33c5('0x8')](),controller['download']);router['post']('/',auth[_0x33c5('0x8')](),controller[_0x33c5('0x14')]);router[_0x33c5('0x15')](_0x33c5('0x16'),auth[_0x33c5('0x8')](),controller[_0x33c5('0x17')]);var upload=multer({'storage':multer[_0x33c5('0x18')]({'destination':function(_0x5dd352,_0x34d5d8,_0x54fd8a){_0x54fd8a(null,path[_0x33c5('0x19')](config[_0x33c5('0x1a')],_0x33c5('0x1b')));},'filename':function(_0x1ac42e,_0x26838b,_0x110626){_0x110626(null,util[_0x33c5('0x1c')](_0x33c5('0x1d'),Date['now'](),_0x26838b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x33c5('0x15')](_0x33c5('0x1e'),upload['single'](_0x33c5('0x1f')),controller['attachmentUpload']);router[_0x33c5('0x15')](_0x33c5('0x10'),auth[_0x33c5('0xd')](),controller[_0x33c5('0x20')]);router[_0x33c5('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x33c5('0x21')](_0x33c5('0x22'),_0x33c5('0x23')),controller[_0x33c5('0x24')]);router[_0x33c5('0x25')](_0x33c5('0xc'),auth['isAuthenticated'](),interaction[_0x33c5('0x21')](_0x33c5('0x22'),'chatinteraction:update'),controller['update']);router[_0x33c5('0x25')](_0x33c5('0x26'),controller[_0x33c5('0x27')]);router['put'](_0x33c5('0x28'),auth[_0x33c5('0xd')](),controller['abandon']);router[_0x33c5('0x25')]('/:id/close',controller[_0x33c5('0x29')]);router[_0x33c5('0x2a')](_0x33c5('0xc'),auth['isAuthenticated'](),interaction[_0x33c5('0x21')](_0x33c5('0x22'),_0x33c5('0x2b')),controller[_0x33c5('0x2c')]);router[_0x33c5('0x2a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x33c5('0x2d')]);module[_0x33c5('0x2e')]=router;
\ No newline at end of file
+var _0xafc1=['../../components/interaction/service','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','create','post','/:id/vidaoo','diskStorage','root','format','%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','addTags','put','chat','update','customUpdate','/:id/abandon','/:id/close','close','tracked','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x52c4e9,_0x5412d0){var _0x252a03=function(_0x57857c){while(--_0x57857c){_0x52c4e9['push'](_0x52c4e9['shift']());}};_0x252a03(++_0x5412d0);}(_0xafc1,0x86));var _0x1afc=function(_0x14bafd,_0x1a20ea){_0x14bafd=_0x14bafd-0x0;var _0x2bb48d=_0xafc1[_0x14bafd];return _0x2bb48d;};'use strict';var multer=require(_0x1afc('0x0'));var util=require(_0x1afc('0x1'));var path=require(_0x1afc('0x2'));var timeout=require('connect-timeout');var express=require(_0x1afc('0x3'));var router=express[_0x1afc('0x4')]();var fs_extra=require(_0x1afc('0x5'));var auth=require(_0x1afc('0x6'));var interaction=require(_0x1afc('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x1afc('0x8')]('/',auth[_0x1afc('0x9')](),controller[_0x1afc('0xa')]);router[_0x1afc('0x8')]('/describe',auth[_0x1afc('0x9')](),controller[_0x1afc('0xb')]);router[_0x1afc('0x8')](_0x1afc('0xc'),auth[_0x1afc('0xd')](),controller[_0x1afc('0xe')]);router[_0x1afc('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x1afc('0xf')]);router[_0x1afc('0x8')](_0x1afc('0x10'),auth['isAuthenticated'](),controller[_0x1afc('0x11')]);router[_0x1afc('0x8')](_0x1afc('0x12'),auth[_0x1afc('0xd')](),controller['getMyMessages']);router[_0x1afc('0x8')](_0x1afc('0x13'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x1afc('0x9')](),controller[_0x1afc('0x14')]);router[_0x1afc('0x15')](_0x1afc('0x16'),auth[_0x1afc('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x1afc('0x17')]({'destination':function(_0x5b5191,_0x3d91b2,_0x209973){_0x209973(null,path['join'](config[_0x1afc('0x18')],'server/files/attachments/'));},'filename':function(_0x469479,_0x47b1b8,_0x27ea91){_0x27ea91(null,util[_0x1afc('0x19')](_0x1afc('0x1a'),Date[_0x1afc('0x1b')](),_0x47b1b8['originalname'][_0x1afc('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1afc('0x15')](_0x1afc('0x1d'),upload[_0x1afc('0x1e')]('file'),controller[_0x1afc('0x1f')]);router[_0x1afc('0x15')](_0x1afc('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x1afc('0x20')]);router[_0x1afc('0x15')](_0x1afc('0x21'),auth[_0x1afc('0x9')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x1afc('0x22')]);router[_0x1afc('0x23')](_0x1afc('0xc'),auth[_0x1afc('0x9')](),interaction['tracked'](_0x1afc('0x24'),'chatinteraction:update'),controller[_0x1afc('0x25')]);router[_0x1afc('0x23')]('/:id/custom_update',controller[_0x1afc('0x26')]);router[_0x1afc('0x23')](_0x1afc('0x27'),auth[_0x1afc('0xd')](),controller['abandon']);router[_0x1afc('0x23')](_0x1afc('0x28'),controller[_0x1afc('0x29')]);router['delete'](_0x1afc('0xc'),auth['isAuthenticated'](),interaction[_0x1afc('0x2a')](_0x1afc('0x24'),_0x1afc('0x2b')),controller[_0x1afc('0x2c')]);router['delete'](_0x1afc('0x21'),auth[_0x1afc('0x9')](),controller[_0x1afc('0x2d')]);module[_0x1afc('0x2e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index a927a55..b689024 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 _0x53db=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x240193,_0x231fdf){var _0x14a322=function(_0x24f8c2){while(--_0x24f8c2){_0x240193['push'](_0x240193['shift']());}};_0x14a322(++_0x231fdf);}(_0x53db,0xc0));var _0xb53d=function(_0x15ff01,_0x3b26d1){_0x15ff01=_0x15ff01-0x0;var _0x2bd417=_0x53db[_0x15ff01];return _0x2bd417;};'use strict';var Sequelize=require(_0xb53d('0x0'));module[_0xb53d('0x1')]={'body':{'type':Sequelize[_0xb53d('0x2')](_0xb53d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb53d('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb53d('0x5')]}};
\ No newline at end of file
+var _0x6db2=['INTEGER','sequelize','medium','BOOLEAN'];(function(_0x193003,_0x40d469){var _0x468d1e=function(_0x26ec53){while(--_0x26ec53){_0x193003['push'](_0x193003['shift']());}};_0x468d1e(++_0x40d469);}(_0x6db2,0x15d));var _0x26db=function(_0x128a79,_0x19f331){_0x128a79=_0x128a79-0x0;var _0x2ff426=_0x6db2[_0x128a79];return _0x2ff426;};'use strict';var Sequelize=require(_0x26db('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x26db('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x26db('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x26db('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 3310b96..f051e19 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 _0xedb6=['read','all','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','ChatInternalMessage','includeAll','findAll','rows','show','params','find','catch','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId'];(function(_0xa43999,_0x5a6538){var _0x2075af=function(_0x35366d){while(--_0x35366d){_0xa43999['push'](_0xa43999['shift']());}};_0x2075af(++_0x5a6538);}(_0xedb6,0x1b6));var _0x6edb=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xedb6[_0x261e29];return _0x25ef43;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6edb('0x0'));var jsonpatch=require(_0x6edb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6edb('0x2'));var Mustache=require(_0x6edb('0x3'));var util=require(_0x6edb('0x4'));var path=require(_0x6edb('0x5'));var sox=require(_0x6edb('0x6'));var csv=require('to-csv');var ejs=require(_0x6edb('0x7'));var fs=require('fs');var fs_extra=require(_0x6edb('0x8'));var _=require(_0x6edb('0x9'));var squel=require(_0x6edb('0xa'));var crypto=require('crypto');var jsforce=require(_0x6edb('0xb'));var deskjs=require(_0x6edb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6edb('0xd'));var Papa=require(_0x6edb('0xe'));var Redis=require('ioredis');var authService=require(_0x6edb('0xf'));var qs=require(_0x6edb('0x10'));var as=require(_0x6edb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6edb('0x12'));var utils=require(_0x6edb('0x13'));var config=require(_0x6edb('0x14'));var licenseUtil=require(_0x6edb('0x15'));var db=require('../../mysqldb')['db'];config[_0x6edb('0x16')]=_['defaults'](config[_0x6edb('0x16')],{'host':_0x6edb('0x17'),'port':0x18eb});var socket=require(_0x6edb('0x18'))(new Redis(config[_0x6edb('0x16')]));require(_0x6edb('0x19'))[_0x6edb('0x1a')](socket);function respondWithStatusCode(_0x55af5e,_0x53d420){_0x53d420=_0x53d420||0xcc;return function(_0x152eb0){if(_0x152eb0){return _0x55af5e[_0x6edb('0x1b')](_0x53d420);}return _0x55af5e[_0x6edb('0x1c')](_0x53d420)[_0x6edb('0x1d')]();};}function respondWithResult(_0x3ab42c,_0x1c37b5){_0x1c37b5=_0x1c37b5||0xc8;return function(_0x5a4c73){if(_0x5a4c73){return _0x3ab42c['status'](_0x1c37b5)[_0x6edb('0x1e')](_0x5a4c73);}};}function respondWithFilteredResult(_0x30a727,_0x2dfda0){return function(_0x1d57f0){if(_0x1d57f0){var _0x3f2338=typeof _0x2dfda0[_0x6edb('0x1f')]===_0x6edb('0x20')&&typeof _0x2dfda0[_0x6edb('0x21')]===_0x6edb('0x20');var _0xee1b65=_0x1d57f0[_0x6edb('0x22')];var _0x277e90=_0x3f2338?0x0:_0x2dfda0['offset'];var _0x38f26c=_0x3f2338?_0x1d57f0[_0x6edb('0x22')]:_0x2dfda0[_0x6edb('0x1f')]+_0x2dfda0[_0x6edb('0x21')];var _0x4b3242;if(_0x38f26c>=_0xee1b65){_0x38f26c=_0xee1b65;_0x4b3242=0xc8;}else{_0x4b3242=0xce;}_0x30a727['status'](_0x4b3242);return _0x30a727['set']('Content-Range',_0x277e90+'-'+_0x38f26c+'/'+_0xee1b65)[_0x6edb('0x1e')](_0x1d57f0);}return null;};}function patchUpdates(_0x3cca94){return function(_0x7f7ffa){try{jsonpatch['apply'](_0x7f7ffa,_0x3cca94,!![]);}catch(_0x3f4678){return BPromise['reject'](_0x3f4678);}return _0x7f7ffa[_0x6edb('0x23')]();};}function saveUpdates(_0x5a84bd,_0x12d439){return function(_0x56bc1b){if(_0x56bc1b){return _0x56bc1b[_0x6edb('0x24')](_0x5a84bd)[_0x6edb('0x25')](function(_0x180db7){return _0x180db7;});}return null;};}function removeEntity(_0x390455,_0x2e5190){return function(_0x3fd4e1){if(_0x3fd4e1){return _0x3fd4e1[_0x6edb('0x26')]()['then'](function(){_0x390455[_0x6edb('0x1c')](0xcc)[_0x6edb('0x1d')]();});}};}function handleEntityNotFound(_0x334aec,_0x1cbd56){return function(_0x2a02ce){if(!_0x2a02ce){_0x334aec['sendStatus'](0x194);}return _0x2a02ce;};}function handleError(_0x491f88,_0x391719){_0x391719=_0x391719||0x1f4;return function(_0x3e131f){logger[_0x6edb('0x27')](_0x3e131f['stack']);if(_0x3e131f['name']){delete _0x3e131f[_0x6edb('0x28')];}_0x491f88[_0x6edb('0x1c')](_0x391719)[_0x6edb('0x29')](_0x3e131f);};}exports[_0x6edb('0x2a')]=function(_0xfeaf22,_0x12e598){var _0x2879bd={},_0x591c36={},_0x49464a={'count':0x0,'rows':[]};var _0x209c49=_[_0x6edb('0x2b')](db['ChatInternalMessage'][_0x6edb('0x2c')],function(_0x3e9486){return{'name':_0x3e9486[_0x6edb('0x2d')],'type':_0x3e9486[_0x6edb('0x2e')][_0x6edb('0x2f')]};});_0x591c36[_0x6edb('0x30')]=_[_0x6edb('0x2b')](_0x209c49,_0x6edb('0x28'));_0x591c36[_0x6edb('0x31')]=_[_0x6edb('0x32')](_0xfeaf22['query']);_0x591c36[_0x6edb('0x33')]=_[_0x6edb('0x34')](_0x591c36[_0x6edb('0x30')],_0x591c36['query']);_0x2879bd[_0x6edb('0x35')]=_[_0x6edb('0x34')](_0x591c36[_0x6edb('0x30')],qs[_0x6edb('0x36')](_0xfeaf22['query']['fields']));_0x2879bd[_0x6edb('0x35')]=_0x2879bd[_0x6edb('0x35')][_0x6edb('0x37')]?_0x2879bd[_0x6edb('0x35')]:_0x591c36['model'];if(!_0xfeaf22[_0x6edb('0x31')][_0x6edb('0x38')](_0x6edb('0x39'))){_0x2879bd['limit']=qs['limit'](_0xfeaf22['query'][_0x6edb('0x21')]);_0x2879bd[_0x6edb('0x1f')]=qs['offset'](_0xfeaf22[_0x6edb('0x31')][_0x6edb('0x1f')]);}_0x2879bd['order']=qs[_0x6edb('0x3a')](_0xfeaf22['query'][_0x6edb('0x3a')]);_0x2879bd[_0x6edb('0x3b')]=qs[_0x6edb('0x33')](_[_0x6edb('0x3c')](_0xfeaf22[_0x6edb('0x31')],_0x591c36['filters']),_0x209c49);if(_0xfeaf22[_0x6edb('0x31')]['filter']){_0x2879bd['where']=_['merge'](_0x2879bd[_0x6edb('0x3b')],{'$or':_[_0x6edb('0x2b')](_0x209c49,function(_0x34b893){if(_0x34b893[_0x6edb('0x2e')]!==_0x6edb('0x3d')){var _0x2e452f={};_0x2e452f[_0x34b893[_0x6edb('0x28')]]={'$like':'%'+_0xfeaf22[_0x6edb('0x31')][_0x6edb('0x3e')]+'%'};return _0x2e452f;}})});}_0x2879bd=_[_0x6edb('0x3f')]({},_0x2879bd,_0xfeaf22[_0x6edb('0x40')]);var _0x35374a={'where':_0x2879bd[_0x6edb('0x3b')]};return db[_0x6edb('0x41')][_0x6edb('0x22')](_0x35374a)[_0x6edb('0x25')](function(_0x1f7389){_0x49464a[_0x6edb('0x22')]=_0x1f7389;if(_0xfeaf22['query'][_0x6edb('0x42')]){_0x2879bd['include']=[{'all':!![]}];}return db[_0x6edb('0x41')][_0x6edb('0x43')](_0x2879bd);})[_0x6edb('0x25')](function(_0x3527fa){_0x49464a[_0x6edb('0x44')]=_0x3527fa;return _0x49464a;})['then'](respondWithFilteredResult(_0x12e598,_0x2879bd))['catch'](handleError(_0x12e598,null));};exports[_0x6edb('0x45')]=function(_0x3dd1f5,_0x3bcc7b){var _0x479101={'raw':!![],'where':{'id':_0x3dd1f5[_0x6edb('0x46')]['id']}},_0x17cae7={};_0x17cae7['model']=_['keys'](db[_0x6edb('0x41')][_0x6edb('0x2c')]);_0x17cae7['query']=_[_0x6edb('0x32')](_0x3dd1f5[_0x6edb('0x31')]);_0x17cae7['filters']=_[_0x6edb('0x34')](_0x17cae7[_0x6edb('0x30')],_0x17cae7[_0x6edb('0x31')]);_0x479101[_0x6edb('0x35')]=_[_0x6edb('0x34')](_0x17cae7[_0x6edb('0x30')],qs[_0x6edb('0x36')](_0x3dd1f5[_0x6edb('0x31')]['fields']));_0x479101['attributes']=_0x479101[_0x6edb('0x35')][_0x6edb('0x37')]?_0x479101[_0x6edb('0x35')]:_0x17cae7[_0x6edb('0x30')];if(_0x3dd1f5[_0x6edb('0x31')][_0x6edb('0x42')]){_0x479101['include']=[{'all':!![]}];}_0x479101=_[_0x6edb('0x3f')]({},_0x479101,_0x3dd1f5['options']);return db['ChatInternalMessage'][_0x6edb('0x47')](_0x479101)[_0x6edb('0x25')](handleEntityNotFound(_0x3bcc7b,null))[_0x6edb('0x25')](respondWithResult(_0x3bcc7b,null))[_0x6edb('0x48')](handleError(_0x3bcc7b,null));};exports['create']=function(_0x1c1f78,_0x3d1414){return db[_0x6edb('0x41')]['create'](_0x1c1f78[_0x6edb('0x49')],{})[_0x6edb('0x25')](respondWithResult(_0x3d1414,0xc9))['catch'](handleError(_0x3d1414,null));};exports[_0x6edb('0x24')]=function(_0x3cc09d,_0x2128a6){if(_0x3cc09d[_0x6edb('0x49')]['id']){delete _0x3cc09d[_0x6edb('0x49')]['id'];}return db[_0x6edb('0x41')][_0x6edb('0x47')]({'where':{'id':_0x3cc09d[_0x6edb('0x46')]['id']}})[_0x6edb('0x25')](handleEntityNotFound(_0x2128a6,null))[_0x6edb('0x25')](saveUpdates(_0x3cc09d['body'],null))[_0x6edb('0x25')](respondWithResult(_0x2128a6,null))['catch'](handleError(_0x2128a6,null));};exports[_0x6edb('0x26')]=function(_0x952fc4,_0x2b0502){return db[_0x6edb('0x41')]['find']({'where':{'id':_0x952fc4[_0x6edb('0x46')]['id']}})[_0x6edb('0x25')](handleEntityNotFound(_0x2b0502,null))['then'](removeEntity(_0x2b0502,null))[_0x6edb('0x48')](handleError(_0x2b0502,null));};exports[_0x6edb('0x4a')]=function(_0x4dd832,_0x9b2da3){return db[_0x6edb('0x41')][_0x6edb('0x4a')]()[_0x6edb('0x25')](respondWithResult(_0x9b2da3,null))[_0x6edb('0x48')](handleError(_0x9b2da3,null));};function wrapUser(_0x5d993b){return function(_0x12184d){var _0x127e63=_0x5d993b[_0x6edb('0x4b')]({'plain':!![]});_0x127e63[_0x6edb('0x4c')]=[];if(_0x12184d){_0x127e63[_0x6edb('0x4d')]=_0x12184d['createdAt'];_0x127e63[_0x6edb('0x4e')]=_0x12184d;}else{_0x127e63[_0x6edb('0x4d')]=moment(0x0)[_0x6edb('0x4f')](_0x6edb('0x50'));_0x127e63['lastMessage']={};}return _0x127e63;};}exports['getUsers']=function(_0x2b6195,_0x12cfe3,_0x557280){var _0x3f1839=[];return db[_0x6edb('0x51')][_0x6edb('0x43')]({'where':{'role':[_0x6edb('0x52'),_0x6edb('0x53'),_0x6edb('0x54')]},'attributes':['id',_0x6edb('0x55'),_0x6edb('0x28'),'role',_0x6edb('0x56'),_0x6edb('0x57'),_0x6edb('0x58'),'lastLoginAt',_0x6edb('0x59'),_0x6edb('0x5a')],'order':qs[_0x6edb('0x3a')](_0x6edb('0x5b')),'include':[{'model':db[_0x6edb('0x5c')],'as':_0x6edb('0x5d'),'attributes':['id',_0x6edb('0x28'),'type'],'through':{'attributes':[]}}]})[_0x6edb('0x25')](function(_0x1a709e){if(_0x1a709e){var _0x2f6b8b=_0x2b6195[_0x6edb('0x54')][_0x6edb('0x4b')]({'plain':!![]});if(!_0x2f6b8b)throw new Error(_0x6edb('0x5e'));if(_0x2f6b8b[_0x6edb('0x5f')]===_0x6edb('0x54')){return db[_0x6edb('0x60')][_0x6edb('0x47')]({'where':{'name':_0x6edb('0x61'),'userProfileId':_0x2f6b8b[_0x6edb('0x62')]},'raw':!![]})[_0x6edb('0x25')](function(_0x5b92d6){if(_0x5b92d6){if(_0x5b92d6[_0x6edb('0x63')]===0x0){return db[_0x6edb('0x64')]['findAll']({'where':{'sectionId':_0x5b92d6['id']},'raw':!![]})[_0x6edb('0x25')](function(_0x349a10){var _0x2c8bda=[];if(_[_0x6edb('0x65')](_0x349a10)){_0x2c8bda=_[_0x6edb('0x3e')](_0x1a709e,function(_0x3406d8){if(_0x3406d8[_0x6edb('0x5f')]!=='agent'){return _0x3406d8;}});return _0x2c8bda;}else{for(var _0x480c6d=0x0;_0x480c6d<_0x1a709e[_0x6edb('0x37')];_0x480c6d++){var _0x28232c=_0x1a709e[_0x480c6d];if(_0x28232c['role']===_0x6edb('0x52')){var _0x472136=_[_0x6edb('0x47')](_0x349a10,function(_0x42442d){return _0x42442d[_0x6edb('0x66')]===_0x28232c['id'];});if(_0x472136)_0x2c8bda['push'](_0x28232c);}else{_0x2c8bda[_0x6edb('0x67')](_0x28232c);}}return _0x2c8bda;}});}else{return _0x1a709e;}}else{var _0x28f21e=_[_0x6edb('0x3e')](_0x1a709e,function(_0x5491cd){if(_0x5491cd[_0x6edb('0x5f')]!==_0x6edb('0x52')){return _0x5491cd;}});return _0x28f21e;}});}else{return _0x1a709e;}}})[_0x6edb('0x25')](function(_0x64eabc){var _0x10fb07=[];if(_0x64eabc){_0x3f1839=_0x64eabc;for(var _0x412690=0x0;_0x412690<_0x64eabc['length'];_0x412690+=0x1){_0x3f1839[_0x412690]['messages']=[];_0x10fb07['push'](db[_0x6edb('0x41')][_0x6edb('0x47')]({'where':{'FromId':[_0x2b6195[_0x6edb('0x54')]['id'],_0x64eabc[_0x412690]['id']],'ToId':[_0x2b6195[_0x6edb('0x54')]['id'],_0x64eabc[_0x412690]['id']],'ChatGroupId':null},'attributes':['id',_0x6edb('0x68'),_0x6edb('0x69'),_0x6edb('0x6a'),_0x6edb('0x6b'),'body'],'order':qs[_0x6edb('0x3a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6edb('0x25')](wrapUser(_0x64eabc[_0x412690])));}return BPromise[_0x6edb('0x6c')](_0x10fb07);}return[];})[_0x6edb('0x25')](function(_0x535715){return{'rows':_0x535715,'count':_0x535715['length']};})['then'](respondWithResult(_0x12cfe3,null))[_0x6edb('0x48')](handleError(_0x12cfe3,null));};
\ No newline at end of file
+var _0x10e5=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x4de1c1,_0x34abee){var _0x31774d=function(_0x1a7b17){while(--_0x1a7b17){_0x4de1c1['push'](_0x4de1c1['shift']());}};_0x31774d(++_0x34abee);}(_0x10e5,0x1bc));var _0x510e=function(_0x4973ff,_0x30abe4){_0x4973ff=_0x4973ff-0x0;var _0x4dd6b6=_0x10e5[_0x4973ff];return _0x4dd6b6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x510e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x510e('0x1'));var moment=require(_0x510e('0x2'));var BPromise=require(_0x510e('0x3'));var Mustache=require(_0x510e('0x4'));var util=require(_0x510e('0x5'));var path=require(_0x510e('0x6'));var sox=require(_0x510e('0x7'));var csv=require(_0x510e('0x8'));var ejs=require(_0x510e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x510e('0xa'));var squel=require(_0x510e('0xb'));var crypto=require(_0x510e('0xc'));var jsforce=require(_0x510e('0xd'));var deskjs=require(_0x510e('0xe'));var toCsv=require(_0x510e('0x8'));var querystring=require('querystring');var Papa=require(_0x510e('0xf'));var Redis=require(_0x510e('0x10'));var authService=require(_0x510e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x510e('0x12'));var hardwareService=require(_0x510e('0x13'));var logger=require(_0x510e('0x14'))('api');var utils=require(_0x510e('0x15'));var config=require(_0x510e('0x16'));var licenseUtil=require(_0x510e('0x17'));var db=require('../../mysqldb')['db'];config[_0x510e('0x18')]=_[_0x510e('0x19')](config[_0x510e('0x18')],{'host':_0x510e('0x1a'),'port':0x18eb});var socket=require(_0x510e('0x1b'))(new Redis(config[_0x510e('0x18')]));require(_0x510e('0x1c'))[_0x510e('0x1d')](socket);function respondWithStatusCode(_0x12f27a,_0x1b4977){_0x1b4977=_0x1b4977||0xcc;return function(_0x4b125c){if(_0x4b125c){return _0x12f27a[_0x510e('0x1e')](_0x1b4977);}return _0x12f27a[_0x510e('0x1f')](_0x1b4977)[_0x510e('0x20')]();};}function respondWithResult(_0x54e4b,_0x523e7c){_0x523e7c=_0x523e7c||0xc8;return function(_0x4d7d30){if(_0x4d7d30){return _0x54e4b[_0x510e('0x1f')](_0x523e7c)[_0x510e('0x21')](_0x4d7d30);}};}function respondWithFilteredResult(_0x4b5a7f,_0x1dac4a){return function(_0x383a57){if(_0x383a57){var _0x163fce=typeof _0x1dac4a['offset']===_0x510e('0x22')&&typeof _0x1dac4a[_0x510e('0x23')]==='undefined';var _0x32d58a=_0x383a57[_0x510e('0x24')];var _0x130d05=_0x163fce?0x0:_0x1dac4a[_0x510e('0x25')];var _0x1d8019=_0x163fce?_0x383a57[_0x510e('0x24')]:_0x1dac4a[_0x510e('0x25')]+_0x1dac4a[_0x510e('0x23')];var _0x2e71ae;if(_0x1d8019>=_0x32d58a){_0x1d8019=_0x32d58a;_0x2e71ae=0xc8;}else{_0x2e71ae=0xce;}_0x4b5a7f[_0x510e('0x1f')](_0x2e71ae);return _0x4b5a7f[_0x510e('0x26')](_0x510e('0x27'),_0x130d05+'-'+_0x1d8019+'/'+_0x32d58a)[_0x510e('0x21')](_0x383a57);}return null;};}function patchUpdates(_0x2ad51a){return function(_0x3884a9){try{jsonpatch[_0x510e('0x28')](_0x3884a9,_0x2ad51a,!![]);}catch(_0x44eb1c){return BPromise['reject'](_0x44eb1c);}return _0x3884a9[_0x510e('0x29')]();};}function saveUpdates(_0x338195,_0xd3a239){return function(_0x4e7f47){if(_0x4e7f47){return _0x4e7f47[_0x510e('0x2a')](_0x338195)[_0x510e('0x2b')](function(_0x55cbd0){return _0x55cbd0;});}return null;};}function removeEntity(_0x981872,_0x18400f){return function(_0x1a5fd7){if(_0x1a5fd7){return _0x1a5fd7[_0x510e('0x2c')]()['then'](function(){_0x981872[_0x510e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f5d9d,_0x3f1e11){return function(_0x5d81b2){if(!_0x5d81b2){_0x5f5d9d['sendStatus'](0x194);}return _0x5d81b2;};}function handleError(_0x40117f,_0x501ed4){_0x501ed4=_0x501ed4||0x1f4;return function(_0x388e48){logger[_0x510e('0x2d')](_0x388e48[_0x510e('0x2e')]);if(_0x388e48['name']){delete _0x388e48[_0x510e('0x2f')];}_0x40117f['status'](_0x501ed4)[_0x510e('0x30')](_0x388e48);};}exports[_0x510e('0x31')]=function(_0x523622,_0x3e2b54){var _0x2640c1={},_0x47aaa7={},_0x10cd6f={'count':0x0,'rows':[]};var _0x3643fa=_[_0x510e('0x32')](db[_0x510e('0x33')]['rawAttributes'],function(_0x4666c9){return{'name':_0x4666c9[_0x510e('0x34')],'type':_0x4666c9[_0x510e('0x35')]['key']};});_0x47aaa7[_0x510e('0x36')]=_['map'](_0x3643fa,_0x510e('0x2f'));_0x47aaa7[_0x510e('0x37')]=_[_0x510e('0x38')](_0x523622[_0x510e('0x37')]);_0x47aaa7[_0x510e('0x39')]=_[_0x510e('0x3a')](_0x47aaa7[_0x510e('0x36')],_0x47aaa7['query']);_0x2640c1[_0x510e('0x3b')]=_[_0x510e('0x3a')](_0x47aaa7['model'],qs['fields'](_0x523622[_0x510e('0x37')][_0x510e('0x3c')]));_0x2640c1[_0x510e('0x3b')]=_0x2640c1[_0x510e('0x3b')][_0x510e('0x3d')]?_0x2640c1[_0x510e('0x3b')]:_0x47aaa7[_0x510e('0x36')];if(!_0x523622['query'][_0x510e('0x3e')]('nolimit')){_0x2640c1[_0x510e('0x23')]=qs[_0x510e('0x23')](_0x523622[_0x510e('0x37')][_0x510e('0x23')]);_0x2640c1[_0x510e('0x25')]=qs['offset'](_0x523622[_0x510e('0x37')][_0x510e('0x25')]);}_0x2640c1[_0x510e('0x3f')]=qs[_0x510e('0x40')](_0x523622[_0x510e('0x37')]['sort']);_0x2640c1[_0x510e('0x41')]=qs[_0x510e('0x39')](_['pick'](_0x523622[_0x510e('0x37')],_0x47aaa7['filters']),_0x3643fa);if(_0x523622[_0x510e('0x37')][_0x510e('0x42')]){_0x2640c1[_0x510e('0x41')]=_[_0x510e('0x43')](_0x2640c1['where'],{'$or':_[_0x510e('0x32')](_0x3643fa,function(_0x554d15){if(_0x554d15[_0x510e('0x35')]!==_0x510e('0x44')){var _0x35a972={};_0x35a972[_0x554d15[_0x510e('0x2f')]]={'$like':'%'+_0x523622['query'][_0x510e('0x42')]+'%'};return _0x35a972;}})});}_0x2640c1=_[_0x510e('0x43')]({},_0x2640c1,_0x523622[_0x510e('0x45')]);var _0x1b0065={'where':_0x2640c1['where']};return db[_0x510e('0x33')][_0x510e('0x24')](_0x1b0065)[_0x510e('0x2b')](function(_0x3ee71e){_0x10cd6f[_0x510e('0x24')]=_0x3ee71e;if(_0x523622['query']['includeAll']){_0x2640c1[_0x510e('0x46')]=[{'all':!![]}];}return db[_0x510e('0x33')][_0x510e('0x47')](_0x2640c1);})[_0x510e('0x2b')](function(_0x20679f){_0x10cd6f[_0x510e('0x48')]=_0x20679f;return _0x10cd6f;})[_0x510e('0x2b')](respondWithFilteredResult(_0x3e2b54,_0x2640c1))[_0x510e('0x49')](handleError(_0x3e2b54,null));};exports[_0x510e('0x4a')]=function(_0x4b850d,_0x1fb815){var _0x33b817={'raw':!![],'where':{'id':_0x4b850d[_0x510e('0x4b')]['id']}},_0x4f50ee={};_0x4f50ee[_0x510e('0x36')]=_[_0x510e('0x38')](db['ChatInternalMessage'][_0x510e('0x4c')]);_0x4f50ee[_0x510e('0x37')]=_[_0x510e('0x38')](_0x4b850d[_0x510e('0x37')]);_0x4f50ee[_0x510e('0x39')]=_[_0x510e('0x3a')](_0x4f50ee[_0x510e('0x36')],_0x4f50ee[_0x510e('0x37')]);_0x33b817[_0x510e('0x3b')]=_[_0x510e('0x3a')](_0x4f50ee[_0x510e('0x36')],qs[_0x510e('0x3c')](_0x4b850d[_0x510e('0x37')][_0x510e('0x3c')]));_0x33b817[_0x510e('0x3b')]=_0x33b817[_0x510e('0x3b')][_0x510e('0x3d')]?_0x33b817['attributes']:_0x4f50ee[_0x510e('0x36')];if(_0x4b850d[_0x510e('0x37')][_0x510e('0x4d')]){_0x33b817[_0x510e('0x46')]=[{'all':!![]}];}_0x33b817=_['merge']({},_0x33b817,_0x4b850d[_0x510e('0x45')]);return db['ChatInternalMessage'][_0x510e('0x4e')](_0x33b817)[_0x510e('0x2b')](handleEntityNotFound(_0x1fb815,null))[_0x510e('0x2b')](respondWithResult(_0x1fb815,null))[_0x510e('0x49')](handleError(_0x1fb815,null));};exports['create']=function(_0x184439,_0x151f5a){return db[_0x510e('0x33')][_0x510e('0x4f')](_0x184439[_0x510e('0x50')],{})[_0x510e('0x2b')](respondWithResult(_0x151f5a,0xc9))[_0x510e('0x49')](handleError(_0x151f5a,null));};exports[_0x510e('0x2a')]=function(_0x286ecb,_0x232822){if(_0x286ecb[_0x510e('0x50')]['id']){delete _0x286ecb[_0x510e('0x50')]['id'];}return db[_0x510e('0x33')][_0x510e('0x4e')]({'where':{'id':_0x286ecb[_0x510e('0x4b')]['id']}})[_0x510e('0x2b')](handleEntityNotFound(_0x232822,null))[_0x510e('0x2b')](saveUpdates(_0x286ecb['body'],null))[_0x510e('0x2b')](respondWithResult(_0x232822,null))[_0x510e('0x49')](handleError(_0x232822,null));};exports[_0x510e('0x2c')]=function(_0x241a2f,_0x343fe5){return db[_0x510e('0x33')][_0x510e('0x4e')]({'where':{'id':_0x241a2f[_0x510e('0x4b')]['id']}})[_0x510e('0x2b')](handleEntityNotFound(_0x343fe5,null))[_0x510e('0x2b')](removeEntity(_0x343fe5,null))[_0x510e('0x49')](handleError(_0x343fe5,null));};exports[_0x510e('0x51')]=function(_0x373bb7,_0x292cc3){return db[_0x510e('0x33')][_0x510e('0x51')]()[_0x510e('0x2b')](respondWithResult(_0x292cc3,null))[_0x510e('0x49')](handleError(_0x292cc3,null));};function wrapUser(_0x10b2d2){return function(_0x5b28cf){var _0xacfc0d=_0x10b2d2[_0x510e('0x52')]({'plain':!![]});_0xacfc0d[_0x510e('0x53')]=[];if(_0x5b28cf){_0xacfc0d[_0x510e('0x54')]=_0x5b28cf[_0x510e('0x55')];_0xacfc0d['lastMessage']=_0x5b28cf;}else{_0xacfc0d[_0x510e('0x54')]=moment(0x0)['format'](_0x510e('0x56'));_0xacfc0d['lastMessage']={};}return _0xacfc0d;};}exports[_0x510e('0x57')]=function(_0xc65bf3,_0x9f025f,_0x3861a4){var _0x16c7c7=[];return db[_0x510e('0x58')][_0x510e('0x47')]({'where':{'role':[_0x510e('0x59'),_0x510e('0x5a'),_0x510e('0x5b')]},'attributes':['id',_0x510e('0x5c'),_0x510e('0x2f'),_0x510e('0x5d'),_0x510e('0x5e'),_0x510e('0x5f'),_0x510e('0x60'),_0x510e('0x61'),_0x510e('0x62'),_0x510e('0x63')],'order':qs['sort'](_0x510e('0x64')),'include':[{'model':db[_0x510e('0x65')],'as':_0x510e('0x66'),'attributes':['id',_0x510e('0x2f'),_0x510e('0x35')],'through':{'attributes':[]}}]})[_0x510e('0x2b')](function(_0x3c898a){if(_0x3c898a){var _0x2d8779=_0xc65bf3['user'][_0x510e('0x52')]({'plain':!![]});if(!_0x2d8779)throw new Error(_0x510e('0x67'));if(_0x2d8779[_0x510e('0x5d')]===_0x510e('0x5b')){return db[_0x510e('0x68')][_0x510e('0x4e')]({'where':{'name':_0x510e('0x69'),'userProfileId':_0x2d8779['userProfileId']},'raw':!![]})[_0x510e('0x2b')](function(_0x3daa90){if(_0x3daa90){if(_0x3daa90[_0x510e('0x6a')]===0x0){return db[_0x510e('0x6b')][_0x510e('0x47')]({'where':{'sectionId':_0x3daa90['id']},'raw':!![]})[_0x510e('0x2b')](function(_0x482320){var _0x366c55=[];if(_[_0x510e('0x6c')](_0x482320)){_0x366c55=_[_0x510e('0x42')](_0x3c898a,function(_0x6edd12){if(_0x6edd12[_0x510e('0x5d')]!=='agent'){return _0x6edd12;}});return _0x366c55;}else{for(var _0xc64562=0x0;_0xc64562<_0x3c898a[_0x510e('0x3d')];_0xc64562++){var _0x3e105f=_0x3c898a[_0xc64562];if(_0x3e105f[_0x510e('0x5d')]===_0x510e('0x59')){var _0x2e18bd=_[_0x510e('0x4e')](_0x482320,function(_0x26619d){return _0x26619d[_0x510e('0x6d')]===_0x3e105f['id'];});if(_0x2e18bd)_0x366c55[_0x510e('0x6e')](_0x3e105f);}else{_0x366c55[_0x510e('0x6e')](_0x3e105f);}}return _0x366c55;}});}else{return _0x3c898a;}}else{var _0x254c80=_[_0x510e('0x42')](_0x3c898a,function(_0x11b7af){if(_0x11b7af['role']!==_0x510e('0x59')){return _0x11b7af;}});return _0x254c80;}});}else{return _0x3c898a;}}})['then'](function(_0x39584a){var _0x382c18=[];if(_0x39584a){_0x16c7c7=_0x39584a;for(var _0x4cc5ee=0x0;_0x4cc5ee<_0x39584a[_0x510e('0x3d')];_0x4cc5ee+=0x1){_0x16c7c7[_0x4cc5ee][_0x510e('0x53')]=[];_0x382c18[_0x510e('0x6e')](db[_0x510e('0x33')]['find']({'where':{'FromId':[_0xc65bf3[_0x510e('0x5b')]['id'],_0x39584a[_0x4cc5ee]['id']],'ToId':[_0xc65bf3[_0x510e('0x5b')]['id'],_0x39584a[_0x4cc5ee]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x510e('0x6f'),_0x510e('0x70'),'read',_0x510e('0x50')],'order':qs['sort'](_0x510e('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x510e('0x2b')](wrapUser(_0x39584a[_0x4cc5ee])));}return BPromise[_0x510e('0x72')](_0x382c18);}return[];})[_0x510e('0x2b')](function(_0x23252c){return{'rows':_0x23252c,'count':_0x23252c[_0x510e('0x3d')]};})[_0x510e('0x2b')](respondWithResult(_0x9f025f,null))[_0x510e('0x49')](handleError(_0x9f025f,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ca58f03..1fe5f9f 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 _0x51d7=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x98f760,_0x443bd7){var _0x54f218=function(_0x7a9255){while(--_0x7a9255){_0x98f760['push'](_0x98f760['shift']());}};_0x54f218(++_0x443bd7);}(_0x51d7,0xcf));var _0x751d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x51d7[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x751d('0x0'));var ChatInternalMessage=require(_0x751d('0x1'))['db'][_0x751d('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x751d('0x3')](0x0);var events={'afterCreate':_0x751d('0x4'),'afterUpdate':_0x751d('0x5'),'afterDestroy':_0x751d('0x6')};function emitEvent(_0x3daae0){return function(_0x229d5e,_0x4005a4,_0x281541){ChatInternalMessageEvents[_0x751d('0x7')](_0x3daae0+':'+_0x229d5e['id'],_0x229d5e);ChatInternalMessageEvents[_0x751d('0x7')](_0x3daae0,_0x229d5e);_0x281541(null);};}for(var e in events){if(events[_0x751d('0x8')](e)){var event=events[e];ChatInternalMessage[_0x751d('0x9')](e,emitEvent(event));}}module[_0x751d('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x2d2c=['exports','../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x3b9566,_0x3d253a){var _0x974e63=function(_0x521bcc){while(--_0x521bcc){_0x3b9566['push'](_0x3b9566['shift']());}};_0x974e63(++_0x3d253a);}(_0x2d2c,0xaf));var _0xc2d2=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0x2d2c[_0x5515a7];return _0x43f4bf;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xc2d2('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc2d2('0x1'),'afterDestroy':'remove'};function emitEvent(_0x5e3450){return function(_0x4b189f,_0x3973a8,_0x30677c){ChatInternalMessageEvents[_0xc2d2('0x2')](_0x5e3450+':'+_0x4b189f['id'],_0x4b189f);ChatInternalMessageEvents[_0xc2d2('0x2')](_0x5e3450,_0x4b189f);_0x30677c(null);};}for(var e in events){if(events[_0xc2d2('0x3')](e)){var event=events[e];ChatInternalMessage[_0xc2d2('0x4')](e,emitEvent(event));}}module[_0xc2d2('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 1f63615..41c25f9 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 _0x792c=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3e95a4,_0x5753be){var _0x20aa73=function(_0x4e2299){while(--_0x4e2299){_0x3e95a4['push'](_0x3e95a4['shift']());}};_0x20aa73(++_0x5753be);}(_0x792c,0x180));var _0xc792=function(_0x18432e,_0xcd1583){_0x18432e=_0x18432e-0x0;var _0x47ab2b=_0x792c[_0x18432e];return _0x47ab2b;};'use strict';var _=require(_0xc792('0x0'));var util=require(_0xc792('0x1'));var logger=require(_0xc792('0x2'))('api');var moment=require(_0xc792('0x3'));var BPromise=require(_0xc792('0x4'));var rp=require(_0xc792('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc792('0x6'));var config=require(_0xc792('0x7'));var attributes=require(_0xc792('0x8'));module['exports']=function(_0x4219d8,_0x207d1f){return _0x4219d8[_0xc792('0x9')](_0xc792('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc792('0xb'),'collate':_0xc792('0xc')});};
\ No newline at end of file
+var _0xc013=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','utf8mb4'];(function(_0x42f2f7,_0x4ea2c7){var _0x20efdc=function(_0x3ba38e){while(--_0x3ba38e){_0x42f2f7['push'](_0x42f2f7['shift']());}};_0x20efdc(++_0x4ea2c7);}(_0xc013,0x12c));var _0x3c01=function(_0x164760,_0x5874b0){_0x164760=_0x164760-0x0;var _0x8b91b2=_0xc013[_0x164760];return _0x8b91b2;};'use strict';var _=require(_0x3c01('0x0'));var util=require(_0x3c01('0x1'));var logger=require(_0x3c01('0x2'))('api');var moment=require(_0x3c01('0x3'));var BPromise=require(_0x3c01('0x4'));var rp=require(_0x3c01('0x5'));var fs=require('fs');var path=require(_0x3c01('0x6'));var rimraf=require(_0x3c01('0x7'));var config=require(_0x3c01('0x8'));var attributes=require(_0x3c01('0x9'));module['exports']=function(_0x11fd48,_0x605920){return _0x11fd48['define'](_0x3c01('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c01('0xb'),'collate':_0x3c01('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 30d0992..1344ec1 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 _0x6ed5=['result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x6ed5,0xe2));var _0x56ed=function(_0x2ae115,_0x34fe95){_0x2ae115=_0x2ae115-0x0;var _0x524af6=_0x6ed5[_0x2ae115];return _0x524af6;};'use strict';var _=require(_0x56ed('0x0'));var util=require(_0x56ed('0x1'));var moment=require('moment');var BPromise=require(_0x56ed('0x2'));var rs=require(_0x56ed('0x3'));var fs=require('fs');var Redis=require(_0x56ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x56ed('0x5'));var logger=require('../../config/logger')(_0x56ed('0x6'));var config=require(_0x56ed('0x7'));var jayson=require(_0x56ed('0x8'));var client=jayson[_0x56ed('0x9')][_0x56ed('0xa')]({'port':0x232a});config[_0x56ed('0xb')]=_['defaults'](config[_0x56ed('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x56ed('0xc'))(new Redis(config[_0x56ed('0xb')]));require(_0x56ed('0xd'))[_0x56ed('0xe')](socket);function respondWithRpcPromise(_0x172466,_0x2db585,_0x12183c){return new BPromise(function(_0x5be598,_0x14a61e){return client['request'](_0x172466,_0x12183c)[_0x56ed('0xf')](function(_0x313c75){logger[_0x56ed('0x10')](_0x56ed('0x11'),_0x2db585,_0x56ed('0x12'));logger[_0x56ed('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x2db585,_0x56ed('0x12'),JSON[_0x56ed('0x14')](_0x313c75));if(_0x313c75[_0x56ed('0x15')]){if(_0x313c75[_0x56ed('0x15')][_0x56ed('0x16')]===0x1f4){logger['error'](_0x56ed('0x11'),_0x2db585,_0x313c75[_0x56ed('0x15')][_0x56ed('0x17')]);return _0x14a61e(_0x313c75[_0x56ed('0x15')]['message']);}logger[_0x56ed('0x15')](_0x56ed('0x11'),_0x2db585,_0x313c75[_0x56ed('0x15')][_0x56ed('0x17')]);return _0x5be598(_0x313c75[_0x56ed('0x15')][_0x56ed('0x17')]);}else{logger[_0x56ed('0x10')](_0x56ed('0x11'),_0x2db585,_0x56ed('0x12'));_0x5be598(_0x313c75[_0x56ed('0x18')][_0x56ed('0x17')]);}})['catch'](function(_0x13b852){logger['error'](_0x56ed('0x11'),_0x2db585,_0x13b852);_0x14a61e(_0x13b852);});});}
\ No newline at end of file
+var _0x28e3=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x437564,_0x81b799){var _0x56bc56=function(_0x53b295){while(--_0x53b295){_0x437564['push'](_0x437564['shift']());}};_0x56bc56(++_0x81b799);}(_0x28e3,0x106));var _0x328e=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x28e3[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var moment=require(_0x328e('0x2'));var BPromise=require(_0x328e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x328e('0x4'));var db=require(_0x328e('0x5'))['db'];var utils=require(_0x328e('0x6'));var logger=require(_0x328e('0x7'))(_0x328e('0x8'));var config=require(_0x328e('0x9'));var jayson=require(_0x328e('0xa'));var client=jayson[_0x328e('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x328e('0xc')],{'host':_0x328e('0xd'),'port':0x18eb});var socket=require(_0x328e('0xe'))(new Redis(config[_0x328e('0xc')]));require(_0x328e('0xf'))['register'](socket);function respondWithRpcPromise(_0x30af7c,_0x1b3bb8,_0x2d58e9){return new BPromise(function(_0x5368fb,_0x509c4d){return client['request'](_0x30af7c,_0x2d58e9)[_0x328e('0x10')](function(_0x30d2f4){logger[_0x328e('0x11')](_0x328e('0x12'),_0x1b3bb8,_0x328e('0x13'));logger[_0x328e('0x14')](_0x328e('0x15'),_0x1b3bb8,_0x328e('0x13'),JSON[_0x328e('0x16')](_0x30d2f4));if(_0x30d2f4[_0x328e('0x17')]){if(_0x30d2f4[_0x328e('0x17')]['code']===0x1f4){logger[_0x328e('0x17')](_0x328e('0x12'),_0x1b3bb8,_0x30d2f4[_0x328e('0x17')][_0x328e('0x18')]);return _0x509c4d(_0x30d2f4[_0x328e('0x17')][_0x328e('0x18')]);}logger[_0x328e('0x17')](_0x328e('0x12'),_0x1b3bb8,_0x30d2f4[_0x328e('0x17')]['message']);return _0x5368fb(_0x30d2f4[_0x328e('0x17')][_0x328e('0x18')]);}else{logger[_0x328e('0x11')](_0x328e('0x12'),_0x1b3bb8,_0x328e('0x13'));_0x5368fb(_0x30d2f4[_0x328e('0x19')][_0x328e('0x18')]);}})['catch'](function(_0x43c2c3){logger[_0x328e('0x17')](_0x328e('0x12'),_0x1b3bb8,_0x43c2c3);_0x509c4d(_0x43c2c3);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 36d20da..08866df 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 _0x5aa6=['save','remove','removeListener','register','length','./chatInternalMessage.events'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0x5aa6,0x1e5));var _0x65aa=function(_0x8975f9,_0x27ba9a){_0x8975f9=_0x8975f9-0x0;var _0x218a78=_0x5aa6[_0x8975f9];return _0x218a78;};'use strict';var ChatInternalMessageEvents=require(_0x65aa('0x0'));var events=[_0x65aa('0x1'),_0x65aa('0x2'),'update'];function createListener(_0x375d1f,_0x10736d){return function(_0x473972){_0x10736d['emit'](_0x375d1f,_0x473972);};}function removeListener(_0x54564e,_0x2f2b2c){return function(){ChatInternalMessageEvents[_0x65aa('0x3')](_0x54564e,_0x2f2b2c);};}exports[_0x65aa('0x4')]=function(_0x22f44b){for(var _0x1c7f94=0x0,_0x3f9e38=events[_0x65aa('0x5')];_0x1c7f94<_0x3f9e38;_0x1c7f94++){var _0x28804f=events[_0x1c7f94];var _0x1f28fc=createListener('chatInternalMessage:'+_0x28804f,_0x22f44b);ChatInternalMessageEvents['on'](_0x28804f,_0x1f28fc);}};
\ No newline at end of file
+var _0xefc0=['register','length','./chatInternalMessage.events','save','remove','update','removeListener'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xefc0,0xf0));var _0x0efc=function(_0x56bd89,_0x45b169){_0x56bd89=_0x56bd89-0x0;var _0x186e42=_0xefc0[_0x56bd89];return _0x186e42;};'use strict';var ChatInternalMessageEvents=require(_0x0efc('0x0'));var events=[_0x0efc('0x1'),_0x0efc('0x2'),_0x0efc('0x3')];function createListener(_0x30b8fb,_0x14fd27){return function(_0x531aaa){_0x14fd27['emit'](_0x30b8fb,_0x531aaa);};}function removeListener(_0x3bb031,_0x5a3ffe){return function(){ChatInternalMessageEvents[_0x0efc('0x4')](_0x3bb031,_0x5a3ffe);};}exports[_0x0efc('0x5')]=function(_0x108015){for(var _0x34174a=0x0,_0x2408d2=events[_0x0efc('0x6')];_0x34174a<_0x2408d2;_0x34174a++){var _0x1a2709=events[_0x34174a];var _0x9f1a72=createListener('chatInternalMessage:'+_0x1a2709,_0x108015);ChatInternalMessageEvents['on'](_0x1a2709,_0x9f1a72);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7670e33..4803c77 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 _0xa25b=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa25b,0x1c6));var _0xba25=function(_0xd81df,_0x480f88){_0xd81df=_0xd81df-0x0;var _0x3edbc5=_0xa25b[_0xd81df];return _0x3edbc5;};'use strict';var multer=require(_0xba25('0x0'));var util=require(_0xba25('0x1'));var path=require(_0xba25('0x2'));var timeout=require(_0xba25('0x3'));var express=require(_0xba25('0x4'));var router=express[_0xba25('0x5')]();var fs_extra=require(_0xba25('0x6'));var auth=require(_0xba25('0x7'));var interaction=require(_0xba25('0x8'));var config=require('../../config/environment');var controller=require(_0xba25('0x9'));router[_0xba25('0xa')]('/',auth[_0xba25('0xb')](),controller[_0xba25('0xc')]);router[_0xba25('0xa')](_0xba25('0xd'),auth[_0xba25('0xb')](),controller[_0xba25('0xe')]);router[_0xba25('0xa')](_0xba25('0xf'),auth[_0xba25('0xb')](),controller['getUsers']);router[_0xba25('0xa')](_0xba25('0x10'),auth['isAuthenticated'](),controller['show']);router[_0xba25('0x11')]('/',auth[_0xba25('0xb')](),controller[_0xba25('0x12')]);router[_0xba25('0x13')](_0xba25('0x10'),controller['update']);router[_0xba25('0x14')](_0xba25('0x10'),auth[_0xba25('0xb')](),controller[_0xba25('0x15')]);module[_0xba25('0x16')]=router;
\ No newline at end of file
+var _0x30bf=['delete','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id','show','post','create','put','update'];(function(_0x3ccce0,_0x11194f){var _0x2265f8=function(_0xb6aa6e){while(--_0xb6aa6e){_0x3ccce0['push'](_0x3ccce0['shift']());}};_0x2265f8(++_0x11194f);}(_0x30bf,0xf2));var _0xf30b=function(_0x344708,_0x4244f9){_0x344708=_0x344708-0x0;var _0x59c2d7=_0x30bf[_0x344708];return _0x59c2d7;};'use strict';var multer=require('multer');var util=require(_0xf30b('0x0'));var path=require(_0xf30b('0x1'));var timeout=require(_0xf30b('0x2'));var express=require('express');var router=express[_0xf30b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf30b('0x4'));var config=require(_0xf30b('0x5'));var controller=require(_0xf30b('0x6'));router[_0xf30b('0x7')]('/',auth[_0xf30b('0x8')](),controller['index']);router[_0xf30b('0x7')](_0xf30b('0x9'),auth[_0xf30b('0x8')](),controller[_0xf30b('0xa')]);router['get']('/users',auth[_0xf30b('0x8')](),controller[_0xf30b('0xb')]);router[_0xf30b('0x7')](_0xf30b('0xc'),auth[_0xf30b('0x8')](),controller[_0xf30b('0xd')]);router[_0xf30b('0xe')]('/',auth[_0xf30b('0x8')](),controller[_0xf30b('0xf')]);router[_0xf30b('0x10')](_0xf30b('0xc'),controller[_0xf30b('0x11')]);router[_0xf30b('0x12')](_0xf30b('0xc'),auth[_0xf30b('0x8')](),controller['destroy']);module[_0xf30b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index f239684..103136f 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 _0x1707=['BOOLEAN','out','DATE','STRING','TEXT','sequelize'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x1707,0x1df));var _0x7170=function(_0x2a0de1,_0x1c2565){_0x2a0de1=_0x2a0de1-0x0;var _0x22e916=_0x1707[_0x2a0de1];return _0x22e916;};'use strict';var Sequelize=require(_0x7170('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7170('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7170('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7170('0x2')),'defaultValue':_0x7170('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7170('0x3')]},'providerName':{'type':Sequelize[_0x7170('0x4')]},'providerResponse':{'type':Sequelize[_0x7170('0x5')]}};
\ No newline at end of file
+var _0xdd4f=['DATE','TEXT','sequelize','BOOLEAN','out'];(function(_0x10a41d,_0x1aada0){var _0x864366=function(_0x513932){while(--_0x513932){_0x10a41d['push'](_0x10a41d['shift']());}};_0x864366(++_0x1aada0);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x355422,_0x1311c9){_0x355422=_0x355422-0x0;var _0x597fa8=_0xdd4f[_0x355422];return _0x597fa8;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfdd4('0x2')),'defaultValue':_0xfdd4('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfdd4('0x3')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfdd4('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 9995b8e..a466b23 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 _0xbf98=['fullname','email','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','SIP/%s','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','show','params','keys','include','options','find','create','body','describe','chat-interactions','accept','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0xbf98,0x1a5));var _0x8bf9=function(_0x591e6e,_0x3f466f){_0x591e6e=_0x591e6e-0x0;var _0x279e1c=_0xbf98[_0x591e6e];return _0x279e1c;};'use strict';var emlformat=require(_0x8bf9('0x0'));var rimraf=require(_0x8bf9('0x1'));var zipdir=require(_0x8bf9('0x2'));var jsonpatch=require(_0x8bf9('0x3'));var rp=require(_0x8bf9('0x4'));var moment=require(_0x8bf9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bf9('0x6'));var path=require('path');var sox=require(_0x8bf9('0x7'));var csv=require(_0x8bf9('0x8'));var ejs=require(_0x8bf9('0x9'));var fs=require('fs');var fs_extra=require(_0x8bf9('0xa'));var _=require(_0x8bf9('0xb'));var squel=require(_0x8bf9('0xc'));var crypto=require(_0x8bf9('0xd'));var jsforce=require(_0x8bf9('0xe'));var deskjs=require(_0x8bf9('0xf'));var toCsv=require(_0x8bf9('0x8'));var querystring=require(_0x8bf9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8bf9('0x11'));var as=require(_0x8bf9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bf9('0x13'))('api');var utils=require(_0x8bf9('0x14'));var config=require(_0x8bf9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bf9('0x16'))['db'];config[_0x8bf9('0x17')]=_[_0x8bf9('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8bf9('0x19'))[_0x8bf9('0x1a')](socket);var jayson=require(_0x8bf9('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8bf9('0x1c')][_0x8bf9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4da83e,_0x10b66a,_0xfc96c5,_0x582fa4){return new BPromise(function(_0x45d2d3,_0x1ad5e7){var _0x4d08f8=_0x582fa4||client;return _0x4d08f8['request'](_0x4da83e,_0xfc96c5)[_0x8bf9('0x1e')](function(_0x48f300){logger[_0x8bf9('0x1f')](_0x8bf9('0x20'),_0x10b66a,_0x8bf9('0x21'));logger[_0x8bf9('0x22')](_0x8bf9('0x23'),_0x10b66a,_0x8bf9('0x21'),JSON[_0x8bf9('0x24')](_0x48f300));if(_0x48f300['error']){if(_0x48f300[_0x8bf9('0x25')]['code']===0x1f4){logger[_0x8bf9('0x25')](_0x8bf9('0x20'),_0x10b66a,_0x48f300[_0x8bf9('0x25')][_0x8bf9('0x26')]);return _0x1ad5e7(_0x48f300['error']['message']);}logger[_0x8bf9('0x25')](_0x8bf9('0x20'),_0x10b66a,_0x48f300[_0x8bf9('0x25')][_0x8bf9('0x26')]);return _0x45d2d3(_0x48f300[_0x8bf9('0x25')]['message']);}else{logger['info'](_0x8bf9('0x20'),_0x10b66a,'request\x20sent');_0x45d2d3(_0x48f300[_0x8bf9('0x27')][_0x8bf9('0x26')]);}})[_0x8bf9('0x28')](function(_0x3d5bd2){logger[_0x8bf9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x10b66a,_0x3d5bd2);_0x1ad5e7(_0x3d5bd2);});});}function respondWithStatusCode(_0xcfb2e,_0x33a17f){_0x33a17f=_0x33a17f||0xcc;return function(_0x34d704){if(_0x34d704){return _0xcfb2e[_0x8bf9('0x29')](_0x33a17f);}return _0xcfb2e['status'](_0x33a17f)[_0x8bf9('0x2a')]();};}function respondWithResult(_0x3f640a,_0x8766e1){_0x8766e1=_0x8766e1||0xc8;return function(_0x47cfbe){if(_0x47cfbe){return _0x3f640a[_0x8bf9('0x2b')](_0x8766e1)[_0x8bf9('0x2c')](_0x47cfbe);}};}function respondWithFilteredResult(_0x2a59f6,_0x3497fd){return function(_0x5ac79c){if(_0x5ac79c){var _0x5c66c1=typeof _0x3497fd['offset']===_0x8bf9('0x2d')&&typeof _0x3497fd[_0x8bf9('0x2e')]===_0x8bf9('0x2d');var _0x330da6=_0x5ac79c[_0x8bf9('0x2f')];var _0x5cc056=_0x5c66c1?0x0:_0x3497fd[_0x8bf9('0x30')];var _0x5573fb=_0x5c66c1?_0x5ac79c[_0x8bf9('0x2f')]:_0x3497fd['offset']+_0x3497fd['limit'];var _0x165710;if(_0x5573fb>=_0x330da6){_0x5573fb=_0x330da6;_0x165710=0xc8;}else{_0x165710=0xce;}_0x2a59f6['status'](_0x165710);return _0x2a59f6[_0x8bf9('0x31')](_0x8bf9('0x32'),_0x5cc056+'-'+_0x5573fb+'/'+_0x330da6)[_0x8bf9('0x2c')](_0x5ac79c);}return null;};}function patchUpdates(_0x1275e4){return function(_0x5a5f10){try{jsonpatch['apply'](_0x5a5f10,_0x1275e4,!![]);}catch(_0x2cb19a){return BPromise['reject'](_0x2cb19a);}return _0x5a5f10[_0x8bf9('0x33')]();};}function saveUpdates(_0x91151e,_0x1ebb08){return function(_0x5a4bfa){if(_0x5a4bfa){return _0x5a4bfa[_0x8bf9('0x34')](_0x91151e)[_0x8bf9('0x1e')](function(_0x176748){return _0x176748;});}return null;};}function removeEntity(_0x32b224,_0x182503){return function(_0x53f982){if(_0x53f982){return _0x53f982[_0x8bf9('0x35')]()[_0x8bf9('0x1e')](function(){_0x32b224[_0x8bf9('0x2b')](0xcc)[_0x8bf9('0x2a')]();});}};}function handleEntityNotFound(_0x2010c8,_0x252661){return function(_0x308536){if(!_0x308536){_0x2010c8[_0x8bf9('0x29')](0x194);}return _0x308536;};}function handleError(_0x3feecb,_0xb8e1ae){_0xb8e1ae=_0xb8e1ae||0x1f4;return function(_0x284f6a){logger[_0x8bf9('0x25')](_0x284f6a[_0x8bf9('0x36')]);if(_0x284f6a[_0x8bf9('0x37')]){delete _0x284f6a[_0x8bf9('0x37')];}_0x3feecb[_0x8bf9('0x2b')](_0xb8e1ae)[_0x8bf9('0x38')](_0x284f6a);};}exports[_0x8bf9('0x39')]=function(_0x53e524,_0x16247e){var _0x3bd0ee={},_0x504fa9={},_0x3a20ca={'count':0x0,'rows':[]};var _0x1a890f=_['map'](db[_0x8bf9('0x3a')][_0x8bf9('0x3b')],function(_0x526fe4){return{'name':_0x526fe4[_0x8bf9('0x3c')],'type':_0x526fe4[_0x8bf9('0x3d')][_0x8bf9('0x3e')]};});_0x504fa9[_0x8bf9('0x3f')]=_[_0x8bf9('0x40')](_0x1a890f,'name');_0x504fa9[_0x8bf9('0x41')]=_['keys'](_0x53e524['query']);_0x504fa9[_0x8bf9('0x42')]=_['intersection'](_0x504fa9[_0x8bf9('0x3f')],_0x504fa9[_0x8bf9('0x41')]);_0x3bd0ee['attributes']=_[_0x8bf9('0x43')](_0x504fa9[_0x8bf9('0x3f')],qs[_0x8bf9('0x44')](_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x44')]));_0x3bd0ee[_0x8bf9('0x45')]=_0x3bd0ee[_0x8bf9('0x45')][_0x8bf9('0x46')]?_0x3bd0ee['attributes']:_0x504fa9[_0x8bf9('0x3f')];if(!_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x47')](_0x8bf9('0x48'))){_0x3bd0ee[_0x8bf9('0x2e')]=qs[_0x8bf9('0x2e')](_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x2e')]);_0x3bd0ee['offset']=qs['offset'](_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x30')]);}_0x3bd0ee['order']=qs[_0x8bf9('0x49')](_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x49')]);_0x3bd0ee[_0x8bf9('0x4a')]=qs[_0x8bf9('0x42')](_[_0x8bf9('0x4b')](_0x53e524[_0x8bf9('0x41')],_0x504fa9[_0x8bf9('0x42')]),_0x1a890f);if(_0x53e524[_0x8bf9('0x41')]['filter']){_0x3bd0ee[_0x8bf9('0x4a')]=_[_0x8bf9('0x4c')](_0x3bd0ee['where'],{'$or':_[_0x8bf9('0x40')](_0x1a890f,function(_0x515384){if(_0x515384['type']!==_0x8bf9('0x4d')){var _0x5c3871={};_0x5c3871[_0x515384['name']]={'$like':'%'+_0x53e524['query'][_0x8bf9('0x4e')]+'%'};return _0x5c3871;}})});}_0x3bd0ee=_[_0x8bf9('0x4c')]({},_0x3bd0ee,_0x53e524['options']);var _0x5671bd={'where':_0x3bd0ee[_0x8bf9('0x4a')]};return db[_0x8bf9('0x3a')][_0x8bf9('0x2f')](_0x5671bd)['then'](function(_0x5c6942){_0x3a20ca[_0x8bf9('0x2f')]=_0x5c6942;if(_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x4f')]){_0x3bd0ee['include']=[{'all':!![]}];}return db[_0x8bf9('0x3a')]['findAll'](_0x3bd0ee);})[_0x8bf9('0x1e')](function(_0x1d9a95){_0x3a20ca['rows']=_0x1d9a95;return _0x3a20ca;})[_0x8bf9('0x1e')](respondWithFilteredResult(_0x16247e,_0x3bd0ee))[_0x8bf9('0x28')](handleError(_0x16247e,null));};exports[_0x8bf9('0x50')]=function(_0x4b4631,_0x1909d9){var _0x1c9a8d={'raw':!![],'where':{'id':_0x4b4631[_0x8bf9('0x51')]['id']}},_0x433486={};_0x433486[_0x8bf9('0x3f')]=_['keys'](db[_0x8bf9('0x3a')][_0x8bf9('0x3b')]);_0x433486[_0x8bf9('0x41')]=_[_0x8bf9('0x52')](_0x4b4631[_0x8bf9('0x41')]);_0x433486['filters']=_['intersection'](_0x433486[_0x8bf9('0x3f')],_0x433486[_0x8bf9('0x41')]);_0x1c9a8d[_0x8bf9('0x45')]=_['intersection'](_0x433486[_0x8bf9('0x3f')],qs[_0x8bf9('0x44')](_0x4b4631['query']['fields']));_0x1c9a8d[_0x8bf9('0x45')]=_0x1c9a8d[_0x8bf9('0x45')][_0x8bf9('0x46')]?_0x1c9a8d[_0x8bf9('0x45')]:_0x433486['model'];if(_0x4b4631['query'][_0x8bf9('0x4f')]){_0x1c9a8d[_0x8bf9('0x53')]=[{'all':!![]}];}_0x1c9a8d=_[_0x8bf9('0x4c')]({},_0x1c9a8d,_0x4b4631[_0x8bf9('0x54')]);return db['ChatMessage'][_0x8bf9('0x55')](_0x1c9a8d)[_0x8bf9('0x1e')](handleEntityNotFound(_0x1909d9,null))[_0x8bf9('0x1e')](respondWithResult(_0x1909d9,null))[_0x8bf9('0x28')](handleError(_0x1909d9,null));};exports[_0x8bf9('0x56')]=function(_0x47c0d1,_0x1df739){return db[_0x8bf9('0x3a')]['create'](_0x47c0d1[_0x8bf9('0x57')],{})[_0x8bf9('0x1e')](respondWithResult(_0x1df739,0xc9))[_0x8bf9('0x28')](handleError(_0x1df739,null));};exports[_0x8bf9('0x34')]=function(_0x3c25bf,_0x45900e){if(_0x3c25bf['body']['id']){delete _0x3c25bf[_0x8bf9('0x57')]['id'];}return db[_0x8bf9('0x3a')]['find']({'where':{'id':_0x3c25bf[_0x8bf9('0x51')]['id']}})[_0x8bf9('0x1e')](handleEntityNotFound(_0x45900e,null))['then'](saveUpdates(_0x3c25bf[_0x8bf9('0x57')],null))['then'](respondWithResult(_0x45900e,null))[_0x8bf9('0x28')](handleError(_0x45900e,null));};exports['destroy']=function(_0x599007,_0x4f596a){return db[_0x8bf9('0x3a')][_0x8bf9('0x55')]({'where':{'id':_0x599007['params']['id']}})[_0x8bf9('0x1e')](handleEntityNotFound(_0x4f596a,null))[_0x8bf9('0x1e')](removeEntity(_0x4f596a,null))['catch'](handleError(_0x4f596a,null));};exports[_0x8bf9('0x58')]=function(_0x4bc1d1,_0x4b5b81){return db[_0x8bf9('0x3a')][_0x8bf9('0x58')]()[_0x8bf9('0x1e')](respondWithResult(_0x4b5b81,null))[_0x8bf9('0x28')](handleError(_0x4b5b81,null));};var interaction_log=require(_0x8bf9('0x13'))(_0x8bf9('0x59'));exports[_0x8bf9('0x5a')]=function(_0xd236b5,_0x420d5c,_0x5e056c){var _0x1006c9={'agent':{},'channel':'chat'};if(_0xd236b5[_0x8bf9('0x57')]['id']){delete _0xd236b5[_0x8bf9('0x57')]['id'];}_0xd236b5[_0x8bf9('0x57')][_0x8bf9('0x5b')]=!![];_0xd236b5[_0x8bf9('0x57')][_0x8bf9('0x5c')]=moment()[_0x8bf9('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0xd236b5[_0x8bf9('0x57')][_0x8bf9('0x5e')]=_0xd236b5[_0x8bf9('0x57')]['UserId']||_0xd236b5[_0x8bf9('0x5f')]['id'];_0x1006c9[_0x8bf9('0x60')]['id']=_0xd236b5['body']['UserId'];return db[_0x8bf9('0x3a')][_0x8bf9('0x55')]({'where':{'id':_0xd236b5[_0x8bf9('0x51')]['id'],'UserId':null}})[_0x8bf9('0x1e')](handleEntityNotFound(_0x420d5c,null))['then'](saveUpdates(_0xd236b5['body'],null))[_0x8bf9('0x1e')](function(_0x112b45){if(_0x112b45){_0x1006c9[_0x8bf9('0x26')]=_0x112b45[_0x8bf9('0x61')]({'plain':!![]});return db[_0x8bf9('0x62')][_0x8bf9('0x55')]({'where':{'id':_0x112b45[_0x8bf9('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x420d5c,null))['then'](function(_0xc7c57a){if(_0xc7c57a){return _0xc7c57a[_0x8bf9('0x34')]({'UserId':_0xd236b5[_0x8bf9('0x57')]['UserId'],'read1stAt':_[_0x8bf9('0x64')](_0xc7c57a[_0x8bf9('0x65')])?moment()[_0x8bf9('0x5d')](_0x8bf9('0x66')):undefined});}return null;})['then'](function(_0x22b77c){if(_0x22b77c){_0x1006c9[_0x8bf9('0x67')]=_0x22b77c[_0x8bf9('0x61')]({'plain':!![]});interaction_log[_0x8bf9('0x1f')](_0x8bf9('0x68'),_0xd236b5[_0x8bf9('0x5f')]['id'],_0xd236b5[_0x8bf9('0x5f')][_0x8bf9('0x37')],_0xd236b5[_0x8bf9('0x5f')][_0x8bf9('0x69')],_0x1006c9[_0x8bf9('0x67')]['id'],_0xd236b5['body']?JSON['stringify'](_0xd236b5['body']):_0x8bf9('0x6a'));return respondWithRpcPromise(_0x8bf9('0x6b'),_0x8bf9('0x6c'),_0x1006c9);}return null;})[_0x8bf9('0x1e')](function(_0xa9ad94){var _0x22c658='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa9ad94[_0x8bf9('0x26')][_0x8bf9('0x6d')];return db[_0x8bf9('0x6e')]['query'](_0x22c658,{'type':db[_0x8bf9('0x6f')][_0x8bf9('0x70')][_0x8bf9('0x71')],'raw':!![]})[_0x8bf9('0x1e')](function(_0x2b87cc){return _0x2b87cc;});})[_0x8bf9('0x1e')](function(_0x524389){if(_0x524389){_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x72')]=_0x524389[0x0];if(!_0xd236b5[_0x8bf9('0x57')][_0x8bf9('0x5e')])return;return db['User'][_0x8bf9('0x55')]({'where':{'id':_0xd236b5[_0x8bf9('0x57')]['UserId'],'role':_0x8bf9('0x60')},'attributes':['id',_0x8bf9('0x37'),_0x8bf9('0x73'),_0x8bf9('0x74'),_0x8bf9('0x75')],'raw':!![]});}return null;})[_0x8bf9('0x1e')](function(_0xf24dba){if(!_0xf24dba)return null;_0x1006c9['message'][_0x8bf9('0x60')]=_0xf24dba;return _0x1006c9;})['then'](function(_0x2af951){if(_0x2af951){if(_0xd236b5[_0x8bf9('0x57')]['manual']){_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x76')]=util[_0x8bf9('0x5d')]('SIP/%s',_0xd236b5[_0x8bf9('0x5f')][_0x8bf9('0x37')]);_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x77')]=_0x1006c9[_0x8bf9('0x77')];_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x78')]=_0x1006c9[_0x8bf9('0x77')];_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x79')]=_0x8bf9('0x5a');return respondWithRpcPromise(_0x8bf9('0x7a'),'EventManager',{'event':_0x8bf9('0x7b'),'message':_[_0x8bf9('0x4c')](_0x1006c9[_0x8bf9('0x26')],JSON['parse'](_0x1006c9[_0x8bf9('0x67')][_0x8bf9('0x7c')]))},client9002)[_0x8bf9('0x1e')](function(){return _0x1006c9;});}return _0x1006c9;}return null;})['then'](respondWithResult(_0x420d5c,null))[_0x8bf9('0x28')](handleError(_0x420d5c,null));};var interaction_log=require(_0x8bf9('0x13'))(_0x8bf9('0x59'));exports[_0x8bf9('0x7d')]=function(_0x539e70,_0x3d8aea,_0x8cf51b){var _0x4a1464={'agent':{},'channel':_0x8bf9('0x7e')};if(_0x539e70['body']['id']){delete _0x539e70[_0x8bf9('0x57')]['id'];}_0x539e70[_0x8bf9('0x57')][_0x8bf9('0x5e')]=_0x539e70[_0x8bf9('0x57')][_0x8bf9('0x5e')]||_0x539e70[_0x8bf9('0x5f')]['id'];_0x4a1464['agent']['id']=_0x539e70[_0x8bf9('0x57')][_0x8bf9('0x5e')];return db['ChatMessage'][_0x8bf9('0x55')]({'where':{'id':_0x539e70['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3d8aea,null))[_0x8bf9('0x1e')](function(_0x55905a){if(_0x55905a){_0x4a1464['message']=_0x55905a[_0x8bf9('0x61')]({'plain':!![]});return db[_0x8bf9('0x62')][_0x8bf9('0x55')]({'where':{'id':_0x55905a[_0x8bf9('0x63')]}});}return null;})[_0x8bf9('0x1e')](handleEntityNotFound(_0x3d8aea,null))[_0x8bf9('0x1e')](function(_0x525e4f){if(_0x525e4f){_0x4a1464[_0x8bf9('0x67')]=_0x525e4f[_0x8bf9('0x61')]({'plain':!![]});interaction_log['info'](_0x8bf9('0x7f'),_0x539e70[_0x8bf9('0x5f')]['id'],_0x539e70[_0x8bf9('0x5f')][_0x8bf9('0x37')],_0x539e70[_0x8bf9('0x5f')][_0x8bf9('0x69')],_0x4a1464[_0x8bf9('0x67')]['id'],_0x539e70[_0x8bf9('0x57')]?JSON['stringify'](_0x539e70['body']):_0x8bf9('0x6a'));return respondWithRpcPromise(_0x8bf9('0x80'),_0x8bf9('0x81'),_0x4a1464);}return null;})[_0x8bf9('0x1e')](function(_0x42a801){var _0x48b006='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x42a801['message'][_0x8bf9('0x6d')];return db['sequelize']['query'](_0x48b006,{'type':db['Sequelize'][_0x8bf9('0x70')][_0x8bf9('0x71')],'raw':!![]})['then'](function(_0x4593e5){return _0x4593e5;});})[_0x8bf9('0x1e')](function(_0x32d323){if(_0x32d323){_0x4a1464[_0x8bf9('0x26')]['contact']=_0x32d323[0x0];if(!_0x539e70[_0x8bf9('0x57')][_0x8bf9('0x5e')])return;return db[_0x8bf9('0x82')][_0x8bf9('0x55')]({'where':{'id':_0x539e70['body']['UserId'],'role':_0x8bf9('0x60')},'attributes':['id',_0x8bf9('0x37'),'fullname',_0x8bf9('0x74'),_0x8bf9('0x75')],'raw':!![]});}return null;})[_0x8bf9('0x1e')](function(_0x310990){if(!_0x310990)return null;_0x4a1464[_0x8bf9('0x26')]['agent']=_0x310990;return _0x4a1464;})[_0x8bf9('0x1e')](function(_0x1bdce8){if(_0x1bdce8){_0x1bdce8['message'][_0x8bf9('0x76')]=util[_0x8bf9('0x5d')](_0x8bf9('0x83'),_0x539e70[_0x8bf9('0x5f')]['name']);_0x1bdce8[_0x8bf9('0x26')][_0x8bf9('0x77')]=_0x4a1464[_0x8bf9('0x77')];_0x1bdce8[_0x8bf9('0x26')][_0x8bf9('0x78')]=_0x4a1464[_0x8bf9('0x77')];_0x1bdce8[_0x8bf9('0x26')][_0x8bf9('0x79')]='reject';respondWithRpcPromise(_0x8bf9('0x7a'),'EventManager',{'event':_0x8bf9('0x84'),'message':_['merge'](_0x4a1464[_0x8bf9('0x26')],JSON[_0x8bf9('0x85')](_0x4a1464[_0x8bf9('0x67')][_0x8bf9('0x7c')]))},client9002);return _0x4a1464;}return null;})[_0x8bf9('0x1e')](respondWithResult(_0x3d8aea,null))[_0x8bf9('0x28')](handleError(_0x3d8aea,null));};
\ No newline at end of file
+var _0xc86b=['rows','show','params','keys','find','body','describe','accept','chat','read','readAt','format','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','reject','get','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','contact','internal','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','ChatMessage','includeAll','include'];(function(_0xdb2727,_0xce46aa){var _0x36d766=function(_0x62a5a7){while(--_0x62a5a7){_0xdb2727['push'](_0xdb2727['shift']());}};_0x36d766(++_0xce46aa);}(_0xc86b,0x1cd));var _0xbc86=function(_0x41a489,_0x53545a){_0x41a489=_0x41a489-0x0;var _0x5a5365=_0xc86b[_0x41a489];return _0x5a5365;};'use strict';var emlformat=require(_0xbc86('0x0'));var rimraf=require(_0xbc86('0x1'));var zipdir=require(_0xbc86('0x2'));var jsonpatch=require(_0xbc86('0x3'));var rp=require(_0xbc86('0x4'));var moment=require(_0xbc86('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbc86('0x6'));var sox=require(_0xbc86('0x7'));var csv=require(_0xbc86('0x8'));var ejs=require(_0xbc86('0x9'));var fs=require('fs');var fs_extra=require(_0xbc86('0xa'));var _=require(_0xbc86('0xb'));var squel=require(_0xbc86('0xc'));var crypto=require(_0xbc86('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbc86('0xe'));var toCsv=require(_0xbc86('0x8'));var querystring=require('querystring');var Papa=require(_0xbc86('0xf'));var Redis=require(_0xbc86('0x10'));var authService=require(_0xbc86('0x11'));var qs=require(_0xbc86('0x12'));var as=require(_0xbc86('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc86('0x14'))(_0xbc86('0x15'));var utils=require(_0xbc86('0x16'));var config=require(_0xbc86('0x17'));var licenseUtil=require(_0xbc86('0x18'));var db=require(_0xbc86('0x19'))['db'];config[_0xbc86('0x1a')]=_[_0xbc86('0x1b')](config[_0xbc86('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xbc86('0x1c'))(new Redis(config[_0xbc86('0x1a')]));require(_0xbc86('0x1d'))[_0xbc86('0x1e')](socket);var jayson=require(_0xbc86('0x1f'));var client=jayson[_0xbc86('0x20')][_0xbc86('0x21')]({'port':0x232c});var client9002=jayson[_0xbc86('0x20')][_0xbc86('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5a0fa1,_0xb3473d,_0x58b2f3,_0x536be5){return new BPromise(function(_0x18e01c,_0x68f173){var _0x5dd72c=_0x536be5||client;return _0x5dd72c[_0xbc86('0x22')](_0x5a0fa1,_0x58b2f3)[_0xbc86('0x23')](function(_0x2ddb0f){logger[_0xbc86('0x24')](_0xbc86('0x25'),_0xb3473d,_0xbc86('0x26'));logger[_0xbc86('0x27')](_0xbc86('0x28'),_0xb3473d,_0xbc86('0x26'),JSON[_0xbc86('0x29')](_0x2ddb0f));if(_0x2ddb0f['error']){if(_0x2ddb0f[_0xbc86('0x2a')][_0xbc86('0x2b')]===0x1f4){logger[_0xbc86('0x2a')](_0xbc86('0x25'),_0xb3473d,_0x2ddb0f[_0xbc86('0x2a')][_0xbc86('0x2c')]);return _0x68f173(_0x2ddb0f['error'][_0xbc86('0x2c')]);}logger[_0xbc86('0x2a')](_0xbc86('0x25'),_0xb3473d,_0x2ddb0f[_0xbc86('0x2a')][_0xbc86('0x2c')]);return _0x18e01c(_0x2ddb0f[_0xbc86('0x2a')][_0xbc86('0x2c')]);}else{logger[_0xbc86('0x24')](_0xbc86('0x25'),_0xb3473d,_0xbc86('0x26'));_0x18e01c(_0x2ddb0f[_0xbc86('0x2d')]['message']);}})[_0xbc86('0x2e')](function(_0x139531){logger[_0xbc86('0x2a')](_0xbc86('0x25'),_0xb3473d,_0x139531);_0x68f173(_0x139531);});});}function respondWithStatusCode(_0x3d69aa,_0x491c63){_0x491c63=_0x491c63||0xcc;return function(_0x4aab9e){if(_0x4aab9e){return _0x3d69aa[_0xbc86('0x2f')](_0x491c63);}return _0x3d69aa['status'](_0x491c63)[_0xbc86('0x30')]();};}function respondWithResult(_0xdaa3e6,_0x5c105e){_0x5c105e=_0x5c105e||0xc8;return function(_0xf9892){if(_0xf9892){return _0xdaa3e6[_0xbc86('0x31')](_0x5c105e)[_0xbc86('0x32')](_0xf9892);}};}function respondWithFilteredResult(_0x5a91a6,_0x3af7dc){return function(_0x1e86a7){if(_0x1e86a7){var _0x3263f9=typeof _0x3af7dc[_0xbc86('0x33')]===_0xbc86('0x34')&&typeof _0x3af7dc[_0xbc86('0x35')]===_0xbc86('0x34');var _0x4e7159=_0x1e86a7[_0xbc86('0x36')];var _0x15c061=_0x3263f9?0x0:_0x3af7dc['offset'];var _0x302494=_0x3263f9?_0x1e86a7[_0xbc86('0x36')]:_0x3af7dc[_0xbc86('0x33')]+_0x3af7dc[_0xbc86('0x35')];var _0x3f73a1;if(_0x302494>=_0x4e7159){_0x302494=_0x4e7159;_0x3f73a1=0xc8;}else{_0x3f73a1=0xce;}_0x5a91a6[_0xbc86('0x31')](_0x3f73a1);return _0x5a91a6[_0xbc86('0x37')]('Content-Range',_0x15c061+'-'+_0x302494+'/'+_0x4e7159)[_0xbc86('0x32')](_0x1e86a7);}return null;};}function patchUpdates(_0x1d3ee7){return function(_0x16eabe){try{jsonpatch[_0xbc86('0x38')](_0x16eabe,_0x1d3ee7,!![]);}catch(_0x202c74){return BPromise['reject'](_0x202c74);}return _0x16eabe[_0xbc86('0x39')]();};}function saveUpdates(_0x3a9bbd,_0x24d59f){return function(_0x29a9e3){if(_0x29a9e3){return _0x29a9e3[_0xbc86('0x3a')](_0x3a9bbd)[_0xbc86('0x23')](function(_0x2e5d04){return _0x2e5d04;});}return null;};}function removeEntity(_0x4754ab,_0xaa6d76){return function(_0x454e5f){if(_0x454e5f){return _0x454e5f[_0xbc86('0x3b')]()[_0xbc86('0x23')](function(){_0x4754ab[_0xbc86('0x31')](0xcc)[_0xbc86('0x30')]();});}};}function handleEntityNotFound(_0x48eff7,_0xf78760){return function(_0x350083){if(!_0x350083){_0x48eff7[_0xbc86('0x2f')](0x194);}return _0x350083;};}function handleError(_0x270d35,_0x2aae74){_0x2aae74=_0x2aae74||0x1f4;return function(_0x19715b){logger[_0xbc86('0x2a')](_0x19715b[_0xbc86('0x3c')]);if(_0x19715b[_0xbc86('0x3d')]){delete _0x19715b[_0xbc86('0x3d')];}_0x270d35[_0xbc86('0x31')](_0x2aae74)['send'](_0x19715b);};}exports[_0xbc86('0x3e')]=function(_0x5cd983,_0x58fb7e){var _0x34d322={},_0x3ea317={},_0x36ce9b={'count':0x0,'rows':[]};var _0x20c19b=_['map'](db['ChatMessage'][_0xbc86('0x3f')],function(_0x57a206){return{'name':_0x57a206[_0xbc86('0x40')],'type':_0x57a206[_0xbc86('0x41')][_0xbc86('0x42')]};});_0x3ea317[_0xbc86('0x43')]=_[_0xbc86('0x44')](_0x20c19b,_0xbc86('0x3d'));_0x3ea317[_0xbc86('0x45')]=_['keys'](_0x5cd983['query']);_0x3ea317[_0xbc86('0x46')]=_[_0xbc86('0x47')](_0x3ea317['model'],_0x3ea317['query']);_0x34d322[_0xbc86('0x48')]=_['intersection'](_0x3ea317[_0xbc86('0x43')],qs[_0xbc86('0x49')](_0x5cd983[_0xbc86('0x45')][_0xbc86('0x49')]));_0x34d322[_0xbc86('0x48')]=_0x34d322['attributes'][_0xbc86('0x4a')]?_0x34d322[_0xbc86('0x48')]:_0x3ea317[_0xbc86('0x43')];if(!_0x5cd983[_0xbc86('0x45')][_0xbc86('0x4b')]('nolimit')){_0x34d322['limit']=qs[_0xbc86('0x35')](_0x5cd983['query'][_0xbc86('0x35')]);_0x34d322[_0xbc86('0x33')]=qs[_0xbc86('0x33')](_0x5cd983[_0xbc86('0x45')][_0xbc86('0x33')]);}_0x34d322[_0xbc86('0x4c')]=qs[_0xbc86('0x4d')](_0x5cd983[_0xbc86('0x45')]['sort']);_0x34d322['where']=qs[_0xbc86('0x46')](_[_0xbc86('0x4e')](_0x5cd983[_0xbc86('0x45')],_0x3ea317[_0xbc86('0x46')]),_0x20c19b);if(_0x5cd983[_0xbc86('0x45')][_0xbc86('0x4f')]){_0x34d322['where']=_['merge'](_0x34d322[_0xbc86('0x50')],{'$or':_['map'](_0x20c19b,function(_0x5b7711){if(_0x5b7711[_0xbc86('0x41')]!==_0xbc86('0x51')){var _0x2eee7c={};_0x2eee7c[_0x5b7711['name']]={'$like':'%'+_0x5cd983[_0xbc86('0x45')][_0xbc86('0x4f')]+'%'};return _0x2eee7c;}})});}_0x34d322=_[_0xbc86('0x52')]({},_0x34d322,_0x5cd983[_0xbc86('0x53')]);var _0x2e7966={'where':_0x34d322['where']};return db[_0xbc86('0x54')]['count'](_0x2e7966)[_0xbc86('0x23')](function(_0x3cfaeb){_0x36ce9b[_0xbc86('0x36')]=_0x3cfaeb;if(_0x5cd983[_0xbc86('0x45')][_0xbc86('0x55')]){_0x34d322[_0xbc86('0x56')]=[{'all':!![]}];}return db[_0xbc86('0x54')]['findAll'](_0x34d322);})[_0xbc86('0x23')](function(_0x37f855){_0x36ce9b[_0xbc86('0x57')]=_0x37f855;return _0x36ce9b;})[_0xbc86('0x23')](respondWithFilteredResult(_0x58fb7e,_0x34d322))[_0xbc86('0x2e')](handleError(_0x58fb7e,null));};exports[_0xbc86('0x58')]=function(_0x274cb1,_0x486fb7){var _0x1ee23a={'raw':!![],'where':{'id':_0x274cb1[_0xbc86('0x59')]['id']}},_0x5c27c9={};_0x5c27c9['model']=_[_0xbc86('0x5a')](db[_0xbc86('0x54')][_0xbc86('0x3f')]);_0x5c27c9[_0xbc86('0x45')]=_[_0xbc86('0x5a')](_0x274cb1['query']);_0x5c27c9['filters']=_[_0xbc86('0x47')](_0x5c27c9[_0xbc86('0x43')],_0x5c27c9['query']);_0x1ee23a[_0xbc86('0x48')]=_[_0xbc86('0x47')](_0x5c27c9[_0xbc86('0x43')],qs[_0xbc86('0x49')](_0x274cb1[_0xbc86('0x45')][_0xbc86('0x49')]));_0x1ee23a[_0xbc86('0x48')]=_0x1ee23a[_0xbc86('0x48')][_0xbc86('0x4a')]?_0x1ee23a[_0xbc86('0x48')]:_0x5c27c9[_0xbc86('0x43')];if(_0x274cb1[_0xbc86('0x45')]['includeAll']){_0x1ee23a['include']=[{'all':!![]}];}_0x1ee23a=_[_0xbc86('0x52')]({},_0x1ee23a,_0x274cb1[_0xbc86('0x53')]);return db[_0xbc86('0x54')][_0xbc86('0x5b')](_0x1ee23a)[_0xbc86('0x23')](handleEntityNotFound(_0x486fb7,null))['then'](respondWithResult(_0x486fb7,null))[_0xbc86('0x2e')](handleError(_0x486fb7,null));};exports['create']=function(_0x37daa7,_0x22ab27){return db['ChatMessage']['create'](_0x37daa7[_0xbc86('0x5c')],{})[_0xbc86('0x23')](respondWithResult(_0x22ab27,0xc9))['catch'](handleError(_0x22ab27,null));};exports[_0xbc86('0x3a')]=function(_0x39f42d,_0x296b20){if(_0x39f42d['body']['id']){delete _0x39f42d['body']['id'];}return db[_0xbc86('0x54')][_0xbc86('0x5b')]({'where':{'id':_0x39f42d[_0xbc86('0x59')]['id']}})['then'](handleEntityNotFound(_0x296b20,null))[_0xbc86('0x23')](saveUpdates(_0x39f42d[_0xbc86('0x5c')],null))[_0xbc86('0x23')](respondWithResult(_0x296b20,null))[_0xbc86('0x2e')](handleError(_0x296b20,null));};exports['destroy']=function(_0x3a5583,_0x507c01){return db[_0xbc86('0x54')]['find']({'where':{'id':_0x3a5583[_0xbc86('0x59')]['id']}})[_0xbc86('0x23')](handleEntityNotFound(_0x507c01,null))[_0xbc86('0x23')](removeEntity(_0x507c01,null))[_0xbc86('0x2e')](handleError(_0x507c01,null));};exports[_0xbc86('0x5d')]=function(_0x41c068,_0x29fc1b){return db[_0xbc86('0x54')][_0xbc86('0x5d')]()[_0xbc86('0x23')](respondWithResult(_0x29fc1b,null))[_0xbc86('0x2e')](handleError(_0x29fc1b,null));};var interaction_log=require(_0xbc86('0x14'))('chat-interactions');exports[_0xbc86('0x5e')]=function(_0x415974,_0x4828ee,_0x1569ea){var _0x29404a={'agent':{},'channel':_0xbc86('0x5f')};if(_0x415974[_0xbc86('0x5c')]['id']){delete _0x415974[_0xbc86('0x5c')]['id'];}_0x415974[_0xbc86('0x5c')][_0xbc86('0x60')]=!![];_0x415974['body'][_0xbc86('0x61')]=moment()[_0xbc86('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x415974[_0xbc86('0x5c')][_0xbc86('0x63')]=_0x415974['body'][_0xbc86('0x63')]||_0x415974[_0xbc86('0x64')]['id'];_0x29404a[_0xbc86('0x65')]['id']=_0x415974['body'][_0xbc86('0x63')];return db[_0xbc86('0x54')][_0xbc86('0x5b')]({'where':{'id':_0x415974[_0xbc86('0x59')]['id'],'UserId':null}})[_0xbc86('0x23')](handleEntityNotFound(_0x4828ee,null))[_0xbc86('0x23')](saveUpdates(_0x415974[_0xbc86('0x5c')],null))['then'](function(_0x3f3bec){if(_0x3f3bec){_0x29404a[_0xbc86('0x2c')]=_0x3f3bec['get']({'plain':!![]});return db[_0xbc86('0x66')][_0xbc86('0x5b')]({'where':{'id':_0x3f3bec[_0xbc86('0x67')]}});}return null;})[_0xbc86('0x23')](handleEntityNotFound(_0x4828ee,null))[_0xbc86('0x23')](function(_0x3b75a7){if(_0x3b75a7){return _0x3b75a7[_0xbc86('0x3a')]({'UserId':_0x415974[_0xbc86('0x5c')][_0xbc86('0x63')],'read1stAt':_[_0xbc86('0x68')](_0x3b75a7[_0xbc86('0x69')])?moment()[_0xbc86('0x62')](_0xbc86('0x6a')):undefined});}return null;})[_0xbc86('0x23')](function(_0xdd8a9){if(_0xdd8a9){_0x29404a[_0xbc86('0x6b')]=_0xdd8a9['get']({'plain':!![]});interaction_log[_0xbc86('0x24')](_0xbc86('0x6c'),_0x415974[_0xbc86('0x64')]['id'],_0x415974[_0xbc86('0x64')]['name'],_0x415974[_0xbc86('0x64')][_0xbc86('0x6d')],_0x29404a['interaction']['id'],_0x415974[_0xbc86('0x5c')]?JSON[_0xbc86('0x29')](_0x415974[_0xbc86('0x5c')]):'null');return respondWithRpcPromise(_0xbc86('0x6e'),_0xbc86('0x6f'),_0x29404a);}return null;})['then'](function(_0x23008c){var _0x1188a0=_0xbc86('0x70')+_0x23008c[_0xbc86('0x2c')]['ContactId'];return db['sequelize'][_0xbc86('0x45')](_0x1188a0,{'type':db['Sequelize']['QueryTypes'][_0xbc86('0x71')],'raw':!![]})[_0xbc86('0x23')](function(_0x48df76){return _0x48df76;});})[_0xbc86('0x23')](function(_0x368f63){if(_0x368f63){_0x29404a[_0xbc86('0x2c')]['contact']=_0x368f63[0x0];if(!_0x415974[_0xbc86('0x5c')][_0xbc86('0x63')])return;return db[_0xbc86('0x72')][_0xbc86('0x5b')]({'where':{'id':_0x415974[_0xbc86('0x5c')][_0xbc86('0x63')],'role':_0xbc86('0x65')},'attributes':['id',_0xbc86('0x3d'),_0xbc86('0x73'),'email','internal'],'raw':!![]});}return null;})[_0xbc86('0x23')](function(_0x5a9e91){if(!_0x5a9e91)return null;_0x29404a['message'][_0xbc86('0x65')]=_0x5a9e91;return _0x29404a;})[_0xbc86('0x23')](function(_0x10537c){if(_0x10537c){if(_0x415974[_0xbc86('0x5c')][_0xbc86('0x74')]){_0x29404a[_0xbc86('0x2c')][_0xbc86('0x75')]=util['format'](_0xbc86('0x76'),_0x415974[_0xbc86('0x64')][_0xbc86('0x3d')]);_0x29404a[_0xbc86('0x2c')]['channel']=_0x29404a[_0xbc86('0x77')];_0x29404a['message'][_0xbc86('0x78')]=_0x29404a[_0xbc86('0x77')];_0x29404a[_0xbc86('0x2c')][_0xbc86('0x79')]=_0xbc86('0x5e');return respondWithRpcPromise(_0xbc86('0x7a'),_0xbc86('0x7a'),{'event':_0xbc86('0x7b'),'message':_[_0xbc86('0x52')](_0x29404a[_0xbc86('0x2c')],JSON[_0xbc86('0x7c')](_0x29404a[_0xbc86('0x6b')]['formData']))},client9002)['then'](function(){return _0x29404a;});}return _0x29404a;}return null;})['then'](respondWithResult(_0x4828ee,null))[_0xbc86('0x2e')](handleError(_0x4828ee,null));};var interaction_log=require('../../config/logger')(_0xbc86('0x7d'));exports[_0xbc86('0x7e')]=function(_0xcf9704,_0x1383e3,_0x4f6e2e){var _0x1ee6c4={'agent':{},'channel':_0xbc86('0x5f')};if(_0xcf9704[_0xbc86('0x5c')]['id']){delete _0xcf9704['body']['id'];}_0xcf9704[_0xbc86('0x5c')][_0xbc86('0x63')]=_0xcf9704[_0xbc86('0x5c')]['UserId']||_0xcf9704[_0xbc86('0x64')]['id'];_0x1ee6c4[_0xbc86('0x65')]['id']=_0xcf9704[_0xbc86('0x5c')][_0xbc86('0x63')];return db[_0xbc86('0x54')][_0xbc86('0x5b')]({'where':{'id':_0xcf9704[_0xbc86('0x59')]['id'],'UserId':null}})[_0xbc86('0x23')](handleEntityNotFound(_0x1383e3,null))[_0xbc86('0x23')](function(_0x2590a7){if(_0x2590a7){_0x1ee6c4[_0xbc86('0x2c')]=_0x2590a7[_0xbc86('0x7f')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x2590a7[_0xbc86('0x67')]}});}return null;})[_0xbc86('0x23')](handleEntityNotFound(_0x1383e3,null))[_0xbc86('0x23')](function(_0x1135c6){if(_0x1135c6){_0x1ee6c4['interaction']=_0x1135c6[_0xbc86('0x7f')]({'plain':!![]});interaction_log[_0xbc86('0x24')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xcf9704[_0xbc86('0x64')]['id'],_0xcf9704[_0xbc86('0x64')][_0xbc86('0x3d')],_0xcf9704['user'][_0xbc86('0x6d')],_0x1ee6c4['interaction']['id'],_0xcf9704[_0xbc86('0x5c')]?JSON[_0xbc86('0x29')](_0xcf9704[_0xbc86('0x5c')]):'null');return respondWithRpcPromise(_0xbc86('0x80'),_0xbc86('0x81'),_0x1ee6c4);}return null;})['then'](function(_0x46c0a5){var _0x7eb224='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46c0a5[_0xbc86('0x2c')][_0xbc86('0x82')];return db[_0xbc86('0x83')]['query'](_0x7eb224,{'type':db[_0xbc86('0x84')]['QueryTypes']['SELECT'],'raw':!![]})[_0xbc86('0x23')](function(_0x417e66){return _0x417e66;});})[_0xbc86('0x23')](function(_0x4aae9f){if(_0x4aae9f){_0x1ee6c4[_0xbc86('0x2c')][_0xbc86('0x85')]=_0x4aae9f[0x0];if(!_0xcf9704['body'][_0xbc86('0x63')])return;return db[_0xbc86('0x72')]['find']({'where':{'id':_0xcf9704[_0xbc86('0x5c')][_0xbc86('0x63')],'role':_0xbc86('0x65')},'attributes':['id',_0xbc86('0x3d'),_0xbc86('0x73'),'email',_0xbc86('0x86')],'raw':!![]});}return null;})[_0xbc86('0x23')](function(_0x39e3ce){if(!_0x39e3ce)return null;_0x1ee6c4[_0xbc86('0x2c')][_0xbc86('0x65')]=_0x39e3ce;return _0x1ee6c4;})[_0xbc86('0x23')](function(_0x113853){if(_0x113853){_0x113853['message'][_0xbc86('0x75')]=util[_0xbc86('0x62')](_0xbc86('0x76'),_0xcf9704[_0xbc86('0x64')][_0xbc86('0x3d')]);_0x113853[_0xbc86('0x2c')][_0xbc86('0x77')]=_0x1ee6c4[_0xbc86('0x77')];_0x113853[_0xbc86('0x2c')][_0xbc86('0x78')]=_0x1ee6c4['channel'];_0x113853[_0xbc86('0x2c')][_0xbc86('0x79')]=_0xbc86('0x7e');respondWithRpcPromise(_0xbc86('0x7a'),_0xbc86('0x7a'),{'event':_0xbc86('0x87'),'message':_[_0xbc86('0x52')](_0x1ee6c4[_0xbc86('0x2c')],JSON[_0xbc86('0x7c')](_0x1ee6c4['interaction'][_0xbc86('0x88')]))},client9002);return _0x1ee6c4;}return null;})[_0xbc86('0x23')](respondWithResult(_0x1383e3,null))[_0xbc86('0x2e')](handleError(_0x1383e3,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c620769..aaa5cbe 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 _0x3337=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x3e5e09,_0x18f56c){var _0x5da589=function(_0x45ee7c){while(--_0x45ee7c){_0x3e5e09['push'](_0x3e5e09['shift']());}};_0x5da589(++_0x18f56c);}(_0x3337,0x130));var _0x7333=function(_0x2b338b,_0x4a06ba){_0x2b338b=_0x2b338b-0x0;var _0x256f66=_0x3337[_0x2b338b];return _0x256f66;};'use strict';var EventEmitter=require(_0x7333('0x0'));var ChatMessage=require(_0x7333('0x1'))['db'][_0x7333('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7333('0x3')](0x0);var events={'afterCreate':_0x7333('0x4'),'afterUpdate':_0x7333('0x5'),'afterDestroy':'remove'};function emitEvent(_0x490e2d){return function(_0x16fb81,_0x1cabb6,_0x6b59fe){ChatMessageEvents[_0x7333('0x6')](_0x490e2d+':'+_0x16fb81['id'],_0x16fb81);ChatMessageEvents[_0x7333('0x6')](_0x490e2d,_0x16fb81);_0x6b59fe(null);};}for(var e in events){if(events[_0x7333('0x7')](e)){var event=events[e];ChatMessage[_0x7333('0x8')](e,emitEvent(event));}}module[_0x7333('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xa433=['emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','update'];(function(_0x1f5e3c,_0x5515ec){var _0x1f0372=function(_0x42d2f9){while(--_0x42d2f9){_0x1f5e3c['push'](_0x1f5e3c['shift']());}};_0x1f0372(++_0x5515ec);}(_0xa433,0xf7));var _0x3a43=function(_0x283845,_0x3e2263){_0x283845=_0x283845-0x0;var _0x3b0b24=_0xa433[_0x283845];return _0x3b0b24;};'use strict';var EventEmitter=require(_0x3a43('0x0'));var ChatMessage=require(_0x3a43('0x1'))['db'][_0x3a43('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3a43('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3a43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x24240e){return function(_0x11aa77,_0x5574e8,_0x4e7bc5){ChatMessageEvents['emit'](_0x24240e+':'+_0x11aa77['id'],_0x11aa77);ChatMessageEvents[_0x3a43('0x5')](_0x24240e,_0x11aa77);_0x4e7bc5(null);};}for(var e in events){if(events[_0x3a43('0x6')](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 0d9bd01..82e53d4 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 _0xb4e5=['FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','createdAt','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body'];(function(_0x15273a,_0xb0393d){var _0x5d9fac=function(_0x3dfa88){while(--_0x3dfa88){_0x15273a['push'](_0x15273a['shift']());}};_0x5d9fac(++_0xb0393d);}(_0xb4e5,0x17a));var _0x5b4e=function(_0x383685,_0x50eadf){_0x383685=_0x383685-0x0;var _0x554106=_0xb4e5[_0x383685];return _0x554106;};'use strict';var _=require('lodash');var util=require(_0x5b4e('0x0'));var logger=require(_0x5b4e('0x1'))(_0x5b4e('0x2'));var moment=require(_0x5b4e('0x3'));var BPromise=require(_0x5b4e('0x4'));var rp=require(_0x5b4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b4e('0x6'));var config=require(_0x5b4e('0x7'));var attributes=require(_0x5b4e('0x8'));module[_0x5b4e('0x9')]=function(_0x3c5c6b,_0x5420b8){return _0x3c5c6b[_0x5b4e('0xa')](_0x5b4e('0xb'),attributes,{'tableName':_0x5b4e('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x5b4e('0xd')],'type':_0x5b4e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4df5fe,_0x1d6ebe,_0x4a1abf){var _0x5501b2=_0x3c5c6b[_0x5b4e('0xf')];var _0x12b231=_0x4df5fe[_0x5b4e('0x10')]({'plain':!![]});if(_0x12b231[_0x5b4e('0x11')][_0x5b4e('0x12')]()==='in'||_0x12b231[_0x5b4e('0x11')][_0x5b4e('0x12')]()===_0x5b4e('0x13')&&!_0x12b231[_0x5b4e('0x14')]&&!_['isNil'](_0x12b231[_0x5b4e('0x15')])){_0x5501b2[_0x5b4e('0x16')][_0x5b4e('0x17')]({'where':{'id':_0x12b231['ChatInteractionId']}})[_0x5b4e('0x18')](function(_0x4ef56f){if(_0x4ef56f){_0x4ef56f['update']({'lastMsgAt':_0x12b231[_0x5b4e('0x19')],'lastMsgDirection':_0x12b231['direction'][_0x5b4e('0x12')]()});}})[_0x5b4e('0x1a')](function(_0x56210f){console['error'](_0x56210f);});}_0x4a1abf();}},'charset':'utf8mb4','collate':_0x5b4e('0x1b')});};
\ No newline at end of file
+var _0x433f=['secret','isNil','findOne','ChatInteractionId','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x433f,0x13c));var _0xf433=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x433f[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xf433('0x0'));var util=require(_0xf433('0x1'));var logger=require(_0xf433('0x2'))(_0xf433('0x3'));var moment=require(_0xf433('0x4'));var BPromise=require('bluebird');var rp=require(_0xf433('0x5'));var fs=require('fs');var path=require(_0xf433('0x6'));var rimraf=require(_0xf433('0x7'));var config=require(_0xf433('0x8'));var attributes=require('./chatMessage.attributes');module[_0xf433('0x9')]=function(_0x5b599e,_0x1f86f1){return _0x5b599e[_0xf433('0xa')](_0xf433('0xb'),attributes,{'tableName':_0xf433('0xc'),'paranoid':![],'indexes':[{'name':_0xf433('0xd'),'fields':[_0xf433('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x631b1b,_0x13408d,_0x1106b0){var _0x38fd0c=_0x5b599e[_0xf433('0xf')];var _0x3deba4=_0x631b1b[_0xf433('0x10')]({'plain':!![]});if(_0x3deba4[_0xf433('0x11')]['toLowerCase']()==='in'||_0x3deba4[_0xf433('0x11')][_0xf433('0x12')]()===_0xf433('0x13')&&!_0x3deba4[_0xf433('0x14')]&&!_[_0xf433('0x15')](_0x3deba4['UserId'])){_0x38fd0c['ChatInteraction'][_0xf433('0x16')]({'where':{'id':_0x3deba4[_0xf433('0x17')]}})['then'](function(_0xc2f494){if(_0xc2f494){_0xc2f494[_0xf433('0x18')]({'lastMsgAt':_0x3deba4['createdAt'],'lastMsgDirection':_0x3deba4[_0xf433('0x11')][_0xf433('0x12')]()});}})['catch'](function(_0x52fd0d){console[_0xf433('0x19')](_0x52fd0d);});}_0x1106b0();}},'charset':_0xf433('0x1a'),'collate':_0xf433('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 9cfb145..4e42b73 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 _0x6b5a=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','raw','then','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x187bc0,_0x41ed6d){var _0x2a6cca=function(_0x326f7b){while(--_0x326f7b){_0x187bc0['push'](_0x187bc0['shift']());}};_0x2a6cca(++_0x41ed6d);}(_0x6b5a,0xd2));var _0xa6b5=function(_0x2256d8,_0x5853cf){_0x2256d8=_0x2256d8-0x0;var _0x2d8c9d=_0x6b5a[_0x2256d8];return _0x2d8c9d;};'use strict';var _=require('lodash');var util=require(_0xa6b5('0x0'));var moment=require(_0xa6b5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6b5('0x2'));var db=require(_0xa6b5('0x3'))['db'];var utils=require(_0xa6b5('0x4'));var logger=require(_0xa6b5('0x5'))('rpc');var config=require(_0xa6b5('0x6'));var jayson=require(_0xa6b5('0x7'));var client=jayson[_0xa6b5('0x8')]['http']({'port':0x232a});config[_0xa6b5('0x9')]=_[_0xa6b5('0xa')](config[_0xa6b5('0x9')],{'host':_0xa6b5('0xb'),'port':0x18eb});var socket=require(_0xa6b5('0xc'))(new Redis(config[_0xa6b5('0x9')]));require(_0xa6b5('0xd'))[_0xa6b5('0xe')](socket);function respondWithRpcPromise(_0x177bdc,_0xd35884,_0x2e740b){return new BPromise(function(_0x4e1b2f,_0xfa0045){return client[_0xa6b5('0xf')](_0x177bdc,_0x2e740b)['then'](function(_0x11a15a){logger[_0xa6b5('0x10')](_0xa6b5('0x11'),_0xd35884,_0xa6b5('0x12'));logger[_0xa6b5('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xd35884,_0xa6b5('0x12'),JSON[_0xa6b5('0x14')](_0x11a15a));if(_0x11a15a['error']){if(_0x11a15a['error']['code']===0x1f4){logger[_0xa6b5('0x15')](_0xa6b5('0x11'),_0xd35884,_0x11a15a[_0xa6b5('0x15')][_0xa6b5('0x16')]);return _0xfa0045(_0x11a15a[_0xa6b5('0x15')][_0xa6b5('0x16')]);}logger[_0xa6b5('0x15')](_0xa6b5('0x11'),_0xd35884,_0x11a15a[_0xa6b5('0x15')]['message']);return _0x4e1b2f(_0x11a15a[_0xa6b5('0x15')][_0xa6b5('0x16')]);}else{logger[_0xa6b5('0x10')](_0xa6b5('0x11'),_0xd35884,_0xa6b5('0x12'));_0x4e1b2f(_0x11a15a[_0xa6b5('0x17')][_0xa6b5('0x16')]);}})[_0xa6b5('0x18')](function(_0x13667d){logger[_0xa6b5('0x15')](_0xa6b5('0x11'),_0xd35884,_0x13667d);_0xfa0045(_0x13667d);});});}exports[_0xa6b5('0x19')]=function(_0x38b441){var _0x42cb8f=this;return new Promise(function(_0x3a1aea,_0x49001a){return db[_0xa6b5('0x1a')][_0xa6b5('0x1b')](_0x38b441[_0xa6b5('0x1c')],{'raw':_0x38b441['options']?_0x38b441['options'][_0xa6b5('0x1d')]===undefined?!![]:![]:!![]})[_0xa6b5('0x1e')](function(_0x1574c1){logger['info']('CreateChatMessage',_0x38b441);logger['debug'](_0xa6b5('0x19'),_0x38b441,JSON['stringify'](_0x1574c1));_0x3a1aea(_0x1574c1);})['catch'](function(_0x3453bc){logger['error'](_0xa6b5('0x19'),_0x3453bc[_0xa6b5('0x16')],_0x38b441);_0x49001a(_0x42cb8f['error'](0x1f4,_0x3453bc['message']));});});};
\ No newline at end of file
+var _0x2718=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','then','stringify'];(function(_0x2ce727,_0x1152e4){var _0x180169=function(_0x32889d){while(--_0x32889d){_0x2ce727['push'](_0x2ce727['shift']());}};_0x180169(++_0x1152e4);}(_0x2718,0x18d));var _0x8271=function(_0x145e13,_0x162d05){_0x145e13=_0x145e13-0x0;var _0x2d0070=_0x2718[_0x145e13];return _0x2d0070;};'use strict';var _=require(_0x8271('0x0'));var util=require(_0x8271('0x1'));var moment=require(_0x8271('0x2'));var BPromise=require(_0x8271('0x3'));var rs=require(_0x8271('0x4'));var fs=require('fs');var Redis=require(_0x8271('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8271('0x6'));var logger=require('../../config/logger')(_0x8271('0x7'));var config=require(_0x8271('0x8'));var jayson=require(_0x8271('0x9'));var client=jayson[_0x8271('0xa')][_0x8271('0xb')]({'port':0x232a});config['redis']=_[_0x8271('0xc')](config[_0x8271('0xd')],{'host':_0x8271('0xe'),'port':0x18eb});var socket=require(_0x8271('0xf'))(new Redis(config[_0x8271('0xd')]));require(_0x8271('0x10'))[_0x8271('0x11')](socket);function respondWithRpcPromise(_0x33a6b4,_0x4edb07,_0x47cb7d){return new BPromise(function(_0x3588e7,_0x267a52){return client['request'](_0x33a6b4,_0x47cb7d)['then'](function(_0x1948ca){logger[_0x8271('0x12')](_0x8271('0x13'),_0x4edb07,_0x8271('0x14'));logger[_0x8271('0x15')](_0x8271('0x16'),_0x4edb07,_0x8271('0x14'),JSON['stringify'](_0x1948ca));if(_0x1948ca[_0x8271('0x17')]){if(_0x1948ca[_0x8271('0x17')][_0x8271('0x18')]===0x1f4){logger[_0x8271('0x17')](_0x8271('0x13'),_0x4edb07,_0x1948ca[_0x8271('0x17')][_0x8271('0x19')]);return _0x267a52(_0x1948ca['error']['message']);}logger[_0x8271('0x17')](_0x8271('0x13'),_0x4edb07,_0x1948ca[_0x8271('0x17')][_0x8271('0x19')]);return _0x3588e7(_0x1948ca[_0x8271('0x17')][_0x8271('0x19')]);}else{logger['info'](_0x8271('0x13'),_0x4edb07,_0x8271('0x14'));_0x3588e7(_0x1948ca[_0x8271('0x1a')][_0x8271('0x19')]);}})['catch'](function(_0x4273ab){logger[_0x8271('0x17')](_0x8271('0x13'),_0x4edb07,_0x4273ab);_0x267a52(_0x4273ab);});});}exports[_0x8271('0x1b')]=function(_0x5b78b7){var _0x343daf=this;return new Promise(function(_0x9ec477,_0x16b691){return db[_0x8271('0x1c')][_0x8271('0x1d')](_0x5b78b7[_0x8271('0x1e')],{'raw':_0x5b78b7[_0x8271('0x1f')]?_0x5b78b7[_0x8271('0x1f')][_0x8271('0x20')]===undefined?!![]:![]:!![]})[_0x8271('0x21')](function(_0x2d6741){logger[_0x8271('0x12')]('CreateChatMessage',_0x5b78b7);logger['debug'](_0x8271('0x1b'),_0x5b78b7,JSON[_0x8271('0x22')](_0x2d6741));_0x9ec477(_0x2d6741);})[_0x8271('0x23')](function(_0x5a70fc){logger[_0x8271('0x17')]('CreateChatMessage',_0x5a70fc[_0x8271('0x19')],_0x5b78b7);_0x16b691(_0x343daf[_0x8271('0x17')](0x1f4,_0x5a70fc[_0x8271('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index a301e19..0f45399 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 _0x19da=['update','register','length','save'];(function(_0x157ed1,_0x4162fb){var _0x4c3f53=function(_0x5a3ba1){while(--_0x5a3ba1){_0x157ed1['push'](_0x157ed1['shift']());}};_0x4c3f53(++_0x4162fb);}(_0x19da,0x9f));var _0xa19d=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x19da[_0x50a0c2];return _0x5ebadd;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa19d('0x0'),'remove',_0xa19d('0x1')];function createListener(_0x5ba569,_0x3a48f4){return function(_0x17f1c6){_0x3a48f4['emit'](_0x5ba569,_0x17f1c6);};}function removeListener(_0x179db7,_0x28ec9a){return function(){ChatMessageEvents['removeListener'](_0x179db7,_0x28ec9a);};}exports[_0xa19d('0x2')]=function(_0x330adb){for(var _0x1f6e10=0x0,_0x14dc68=events[_0xa19d('0x3')];_0x1f6e10<_0x14dc68;_0x1f6e10++){var _0x4b4627=events[_0x1f6e10];var _0x197c4e=createListener('chatMessage:'+_0x4b4627,_0x330adb);ChatMessageEvents['on'](_0x4b4627,_0x197c4e);}};
\ No newline at end of file
+var _0xae1c=['removeListener','register','length','emit'];(function(_0x161ffe,_0x514051){var _0x5bec90=function(_0x55debc){while(--_0x55debc){_0x161ffe['push'](_0x161ffe['shift']());}};_0x5bec90(++_0x514051);}(_0xae1c,0xff));var _0xcae1=function(_0xe5f49c,_0x4959d9){_0xe5f49c=_0xe5f49c-0x0;var _0x392cee=_0xae1c[_0xe5f49c];return _0x392cee;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove','update'];function createListener(_0x1ab262,_0x19e218){return function(_0x3e2e25){_0x19e218[_0xcae1('0x0')](_0x1ab262,_0x3e2e25);};}function removeListener(_0x1d37db,_0x2b6b57){return function(){ChatMessageEvents[_0xcae1('0x1')](_0x1d37db,_0x2b6b57);};}exports[_0xcae1('0x2')]=function(_0x3513e5){for(var _0x40fcec=0x0,_0x3c35c7=events[_0xcae1('0x3')];_0x40fcec<_0x3c35c7;_0x40fcec++){var _0x7a27b8=events[_0x40fcec];var _0x50d451=createListener('chatMessage:'+_0x7a27b8,_0x3513e5);ChatMessageEvents['on'](_0x7a27b8,_0x50d451);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 11aee4b..68d7d14 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 _0xb0e8=['reject','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/:id','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject'];(function(_0x98ee7c,_0x499bff){var _0xe4d709=function(_0x12791a){while(--_0x12791a){_0x98ee7c['push'](_0x98ee7c['shift']());}};_0xe4d709(++_0x499bff);}(_0xb0e8,0xff));var _0x8b0e=function(_0x211087,_0x354fdd){_0x211087=_0x211087-0x0;var _0x2a581f=_0xb0e8[_0x211087];return _0x2a581f;};'use strict';var multer=require(_0x8b0e('0x0'));var util=require(_0x8b0e('0x1'));var path=require(_0x8b0e('0x2'));var timeout=require(_0x8b0e('0x3'));var express=require(_0x8b0e('0x4'));var router=express[_0x8b0e('0x5')]();var fs_extra=require(_0x8b0e('0x6'));var auth=require(_0x8b0e('0x7'));var interaction=require(_0x8b0e('0x8'));var config=require('../../config/environment');var controller=require(_0x8b0e('0x9'));router[_0x8b0e('0xa')]('/',auth[_0x8b0e('0xb')](),controller['index']);router[_0x8b0e('0xa')]('/describe',auth[_0x8b0e('0xb')](),controller['describe']);router[_0x8b0e('0xa')](_0x8b0e('0xc'),auth[_0x8b0e('0xb')](),controller['show']);router[_0x8b0e('0xd')]('/',auth[_0x8b0e('0xb')](),interaction[_0x8b0e('0xe')](_0x8b0e('0xf'),_0x8b0e('0x10')),controller[_0x8b0e('0x11')]);router[_0x8b0e('0x12')](_0x8b0e('0xc'),controller[_0x8b0e('0x13')]);router[_0x8b0e('0x12')]('/:id/accept',auth[_0x8b0e('0xb')](),controller['accept']);router['put'](_0x8b0e('0x14'),auth[_0x8b0e('0xb')](),controller[_0x8b0e('0x15')]);router['delete'](_0x8b0e('0xc'),auth['isAuthenticated'](),controller[_0x8b0e('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xe657=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked','chat','create','put','/:id/accept','accept','reject','delete','destroy','multer','path','connect-timeout'];(function(_0x4fff35,_0x256fed){var _0x13ad17=function(_0x1d43c5){while(--_0x1d43c5){_0x4fff35['push'](_0x4fff35['shift']());}};_0x13ad17(++_0x256fed);}(_0xe657,0x101));var _0x7e65=function(_0x4d9a48,_0x20bc50){_0x4d9a48=_0x4d9a48-0x0;var _0xef464d=_0xe657[_0x4d9a48];return _0xef464d;};'use strict';var multer=require(_0x7e65('0x0'));var util=require('util');var path=require(_0x7e65('0x1'));var timeout=require(_0x7e65('0x2'));var express=require(_0x7e65('0x3'));var router=express[_0x7e65('0x4')]();var fs_extra=require(_0x7e65('0x5'));var auth=require(_0x7e65('0x6'));var interaction=require(_0x7e65('0x7'));var config=require(_0x7e65('0x8'));var controller=require(_0x7e65('0x9'));router[_0x7e65('0xa')]('/',auth['isAuthenticated'](),controller[_0x7e65('0xb')]);router[_0x7e65('0xa')](_0x7e65('0xc'),auth[_0x7e65('0xd')](),controller['describe']);router['get'](_0x7e65('0xe'),auth[_0x7e65('0xd')](),controller[_0x7e65('0xf')]);router[_0x7e65('0x10')]('/',auth[_0x7e65('0xd')](),interaction[_0x7e65('0x11')](_0x7e65('0x12'),'chatmessage:create'),controller[_0x7e65('0x13')]);router['put']('/:id',controller['update']);router[_0x7e65('0x14')](_0x7e65('0x15'),auth[_0x7e65('0xd')](),controller[_0x7e65('0x16')]);router[_0x7e65('0x14')]('/:id/reject',auth[_0x7e65('0xd')](),controller[_0x7e65('0x17')]);router[_0x7e65('0x18')](_0x7e65('0xe'),auth[_0x7e65('0xd')](),controller[_0x7e65('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 2579e67..eb504fa 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x427eed,_0x69d704){var _0x3187bb=function(_0x2d2449){while(--_0x2d2449){_0x427eed['push'](_0x427eed['shift']());}};_0x3187bb(++_0x69d704);}(_0x5f2f,0x73));var _0xf5f2=function(_0x525ef9,_0x12b1c2){_0x525ef9=_0x525ef9-0x0;var _0x5561fb=_0x5f2f[_0x525ef9];return _0x5561fb;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x52c5f3,_0x24adc9){var _0x415968=function(_0x2f08ea){while(--_0x2f08ea){_0x52c5f3['push'](_0x52c5f3['shift']());}};_0x415968(++_0x24adc9);}(_0xadb5,0xad));var _0x5adb=function(_0x3f1d92,_0x3584d8){_0x3f1d92=_0x3f1d92-0x0;var _0x424d8f=_0xadb5[_0x3f1d92];return _0x424d8f;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index a647239..ada18f6 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(_0x5bc6ac,_0x5516c1){var _0x56aef3=function(_0x8fcb2a){while(--_0x8fcb2a){_0x5bc6ac['push'](_0x5bc6ac['shift']());}};_0x56aef3(++_0x5516c1);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 _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(_0x5f57b0,_0xce8c48){var _0x2e774f=function(_0x5a41d7){while(--_0x5a41d7){_0x5f57b0['push'](_0x5f57b0['shift']());}};_0x2e774f(++_0xce8c48);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index a28e7ef..b6ead1d 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 _0xb799=['emit','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb799,0x163));var _0x9b79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb799[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9b79('0x0'))['db'][_0x9b79('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9b79('0x2')](0x0);var events={'afterCreate':_0x9b79('0x3'),'afterUpdate':_0x9b79('0x4'),'afterDestroy':'remove'};function emitEvent(_0x549d07){return function(_0x508557,_0x495997,_0x3f222d){ChatOfflineMessageEvents[_0x9b79('0x5')](_0x549d07+':'+_0x508557['id'],_0x508557);ChatOfflineMessageEvents[_0x9b79('0x5')](_0x549d07,_0x508557);_0x3f222d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x9b79('0x6')](e,emitEvent(event));}}module[_0x9b79('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x2c92=['emit','hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2c92,0x93));var _0x22c9=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x2c92[_0x13cab0];return _0x38804f;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x22c9('0x0'))['db'][_0x22c9('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x22c9('0x2')](0x0);var events={'afterCreate':_0x22c9('0x3'),'afterUpdate':_0x22c9('0x4'),'afterDestroy':_0x22c9('0x5')};function emitEvent(_0x12782d){return function(_0x4bc85f,_0x7b7b2b,_0x1f3877){ChatOfflineMessageEvents[_0x22c9('0x6')](_0x12782d+':'+_0x4bc85f['id'],_0x4bc85f);ChatOfflineMessageEvents[_0x22c9('0x6')](_0x12782d,_0x4bc85f);_0x1f3877(null);};}for(var e in events){if(events[_0x22c9('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x22c9('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 163912b..4e74f29 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 _0xce09=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x22ced5,_0xf8882f){var _0x11e29b=function(_0x40246b){while(--_0x40246b){_0x22ced5['push'](_0x22ced5['shift']());}};_0x11e29b(++_0xf8882f);}(_0xce09,0x1c5));var _0x9ce0=function(_0x23b1fd,_0x347756){_0x23b1fd=_0x23b1fd-0x0;var _0x2bac5d=_0xce09[_0x23b1fd];return _0x2bac5d;};'use strict';var attributes=require(_0x9ce0('0x0'));module['exports']=function(_0x21ba4d){return _0x21ba4d[_0x9ce0('0x1')](_0x9ce0('0x2'),attributes,{'tableName':_0x9ce0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ce0('0x4'),'collate':_0x9ce0('0x5')});};
\ No newline at end of file
+var _0x805f=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x3a686f,_0x5292c4){var _0x21b6e3=function(_0x1ce27c){while(--_0x1ce27c){_0x3a686f['push'](_0x3a686f['shift']());}};_0x21b6e3(++_0x5292c4);}(_0x805f,0xda));var _0xf805=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x805f[_0x122ef9];return _0x42fba0;};'use strict';var attributes=require(_0xf805('0x0'));module['exports']=function(_0x12621a){return _0x12621a[_0xf805('0x1')](_0xf805('0x2'),attributes,{'tableName':_0xf805('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf805('0x4'),'collate':_0xf805('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 1861317..6ca4d2c 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 _0xd8f6=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatOfflineMessage,\x20%s,\x20%s','catch','util','moment'];(function(_0xab3d10,_0x3cbea2){var _0x1b64c7=function(_0x144e62){while(--_0x144e62){_0xab3d10['push'](_0xab3d10['shift']());}};_0x1b64c7(++_0x3cbea2);}(_0xd8f6,0xf0));var _0x6d8f=function(_0x312456,_0x19cd57){_0x312456=_0x312456-0x0;var _0x1b708b=_0xd8f6[_0x312456];return _0x1b708b;};'use strict';var _=require('lodash');var util=require(_0x6d8f('0x0'));var moment=require(_0x6d8f('0x1'));var BPromise=require(_0x6d8f('0x2'));var rs=require(_0x6d8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d8f('0x4'))['db'];var utils=require(_0x6d8f('0x5'));var logger=require(_0x6d8f('0x6'))('rpc');var config=require(_0x6d8f('0x7'));var jayson=require(_0x6d8f('0x8'));var client=jayson[_0x6d8f('0x9')][_0x6d8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ec4ba,_0x3ab3be,_0x5c6ac7){return new BPromise(function(_0x17f33d,_0x166f73){return client[_0x6d8f('0xb')](_0x5ec4ba,_0x5c6ac7)[_0x6d8f('0xc')](function(_0x331e84){logger[_0x6d8f('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3ab3be,_0x6d8f('0xe'));logger['debug'](_0x6d8f('0xf'),_0x3ab3be,_0x6d8f('0xe'),JSON[_0x6d8f('0x10')](_0x331e84));if(_0x331e84['error']){if(_0x331e84['error'][_0x6d8f('0x11')]===0x1f4){logger[_0x6d8f('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3ab3be,_0x331e84[_0x6d8f('0x12')][_0x6d8f('0x13')]);return _0x166f73(_0x331e84[_0x6d8f('0x12')][_0x6d8f('0x13')]);}logger[_0x6d8f('0x12')](_0x6d8f('0x14'),_0x3ab3be,_0x331e84[_0x6d8f('0x12')][_0x6d8f('0x13')]);return _0x17f33d(_0x331e84['error'][_0x6d8f('0x13')]);}else{logger[_0x6d8f('0xd')](_0x6d8f('0x14'),_0x3ab3be,_0x6d8f('0xe'));_0x17f33d(_0x331e84['result']['message']);}})[_0x6d8f('0x15')](function(_0x526f0a){logger[_0x6d8f('0x12')](_0x6d8f('0x14'),_0x3ab3be,_0x526f0a);_0x166f73(_0x526f0a);});});}
\ No newline at end of file
+var _0x1403=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x8fee0f,_0x118ab0){var _0xa5e569=function(_0x3d5a70){while(--_0x3d5a70){_0x8fee0f['push'](_0x8fee0f['shift']());}};_0xa5e569(++_0x118ab0);}(_0x1403,0x153));var _0x3140=function(_0x2273fd,_0x1290c0){_0x2273fd=_0x2273fd-0x0;var _0x46527d=_0x1403[_0x2273fd];return _0x46527d;};'use strict';var _=require(_0x3140('0x0'));var util=require(_0x3140('0x1'));var moment=require(_0x3140('0x2'));var BPromise=require(_0x3140('0x3'));var rs=require(_0x3140('0x4'));var fs=require('fs');var Redis=require(_0x3140('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3140('0x6'));var logger=require(_0x3140('0x7'))(_0x3140('0x8'));var config=require('../../config/environment');var jayson=require(_0x3140('0x9'));var client=jayson[_0x3140('0xa')][_0x3140('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23188b,_0x3d6162,_0x4ea0d2){return new BPromise(function(_0x104eec,_0x59ea50){return client[_0x3140('0xc')](_0x23188b,_0x4ea0d2)[_0x3140('0xd')](function(_0x2d5211){logger[_0x3140('0xe')](_0x3140('0xf'),_0x3d6162,_0x3140('0x10'));logger[_0x3140('0x11')](_0x3140('0x12'),_0x3d6162,_0x3140('0x10'),JSON[_0x3140('0x13')](_0x2d5211));if(_0x2d5211[_0x3140('0x14')]){if(_0x2d5211[_0x3140('0x14')]['code']===0x1f4){logger[_0x3140('0x14')](_0x3140('0xf'),_0x3d6162,_0x2d5211['error'][_0x3140('0x15')]);return _0x59ea50(_0x2d5211[_0x3140('0x14')][_0x3140('0x15')]);}logger['error'](_0x3140('0xf'),_0x3d6162,_0x2d5211[_0x3140('0x14')]['message']);return _0x104eec(_0x2d5211['error']['message']);}else{logger[_0x3140('0xe')](_0x3140('0xf'),_0x3d6162,_0x3140('0x10'));_0x104eec(_0x2d5211['result'][_0x3140('0x15')]);}})['catch'](function(_0x407bab){logger[_0x3140('0x14')](_0x3140('0xf'),_0x3d6162,_0x407bab);_0x59ea50(_0x407bab);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 340d60c..485f3c5 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 _0x2cb9=['get','/describe','isAuthenticated','/:id','show','post','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x30538b,_0x19e98e){var _0xf5171b=function(_0x2b6a5f){while(--_0x2b6a5f){_0x30538b['push'](_0x30538b['shift']());}};_0xf5171b(++_0x19e98e);}(_0x2cb9,0x86));var _0x92cb=function(_0x4234f5,_0x130d72){_0x4234f5=_0x4234f5-0x0;var _0x554390=_0x2cb9[_0x4234f5];return _0x554390;};'use strict';var multer=require(_0x92cb('0x0'));var util=require('util');var path=require(_0x92cb('0x1'));var timeout=require(_0x92cb('0x2'));var express=require('express');var router=express[_0x92cb('0x3')]();var fs_extra=require(_0x92cb('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x92cb('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x92cb('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x92cb('0x6')](_0x92cb('0x7'),auth[_0x92cb('0x8')](),controller['describe']);router[_0x92cb('0x6')](_0x92cb('0x9'),auth['isAuthenticated'](),controller[_0x92cb('0xa')]);router[_0x92cb('0xb')]('/',auth[_0x92cb('0x8')](),controller['create']);router['put']('/:id',auth[_0x92cb('0x8')](),controller['update']);router[_0x92cb('0xc')](_0x92cb('0x9'),auth['isAuthenticated'](),controller[_0x92cb('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xff89=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/:id','show','post','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40a098,_0x33f92a){var _0x4db5f0=function(_0x2f608e){while(--_0x2f608e){_0x40a098['push'](_0x40a098['shift']());}};_0x4db5f0(++_0x33f92a);}(_0xff89,0x109));var _0x9ff8=function(_0x37ebbf,_0x2e0d70){_0x37ebbf=_0x37ebbf-0x0;var _0x27b75e=_0xff89[_0x37ebbf];return _0x27b75e;};'use strict';var multer=require(_0x9ff8('0x0'));var util=require(_0x9ff8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ff8('0x2'));var router=express[_0x9ff8('0x3')]();var fs_extra=require(_0x9ff8('0x4'));var auth=require(_0x9ff8('0x5'));var interaction=require(_0x9ff8('0x6'));var config=require(_0x9ff8('0x7'));var controller=require(_0x9ff8('0x8'));router[_0x9ff8('0x9')]('/',auth[_0x9ff8('0xa')](),controller['index']);router[_0x9ff8('0x9')]('/describe',auth[_0x9ff8('0xa')](),controller['describe']);router[_0x9ff8('0x9')](_0x9ff8('0xb'),auth[_0x9ff8('0xa')](),controller[_0x9ff8('0xc')]);router[_0x9ff8('0xd')]('/',auth[_0x9ff8('0xa')](),controller['create']);router['put'](_0x9ff8('0xb'),auth[_0x9ff8('0xa')](),controller[_0x9ff8('0xe')]);router[_0x9ff8('0xf')]('/:id',auth[_0x9ff8('0xa')](),controller['destroy']);module[_0x9ff8('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index b12cafd..8491ead 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 _0xa617=['STRING','ENUM','mouseOver','sequelize','exports'];(function(_0x1179e4,_0x53658c){var _0x172bc5=function(_0x8d4438){while(--_0x8d4438){_0x1179e4['push'](_0x1179e4['shift']());}};_0x172bc5(++_0x53658c);}(_0xa617,0x76));var _0x7a61=function(_0x5bea5c,_0x1a2340){_0x5bea5c=_0x5bea5c-0x0;var _0x34768f=_0xa617[_0x5bea5c];return _0x34768f;};'use strict';var Sequelize=require(_0x7a61('0x0'));module[_0x7a61('0x1')]={'name':{'type':Sequelize[_0x7a61('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7a61('0x3')](_0x7a61('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x7a61('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x8698=['INTEGER','sequelize','exports','ENUM','mouseOver','timeout'];(function(_0x31a321,_0x5cd2d4){var _0x53b946=function(_0x2f965e){while(--_0x2f965e){_0x31a321['push'](_0x31a321['shift']());}};_0x53b946(++_0x5cd2d4);}(_0x8698,0x97));var _0x8869=function(_0x20ef3f,_0x181d32){_0x20ef3f=_0x20ef3f-0x0;var _0x4fc506=_0x8698[_0x20ef3f];return _0x4fc506;};'use strict';var Sequelize=require(_0x8869('0x0'));module[_0x8869('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8869('0x2')](_0x8869('0x3'),_0x8869('0x4')),'defaultValue':_0x8869('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8869('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index ead318b..c251408 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 _0x2171=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','intersection','fields','attributes','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x51cd85,_0x1ea665){var _0x1b793a=function(_0x8afc78){while(--_0x8afc78){_0x51cd85['push'](_0x51cd85['shift']());}};_0x1b793a(++_0x1ea665);}(_0x2171,0x143));var _0x1217=function(_0x2b3d5f,_0x54cdb3){_0x2b3d5f=_0x2b3d5f-0x0;var _0x7a0e57=_0x2171[_0x2b3d5f];return _0x7a0e57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1217('0x0'));var zipdir=require(_0x1217('0x1'));var jsonpatch=require(_0x1217('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1217('0x3'));var Mustache=require('mustache');var util=require(_0x1217('0x4'));var path=require(_0x1217('0x5'));var sox=require(_0x1217('0x6'));var csv=require(_0x1217('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1217('0x8'));var _=require(_0x1217('0x9'));var squel=require(_0x1217('0xa'));var crypto=require('crypto');var jsforce=require(_0x1217('0xb'));var deskjs=require(_0x1217('0xc'));var toCsv=require(_0x1217('0x7'));var querystring=require(_0x1217('0xd'));var Papa=require(_0x1217('0xe'));var Redis=require(_0x1217('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1217('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1217('0x11'));var logger=require(_0x1217('0x12'))(_0x1217('0x13'));var utils=require(_0x1217('0x14'));var config=require(_0x1217('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1217('0x16'))['db'];function respondWithStatusCode(_0x358007,_0x1e34e9){_0x1e34e9=_0x1e34e9||0xcc;return function(_0x107d99){if(_0x107d99){return _0x358007[_0x1217('0x17')](_0x1e34e9);}return _0x358007['status'](_0x1e34e9)['end']();};}function respondWithResult(_0xb06ed5,_0x5d8f22){_0x5d8f22=_0x5d8f22||0xc8;return function(_0x4aa848){if(_0x4aa848){return _0xb06ed5[_0x1217('0x18')](_0x5d8f22)['json'](_0x4aa848);}};}function respondWithFilteredResult(_0x4ef9be,_0x2300f0){return function(_0x24a3f3){if(_0x24a3f3){var _0x417cfe=typeof _0x2300f0[_0x1217('0x19')]==='undefined'&&typeof _0x2300f0[_0x1217('0x1a')]===_0x1217('0x1b');var _0x41c34f=_0x24a3f3[_0x1217('0x1c')];var _0x512159=_0x417cfe?0x0:_0x2300f0[_0x1217('0x19')];var _0x24033f=_0x417cfe?_0x24a3f3[_0x1217('0x1c')]:_0x2300f0[_0x1217('0x19')]+_0x2300f0[_0x1217('0x1a')];var _0x20ccb9;if(_0x24033f>=_0x41c34f){_0x24033f=_0x41c34f;_0x20ccb9=0xc8;}else{_0x20ccb9=0xce;}_0x4ef9be[_0x1217('0x18')](_0x20ccb9);return _0x4ef9be[_0x1217('0x1d')]('Content-Range',_0x512159+'-'+_0x24033f+'/'+_0x41c34f)[_0x1217('0x1e')](_0x24a3f3);}return null;};}function patchUpdates(_0x49382b){return function(_0x3bb618){try{jsonpatch[_0x1217('0x1f')](_0x3bb618,_0x49382b,!![]);}catch(_0x5f018c){return BPromise[_0x1217('0x20')](_0x5f018c);}return _0x3bb618[_0x1217('0x21')]();};}function saveUpdates(_0x4ea5e6,_0xb4e4ea){return function(_0x2c625b){if(_0x2c625b){return _0x2c625b['update'](_0x4ea5e6)[_0x1217('0x22')](function(_0x11f512){return _0x11f512;});}return null;};}function removeEntity(_0x1516e8,_0x5b9b7a){return function(_0x4a9c32){if(_0x4a9c32){return _0x4a9c32[_0x1217('0x23')]()[_0x1217('0x22')](function(){_0x1516e8[_0x1217('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x463c66,_0x8bd9d9){return function(_0x1bde0b){if(!_0x1bde0b){_0x463c66[_0x1217('0x17')](0x194);}return _0x1bde0b;};}function handleError(_0x465209,_0x446dc3){_0x446dc3=_0x446dc3||0x1f4;return function(_0x518a0a){logger['error'](_0x518a0a[_0x1217('0x24')]);if(_0x518a0a[_0x1217('0x25')]){delete _0x518a0a['name'];}_0x465209[_0x1217('0x18')](_0x446dc3)[_0x1217('0x26')](_0x518a0a);};}exports[_0x1217('0x27')]=function(_0x21392c,_0x2f5387){var _0x5eb398={'raw':!![],'where':{'id':_0x21392c[_0x1217('0x28')]['id']}},_0xdb98d5={};_0xdb98d5[_0x1217('0x29')]=_['keys'](db['ChatProactiveAction'][_0x1217('0x2a')]);_0xdb98d5[_0x1217('0x2b')]=_[_0x1217('0x2c')](_0x21392c['query']);_0xdb98d5['filters']=_[_0x1217('0x2d')](_0xdb98d5[_0x1217('0x29')],_0xdb98d5[_0x1217('0x2b')]);_0x5eb398['attributes']=_['intersection'](_0xdb98d5[_0x1217('0x29')],qs[_0x1217('0x2e')](_0x21392c[_0x1217('0x2b')][_0x1217('0x2e')]));_0x5eb398[_0x1217('0x2f')]=_0x5eb398['attributes']['length']?_0x5eb398['attributes']:_0xdb98d5['model'];if(_0x21392c[_0x1217('0x2b')][_0x1217('0x30')]){_0x5eb398['include']=[{'all':!![]}];}_0x5eb398=_[_0x1217('0x31')]({},_0x5eb398,_0x21392c[_0x1217('0x32')]);return db[_0x1217('0x33')][_0x1217('0x34')](_0x5eb398)[_0x1217('0x22')](handleEntityNotFound(_0x2f5387,null))[_0x1217('0x22')](respondWithResult(_0x2f5387,null))[_0x1217('0x35')](handleError(_0x2f5387,null));};exports[_0x1217('0x36')]=function(_0x2d6653,_0x445bd2){return db[_0x1217('0x33')][_0x1217('0x36')](_0x2d6653[_0x1217('0x37')],{})[_0x1217('0x22')](respondWithResult(_0x445bd2,0xc9))[_0x1217('0x35')](handleError(_0x445bd2,null));};exports['update']=function(_0xc189a6,_0x3ac293){if(_0xc189a6[_0x1217('0x37')]['id']){delete _0xc189a6['body']['id'];}return db[_0x1217('0x33')]['find']({'where':{'id':_0xc189a6[_0x1217('0x28')]['id']}})['then'](handleEntityNotFound(_0x3ac293,null))[_0x1217('0x22')](saveUpdates(_0xc189a6[_0x1217('0x37')],null))[_0x1217('0x22')](respondWithResult(_0x3ac293,null))[_0x1217('0x35')](handleError(_0x3ac293,null));};exports['destroy']=function(_0xc699b3,_0x437f54){return db[_0x1217('0x33')]['find']({'where':{'id':_0xc699b3[_0x1217('0x28')]['id']}})['then'](handleEntityNotFound(_0x437f54,null))[_0x1217('0x22')](removeEntity(_0x437f54,null))[_0x1217('0x35')](handleError(_0x437f54,null));};
\ No newline at end of file
+var _0x6dfa=['catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x6dfa,0x7b));var _0xa6df=function(_0x1f8bb0,_0x3cfd5c){_0x1f8bb0=_0x1f8bb0-0x0;var _0x15e553=_0x6dfa[_0x1f8bb0];return _0x15e553;};'use strict';var emlformat=require(_0xa6df('0x0'));var rimraf=require(_0xa6df('0x1'));var zipdir=require(_0xa6df('0x2'));var jsonpatch=require(_0xa6df('0x3'));var rp=require(_0xa6df('0x4'));var moment=require('moment');var BPromise=require(_0xa6df('0x5'));var Mustache=require('mustache');var util=require(_0xa6df('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa6df('0x7'));var ejs=require(_0xa6df('0x8'));var fs=require('fs');var fs_extra=require(_0xa6df('0x9'));var _=require(_0xa6df('0xa'));var squel=require(_0xa6df('0xb'));var crypto=require(_0xa6df('0xc'));var jsforce=require(_0xa6df('0xd'));var deskjs=require(_0xa6df('0xe'));var toCsv=require(_0xa6df('0x7'));var querystring=require(_0xa6df('0xf'));var Papa=require('papaparse');var Redis=require(_0xa6df('0x10'));var authService=require(_0xa6df('0x11'));var qs=require(_0xa6df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6df('0x13'));var logger=require('../../config/logger')(_0xa6df('0x14'));var utils=require(_0xa6df('0x15'));var config=require(_0xa6df('0x16'));var licenseUtil=require(_0xa6df('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6bdaa,_0x500e77){_0x500e77=_0x500e77||0xcc;return function(_0x1540f1){if(_0x1540f1){return _0x6bdaa[_0xa6df('0x18')](_0x500e77);}return _0x6bdaa[_0xa6df('0x19')](_0x500e77)[_0xa6df('0x1a')]();};}function respondWithResult(_0x53325a,_0x1e536d){_0x1e536d=_0x1e536d||0xc8;return function(_0x5bbd9e){if(_0x5bbd9e){return _0x53325a[_0xa6df('0x19')](_0x1e536d)[_0xa6df('0x1b')](_0x5bbd9e);}};}function respondWithFilteredResult(_0x59c2a2,_0x300a72){return function(_0x414cae){if(_0x414cae){var _0x23f4c1=typeof _0x300a72[_0xa6df('0x1c')]===_0xa6df('0x1d')&&typeof _0x300a72['limit']===_0xa6df('0x1d');var _0x3f9a6b=_0x414cae[_0xa6df('0x1e')];var _0x172bb9=_0x23f4c1?0x0:_0x300a72['offset'];var _0x203375=_0x23f4c1?_0x414cae[_0xa6df('0x1e')]:_0x300a72[_0xa6df('0x1c')]+_0x300a72[_0xa6df('0x1f')];var _0x48de1c;if(_0x203375>=_0x3f9a6b){_0x203375=_0x3f9a6b;_0x48de1c=0xc8;}else{_0x48de1c=0xce;}_0x59c2a2['status'](_0x48de1c);return _0x59c2a2[_0xa6df('0x20')]('Content-Range',_0x172bb9+'-'+_0x203375+'/'+_0x3f9a6b)[_0xa6df('0x1b')](_0x414cae);}return null;};}function patchUpdates(_0xfefceb){return function(_0x297e0f){try{jsonpatch[_0xa6df('0x21')](_0x297e0f,_0xfefceb,!![]);}catch(_0x2f41e1){return BPromise['reject'](_0x2f41e1);}return _0x297e0f[_0xa6df('0x22')]();};}function saveUpdates(_0x37dcbd,_0x3c09de){return function(_0x10fb11){if(_0x10fb11){return _0x10fb11[_0xa6df('0x23')](_0x37dcbd)[_0xa6df('0x24')](function(_0x539be3){return _0x539be3;});}return null;};}function removeEntity(_0x4be3e0,_0xcaa3a1){return function(_0x111659){if(_0x111659){return _0x111659[_0xa6df('0x25')]()[_0xa6df('0x24')](function(){_0x4be3e0[_0xa6df('0x19')](0xcc)[_0xa6df('0x1a')]();});}};}function handleEntityNotFound(_0x557aa6,_0x51e836){return function(_0x1f138b){if(!_0x1f138b){_0x557aa6[_0xa6df('0x18')](0x194);}return _0x1f138b;};}function handleError(_0x2745f8,_0x50e7b8){_0x50e7b8=_0x50e7b8||0x1f4;return function(_0x54ff44){logger['error'](_0x54ff44[_0xa6df('0x26')]);if(_0x54ff44['name']){delete _0x54ff44[_0xa6df('0x27')];}_0x2745f8[_0xa6df('0x19')](_0x50e7b8)[_0xa6df('0x28')](_0x54ff44);};}exports[_0xa6df('0x29')]=function(_0x37b079,_0x25a36a){var _0x55161d={'raw':!![],'where':{'id':_0x37b079[_0xa6df('0x2a')]['id']}},_0x42fa1b={};_0x42fa1b[_0xa6df('0x2b')]=_[_0xa6df('0x2c')](db[_0xa6df('0x2d')]['rawAttributes']);_0x42fa1b[_0xa6df('0x2e')]=_[_0xa6df('0x2c')](_0x37b079['query']);_0x42fa1b[_0xa6df('0x2f')]=_[_0xa6df('0x30')](_0x42fa1b['model'],_0x42fa1b[_0xa6df('0x2e')]);_0x55161d[_0xa6df('0x31')]=_[_0xa6df('0x30')](_0x42fa1b[_0xa6df('0x2b')],qs[_0xa6df('0x32')](_0x37b079['query'][_0xa6df('0x32')]));_0x55161d[_0xa6df('0x31')]=_0x55161d[_0xa6df('0x31')][_0xa6df('0x33')]?_0x55161d['attributes']:_0x42fa1b[_0xa6df('0x2b')];if(_0x37b079['query'][_0xa6df('0x34')]){_0x55161d[_0xa6df('0x35')]=[{'all':!![]}];}_0x55161d=_[_0xa6df('0x36')]({},_0x55161d,_0x37b079[_0xa6df('0x37')]);return db[_0xa6df('0x2d')][_0xa6df('0x38')](_0x55161d)[_0xa6df('0x24')](handleEntityNotFound(_0x25a36a,null))[_0xa6df('0x24')](respondWithResult(_0x25a36a,null))[_0xa6df('0x39')](handleError(_0x25a36a,null));};exports[_0xa6df('0x3a')]=function(_0x55c1e3,_0x48c21f){return db['ChatProactiveAction'][_0xa6df('0x3a')](_0x55c1e3[_0xa6df('0x3b')],{})[_0xa6df('0x24')](respondWithResult(_0x48c21f,0xc9))[_0xa6df('0x39')](handleError(_0x48c21f,null));};exports[_0xa6df('0x23')]=function(_0x4e2d03,_0x463d54){if(_0x4e2d03[_0xa6df('0x3b')]['id']){delete _0x4e2d03[_0xa6df('0x3b')]['id'];}return db[_0xa6df('0x2d')][_0xa6df('0x38')]({'where':{'id':_0x4e2d03['params']['id']}})[_0xa6df('0x24')](handleEntityNotFound(_0x463d54,null))[_0xa6df('0x24')](saveUpdates(_0x4e2d03[_0xa6df('0x3b')],null))['then'](respondWithResult(_0x463d54,null))[_0xa6df('0x39')](handleError(_0x463d54,null));};exports['destroy']=function(_0x56c2bf,_0x56d9e6){return db[_0xa6df('0x2d')][_0xa6df('0x38')]({'where':{'id':_0x56c2bf['params']['id']}})['then'](handleEntityNotFound(_0x56d9e6,null))[_0xa6df('0x24')](removeEntity(_0x56d9e6,null))[_0xa6df('0x39')](handleError(_0x56d9e6,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0ef4f64..8de56b4 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 _0x770a=['chat_proactive_actions','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x486f4a,_0x515ec6){var _0x1ad150=function(_0xf5c85e){while(--_0xf5c85e){_0x486f4a['push'](_0x486f4a['shift']());}};_0x1ad150(++_0x515ec6);}(_0x770a,0x175));var _0xa770=function(_0x3a400b,_0x1b97c6){_0x3a400b=_0x3a400b-0x0;var _0x560b1a=_0x770a[_0x3a400b];return _0x560b1a;};'use strict';var _=require(_0xa770('0x0'));var util=require(_0xa770('0x1'));var logger=require(_0xa770('0x2'))('api');var moment=require(_0xa770('0x3'));var BPromise=require('bluebird');var rp=require(_0xa770('0x4'));var fs=require('fs');var path=require(_0xa770('0x5'));var rimraf=require(_0xa770('0x6'));var config=require(_0xa770('0x7'));var attributes=require(_0xa770('0x8'));module[_0xa770('0x9')]=function(_0x59004,_0x761354){return _0x59004[_0xa770('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xa770('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf892=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf892,0x196));var _0x2f89=function(_0x28dd58,_0x4336e9){_0x28dd58=_0x28dd58-0x0;var _0x2b0f07=_0xf892[_0x28dd58];return _0x2b0f07;};'use strict';var _=require('lodash');var util=require(_0x2f89('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2f89('0x1'));var BPromise=require(_0x2f89('0x2'));var rp=require(_0x2f89('0x3'));var fs=require('fs');var path=require(_0x2f89('0x4'));var rimraf=require(_0x2f89('0x5'));var config=require(_0x2f89('0x6'));var attributes=require(_0x2f89('0x7'));module[_0x2f89('0x8')]=function(_0x149ad7,_0x20a368){return _0x149ad7[_0x2f89('0x9')](_0x2f89('0xa'),attributes,{'tableName':_0x2f89('0xb'),'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 1abdda1..1ecb756 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 _0xe2ea=['request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5f1e8e,_0x2774f2){var _0x517bc4=function(_0x4c92eb){while(--_0x4c92eb){_0x5f1e8e['push'](_0x5f1e8e['shift']());}};_0x517bc4(++_0x2774f2);}(_0xe2ea,0x71));var _0xae2e=function(_0x29c964,_0x406ece){_0x29c964=_0x29c964-0x0;var _0x499778=_0xe2ea[_0x29c964];return _0x499778;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae2e('0x0'));var BPromise=require(_0xae2e('0x1'));var rs=require(_0xae2e('0x2'));var fs=require('fs');var Redis=require(_0xae2e('0x3'));var db=require(_0xae2e('0x4'))['db'];var utils=require(_0xae2e('0x5'));var logger=require(_0xae2e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xae2e('0x7'));var client=jayson[_0xae2e('0x8')][_0xae2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x512c4c,_0xf64b3c,_0xfebf59){return new BPromise(function(_0x1df7f9,_0x5e1f41){return client[_0xae2e('0xa')](_0x512c4c,_0xfebf59)[_0xae2e('0xb')](function(_0x48dd08){logger['info'](_0xae2e('0xc'),_0xf64b3c,'request\x20sent');logger['debug'](_0xae2e('0xd'),_0xf64b3c,'request\x20sent',JSON[_0xae2e('0xe')](_0x48dd08));if(_0x48dd08[_0xae2e('0xf')]){if(_0x48dd08[_0xae2e('0xf')][_0xae2e('0x10')]===0x1f4){logger[_0xae2e('0xf')](_0xae2e('0xc'),_0xf64b3c,_0x48dd08['error']['message']);return _0x5e1f41(_0x48dd08[_0xae2e('0xf')]['message']);}logger[_0xae2e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0xf64b3c,_0x48dd08[_0xae2e('0xf')]['message']);return _0x1df7f9(_0x48dd08[_0xae2e('0xf')][_0xae2e('0x11')]);}else{logger[_0xae2e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0xf64b3c,_0xae2e('0x13'));_0x1df7f9(_0x48dd08[_0xae2e('0x14')][_0xae2e('0x11')]);}})[_0xae2e('0x15')](function(_0x499704){logger[_0xae2e('0xf')](_0xae2e('0xc'),_0xf64b3c,_0x499704);_0x5e1f41(_0x499704);});});}
\ No newline at end of file
+var _0xd540=['ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39cd32,_0x440510){var _0xadbc55=function(_0x1368f1){while(--_0x1368f1){_0x39cd32['push'](_0x39cd32['shift']());}};_0xadbc55(++_0x440510);}(_0xd540,0x68));var _0x0d54=function(_0x1ed2db,_0x4a0537){_0x1ed2db=_0x1ed2db-0x0;var _0x28fe68=_0xd540[_0x1ed2db];return _0x28fe68;};'use strict';var _=require(_0x0d54('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0d54('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d54('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d54('0x3'));var logger=require(_0x0d54('0x4'))(_0x0d54('0x5'));var config=require(_0x0d54('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0d54('0x7')][_0x0d54('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a0c06,_0x59f183,_0x465a72){return new BPromise(function(_0x1346fc,_0x3d888d){return client['request'](_0x1a0c06,_0x465a72)['then'](function(_0x36584b){logger[_0x0d54('0x9')]('ChatProactiveAction,\x20%s,\x20%s',_0x59f183,_0x0d54('0xa'));logger[_0x0d54('0xb')](_0x0d54('0xc'),_0x59f183,_0x0d54('0xa'),JSON[_0x0d54('0xd')](_0x36584b));if(_0x36584b[_0x0d54('0xe')]){if(_0x36584b[_0x0d54('0xe')][_0x0d54('0xf')]===0x1f4){logger[_0x0d54('0xe')](_0x0d54('0x10'),_0x59f183,_0x36584b[_0x0d54('0xe')][_0x0d54('0x11')]);return _0x3d888d(_0x36584b[_0x0d54('0xe')][_0x0d54('0x11')]);}logger[_0x0d54('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x59f183,_0x36584b[_0x0d54('0xe')][_0x0d54('0x11')]);return _0x1346fc(_0x36584b[_0x0d54('0xe')][_0x0d54('0x11')]);}else{logger[_0x0d54('0x9')](_0x0d54('0x10'),_0x59f183,_0x0d54('0xa'));_0x1346fc(_0x36584b[_0x0d54('0x12')][_0x0d54('0x11')]);}})[_0x0d54('0x13')](function(_0x260e1b){logger['error'](_0x0d54('0x10'),_0x59f183,_0x260e1b);_0x3d888d(_0x260e1b);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 6f9897f..0e67558 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 _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xeff8,0x186));var _0x8eff=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xeff8[_0x424a9a];return _0xa7831c;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xc4aa=['show','post','update','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x3697e5,_0x311f94){var _0x476d4e=function(_0x5d9b67){while(--_0x5d9b67){_0x3697e5['push'](_0x3697e5['shift']());}};_0x476d4e(++_0x311f94);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xb')]);router[_0xac4a('0xc')]('/',auth[_0xac4a('0xa')](),controller['create']);router['put'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xd')]);router['delete'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index ea74c68..15c37a9 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 _0xc6a0=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0xc6a0,0x170));var _0x0c6a=function(_0xc1a550,_0x3ddc8a){_0xc1a550=_0xc1a550-0x0;var _0x896e2c=_0xc6a0[_0xc1a550];return _0x896e2c;};'use strict';var Sequelize=require(_0x0c6a('0x0'));module[_0x0c6a('0x1')]={'name':{'type':Sequelize[_0x0c6a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0c6a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0c6a('0x4')](_0x0c6a('0x5'),_0x0c6a('0x6'),_0x0c6a('0x7'))}};
\ No newline at end of file
+var _0x246e=['exports','STRING','rrmemory','beepall','roundrobin','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x246e,0x1df));var _0xe246=function(_0x48ecc8,_0x2c6d4b){_0x48ecc8=_0x48ecc8-0x0;var _0x36249c=_0x246e[_0x48ecc8];return _0x36249c;};'use strict';var Sequelize=require(_0xe246('0x0'));module[_0xe246('0x1')]={'name':{'type':Sequelize[_0xe246('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe246('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe246('0x3'),_0xe246('0x4'),_0xe246('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 3881f5f..703f81e 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 _0xf4a0=['online','voicePause','Agents','addTeams','each','findOrCreate','emit','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','client','http','request','then','info','request\x20sent','error','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','ChatQueue','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','hasOwnProperty','nolimit','ChatQueueId','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','ids'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf4a0,0xb9));var _0x0f4a=function(_0x5b6ff4,_0x40c57f){_0x5b6ff4=_0x5b6ff4-0x0;var _0x141c44=_0xf4a0[_0x5b6ff4];return _0x141c44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f4a('0x0'));var zipdir=require(_0x0f4a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f4a('0x2'));var moment=require(_0x0f4a('0x3'));var BPromise=require(_0x0f4a('0x4'));var Mustache=require(_0x0f4a('0x5'));var util=require(_0x0f4a('0x6'));var path=require(_0x0f4a('0x7'));var sox=require(_0x0f4a('0x8'));var csv=require('to-csv');var ejs=require(_0x0f4a('0x9'));var fs=require('fs');var fs_extra=require(_0x0f4a('0xa'));var _=require(_0x0f4a('0xb'));var squel=require(_0x0f4a('0xc'));var crypto=require('crypto');var jsforce=require(_0x0f4a('0xd'));var deskjs=require(_0x0f4a('0xe'));var toCsv=require(_0x0f4a('0xf'));var querystring=require(_0x0f4a('0x10'));var Papa=require(_0x0f4a('0x11'));var Redis=require(_0x0f4a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0f4a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f4a('0x14'))(_0x0f4a('0x15'));var utils=require(_0x0f4a('0x16'));var config=require(_0x0f4a('0x17'));var licenseUtil=require(_0x0f4a('0x18'));var db=require('../../mysqldb')['db'];config[_0x0f4a('0x19')]=_[_0x0f4a('0x1a')](config[_0x0f4a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0f4a('0x1b'))(new Redis(config[_0x0f4a('0x19')]));require('./chatQueue.socket')[_0x0f4a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0f4a('0x1d')][_0x0f4a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x10cf4f,_0x2a7d3a,_0x573b89,_0x5dccca){return new BPromise(function(_0x2e886f,_0x2f8564){var _0x5999c1=_0x5dccca||client;return _0x5999c1[_0x0f4a('0x1f')](_0x10cf4f,_0x573b89)[_0x0f4a('0x20')](function(_0x321360){logger[_0x0f4a('0x21')]('ChatQueue,\x20%s,\x20%s',_0x2a7d3a,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2a7d3a,_0x0f4a('0x22'),JSON['stringify'](_0x321360));if(_0x321360[_0x0f4a('0x23')]){if(_0x321360[_0x0f4a('0x23')]['code']===0x1f4){logger['error'](_0x0f4a('0x24'),_0x2a7d3a,_0x321360['error'][_0x0f4a('0x25')]);return _0x2f8564(_0x321360['error']['message']);}logger[_0x0f4a('0x23')]('ChatQueue,\x20%s,\x20%s',_0x2a7d3a,_0x321360['error'][_0x0f4a('0x25')]);return _0x2e886f(_0x321360[_0x0f4a('0x23')]['message']);}else{logger[_0x0f4a('0x21')](_0x0f4a('0x24'),_0x2a7d3a,_0x0f4a('0x22'));_0x2e886f(_0x321360[_0x0f4a('0x26')][_0x0f4a('0x25')]);}})['catch'](function(_0x19d0e4){logger[_0x0f4a('0x23')](_0x0f4a('0x24'),_0x2a7d3a,_0x19d0e4);_0x2f8564(_0x19d0e4);});});}function respondWithStatusCode(_0x3e822c,_0xdb238f){_0xdb238f=_0xdb238f||0xcc;return function(_0x326325){if(_0x326325){return _0x3e822c[_0x0f4a('0x27')](_0xdb238f);}return _0x3e822c['status'](_0xdb238f)[_0x0f4a('0x28')]();};}function respondWithResult(_0xec1d9e,_0xf812e4){_0xf812e4=_0xf812e4||0xc8;return function(_0x50ede3){if(_0x50ede3){return _0xec1d9e['status'](_0xf812e4)[_0x0f4a('0x29')](_0x50ede3);}};}function respondWithFilteredResult(_0x226d45,_0x22a038){return function(_0x25f74d){if(_0x25f74d){var _0x553dd8=typeof _0x22a038[_0x0f4a('0x2a')]===_0x0f4a('0x2b')&&typeof _0x22a038[_0x0f4a('0x2c')]==='undefined';var _0x50b6ea=_0x25f74d[_0x0f4a('0x2d')];var _0x5955e4=_0x553dd8?0x0:_0x22a038['offset'];var _0x28b829=_0x553dd8?_0x25f74d[_0x0f4a('0x2d')]:_0x22a038[_0x0f4a('0x2a')]+_0x22a038['limit'];var _0x3f0d3c;if(_0x28b829>=_0x50b6ea){_0x28b829=_0x50b6ea;_0x3f0d3c=0xc8;}else{_0x3f0d3c=0xce;}_0x226d45[_0x0f4a('0x2e')](_0x3f0d3c);return _0x226d45[_0x0f4a('0x2f')]('Content-Range',_0x5955e4+'-'+_0x28b829+'/'+_0x50b6ea)[_0x0f4a('0x29')](_0x25f74d);}return null;};}function patchUpdates(_0x8c8837){return function(_0x2f36a3){try{jsonpatch[_0x0f4a('0x30')](_0x2f36a3,_0x8c8837,!![]);}catch(_0x577705){return BPromise['reject'](_0x577705);}return _0x2f36a3[_0x0f4a('0x31')]();};}function saveUpdates(_0xb4fb14,_0x2626b5){return function(_0x5646cf){if(_0x5646cf){return _0x5646cf['update'](_0xb4fb14)[_0x0f4a('0x20')](function(_0x4d580){return _0x4d580;});}return null;};}function removeEntity(_0x3896e2,_0x3666c5){return function(_0x50f486){if(_0x50f486){return _0x50f486['destroy']()[_0x0f4a('0x20')](function(){var _0x486e38=_0x50f486[_0x0f4a('0x32')]({'plain':!![]});var _0x5a3112=_0x0f4a('0x33');return db[_0x0f4a('0x34')][_0x0f4a('0x35')]({'where':{'type':_0x5a3112,'resourceId':_0x486e38['id']}})[_0x0f4a('0x20')](function(){return _0x50f486;});})[_0x0f4a('0x20')](function(){_0x3896e2[_0x0f4a('0x2e')](0xcc)[_0x0f4a('0x28')]();});}};}function handleEntityNotFound(_0x2f39f7,_0x4f7a0c){return function(_0xc9388e){if(!_0xc9388e){_0x2f39f7[_0x0f4a('0x27')](0x194);}return _0xc9388e;};}function handleError(_0x1eb1de,_0x3a0a0d){_0x3a0a0d=_0x3a0a0d||0x1f4;return function(_0xd60779){logger[_0x0f4a('0x23')](_0xd60779[_0x0f4a('0x36')]);if(_0xd60779['name']){delete _0xd60779[_0x0f4a('0x37')];}_0x1eb1de['status'](_0x3a0a0d)[_0x0f4a('0x38')](_0xd60779);};}exports[_0x0f4a('0x39')]=function(_0x4116ae,_0xa75e40){var _0x44829f={},_0x5605b0={},_0x63937b={'count':0x0,'rows':[]};var _0x55f580=_['map'](db[_0x0f4a('0x3a')][_0x0f4a('0x3b')],function(_0x1869e9){return{'name':_0x1869e9[_0x0f4a('0x3c')],'type':_0x1869e9['type'][_0x0f4a('0x3d')]};});_0x5605b0[_0x0f4a('0x3e')]=_[_0x0f4a('0x3f')](_0x55f580,_0x0f4a('0x37'));_0x5605b0['query']=_[_0x0f4a('0x40')](_0x4116ae[_0x0f4a('0x41')]);_0x5605b0[_0x0f4a('0x42')]=_['intersection'](_0x5605b0[_0x0f4a('0x3e')],_0x5605b0[_0x0f4a('0x41')]);_0x44829f[_0x0f4a('0x43')]=_[_0x0f4a('0x44')](_0x5605b0['model'],qs[_0x0f4a('0x45')](_0x4116ae[_0x0f4a('0x41')][_0x0f4a('0x45')]));_0x44829f[_0x0f4a('0x43')]=_0x44829f[_0x0f4a('0x43')][_0x0f4a('0x46')]?_0x44829f[_0x0f4a('0x43')]:_0x5605b0[_0x0f4a('0x3e')];if(!_0x4116ae['query']['hasOwnProperty']('nolimit')){_0x44829f[_0x0f4a('0x2c')]=qs[_0x0f4a('0x2c')](_0x4116ae[_0x0f4a('0x41')][_0x0f4a('0x2c')]);_0x44829f['offset']=qs[_0x0f4a('0x2a')](_0x4116ae[_0x0f4a('0x41')]['offset']);}_0x44829f[_0x0f4a('0x47')]=qs[_0x0f4a('0x48')](_0x4116ae[_0x0f4a('0x41')][_0x0f4a('0x48')]);_0x44829f[_0x0f4a('0x49')]=qs[_0x0f4a('0x42')](_[_0x0f4a('0x4a')](_0x4116ae[_0x0f4a('0x41')],_0x5605b0['filters']),_0x55f580);if(_0x4116ae[_0x0f4a('0x41')]['filter']){_0x44829f[_0x0f4a('0x49')]=_[_0x0f4a('0x4b')](_0x44829f[_0x0f4a('0x49')],{'$or':_[_0x0f4a('0x3f')](_0x55f580,function(_0x4a1384){if(_0x4a1384[_0x0f4a('0x4c')]!==_0x0f4a('0x4d')){var _0x1968aa={};_0x1968aa[_0x4a1384[_0x0f4a('0x37')]]={'$like':'%'+_0x4116ae[_0x0f4a('0x41')][_0x0f4a('0x4e')]+'%'};return _0x1968aa;}})});}_0x44829f=_[_0x0f4a('0x4b')]({},_0x44829f,_0x4116ae['options']);var _0x657358={'where':_0x44829f['where']};return db['ChatQueue']['count'](_0x657358)[_0x0f4a('0x20')](function(_0xfff0be){_0x63937b[_0x0f4a('0x2d')]=_0xfff0be;if(_0x4116ae['query'][_0x0f4a('0x4f')]){_0x44829f[_0x0f4a('0x50')]=[{'all':!![]}];}return db[_0x0f4a('0x3a')]['findAll'](_0x44829f);})[_0x0f4a('0x20')](function(_0x4f4bd3){_0x63937b[_0x0f4a('0x51')]=_0x4f4bd3;return _0x63937b;})[_0x0f4a('0x20')](respondWithFilteredResult(_0xa75e40,_0x44829f))[_0x0f4a('0x52')](handleError(_0xa75e40,null));};exports['show']=function(_0x4852fd,_0x380648){var _0x23592b={'raw':!![],'where':{'id':_0x4852fd[_0x0f4a('0x53')]['id']}},_0x1ddc18={};_0x1ddc18[_0x0f4a('0x3e')]=_['keys'](db[_0x0f4a('0x3a')][_0x0f4a('0x3b')]);_0x1ddc18['query']=_['keys'](_0x4852fd[_0x0f4a('0x41')]);_0x1ddc18[_0x0f4a('0x42')]=_[_0x0f4a('0x44')](_0x1ddc18[_0x0f4a('0x3e')],_0x1ddc18['query']);_0x23592b[_0x0f4a('0x43')]=_[_0x0f4a('0x44')](_0x1ddc18[_0x0f4a('0x3e')],qs[_0x0f4a('0x45')](_0x4852fd[_0x0f4a('0x41')]['fields']));_0x23592b[_0x0f4a('0x43')]=_0x23592b[_0x0f4a('0x43')][_0x0f4a('0x46')]?_0x23592b['attributes']:_0x1ddc18[_0x0f4a('0x3e')];if(_0x4852fd[_0x0f4a('0x41')][_0x0f4a('0x4f')]){_0x23592b[_0x0f4a('0x50')]=[{'all':!![]}];}_0x23592b=_['merge']({},_0x23592b,_0x4852fd[_0x0f4a('0x54')]);return db[_0x0f4a('0x3a')][_0x0f4a('0x55')](_0x23592b)[_0x0f4a('0x20')](handleEntityNotFound(_0x380648,null))['then'](respondWithResult(_0x380648,null))['catch'](handleError(_0x380648,null));};exports['create']=function(_0x11034e,_0x498c59){return db[_0x0f4a('0x3a')]['create'](_0x11034e[_0x0f4a('0x56')],{})[_0x0f4a('0x20')](function(_0x136f84){var _0x470064=_0x11034e[_0x0f4a('0x57')]['get']({'plain':!![]});if(!_0x470064)throw new Error(_0x0f4a('0x58'));if(_0x470064[_0x0f4a('0x59')]==='user'){var _0x31ff87=_0x136f84[_0x0f4a('0x32')]({'plain':!![]});var _0x3ea46e=_0x0f4a('0x33');return db[_0x0f4a('0x5a')][_0x0f4a('0x55')]({'where':{'name':_0x3ea46e,'userProfileId':_0x470064[_0x0f4a('0x5b')]},'raw':!![]})['then'](function(_0x2d9347){if(_0x2d9347&&_0x2d9347[_0x0f4a('0x5c')]===0x0){return db[_0x0f4a('0x34')][_0x0f4a('0x5d')]({'name':_0x31ff87[_0x0f4a('0x37')],'resourceId':_0x31ff87['id'],'type':_0x2d9347[_0x0f4a('0x37')],'sectionId':_0x2d9347['id']},{})[_0x0f4a('0x20')](function(){return _0x136f84;});}else{return _0x136f84;}})[_0x0f4a('0x52')](function(_0x5ca079){logger[_0x0f4a('0x23')](_0x0f4a('0x5e'),_0x5ca079);throw _0x5ca079;});}return _0x136f84;})[_0x0f4a('0x20')](respondWithResult(_0x498c59,0xc9))[_0x0f4a('0x52')](handleError(_0x498c59,null));};exports[_0x0f4a('0x5f')]=function(_0x52e33e,_0x4f89de){if(_0x52e33e[_0x0f4a('0x56')]['id']){delete _0x52e33e[_0x0f4a('0x56')]['id'];}return db['ChatQueue'][_0x0f4a('0x55')]({'where':{'id':_0x52e33e[_0x0f4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f89de,null))[_0x0f4a('0x20')](saveUpdates(_0x52e33e[_0x0f4a('0x56')],null))[_0x0f4a('0x20')](respondWithResult(_0x4f89de,null))['catch'](handleError(_0x4f89de,null));};exports[_0x0f4a('0x35')]=function(_0x4e84ae,_0x126104){return db[_0x0f4a('0x3a')][_0x0f4a('0x55')]({'where':{'id':_0x4e84ae[_0x0f4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x126104,null))[_0x0f4a('0x20')](removeEntity(_0x126104,null))[_0x0f4a('0x52')](handleError(_0x126104,null));};exports[_0x0f4a('0x60')]=function(_0x47665,_0x2e2df4){return db[_0x0f4a('0x3a')][_0x0f4a('0x60')]()[_0x0f4a('0x20')](respondWithResult(_0x2e2df4,null))[_0x0f4a('0x52')](handleError(_0x2e2df4,null));};exports[_0x0f4a('0x61')]=function(_0x24c41a,_0x4d44a2,_0x2e697){var _0x541c1e={'raw':!![],'where':{}},_0x29f874={},_0x5b6c3c;return db['ChatQueue']['findOne']({'where':{'id':_0x24c41a['params']['id']}})[_0x0f4a('0x20')](handleEntityNotFound(_0x4d44a2,null))[_0x0f4a('0x20')](function(_0x4db15b){if(_0x4db15b){_0x5b6c3c=_0x4db15b[_0x0f4a('0x32')]({'plain':!![]});_0x29f874[_0x0f4a('0x3e')]=_['keys'](db['UserChatQueue'][_0x0f4a('0x3b')]);_0x29f874[_0x0f4a('0x41')]=_['keys'](_0x24c41a['query']);_0x29f874[_0x0f4a('0x42')]=_[_0x0f4a('0x44')](_0x29f874[_0x0f4a('0x3e')],_0x29f874[_0x0f4a('0x41')]);_0x541c1e[_0x0f4a('0x43')]=_[_0x0f4a('0x44')](_0x29f874[_0x0f4a('0x3e')],qs[_0x0f4a('0x45')](_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x45')]));_0x541c1e[_0x0f4a('0x43')]=_0x541c1e[_0x0f4a('0x43')][_0x0f4a('0x46')]?_0x541c1e[_0x0f4a('0x43')]:_0x29f874[_0x0f4a('0x3e')];if(!_0x24c41a['query'][_0x0f4a('0x62')](_0x0f4a('0x63'))){_0x541c1e[_0x0f4a('0x2c')]=qs['limit'](_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x2c')]);_0x541c1e[_0x0f4a('0x2a')]=qs[_0x0f4a('0x2a')](_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x2a')]);}_0x541c1e[_0x0f4a('0x47')]=qs[_0x0f4a('0x48')](_0x24c41a['query'][_0x0f4a('0x48')]);_0x541c1e[_0x0f4a('0x49')]=qs[_0x0f4a('0x42')](_['pick'](_0x24c41a[_0x0f4a('0x41')],_0x29f874[_0x0f4a('0x42')]));_0x541c1e[_0x0f4a('0x49')][_0x0f4a('0x64')]=_0x4db15b['id'];if(_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x4e')]){_0x541c1e[_0x0f4a('0x49')]=_[_0x0f4a('0x4b')](_0x541c1e[_0x0f4a('0x49')],{'$or':_[_0x0f4a('0x3f')](_0x541c1e[_0x0f4a('0x43')],function(_0x861fed){var _0x46ab8f={};_0x46ab8f[_0x861fed]={'$like':'%'+_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x4e')]+'%'};return _0x46ab8f;})});}_0x541c1e=_[_0x0f4a('0x4b')]({},_0x541c1e,_0x24c41a['options']);return db[_0x0f4a('0x65')][_0x0f4a('0x66')](_0x541c1e);}})[_0x0f4a('0x20')](function(_0x4ef725){if(_0x4ef725){return db[_0x0f4a('0x67')][_0x0f4a('0x68')]({'where':{'id':_[_0x0f4a('0x3f')](_0x4ef725,_0x0f4a('0x69')),'role':_0x0f4a('0x6a')},'attributes':['id','name','chatPause',_0x0f4a('0x6b'),_0x0f4a('0x6c')]});}})['then'](function(_0x14133e){if(_0x14133e){return{'count':_0x14133e[_0x0f4a('0x2d')],'rows':_[_0x0f4a('0x3f')](_0x14133e[_0x0f4a('0x51')],function(_0x5968da){return{'membername':_0x5968da[_0x0f4a('0x37')],'UserId':_0x5968da['id'],'queue_name':_0x5b6c3c[_0x0f4a('0x37')],'ChatQueueId':_0x5b6c3c['id'],'interface':util[_0x0f4a('0x6d')](_0x0f4a('0x6e'),'SIP',_0x5968da['name']),'penalty':0x0,'paused':_0x5968da['chatPause'],'createdAt':_0x5968da[_0x0f4a('0x6c')],'updatedAt':_0x5968da[_0x0f4a('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0f4a('0x20')](respondWithFilteredResult(_0x4d44a2,_0x541c1e))[_0x0f4a('0x52')](handleError(_0x4d44a2,null));};exports[_0x0f4a('0x6f')]=function(_0x4a10d8,_0x123a26,_0x5db69d){var _0x2d716f={};var _0x5ef382={};var _0x298e09;var _0x115fa8;return db[_0x0f4a('0x3a')][_0x0f4a('0x70')]({'where':{'id':_0x4a10d8['params']['id']}})[_0x0f4a('0x20')](handleEntityNotFound(_0x123a26,null))[_0x0f4a('0x20')](function(_0x1e3bf5){if(_0x1e3bf5){_0x298e09=_0x1e3bf5;_0x5ef382[_0x0f4a('0x3e')]=_[_0x0f4a('0x40')](db[_0x0f4a('0x71')][_0x0f4a('0x3b')]);_0x5ef382[_0x0f4a('0x41')]=_['keys'](_0x4a10d8['query']);_0x5ef382['filters']=_[_0x0f4a('0x44')](_0x5ef382[_0x0f4a('0x3e')],_0x5ef382[_0x0f4a('0x41')]);_0x2d716f['attributes']=_[_0x0f4a('0x44')](_0x5ef382[_0x0f4a('0x3e')],qs[_0x0f4a('0x45')](_0x4a10d8[_0x0f4a('0x41')][_0x0f4a('0x45')]));_0x2d716f['attributes']=_0x2d716f['attributes'][_0x0f4a('0x46')]?_0x2d716f[_0x0f4a('0x43')]:_0x5ef382[_0x0f4a('0x3e')];_0x2d716f[_0x0f4a('0x47')]=qs[_0x0f4a('0x48')](_0x4a10d8['query'][_0x0f4a('0x48')]);_0x2d716f[_0x0f4a('0x49')]=qs['filters'](_[_0x0f4a('0x4a')](_0x4a10d8[_0x0f4a('0x41')],_0x5ef382[_0x0f4a('0x42')]));if(_0x4a10d8[_0x0f4a('0x41')][_0x0f4a('0x4e')]){_0x2d716f['where']=_[_0x0f4a('0x4b')](_0x2d716f[_0x0f4a('0x49')],{'$or':_[_0x0f4a('0x3f')](_0x2d716f[_0x0f4a('0x43')],function(_0x2f95a6){var _0x53947e={};_0x53947e[_0x2f95a6]={'$like':'%'+_0x4a10d8[_0x0f4a('0x41')][_0x0f4a('0x4e')]+'%'};return _0x53947e;})});}_0x2d716f=_['merge']({},_0x2d716f,_0x4a10d8[_0x0f4a('0x54')]);return _0x298e09[_0x0f4a('0x6f')](_0x2d716f);}})[_0x0f4a('0x20')](function(_0x35526f){if(_0x35526f){_0x115fa8=_0x35526f['length'];if(!_0x4a10d8['query'][_0x0f4a('0x62')](_0x0f4a('0x63'))){_0x2d716f[_0x0f4a('0x2c')]=qs[_0x0f4a('0x2c')](_0x4a10d8[_0x0f4a('0x41')]['limit']);_0x2d716f[_0x0f4a('0x2a')]=qs['offset'](_0x4a10d8[_0x0f4a('0x41')][_0x0f4a('0x2a')]);}return _0x298e09[_0x0f4a('0x6f')](_0x2d716f);}})['then'](function(_0x5a8e99){if(_0x5a8e99){return _0x5a8e99?{'count':_0x115fa8,'rows':_0x5a8e99}:null;}})[_0x0f4a('0x20')](respondWithResult(_0x123a26,null))['catch'](handleError(_0x123a26,null));};exports['addTeams']=function(_0x491970,_0x38a11d,_0x50e8d0){var _0x282065=_0x491970['body'][_0x0f4a('0x72')];return db['Team']['findAll']({'where':{'id':_0x282065},'attributes':['id'],'include':[{'model':db[_0x0f4a('0x67')],'as':'Agents','attributes':['id','name',_0x0f4a('0x73'),_0x0f4a('0x74'),'interface'],'raw':!![]}]})[_0x0f4a('0x20')](function(_0x4d9797){if(_0x4d9797){var _0x23a610=_['flatMap'](_0x4d9797,function(_0x12a234){var _0x5d6ac2=_0x12a234['get']({'plain':!![]});return _0x5d6ac2[_0x0f4a('0x75')];});return db[_0x0f4a('0x3a')][_0x0f4a('0x55')]({'where':{'id':_0x491970[_0x0f4a('0x53')]['id']}})['then'](function(_0x3b5622){return db['sequelize']['transaction'](function(_0x35dc55){return _0x3b5622[_0x0f4a('0x76')](_0x282065,{'transaction':_0x35dc55})[_0x0f4a('0x20')](function(){return BPromise[_0x0f4a('0x77')](_0x23a610,function(_0x232ad5){return db[_0x0f4a('0x65')][_0x0f4a('0x78')]({'where':{'UserId':_0x232ad5['id'],'ChatQueueId':_0x491970[_0x0f4a('0x53')]['id']},'transaction':_0x35dc55});});})[_0x0f4a('0x20')](function(){_0x23a610['forEach'](function(_0x222af1){socket[_0x0f4a('0x79')]('userChatQueue:save',{'UserId':_0x222af1['id'],'ChatQueueId':_0x3b5622['id']});});});});});}})[_0x0f4a('0x20')](respondWithStatusCode(_0x38a11d,null))['catch'](handleError(_0x38a11d,null));};exports['removeTeams']=function(_0x2c5647,_0xb8e340,_0x31064b){return db[_0x0f4a('0x71')][_0x0f4a('0x66')]({'where':{'id':_0x2c5647[_0x0f4a('0x41')][_0x0f4a('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0f4a('0x20')](handleEntityNotFound(_0xb8e340,null))[_0x0f4a('0x20')](function(_0x4826a2){var _0x548a79=_['map'](_0x4826a2,'id');var _0xe5a8ac=[];var _0x11a4b6=[];var _0x3af110=squel[_0x0f4a('0x7a')]();_0x3af110['field'](_0x0f4a('0x7b'))[_0x0f4a('0x7c')](_0x0f4a('0x7d'),'tq')['join'](_0x0f4a('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0f4a('0x49')](_0x0f4a('0x7f'),_0x2c5647[_0x0f4a('0x53')]['id']);for(var _0x5b9699=0x0;_0x5b9699<_0x4826a2[_0x0f4a('0x46')];_0x5b9699+=0x1){let _0x1709aa=_0x4826a2[_0x5b9699];for(var _0x4c90ae=0x0;_0x4c90ae<_0x1709aa[_0x0f4a('0x75')]['length'];_0x4c90ae+=0x1){let _0x41a203=_0x1709aa[_0x0f4a('0x75')][_0x4c90ae];var _0x109f8d=_0x3af110[_0x0f4a('0x80')]();_0x109f8d[_0x0f4a('0x49')](_0x0f4a('0x81'),_0x41a203['id']);_0x11a4b6[_0x0f4a('0x82')](db['sequelize'][_0x0f4a('0x41')](_0x109f8d['toString'](),{'type':db[_0x0f4a('0x83')][_0x0f4a('0x84')]['SELECT']})[_0x0f4a('0x20')](function(_0x10fb1e){if(_0x10fb1e['length']===0x1){return _0x41a203['id'];}else{var _0x26e1ad=_[_0x0f4a('0x85')](_[_0x0f4a('0x3f')](_0x10fb1e,_0x0f4a('0x86')),function(_0x105b62){return _[_0x0f4a('0x87')](_0x548a79,_0x105b62);});if(_0x26e1ad){return _0x41a203['id'];}}}));}}return BPromise[_0x0f4a('0x88')](_0x11a4b6)['then'](function(_0x17d7fd){_0xe5a8ac=_(_0xe5a8ac)[_0x0f4a('0x89')](_0x17d7fd)[_0x0f4a('0x8a')]()[_0x0f4a('0x8b')]();return db[_0x0f4a('0x3a')]['find']({'where':{'id':_0x2c5647[_0x0f4a('0x53')]['id']}})[_0x0f4a('0x20')](function(_0x80e2e8){return db[_0x0f4a('0x83')][_0x0f4a('0x8c')](function(_0x341508){return _0x80e2e8['removeTeams'](_0x2c5647[_0x0f4a('0x41')][_0x0f4a('0x72')],{'transaction':_0x341508})[_0x0f4a('0x20')](function(){if(!_[_0x0f4a('0x8d')](_0xe5a8ac)){return _0x80e2e8['removeAgents'](_0xe5a8ac,{'transaction':_0x341508});}})['then'](function(){_0xe5a8ac['forEach'](function(_0x2a88a0){socket[_0x0f4a('0x79')](_0x0f4a('0x8e'),{'UserId':_0x2a88a0,'ChatQueueId':_0x80e2e8['id']});});});});});});})[_0x0f4a('0x20')](respondWithStatusCode(_0xb8e340,null))[_0x0f4a('0x52')](handleError(_0xb8e340,null));};exports[_0x0f4a('0x8f')]=function(_0x46824b,_0x1c9ad5,_0xed7b9f){return db['ChatQueue'][_0x0f4a('0x55')]({'where':{'id':_0x46824b[_0x0f4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x1c9ad5,null))[_0x0f4a('0x20')](function(_0x2258b0){if(_0x2258b0){return _0x2258b0[_0x0f4a('0x8f')](_0x46824b[_0x0f4a('0x56')][_0x0f4a('0x72')],_[_0x0f4a('0x90')](_0x46824b[_0x0f4a('0x56')],[_0x0f4a('0x72'),'id'])||{})[_0x0f4a('0x91')](function(_0xb6df24){for(var _0x1022c7=0x0;_0x1022c7<_0x46824b[_0x0f4a('0x56')]['ids']['length'];_0x1022c7+=0x1){socket[_0x0f4a('0x79')](_0x0f4a('0x92'),{'UserId':Number(_0x46824b['body']['ids'][_0x1022c7]),'ChatQueueId':Number(_0x46824b['params']['id'])});}return _0xb6df24;});}})['then'](respondWithResult(_0x1c9ad5,null))[_0x0f4a('0x52')](handleError(_0x1c9ad5,null));};exports[_0x0f4a('0x93')]=function(_0x562c86,_0x4a3a09,_0x13d5fd){return db[_0x0f4a('0x3a')]['find']({'where':{'id':_0x562c86['params']['id']}})[_0x0f4a('0x20')](handleEntityNotFound(_0x4a3a09,null))[_0x0f4a('0x20')](function(_0x150a5b){if(_0x150a5b){return _0x150a5b[_0x0f4a('0x93')](_0x562c86[_0x0f4a('0x41')][_0x0f4a('0x72')])[_0x0f4a('0x20')](function(){if(_[_0x0f4a('0x94')](_0x562c86[_0x0f4a('0x41')][_0x0f4a('0x72')])){for(var _0x4d4eda=0x0;_0x4d4eda<_0x562c86[_0x0f4a('0x41')]['ids']['length'];_0x4d4eda+=0x1){socket[_0x0f4a('0x79')]('userChatQueue:remove',{'UserId':Number(_0x562c86['query']['ids'][_0x4d4eda]),'ChatQueueId':Number(_0x562c86[_0x0f4a('0x53')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x562c86['query'][_0x0f4a('0x72')]),'ChatQueueId':Number(_0x562c86[_0x0f4a('0x53')]['id'])});}});}})[_0x0f4a('0x20')](respondWithStatusCode(_0x4a3a09,null))[_0x0f4a('0x52')](handleError(_0x4a3a09,null));};exports[_0x0f4a('0x95')]=function(_0x13ebeb,_0x4e12a3,_0x37c858){var _0x4e3b45={};var _0x106bd4={};var _0xa4c535;var _0x682ad3;return db['ChatQueue'][_0x0f4a('0x70')]({'where':{'id':_0x13ebeb[_0x0f4a('0x53')]['id']}})[_0x0f4a('0x20')](handleEntityNotFound(_0x4e12a3,null))['then'](function(_0x305c98){if(_0x305c98){_0xa4c535=_0x305c98;_0x106bd4[_0x0f4a('0x3e')]=_[_0x0f4a('0x40')](db[_0x0f4a('0x67')]['rawAttributes']);_0x106bd4['query']=_[_0x0f4a('0x40')](_0x13ebeb[_0x0f4a('0x41')]);_0x106bd4[_0x0f4a('0x42')]=_['intersection'](_0x106bd4[_0x0f4a('0x3e')],_0x106bd4['query']);_0x4e3b45[_0x0f4a('0x43')]=_['intersection'](_0x106bd4[_0x0f4a('0x3e')],qs[_0x0f4a('0x45')](_0x13ebeb[_0x0f4a('0x41')][_0x0f4a('0x45')]));_0x4e3b45[_0x0f4a('0x43')]=_0x4e3b45[_0x0f4a('0x43')][_0x0f4a('0x46')]?_0x4e3b45['attributes']:_0x106bd4['model'];_0x4e3b45[_0x0f4a('0x47')]=qs['sort'](_0x13ebeb['query'][_0x0f4a('0x48')]);_0x4e3b45[_0x0f4a('0x49')]=qs[_0x0f4a('0x42')](_['pick'](_0x13ebeb[_0x0f4a('0x41')],_0x106bd4[_0x0f4a('0x42')]));if(_0x13ebeb[_0x0f4a('0x41')]['filter']){_0x4e3b45[_0x0f4a('0x49')]=_['merge'](_0x4e3b45[_0x0f4a('0x49')],{'$or':_[_0x0f4a('0x3f')](_0x4e3b45[_0x0f4a('0x43')],function(_0x4c7dba){var _0x596618={};_0x596618[_0x4c7dba]={'$like':'%'+_0x13ebeb['query']['filter']+'%'};return _0x596618;})});}_0x4e3b45=_[_0x0f4a('0x4b')]({},_0x4e3b45,_0x13ebeb['options']);return _0xa4c535[_0x0f4a('0x95')](_0x4e3b45);}})[_0x0f4a('0x20')](function(_0x4417b8){if(_0x4417b8){_0x682ad3=_0x4417b8[_0x0f4a('0x46')];if(!_0x13ebeb[_0x0f4a('0x41')][_0x0f4a('0x62')]('nolimit')){_0x4e3b45[_0x0f4a('0x2c')]=qs[_0x0f4a('0x2c')](_0x13ebeb['query'][_0x0f4a('0x2c')]);_0x4e3b45[_0x0f4a('0x2a')]=qs[_0x0f4a('0x2a')](_0x13ebeb[_0x0f4a('0x41')]['offset']);}return _0xa4c535[_0x0f4a('0x95')](_0x4e3b45);}})[_0x0f4a('0x20')](function(_0x42db87){if(_0x42db87){return _0x42db87?{'count':_0x682ad3,'rows':_0x42db87}:null;}})['then'](respondWithResult(_0x4e12a3,null))['catch'](handleError(_0x4e12a3,null));};
\ No newline at end of file
+var _0x6994=['value','ids','isEmpty','forEach','emit','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','get','ChatQueues','stack','name','send','index','map','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','ChatQueueId','findAndCountAll','agent','updatedAt','createdAt','%s/%s','chatPause','getTeams','findOne','Team','User','online','voicePause','interface','flatMap','Agents','transaction','addTeams','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','TeamId','all','union','compact'];(function(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0x6994,0x1d1));var _0x4699=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x6994[_0x5a3cf0];return _0x5a64ee;};'use strict';var emlformat=require(_0x4699('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4699('0x1'));var jsonpatch=require(_0x4699('0x2'));var rp=require(_0x4699('0x3'));var moment=require(_0x4699('0x4'));var BPromise=require(_0x4699('0x5'));var Mustache=require(_0x4699('0x6'));var util=require(_0x4699('0x7'));var path=require(_0x4699('0x8'));var sox=require('sox');var csv=require(_0x4699('0x9'));var ejs=require(_0x4699('0xa'));var fs=require('fs');var fs_extra=require(_0x4699('0xb'));var _=require(_0x4699('0xc'));var squel=require(_0x4699('0xd'));var crypto=require('crypto');var jsforce=require(_0x4699('0xe'));var deskjs=require(_0x4699('0xf'));var toCsv=require(_0x4699('0x9'));var querystring=require('querystring');var Papa=require(_0x4699('0x10'));var Redis=require(_0x4699('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4699('0x12'));var as=require(_0x4699('0x13'));var hardwareService=require(_0x4699('0x14'));var logger=require(_0x4699('0x15'))('api');var utils=require(_0x4699('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4699('0x17'));var db=require('../../mysqldb')['db'];config[_0x4699('0x18')]=_[_0x4699('0x19')](config[_0x4699('0x18')],{'host':_0x4699('0x1a'),'port':0x18eb});var socket=require(_0x4699('0x1b'))(new Redis(config['redis']));require(_0x4699('0x1c'))[_0x4699('0x1d')](socket);var jayson=require(_0x4699('0x1e'));var client=jayson[_0x4699('0x1f')][_0x4699('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xbd46e3,_0x3282be,_0x26a0b1,_0x5842a7){return new BPromise(function(_0x3f68a0,_0x2a5a4c){var _0x5c78c8=_0x5842a7||client;return _0x5c78c8['request'](_0xbd46e3,_0x26a0b1)['then'](function(_0x2d6f4f){logger['info'](_0x4699('0x21'),_0x3282be,_0x4699('0x22'));logger[_0x4699('0x23')](_0x4699('0x24'),_0x3282be,_0x4699('0x22'),JSON[_0x4699('0x25')](_0x2d6f4f));if(_0x2d6f4f['error']){if(_0x2d6f4f[_0x4699('0x26')]['code']===0x1f4){logger[_0x4699('0x26')](_0x4699('0x21'),_0x3282be,_0x2d6f4f[_0x4699('0x26')][_0x4699('0x27')]);return _0x2a5a4c(_0x2d6f4f['error'][_0x4699('0x27')]);}logger[_0x4699('0x26')](_0x4699('0x21'),_0x3282be,_0x2d6f4f[_0x4699('0x26')][_0x4699('0x27')]);return _0x3f68a0(_0x2d6f4f[_0x4699('0x26')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x3282be,_0x4699('0x22'));_0x3f68a0(_0x2d6f4f[_0x4699('0x28')][_0x4699('0x27')]);}})[_0x4699('0x29')](function(_0x1789b){logger[_0x4699('0x26')](_0x4699('0x21'),_0x3282be,_0x1789b);_0x2a5a4c(_0x1789b);});});}function respondWithStatusCode(_0xca6426,_0x2ca876){_0x2ca876=_0x2ca876||0xcc;return function(_0x66ad12){if(_0x66ad12){return _0xca6426[_0x4699('0x2a')](_0x2ca876);}return _0xca6426[_0x4699('0x2b')](_0x2ca876)[_0x4699('0x2c')]();};}function respondWithResult(_0x5d5946,_0x56b211){_0x56b211=_0x56b211||0xc8;return function(_0x3c8748){if(_0x3c8748){return _0x5d5946[_0x4699('0x2b')](_0x56b211)['json'](_0x3c8748);}};}function respondWithFilteredResult(_0x366624,_0x3e6e8c){return function(_0x42cc1f){if(_0x42cc1f){var _0x29cffc=typeof _0x3e6e8c[_0x4699('0x2d')]===_0x4699('0x2e')&&typeof _0x3e6e8c['limit']===_0x4699('0x2e');var _0x4b2bcd=_0x42cc1f[_0x4699('0x2f')];var _0x4c3e18=_0x29cffc?0x0:_0x3e6e8c[_0x4699('0x2d')];var _0x1d783d=_0x29cffc?_0x42cc1f[_0x4699('0x2f')]:_0x3e6e8c[_0x4699('0x2d')]+_0x3e6e8c[_0x4699('0x30')];var _0x169714;if(_0x1d783d>=_0x4b2bcd){_0x1d783d=_0x4b2bcd;_0x169714=0xc8;}else{_0x169714=0xce;}_0x366624[_0x4699('0x2b')](_0x169714);return _0x366624['set'](_0x4699('0x31'),_0x4c3e18+'-'+_0x1d783d+'/'+_0x4b2bcd)[_0x4699('0x32')](_0x42cc1f);}return null;};}function patchUpdates(_0x4dd7b1){return function(_0x4e18bd){try{jsonpatch[_0x4699('0x33')](_0x4e18bd,_0x4dd7b1,!![]);}catch(_0x5b0cba){return BPromise[_0x4699('0x34')](_0x5b0cba);}return _0x4e18bd[_0x4699('0x35')]();};}function saveUpdates(_0x1cd490,_0x3f7519){return function(_0x3eba28){if(_0x3eba28){return _0x3eba28[_0x4699('0x36')](_0x1cd490)['then'](function(_0x9d6f17){return _0x9d6f17;});}return null;};}function removeEntity(_0x396667,_0x1a1a92){return function(_0x59b4ff){if(_0x59b4ff){return _0x59b4ff[_0x4699('0x37')]()[_0x4699('0x38')](function(){var _0x281f78=_0x59b4ff[_0x4699('0x39')]({'plain':!![]});var _0x26d2cf=_0x4699('0x3a');return db['UserProfileResource'][_0x4699('0x37')]({'where':{'type':_0x26d2cf,'resourceId':_0x281f78['id']}})['then'](function(){return _0x59b4ff;});})['then'](function(){_0x396667[_0x4699('0x2b')](0xcc)[_0x4699('0x2c')]();});}};}function handleEntityNotFound(_0x4361f0,_0x44a445){return function(_0x42f346){if(!_0x42f346){_0x4361f0[_0x4699('0x2a')](0x194);}return _0x42f346;};}function handleError(_0x3c4bba,_0x28f63b){_0x28f63b=_0x28f63b||0x1f4;return function(_0x17dc2b){logger['error'](_0x17dc2b[_0x4699('0x3b')]);if(_0x17dc2b['name']){delete _0x17dc2b[_0x4699('0x3c')];}_0x3c4bba[_0x4699('0x2b')](_0x28f63b)[_0x4699('0x3d')](_0x17dc2b);};}exports[_0x4699('0x3e')]=function(_0x3b93b8,_0x357f9d){var _0x5ebbfa={},_0x4f2653={},_0x14aaf3={'count':0x0,'rows':[]};var _0x475a4c=_[_0x4699('0x3f')](db[_0x4699('0x40')]['rawAttributes'],function(_0x46c4b9){return{'name':_0x46c4b9[_0x4699('0x41')],'type':_0x46c4b9[_0x4699('0x42')][_0x4699('0x43')]};});_0x4f2653[_0x4699('0x44')]=_[_0x4699('0x3f')](_0x475a4c,_0x4699('0x3c'));_0x4f2653[_0x4699('0x45')]=_[_0x4699('0x46')](_0x3b93b8['query']);_0x4f2653[_0x4699('0x47')]=_[_0x4699('0x48')](_0x4f2653[_0x4699('0x44')],_0x4f2653[_0x4699('0x45')]);_0x5ebbfa[_0x4699('0x49')]=_[_0x4699('0x48')](_0x4f2653[_0x4699('0x44')],qs[_0x4699('0x4a')](_0x3b93b8['query']['fields']));_0x5ebbfa[_0x4699('0x49')]=_0x5ebbfa['attributes'][_0x4699('0x4b')]?_0x5ebbfa[_0x4699('0x49')]:_0x4f2653[_0x4699('0x44')];if(!_0x3b93b8[_0x4699('0x45')][_0x4699('0x4c')](_0x4699('0x4d'))){_0x5ebbfa['limit']=qs['limit'](_0x3b93b8['query']['limit']);_0x5ebbfa['offset']=qs[_0x4699('0x2d')](_0x3b93b8['query']['offset']);}_0x5ebbfa[_0x4699('0x4e')]=qs[_0x4699('0x4f')](_0x3b93b8['query'][_0x4699('0x4f')]);_0x5ebbfa[_0x4699('0x50')]=qs[_0x4699('0x47')](_[_0x4699('0x51')](_0x3b93b8[_0x4699('0x45')],_0x4f2653[_0x4699('0x47')]),_0x475a4c);if(_0x3b93b8[_0x4699('0x45')][_0x4699('0x52')]){_0x5ebbfa[_0x4699('0x50')]=_[_0x4699('0x53')](_0x5ebbfa[_0x4699('0x50')],{'$or':_[_0x4699('0x3f')](_0x475a4c,function(_0x288c27){if(_0x288c27[_0x4699('0x42')]!==_0x4699('0x54')){var _0x162875={};_0x162875[_0x288c27[_0x4699('0x3c')]]={'$like':'%'+_0x3b93b8['query'][_0x4699('0x52')]+'%'};return _0x162875;}})});}_0x5ebbfa=_[_0x4699('0x53')]({},_0x5ebbfa,_0x3b93b8[_0x4699('0x55')]);var _0x48f7af={'where':_0x5ebbfa[_0x4699('0x50')]};return db[_0x4699('0x40')][_0x4699('0x2f')](_0x48f7af)[_0x4699('0x38')](function(_0x4f2f85){_0x14aaf3['count']=_0x4f2f85;if(_0x3b93b8[_0x4699('0x45')]['includeAll']){_0x5ebbfa['include']=[{'all':!![]}];}return db[_0x4699('0x40')][_0x4699('0x56')](_0x5ebbfa);})['then'](function(_0x6154cc){_0x14aaf3['rows']=_0x6154cc;return _0x14aaf3;})[_0x4699('0x38')](respondWithFilteredResult(_0x357f9d,_0x5ebbfa))[_0x4699('0x29')](handleError(_0x357f9d,null));};exports[_0x4699('0x57')]=function(_0x3c0e60,_0x4869d6){var _0x29a9e6={'raw':!![],'where':{'id':_0x3c0e60[_0x4699('0x58')]['id']}},_0x22c73d={};_0x22c73d[_0x4699('0x44')]=_['keys'](db[_0x4699('0x40')][_0x4699('0x59')]);_0x22c73d[_0x4699('0x45')]=_[_0x4699('0x46')](_0x3c0e60[_0x4699('0x45')]);_0x22c73d[_0x4699('0x47')]=_[_0x4699('0x48')](_0x22c73d[_0x4699('0x44')],_0x22c73d[_0x4699('0x45')]);_0x29a9e6['attributes']=_['intersection'](_0x22c73d[_0x4699('0x44')],qs['fields'](_0x3c0e60['query'][_0x4699('0x4a')]));_0x29a9e6['attributes']=_0x29a9e6[_0x4699('0x49')][_0x4699('0x4b')]?_0x29a9e6[_0x4699('0x49')]:_0x22c73d[_0x4699('0x44')];if(_0x3c0e60[_0x4699('0x45')][_0x4699('0x5a')]){_0x29a9e6[_0x4699('0x5b')]=[{'all':!![]}];}_0x29a9e6=_[_0x4699('0x53')]({},_0x29a9e6,_0x3c0e60[_0x4699('0x55')]);return db[_0x4699('0x40')][_0x4699('0x5c')](_0x29a9e6)[_0x4699('0x38')](handleEntityNotFound(_0x4869d6,null))[_0x4699('0x38')](respondWithResult(_0x4869d6,null))[_0x4699('0x29')](handleError(_0x4869d6,null));};exports['create']=function(_0x1b5d07,_0x140296){return db[_0x4699('0x40')][_0x4699('0x5d')](_0x1b5d07[_0x4699('0x5e')],{})['then'](function(_0x1a6897){var _0x4d2d80=_0x1b5d07[_0x4699('0x5f')]['get']({'plain':!![]});if(!_0x4d2d80)throw new Error(_0x4699('0x60'));if(_0x4d2d80['role']===_0x4699('0x5f')){var _0xe5550f=_0x1a6897['get']({'plain':!![]});var _0x12699e=_0x4699('0x3a');return db[_0x4699('0x61')][_0x4699('0x5c')]({'where':{'name':_0x12699e,'userProfileId':_0x4d2d80['userProfileId']},'raw':!![]})[_0x4699('0x38')](function(_0x58f038){if(_0x58f038&&_0x58f038[_0x4699('0x62')]===0x0){return db[_0x4699('0x63')][_0x4699('0x5d')]({'name':_0xe5550f[_0x4699('0x3c')],'resourceId':_0xe5550f['id'],'type':_0x58f038[_0x4699('0x3c')],'sectionId':_0x58f038['id']},{})[_0x4699('0x38')](function(){return _0x1a6897;});}else{return _0x1a6897;}})[_0x4699('0x29')](function(_0x1c151b){logger[_0x4699('0x26')](_0x4699('0x64'),_0x1c151b);throw _0x1c151b;});}return _0x1a6897;})['then'](respondWithResult(_0x140296,0xc9))[_0x4699('0x29')](handleError(_0x140296,null));};exports[_0x4699('0x36')]=function(_0x4b72cd,_0x4dd31b){if(_0x4b72cd[_0x4699('0x5e')]['id']){delete _0x4b72cd['body']['id'];}return db[_0x4699('0x40')][_0x4699('0x5c')]({'where':{'id':_0x4b72cd['params']['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x4dd31b,null))['then'](saveUpdates(_0x4b72cd[_0x4699('0x5e')],null))[_0x4699('0x38')](respondWithResult(_0x4dd31b,null))['catch'](handleError(_0x4dd31b,null));};exports[_0x4699('0x37')]=function(_0x92a35e,_0x1da266){return db[_0x4699('0x40')]['find']({'where':{'id':_0x92a35e[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x1da266,null))[_0x4699('0x38')](removeEntity(_0x1da266,null))[_0x4699('0x29')](handleError(_0x1da266,null));};exports[_0x4699('0x65')]=function(_0x3c3ac0,_0x3c5dca){return db[_0x4699('0x40')][_0x4699('0x65')]()[_0x4699('0x38')](respondWithResult(_0x3c5dca,null))[_0x4699('0x29')](handleError(_0x3c5dca,null));};exports['getMembers']=function(_0x2f0fb9,_0x3002cb,_0x372eac){var _0x5d7698={'raw':!![],'where':{}},_0x23b907={},_0x43d714;return db[_0x4699('0x40')]['findOne']({'where':{'id':_0x2f0fb9['params']['id']}})['then'](handleEntityNotFound(_0x3002cb,null))[_0x4699('0x38')](function(_0x5cfdc5){if(_0x5cfdc5){_0x43d714=_0x5cfdc5[_0x4699('0x39')]({'plain':!![]});_0x23b907[_0x4699('0x44')]=_[_0x4699('0x46')](db[_0x4699('0x66')][_0x4699('0x59')]);_0x23b907[_0x4699('0x45')]=_[_0x4699('0x46')](_0x2f0fb9[_0x4699('0x45')]);_0x23b907[_0x4699('0x47')]=_[_0x4699('0x48')](_0x23b907[_0x4699('0x44')],_0x23b907[_0x4699('0x45')]);_0x5d7698[_0x4699('0x49')]=_[_0x4699('0x48')](_0x23b907[_0x4699('0x44')],qs['fields'](_0x2f0fb9[_0x4699('0x45')][_0x4699('0x4a')]));_0x5d7698[_0x4699('0x49')]=_0x5d7698[_0x4699('0x49')][_0x4699('0x4b')]?_0x5d7698[_0x4699('0x49')]:_0x23b907[_0x4699('0x44')];if(!_0x2f0fb9[_0x4699('0x45')][_0x4699('0x4c')](_0x4699('0x4d'))){_0x5d7698[_0x4699('0x30')]=qs[_0x4699('0x30')](_0x2f0fb9[_0x4699('0x45')][_0x4699('0x30')]);_0x5d7698[_0x4699('0x2d')]=qs[_0x4699('0x2d')](_0x2f0fb9[_0x4699('0x45')][_0x4699('0x2d')]);}_0x5d7698[_0x4699('0x4e')]=qs[_0x4699('0x4f')](_0x2f0fb9[_0x4699('0x45')][_0x4699('0x4f')]);_0x5d7698[_0x4699('0x50')]=qs[_0x4699('0x47')](_[_0x4699('0x51')](_0x2f0fb9[_0x4699('0x45')],_0x23b907[_0x4699('0x47')]));_0x5d7698[_0x4699('0x50')][_0x4699('0x67')]=_0x5cfdc5['id'];if(_0x2f0fb9[_0x4699('0x45')][_0x4699('0x52')]){_0x5d7698[_0x4699('0x50')]=_['merge'](_0x5d7698[_0x4699('0x50')],{'$or':_[_0x4699('0x3f')](_0x5d7698[_0x4699('0x49')],function(_0x4f68e9){var _0x59c523={};_0x59c523[_0x4f68e9]={'$like':'%'+_0x2f0fb9[_0x4699('0x45')][_0x4699('0x52')]+'%'};return _0x59c523;})});}_0x5d7698=_[_0x4699('0x53')]({},_0x5d7698,_0x2f0fb9[_0x4699('0x55')]);return db[_0x4699('0x66')]['findAll'](_0x5d7698);}})[_0x4699('0x38')](function(_0x5c6818){if(_0x5c6818){return db['User'][_0x4699('0x68')]({'where':{'id':_['map'](_0x5c6818,'UserId'),'role':_0x4699('0x69')},'attributes':['id',_0x4699('0x3c'),'chatPause',_0x4699('0x6a'),_0x4699('0x6b')]});}})[_0x4699('0x38')](function(_0x2cc2c1){if(_0x2cc2c1){return{'count':_0x2cc2c1[_0x4699('0x2f')],'rows':_[_0x4699('0x3f')](_0x2cc2c1['rows'],function(_0x268f39){return{'membername':_0x268f39['name'],'UserId':_0x268f39['id'],'queue_name':_0x43d714[_0x4699('0x3c')],'ChatQueueId':_0x43d714['id'],'interface':util['format'](_0x4699('0x6c'),'SIP',_0x268f39[_0x4699('0x3c')]),'penalty':0x0,'paused':_0x268f39[_0x4699('0x6d')],'createdAt':_0x268f39[_0x4699('0x6b')],'updatedAt':_0x268f39['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4699('0x38')](respondWithFilteredResult(_0x3002cb,_0x5d7698))[_0x4699('0x29')](handleError(_0x3002cb,null));};exports[_0x4699('0x6e')]=function(_0x4165b5,_0x228451,_0x4fc8b8){var _0x1bb22a={};var _0x558b29={};var _0x352154;var _0x214fc4;return db[_0x4699('0x40')][_0x4699('0x6f')]({'where':{'id':_0x4165b5[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x228451,null))['then'](function(_0x109f28){if(_0x109f28){_0x352154=_0x109f28;_0x558b29['model']=_[_0x4699('0x46')](db[_0x4699('0x70')][_0x4699('0x59')]);_0x558b29[_0x4699('0x45')]=_[_0x4699('0x46')](_0x4165b5[_0x4699('0x45')]);_0x558b29[_0x4699('0x47')]=_[_0x4699('0x48')](_0x558b29['model'],_0x558b29[_0x4699('0x45')]);_0x1bb22a['attributes']=_['intersection'](_0x558b29['model'],qs[_0x4699('0x4a')](_0x4165b5['query'][_0x4699('0x4a')]));_0x1bb22a[_0x4699('0x49')]=_0x1bb22a[_0x4699('0x49')][_0x4699('0x4b')]?_0x1bb22a['attributes']:_0x558b29['model'];_0x1bb22a['order']=qs[_0x4699('0x4f')](_0x4165b5['query'][_0x4699('0x4f')]);_0x1bb22a['where']=qs[_0x4699('0x47')](_[_0x4699('0x51')](_0x4165b5['query'],_0x558b29[_0x4699('0x47')]));if(_0x4165b5[_0x4699('0x45')][_0x4699('0x52')]){_0x1bb22a[_0x4699('0x50')]=_[_0x4699('0x53')](_0x1bb22a['where'],{'$or':_[_0x4699('0x3f')](_0x1bb22a[_0x4699('0x49')],function(_0x1b69dd){var _0x3f5406={};_0x3f5406[_0x1b69dd]={'$like':'%'+_0x4165b5[_0x4699('0x45')]['filter']+'%'};return _0x3f5406;})});}_0x1bb22a=_[_0x4699('0x53')]({},_0x1bb22a,_0x4165b5[_0x4699('0x55')]);return _0x352154[_0x4699('0x6e')](_0x1bb22a);}})['then'](function(_0x1b33a5){if(_0x1b33a5){_0x214fc4=_0x1b33a5['length'];if(!_0x4165b5[_0x4699('0x45')][_0x4699('0x4c')](_0x4699('0x4d'))){_0x1bb22a[_0x4699('0x30')]=qs[_0x4699('0x30')](_0x4165b5[_0x4699('0x45')]['limit']);_0x1bb22a['offset']=qs['offset'](_0x4165b5['query'][_0x4699('0x2d')]);}return _0x352154[_0x4699('0x6e')](_0x1bb22a);}})['then'](function(_0x2bf759){if(_0x2bf759){return _0x2bf759?{'count':_0x214fc4,'rows':_0x2bf759}:null;}})['then'](respondWithResult(_0x228451,null))[_0x4699('0x29')](handleError(_0x228451,null));};exports['addTeams']=function(_0x521d78,_0x11619f,_0x54affd){var _0x1e0c4a=_0x521d78[_0x4699('0x5e')]['ids'];return db[_0x4699('0x70')][_0x4699('0x56')]({'where':{'id':_0x1e0c4a},'attributes':['id'],'include':[{'model':db[_0x4699('0x71')],'as':'Agents','attributes':['id',_0x4699('0x3c'),_0x4699('0x72'),_0x4699('0x73'),_0x4699('0x74')],'raw':!![]}]})[_0x4699('0x38')](function(_0x185240){if(_0x185240){var _0xd7172c=_[_0x4699('0x75')](_0x185240,function(_0x35bc0a){var _0x54501a=_0x35bc0a[_0x4699('0x39')]({'plain':!![]});return _0x54501a[_0x4699('0x76')];});return db['ChatQueue'][_0x4699('0x5c')]({'where':{'id':_0x521d78['params']['id']}})[_0x4699('0x38')](function(_0x34b500){return db['sequelize'][_0x4699('0x77')](function(_0x532796){return _0x34b500[_0x4699('0x78')](_0x1e0c4a,{'transaction':_0x532796})[_0x4699('0x38')](function(){return BPromise['each'](_0xd7172c,function(_0x38ae09){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x38ae09['id'],'ChatQueueId':_0x521d78['params']['id']},'transaction':_0x532796});});})[_0x4699('0x38')](function(){_0xd7172c['forEach'](function(_0x2a5064){socket['emit'](_0x4699('0x79'),{'UserId':_0x2a5064['id'],'ChatQueueId':_0x34b500['id']});});});});});}})['then'](respondWithStatusCode(_0x11619f,null))[_0x4699('0x29')](handleError(_0x11619f,null));};exports[_0x4699('0x7a')]=function(_0x4a222e,_0x521a3f,_0x490cfa){return db[_0x4699('0x70')][_0x4699('0x56')]({'where':{'id':_0x4a222e[_0x4699('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4699('0x71')],'as':_0x4699('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x521a3f,null))[_0x4699('0x38')](function(_0x5bf4a7){var _0x45640a=_[_0x4699('0x3f')](_0x5bf4a7,'id');var _0x138bfa=[];var _0x4f1d4f=[];var _0x58c8be=squel['select']();_0x58c8be[_0x4699('0x7b')](_0x4699('0x7c'))[_0x4699('0x7d')](_0x4699('0x7e'),'tq')[_0x4699('0x7f')](_0x4699('0x80'),'ut',_0x4699('0x81'))[_0x4699('0x50')](_0x4699('0x82'),_0x4a222e[_0x4699('0x58')]['id']);for(var _0x2461ed=0x0;_0x2461ed<_0x5bf4a7[_0x4699('0x4b')];_0x2461ed+=0x1){let _0x45916c=_0x5bf4a7[_0x2461ed];for(var _0x3bb9a0=0x0;_0x3bb9a0<_0x45916c[_0x4699('0x76')][_0x4699('0x4b')];_0x3bb9a0+=0x1){let _0x560644=_0x45916c[_0x4699('0x76')][_0x3bb9a0];var _0x48df19=_0x58c8be['clone']();_0x48df19[_0x4699('0x50')](_0x4699('0x83'),_0x560644['id']);_0x4f1d4f[_0x4699('0x84')](db[_0x4699('0x85')][_0x4699('0x45')](_0x48df19['toString'](),{'type':db[_0x4699('0x85')][_0x4699('0x86')]['SELECT']})[_0x4699('0x38')](function(_0x3e1577){if(_0x3e1577[_0x4699('0x4b')]===0x1){return _0x560644['id'];}else{var _0x52711d=_['every'](_[_0x4699('0x3f')](_0x3e1577,_0x4699('0x87')),function(_0x1aa703){return _['includes'](_0x45640a,_0x1aa703);});if(_0x52711d){return _0x560644['id'];}}}));}}return BPromise[_0x4699('0x88')](_0x4f1d4f)[_0x4699('0x38')](function(_0x2c4a90){_0x138bfa=_(_0x138bfa)[_0x4699('0x89')](_0x2c4a90)[_0x4699('0x8a')]()[_0x4699('0x8b')]();return db[_0x4699('0x40')][_0x4699('0x5c')]({'where':{'id':_0x4a222e[_0x4699('0x58')]['id']}})['then'](function(_0x53ed75){return db[_0x4699('0x85')][_0x4699('0x77')](function(_0x4acf3f){return _0x53ed75[_0x4699('0x7a')](_0x4a222e['query'][_0x4699('0x8c')],{'transaction':_0x4acf3f})[_0x4699('0x38')](function(){if(!_[_0x4699('0x8d')](_0x138bfa)){return _0x53ed75['removeAgents'](_0x138bfa,{'transaction':_0x4acf3f});}})['then'](function(){_0x138bfa[_0x4699('0x8e')](function(_0x55540c){socket[_0x4699('0x8f')]('userChatQueue:remove',{'UserId':_0x55540c,'ChatQueueId':_0x53ed75['id']});});});});});});})[_0x4699('0x38')](respondWithStatusCode(_0x521a3f,null))[_0x4699('0x29')](handleError(_0x521a3f,null));};exports[_0x4699('0x90')]=function(_0x31f6d5,_0x31dffa,_0x3800eb){return db[_0x4699('0x40')]['find']({'where':{'id':_0x31f6d5[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x31dffa,null))['then'](function(_0x1588fc){if(_0x1588fc){return _0x1588fc[_0x4699('0x90')](_0x31f6d5[_0x4699('0x5e')]['ids'],_[_0x4699('0x91')](_0x31f6d5[_0x4699('0x5e')],[_0x4699('0x8c'),'id'])||{})[_0x4699('0x92')](function(_0x118a28){for(var _0x355c63=0x0;_0x355c63<_0x31f6d5[_0x4699('0x5e')]['ids'][_0x4699('0x4b')];_0x355c63+=0x1){socket[_0x4699('0x8f')]('userChatQueue:save',{'UserId':Number(_0x31f6d5[_0x4699('0x5e')][_0x4699('0x8c')][_0x355c63]),'ChatQueueId':Number(_0x31f6d5[_0x4699('0x58')]['id'])});}return _0x118a28;});}})[_0x4699('0x38')](respondWithResult(_0x31dffa,null))[_0x4699('0x29')](handleError(_0x31dffa,null));};exports[_0x4699('0x93')]=function(_0x40fafc,_0xdbd490,_0x176258){return db[_0x4699('0x40')][_0x4699('0x5c')]({'where':{'id':_0x40fafc[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0xdbd490,null))[_0x4699('0x38')](function(_0x28f70c){if(_0x28f70c){return _0x28f70c['removeAgents'](_0x40fafc[_0x4699('0x45')][_0x4699('0x8c')])[_0x4699('0x38')](function(){if(_[_0x4699('0x94')](_0x40fafc['query']['ids'])){for(var _0x39c7f0=0x0;_0x39c7f0<_0x40fafc[_0x4699('0x45')][_0x4699('0x8c')][_0x4699('0x4b')];_0x39c7f0+=0x1){socket['emit'](_0x4699('0x95'),{'UserId':Number(_0x40fafc[_0x4699('0x45')]['ids'][_0x39c7f0]),'ChatQueueId':Number(_0x40fafc[_0x4699('0x58')]['id'])});}}else{socket['emit'](_0x4699('0x95'),{'UserId':Number(_0x40fafc['query'][_0x4699('0x8c')]),'ChatQueueId':Number(_0x40fafc[_0x4699('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0xdbd490,null))[_0x4699('0x29')](handleError(_0xdbd490,null));};exports[_0x4699('0x96')]=function(_0x2131db,_0x499479,_0x36c0f5){var _0x4129b3={};var _0x4f7592={};var _0x477799;var _0x3cd5fa;return db[_0x4699('0x40')][_0x4699('0x6f')]({'where':{'id':_0x2131db[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x499479,null))[_0x4699('0x38')](function(_0x4b1e3f){if(_0x4b1e3f){_0x477799=_0x4b1e3f;_0x4f7592['model']=_[_0x4699('0x46')](db[_0x4699('0x71')]['rawAttributes']);_0x4f7592[_0x4699('0x45')]=_[_0x4699('0x46')](_0x2131db[_0x4699('0x45')]);_0x4f7592[_0x4699('0x47')]=_[_0x4699('0x48')](_0x4f7592['model'],_0x4f7592[_0x4699('0x45')]);_0x4129b3[_0x4699('0x49')]=_[_0x4699('0x48')](_0x4f7592[_0x4699('0x44')],qs[_0x4699('0x4a')](_0x2131db[_0x4699('0x45')][_0x4699('0x4a')]));_0x4129b3[_0x4699('0x49')]=_0x4129b3[_0x4699('0x49')]['length']?_0x4129b3[_0x4699('0x49')]:_0x4f7592[_0x4699('0x44')];_0x4129b3[_0x4699('0x4e')]=qs[_0x4699('0x4f')](_0x2131db['query'][_0x4699('0x4f')]);_0x4129b3[_0x4699('0x50')]=qs[_0x4699('0x47')](_[_0x4699('0x51')](_0x2131db['query'],_0x4f7592[_0x4699('0x47')]));if(_0x2131db[_0x4699('0x45')][_0x4699('0x52')]){_0x4129b3[_0x4699('0x50')]=_[_0x4699('0x53')](_0x4129b3[_0x4699('0x50')],{'$or':_[_0x4699('0x3f')](_0x4129b3['attributes'],function(_0x113d09){var _0x2100ff={};_0x2100ff[_0x113d09]={'$like':'%'+_0x2131db[_0x4699('0x45')][_0x4699('0x52')]+'%'};return _0x2100ff;})});}_0x4129b3=_[_0x4699('0x53')]({},_0x4129b3,_0x2131db[_0x4699('0x55')]);return _0x477799[_0x4699('0x96')](_0x4129b3);}})[_0x4699('0x38')](function(_0xadeeb4){if(_0xadeeb4){_0x3cd5fa=_0xadeeb4[_0x4699('0x4b')];if(!_0x2131db[_0x4699('0x45')][_0x4699('0x4c')]('nolimit')){_0x4129b3[_0x4699('0x30')]=qs['limit'](_0x2131db[_0x4699('0x45')][_0x4699('0x30')]);_0x4129b3['offset']=qs[_0x4699('0x2d')](_0x2131db['query'][_0x4699('0x2d')]);}return _0x477799['getAgents'](_0x4129b3);}})[_0x4699('0x38')](function(_0xc04a4d){if(_0xc04a4d){return _0xc04a4d?{'count':_0x3cd5fa,'rows':_0xc04a4d}:null;}})[_0x4699('0x38')](respondWithResult(_0x499479,null))[_0x4699('0x29')](handleError(_0x499479,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 9a3c05e..aa1a08c 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 _0xeb24=['ChatQueue','setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2b7338,_0x71669b){var _0x26660e=function(_0x575e78){while(--_0x575e78){_0x2b7338['push'](_0x2b7338['shift']());}};_0x26660e(++_0x71669b);}(_0xeb24,0x12e));var _0x4eb2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeb24[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x4eb2('0x0'));var ChatQueue=require(_0x4eb2('0x1'))['db'][_0x4eb2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4eb2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4eb2('0x4')};function emitEvent(_0x56faf4){return function(_0x469c2e,_0x42059f,_0x5e8bc2){ChatQueueEvents[_0x4eb2('0x5')](_0x56faf4+':'+_0x469c2e['id'],_0x469c2e);ChatQueueEvents[_0x4eb2('0x5')](_0x56faf4,_0x469c2e);_0x5e8bc2(null);};}for(var e in events){if(events[_0x4eb2('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4eb2('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe338=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0x209f56,_0x24449e){var _0x22767d=function(_0x17e2d0){while(--_0x17e2d0){_0x209f56['push'](_0x209f56['shift']());}};_0x22767d(++_0x24449e);}(_0xe338,0x99));var _0x8e33=function(_0x3a75f3,_0x1fa9e3){_0x3a75f3=_0x3a75f3-0x0;var _0x15be50=_0xe338[_0x3a75f3];return _0x15be50;};'use strict';var EventEmitter=require(_0x8e33('0x0'));var ChatQueue=require(_0x8e33('0x1'))['db'][_0x8e33('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e33('0x3'),'afterUpdate':_0x8e33('0x4'),'afterDestroy':_0x8e33('0x5')};function emitEvent(_0x3f2254){return function(_0x331746,_0x430e45,_0x315e94){ChatQueueEvents[_0x8e33('0x6')](_0x3f2254+':'+_0x331746['id'],_0x331746);ChatQueueEvents[_0x8e33('0x6')](_0x3f2254,_0x331746);_0x315e94(null);};}for(var e in events){if(events[_0x8e33('0x7')](e)){var event=events[e];ChatQueue[_0x8e33('0x8')](e,emitEvent(event));}}module[_0x8e33('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 5080c51..decaaa0 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 _0xf31e=['define','ChatQueue','chat_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf31e,0x1bb));var _0xef31=function(_0x6ce9fb,_0x5a2013){_0x6ce9fb=_0x6ce9fb-0x0;var _0x42794c=_0xf31e[_0x6ce9fb];return _0x42794c;};'use strict';var _=require(_0xef31('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xef31('0x1'));var moment=require(_0xef31('0x2'));var BPromise=require(_0xef31('0x3'));var rp=require(_0xef31('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef31('0x5'));var config=require(_0xef31('0x6'));var attributes=require('./chatQueue.attributes');module[_0xef31('0x7')]=function(_0x317396,_0x6dfff){return _0x317396[_0xef31('0x8')](_0xef31('0x9'),attributes,{'tableName':_0xef31('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45d6=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2b8981,_0x24c688){var _0x377d15=function(_0x398128){while(--_0x398128){_0x2b8981['push'](_0x2b8981['shift']());}};_0x377d15(++_0x24c688);}(_0x45d6,0xbb));var _0x645d=function(_0x5da90b,_0x3e13cd){_0x5da90b=_0x5da90b-0x0;var _0x530e40=_0x45d6[_0x5da90b];return _0x530e40;};'use strict';var _=require(_0x645d('0x0'));var util=require(_0x645d('0x1'));var logger=require(_0x645d('0x2'))(_0x645d('0x3'));var moment=require(_0x645d('0x4'));var BPromise=require('bluebird');var rp=require(_0x645d('0x5'));var fs=require('fs');var path=require(_0x645d('0x6'));var rimraf=require(_0x645d('0x7'));var config=require(_0x645d('0x8'));var attributes=require(_0x645d('0x9'));module[_0x645d('0xa')]=function(_0x3e0d23,_0x550a93){return _0x3e0d23[_0x645d('0xb')](_0x645d('0xc'),attributes,{'tableName':_0x645d('0xd'),'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 1f7841d..f040772 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 _0xe511=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','raw','options','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','ChatQueue','find','lodash','util','bluebird'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xe511,0x16f));var _0x1e51=function(_0x4f0f9b,_0x4e963e){_0x4f0f9b=_0x4f0f9b-0x0;var _0x970f94=_0xe511[_0x4f0f9b];return _0x970f94;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});config[_0x1e51('0xa')]=_['defaults'](config['redis'],{'host':_0x1e51('0xb'),'port':0x18eb});var socket=require(_0x1e51('0xc'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x1e51('0xd')](socket);function respondWithRpcPromise(_0x2712e0,_0x29da1f,_0x706e60){return new BPromise(function(_0x4241a6,_0x141e2e){return client['request'](_0x2712e0,_0x706e60)[_0x1e51('0xe')](function(_0xcdfa5d){logger[_0x1e51('0xf')](_0x1e51('0x10'),_0x29da1f,_0x1e51('0x11'));logger[_0x1e51('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x29da1f,_0x1e51('0x11'),JSON[_0x1e51('0x13')](_0xcdfa5d));if(_0xcdfa5d[_0x1e51('0x14')]){if(_0xcdfa5d[_0x1e51('0x14')][_0x1e51('0x15')]===0x1f4){logger[_0x1e51('0x14')](_0x1e51('0x10'),_0x29da1f,_0xcdfa5d[_0x1e51('0x14')][_0x1e51('0x16')]);return _0x141e2e(_0xcdfa5d[_0x1e51('0x14')]['message']);}logger[_0x1e51('0x14')](_0x1e51('0x10'),_0x29da1f,_0xcdfa5d[_0x1e51('0x14')]['message']);return _0x4241a6(_0xcdfa5d[_0x1e51('0x14')]['message']);}else{logger['info'](_0x1e51('0x10'),_0x29da1f,_0x1e51('0x11'));_0x4241a6(_0xcdfa5d[_0x1e51('0x17')][_0x1e51('0x16')]);}})[_0x1e51('0x18')](function(_0x3e4234){logger['error'](_0x1e51('0x10'),_0x29da1f,_0x3e4234);_0x141e2e(_0x3e4234);});});}exports['GetChatQueue']=function(_0xea581d){var _0x1cbd1c=this;return new Promise(function(_0x309a87,_0x183a95){return db['ChatQueue']['findAll']({'raw':_0xea581d['options']?_0xea581d['options'][_0x1e51('0x19')]===undefined?!![]:![]:!![],'where':_0xea581d['options']?_0xea581d[_0x1e51('0x1a')][_0x1e51('0x1b')]||null:null,'attributes':_0xea581d[_0x1e51('0x1a')]?_0xea581d[_0x1e51('0x1a')][_0x1e51('0x1c')]||null:null,'limit':_0xea581d[_0x1e51('0x1a')]?_0xea581d[_0x1e51('0x1a')][_0x1e51('0x1d')]||null:null,'include':_0xea581d['options']?_0xea581d['options'][_0x1e51('0x1e')]?_[_0x1e51('0x1f')](_0xea581d[_0x1e51('0x1a')][_0x1e51('0x1e')],function(_0x505d79){return{'model':db[_0x505d79['model']],'as':_0x505d79['as'],'attributes':_0x505d79['attributes'],'include':_0x505d79[_0x1e51('0x1e')]?_[_0x1e51('0x1f')](_0x505d79[_0x1e51('0x1e')],function(_0x5412bc){return{'model':db[_0x5412bc[_0x1e51('0x20')]],'as':_0x5412bc['as'],'attributes':_0x5412bc['attributes'],'include':_0x5412bc['include']?_[_0x1e51('0x1f')](_0x5412bc['include'],function(_0x170ec6){return{'model':db[_0x170ec6[_0x1e51('0x20')]],'as':_0x170ec6['as'],'attributes':_0x170ec6['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e51('0xe')](function(_0x10ee23){logger[_0x1e51('0xf')](_0x1e51('0x21'),_0xea581d);logger['debug']('GetChatQueue',_0xea581d,JSON['stringify'](_0x10ee23));_0x309a87(_0x10ee23);})[_0x1e51('0x18')](function(_0x288b50){logger[_0x1e51('0x14')](_0x1e51('0x21'),_0x288b50[_0x1e51('0x16')],_0xea581d);_0x183a95(_0x1cbd1c[_0x1e51('0x14')](0x1f4,_0x288b50[_0x1e51('0x16')]));});});};exports[_0x1e51('0x22')]=function(_0x31b678){var _0x3167b6=this;return new Promise(function(_0x27b550,_0x54c84e){return db[_0x1e51('0x23')][_0x1e51('0x24')]({'raw':_0x31b678[_0x1e51('0x1a')]?_0x31b678[_0x1e51('0x1a')][_0x1e51('0x19')]===undefined?!![]:![]:!![],'where':_0x31b678['options']?_0x31b678[_0x1e51('0x1a')]['where']||null:null,'attributes':_0x31b678[_0x1e51('0x1a')]?_0x31b678[_0x1e51('0x1a')][_0x1e51('0x1c')]||null:null,'include':_0x31b678['options']?_0x31b678[_0x1e51('0x1a')]['include']?_[_0x1e51('0x1f')](_0x31b678['options']['include'],function(_0x463afa){return{'model':db[_0x463afa[_0x1e51('0x20')]],'as':_0x463afa['as'],'attributes':_0x463afa[_0x1e51('0x1c')],'include':_0x463afa['include']?_[_0x1e51('0x1f')](_0x463afa['include'],function(_0x3797a6){return{'model':db[_0x3797a6[_0x1e51('0x20')]],'as':_0x3797a6['as'],'attributes':_0x3797a6['attributes'],'include':_0x3797a6[_0x1e51('0x1e')]?_[_0x1e51('0x1f')](_0x3797a6[_0x1e51('0x1e')],function(_0xeeff34){return{'model':db[_0xeeff34[_0x1e51('0x20')]],'as':_0xeeff34['as'],'attributes':_0xeeff34[_0x1e51('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x509f7d){logger[_0x1e51('0xf')]('ShowChatQueue',_0x31b678);logger[_0x1e51('0x12')](_0x1e51('0x22'),_0x31b678,JSON[_0x1e51('0x13')](_0x509f7d));_0x27b550(_0x509f7d);})[_0x1e51('0x18')](function(_0x1ce020){logger[_0x1e51('0x14')](_0x1e51('0x22'),_0x1ce020[_0x1e51('0x16')],_0x31b678);_0x54c84e(_0x3167b6[_0x1e51('0x14')](0x1f4,_0x1ce020[_0x1e51('0x16')]));});});};
\ No newline at end of file
+var _0x62cf=['attributes','limit','map','model','include','debug','ShowChatQueue','find','raw','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x62cf,0x81));var _0xf62c=function(_0x16e3d8,_0x201862){_0x16e3d8=_0x16e3d8-0x0;var _0x35009a=_0x62cf[_0x16e3d8];return _0x35009a;};'use strict';var _=require(_0xf62c('0x0'));var util=require('util');var moment=require(_0xf62c('0x1'));var BPromise=require('bluebird');var rs=require(_0xf62c('0x2'));var fs=require('fs');var Redis=require(_0xf62c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf62c('0x4'))(_0xf62c('0x5'));var config=require(_0xf62c('0x6'));var jayson=require(_0xf62c('0x7'));var client=jayson[_0xf62c('0x8')][_0xf62c('0x9')]({'port':0x232a});config[_0xf62c('0xa')]=_[_0xf62c('0xb')](config[_0xf62c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf62c('0xc'))(new Redis(config['redis']));require(_0xf62c('0xd'))[_0xf62c('0xe')](socket);function respondWithRpcPromise(_0x9b92cb,_0x424bf6,_0x24c553){return new BPromise(function(_0x250c8c,_0x336122){return client[_0xf62c('0xf')](_0x9b92cb,_0x24c553)[_0xf62c('0x10')](function(_0x9a583f){logger[_0xf62c('0x11')]('ChatQueue,\x20%s,\x20%s',_0x424bf6,_0xf62c('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x424bf6,_0xf62c('0x12'),JSON[_0xf62c('0x13')](_0x9a583f));if(_0x9a583f['error']){if(_0x9a583f[_0xf62c('0x14')][_0xf62c('0x15')]===0x1f4){logger['error'](_0xf62c('0x16'),_0x424bf6,_0x9a583f['error'][_0xf62c('0x17')]);return _0x336122(_0x9a583f[_0xf62c('0x14')]['message']);}logger[_0xf62c('0x14')](_0xf62c('0x16'),_0x424bf6,_0x9a583f['error'][_0xf62c('0x17')]);return _0x250c8c(_0x9a583f[_0xf62c('0x14')][_0xf62c('0x17')]);}else{logger['info'](_0xf62c('0x16'),_0x424bf6,_0xf62c('0x12'));_0x250c8c(_0x9a583f[_0xf62c('0x18')][_0xf62c('0x17')]);}})[_0xf62c('0x19')](function(_0x5020f6){logger[_0xf62c('0x14')](_0xf62c('0x16'),_0x424bf6,_0x5020f6);_0x336122(_0x5020f6);});});}exports[_0xf62c('0x1a')]=function(_0x55a475){var _0x5e4dac=this;return new Promise(function(_0x3ae15e,_0x3c3624){return db[_0xf62c('0x1b')][_0xf62c('0x1c')]({'raw':_0x55a475[_0xf62c('0x1d')]?_0x55a475['options']['raw']===undefined?!![]:![]:!![],'where':_0x55a475['options']?_0x55a475[_0xf62c('0x1d')][_0xf62c('0x1e')]||null:null,'attributes':_0x55a475[_0xf62c('0x1d')]?_0x55a475[_0xf62c('0x1d')][_0xf62c('0x1f')]||null:null,'limit':_0x55a475[_0xf62c('0x1d')]?_0x55a475['options'][_0xf62c('0x20')]||null:null,'include':_0x55a475[_0xf62c('0x1d')]?_0x55a475[_0xf62c('0x1d')]['include']?_['map'](_0x55a475['options']['include'],function(_0x2165ae){return{'model':db[_0x2165ae['model']],'as':_0x2165ae['as'],'attributes':_0x2165ae[_0xf62c('0x1f')],'include':_0x2165ae['include']?_[_0xf62c('0x21')](_0x2165ae['include'],function(_0x9da128){return{'model':db[_0x9da128[_0xf62c('0x22')]],'as':_0x9da128['as'],'attributes':_0x9da128[_0xf62c('0x1f')],'include':_0x9da128[_0xf62c('0x23')]?_[_0xf62c('0x21')](_0x9da128['include'],function(_0x1ecd60){return{'model':db[_0x1ecd60[_0xf62c('0x22')]],'as':_0x1ecd60['as'],'attributes':_0x1ecd60[_0xf62c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf62c('0x10')](function(_0x9dde25){logger[_0xf62c('0x11')](_0xf62c('0x1a'),_0x55a475);logger[_0xf62c('0x24')](_0xf62c('0x1a'),_0x55a475,JSON[_0xf62c('0x13')](_0x9dde25));_0x3ae15e(_0x9dde25);})['catch'](function(_0x398d1c){logger[_0xf62c('0x14')]('GetChatQueue',_0x398d1c[_0xf62c('0x17')],_0x55a475);_0x3c3624(_0x5e4dac['error'](0x1f4,_0x398d1c[_0xf62c('0x17')]));});});};exports[_0xf62c('0x25')]=function(_0x515292){var _0x5e7590=this;return new Promise(function(_0x3c21c9,_0x198a36){return db['ChatQueue'][_0xf62c('0x26')]({'raw':_0x515292['options']?_0x515292[_0xf62c('0x1d')][_0xf62c('0x27')]===undefined?!![]:![]:!![],'where':_0x515292[_0xf62c('0x1d')]?_0x515292[_0xf62c('0x1d')]['where']||null:null,'attributes':_0x515292['options']?_0x515292[_0xf62c('0x1d')]['attributes']||null:null,'include':_0x515292[_0xf62c('0x1d')]?_0x515292['options'][_0xf62c('0x23')]?_[_0xf62c('0x21')](_0x515292[_0xf62c('0x1d')][_0xf62c('0x23')],function(_0x5db4cb){return{'model':db[_0x5db4cb[_0xf62c('0x22')]],'as':_0x5db4cb['as'],'attributes':_0x5db4cb[_0xf62c('0x1f')],'include':_0x5db4cb[_0xf62c('0x23')]?_[_0xf62c('0x21')](_0x5db4cb['include'],function(_0x13aeaa){return{'model':db[_0x13aeaa[_0xf62c('0x22')]],'as':_0x13aeaa['as'],'attributes':_0x13aeaa['attributes'],'include':_0x13aeaa[_0xf62c('0x23')]?_[_0xf62c('0x21')](_0x13aeaa[_0xf62c('0x23')],function(_0x304f5e){return{'model':db[_0x304f5e[_0xf62c('0x22')]],'as':_0x304f5e['as'],'attributes':_0x304f5e[_0xf62c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf62c('0x10')](function(_0x2c4100){logger[_0xf62c('0x11')](_0xf62c('0x25'),_0x515292);logger[_0xf62c('0x24')](_0xf62c('0x25'),_0x515292,JSON[_0xf62c('0x13')](_0x2c4100));_0x3c21c9(_0x2c4100);})[_0xf62c('0x19')](function(_0x23976e){logger[_0xf62c('0x14')](_0xf62c('0x25'),_0x23976e[_0xf62c('0x17')],_0x515292);_0x198a36(_0x5e7590[_0xf62c('0x14')](0x1f4,_0x23976e[_0xf62c('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 3a8559c..db2f60a 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 _0x579c=['chatQueue:','./chatQueue.events','save','remove','update','removeListener','register'];(function(_0x17efa2,_0x58db0d){var _0x46f952=function(_0x7a4122){while(--_0x7a4122){_0x17efa2['push'](_0x17efa2['shift']());}};_0x46f952(++_0x58db0d);}(_0x579c,0xda));var _0xc579=function(_0x26aa88,_0x12eb93){_0x26aa88=_0x26aa88-0x0;var _0x5560b0=_0x579c[_0x26aa88];return _0x5560b0;};'use strict';var ChatQueueEvents=require(_0xc579('0x0'));var events=[_0xc579('0x1'),_0xc579('0x2'),_0xc579('0x3')];function createListener(_0x397136,_0x586948){return function(_0x1e2808){_0x586948['emit'](_0x397136,_0x1e2808);};}function removeListener(_0x21a0a2,_0x3b913c){return function(){ChatQueueEvents[_0xc579('0x4')](_0x21a0a2,_0x3b913c);};}exports[_0xc579('0x5')]=function(_0x124ee5){for(var _0x1bd276=0x0,_0x2e451b=events['length'];_0x1bd276<_0x2e451b;_0x1bd276++){var _0x1c6d9c=events[_0x1bd276];var _0x293c4a=createListener(_0xc579('0x6')+_0x1c6d9c,_0x124ee5);ChatQueueEvents['on'](_0x1c6d9c,_0x293c4a);}};
\ No newline at end of file
+var _0x8ce3=['emit','removeListener','length','./chatQueue.events','save','update'];(function(_0x23de6d,_0xb9088e){var _0x2231cf=function(_0x378137){while(--_0x378137){_0x23de6d['push'](_0x23de6d['shift']());}};_0x2231cf(++_0xb9088e);}(_0x8ce3,0xc3));var _0x38ce=function(_0x30225a,_0x233ad6){_0x30225a=_0x30225a-0x0;var _0x3551ef=_0x8ce3[_0x30225a];return _0x3551ef;};'use strict';var ChatQueueEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),'remove',_0x38ce('0x2')];function createListener(_0x2b99b0,_0xee1d0e){return function(_0x26ec48){_0xee1d0e[_0x38ce('0x3')](_0x2b99b0,_0x26ec48);};}function removeListener(_0x17b96d,_0x1efae3){return function(){ChatQueueEvents[_0x38ce('0x4')](_0x17b96d,_0x1efae3);};}exports['register']=function(_0x372f86){for(var _0xb24f4c=0x0,_0x58074c=events[_0x38ce('0x5')];_0xb24f4c<_0x58074c;_0xb24f4c++){var _0xbe7332=events[_0xb24f4c];var _0x3f8011=createListener('chatQueue:'+_0xbe7332,_0x372f86);ChatQueueEvents['on'](_0xbe7332,_0x3f8011);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index edabffb..322e9b5 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5a3604,_0x3d15b5){var _0x17ce7e=function(_0x1ccff8){while(--_0x1ccff8){_0x5a3604['push'](_0x5a3604['shift']());}};_0x17ce7e(++_0x3d15b5);}(_0xe14b,0x93));var _0xbe14=function(_0x117db9,_0x4b8520){_0x117db9=_0x117db9-0x0;var _0x19da3f=_0xe14b[_0x117db9];return _0x19da3f;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x1a8be3,_0xa1d303){var _0xac9769=function(_0x3e5ccb){while(--_0x3e5ccb){_0x1a8be3['push'](_0x1a8be3['shift']());}};_0xac9769(++_0xa1d303);}(_0x55ca,0x126));var _0xa55c=function(_0x2e891a,_0xb5a3b5){_0x2e891a=_0x2e891a-0x0;var _0x39f989=_0x55ca[_0x2e891a];return _0x39f989;};'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 9e1a267..b339db8 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 _0x8810=['DATE','moment','sequelize','STRING'];(function(_0x3449f4,_0x5710d2){var _0x5a684d=function(_0x4da3cb){while(--_0x4da3cb){_0x3449f4['push'](_0x3449f4['shift']());}};_0x5a684d(++_0x5710d2);}(_0x8810,0x85));var _0x0881=function(_0xa57938,_0x3acf3a){_0xa57938=_0xa57938-0x0;var _0xb42015=_0x8810[_0xa57938];return _0xb42015;};'use strict';var moment=require(_0x0881('0x0'));var Sequelize=require(_0x0881('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0881('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0881('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0881('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0881('0x3')]},'reason':{'type':Sequelize[_0x0881('0x2')]}};
\ No newline at end of file
+var _0x45d4=['moment','exports','STRING','DATE'];(function(_0x4d05e9,_0x361c7d){var _0x197a51=function(_0x1442f7){while(--_0x1442f7){_0x4d05e9['push'](_0x4d05e9['shift']());}};_0x197a51(++_0x361c7d);}(_0x45d4,0x170));var _0x445d=function(_0x26404d,_0xdab8ab){_0x26404d=_0x26404d-0x0;var _0x40eaa8=_0x45d4[_0x26404d];return _0x40eaa8;};'use strict';var moment=require(_0x445d('0x0'));var Sequelize=require('sequelize');module[_0x445d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x445d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x445d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x445d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 96dede4..b7563cf 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 _0x5d59=['squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','save','update','then','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','lodash'];(function(_0x43c4f5,_0x5d46d9){var _0x56774c=function(_0x57f171){while(--_0x57f171){_0x43c4f5['push'](_0x43c4f5['shift']());}};_0x56774c(++_0x5d46d9);}(_0x5d59,0x15f));var _0x95d5=function(_0x3f6c60,_0x486af8){_0x3f6c60=_0x3f6c60-0x0;var _0x2bbe6a=_0x5d59[_0x3f6c60];return _0x2bbe6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95d5('0x0'));var zipdir=require(_0x95d5('0x1'));var jsonpatch=require(_0x95d5('0x2'));var rp=require(_0x95d5('0x3'));var moment=require(_0x95d5('0x4'));var BPromise=require(_0x95d5('0x5'));var Mustache=require('mustache');var util=require(_0x95d5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x95d5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95d5('0x8'));var squel=require(_0x95d5('0x9'));var crypto=require(_0x95d5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x95d5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x95d5('0xc'));var Papa=require('papaparse');var Redis=require(_0x95d5('0xd'));var authService=require(_0x95d5('0xe'));var qs=require(_0x95d5('0xf'));var as=require(_0x95d5('0x10'));var hardwareService=require(_0x95d5('0x11'));var logger=require(_0x95d5('0x12'))(_0x95d5('0x13'));var utils=require(_0x95d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x95d5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47fb16,_0x12b0ff){_0x12b0ff=_0x12b0ff||0xcc;return function(_0x30ad51){if(_0x30ad51){return _0x47fb16[_0x95d5('0x16')](_0x12b0ff);}return _0x47fb16[_0x95d5('0x17')](_0x12b0ff)['end']();};}function respondWithResult(_0x33d769,_0x2ce559){_0x2ce559=_0x2ce559||0xc8;return function(_0x3c0c3e){if(_0x3c0c3e){return _0x33d769[_0x95d5('0x17')](_0x2ce559)[_0x95d5('0x18')](_0x3c0c3e);}};}function respondWithFilteredResult(_0x3a59df,_0x3d8de7){return function(_0x1f03eb){if(_0x1f03eb){var _0x14d8a9=typeof _0x3d8de7['offset']==='undefined'&&typeof _0x3d8de7[_0x95d5('0x19')]==='undefined';var _0x34a382=_0x1f03eb[_0x95d5('0x1a')];var _0x5bdf14=_0x14d8a9?0x0:_0x3d8de7[_0x95d5('0x1b')];var _0x3793eb=_0x14d8a9?_0x1f03eb[_0x95d5('0x1a')]:_0x3d8de7[_0x95d5('0x1b')]+_0x3d8de7[_0x95d5('0x19')];var _0x11e905;if(_0x3793eb>=_0x34a382){_0x3793eb=_0x34a382;_0x11e905=0xc8;}else{_0x11e905=0xce;}_0x3a59df['status'](_0x11e905);return _0x3a59df[_0x95d5('0x1c')](_0x95d5('0x1d'),_0x5bdf14+'-'+_0x3793eb+'/'+_0x34a382)[_0x95d5('0x18')](_0x1f03eb);}return null;};}function patchUpdates(_0x5bd58d){return function(_0x5e8a19){try{jsonpatch[_0x95d5('0x1e')](_0x5e8a19,_0x5bd58d,!![]);}catch(_0x4023d3){return BPromise['reject'](_0x4023d3);}return _0x5e8a19[_0x95d5('0x1f')]();};}function saveUpdates(_0x2557e7,_0x2ca4b6){return function(_0x51ba73){if(_0x51ba73){return _0x51ba73[_0x95d5('0x20')](_0x2557e7)['then'](function(_0x5a5a7e){return _0x5a5a7e;});}return null;};}function removeEntity(_0x4f64ac,_0x554f4d){return function(_0x588825){if(_0x588825){return _0x588825['destroy']()[_0x95d5('0x21')](function(){_0x4f64ac[_0x95d5('0x17')](0xcc)[_0x95d5('0x22')]();});}};}function handleEntityNotFound(_0x260582,_0x54f64c){return function(_0x3fe6ef){if(!_0x3fe6ef){_0x260582[_0x95d5('0x16')](0x194);}return _0x3fe6ef;};}function handleError(_0x316d19,_0x1b8d73){_0x1b8d73=_0x1b8d73||0x1f4;return function(_0xe12a95){logger[_0x95d5('0x23')](_0xe12a95[_0x95d5('0x24')]);if(_0xe12a95[_0x95d5('0x25')]){delete _0xe12a95[_0x95d5('0x25')];}_0x316d19[_0x95d5('0x17')](_0x1b8d73)['send'](_0xe12a95);};}exports['index']=function(_0xd9b81c,_0x18121f){var _0x256727={},_0x5dfe00={},_0x1c8626={'count':0x0,'rows':[]};var _0x4e6f3b=_[_0x95d5('0x26')](db['ChatQueueReport'][_0x95d5('0x27')],function(_0x14b058){return{'name':_0x14b058[_0x95d5('0x28')],'type':_0x14b058[_0x95d5('0x29')][_0x95d5('0x2a')]};});_0x5dfe00[_0x95d5('0x2b')]=_[_0x95d5('0x26')](_0x4e6f3b,_0x95d5('0x25'));_0x5dfe00['query']=_['keys'](_0xd9b81c['query']);_0x5dfe00[_0x95d5('0x2c')]=_[_0x95d5('0x2d')](_0x5dfe00[_0x95d5('0x2b')],_0x5dfe00[_0x95d5('0x2e')]);_0x256727[_0x95d5('0x2f')]=_[_0x95d5('0x2d')](_0x5dfe00['model'],qs[_0x95d5('0x30')](_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x30')]));_0x256727[_0x95d5('0x2f')]=_0x256727[_0x95d5('0x2f')][_0x95d5('0x31')]?_0x256727[_0x95d5('0x2f')]:_0x5dfe00[_0x95d5('0x2b')];if(!_0xd9b81c[_0x95d5('0x2e')]['hasOwnProperty']('nolimit')){_0x256727[_0x95d5('0x19')]=qs[_0x95d5('0x19')](_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x19')]);_0x256727['offset']=qs[_0x95d5('0x1b')](_0xd9b81c['query'][_0x95d5('0x1b')]);}_0x256727[_0x95d5('0x32')]=qs[_0x95d5('0x33')](_0xd9b81c['query'][_0x95d5('0x33')]);_0x256727[_0x95d5('0x34')]=qs[_0x95d5('0x2c')](_[_0x95d5('0x35')](_0xd9b81c[_0x95d5('0x2e')],_0x5dfe00[_0x95d5('0x2c')]),_0x4e6f3b);if(_0xd9b81c['query'][_0x95d5('0x36')]){_0x256727[_0x95d5('0x34')]=_[_0x95d5('0x37')](_0x256727[_0x95d5('0x34')],{'$or':_[_0x95d5('0x26')](_0x4e6f3b,function(_0x236e98){if(_0x236e98[_0x95d5('0x29')]!==_0x95d5('0x38')){var _0x172396={};_0x172396[_0x236e98[_0x95d5('0x25')]]={'$like':'%'+_0xd9b81c['query']['filter']+'%'};return _0x172396;}})});}_0x256727=_[_0x95d5('0x37')]({},_0x256727,_0xd9b81c[_0x95d5('0x39')]);var _0x28a05e={'where':_0x256727[_0x95d5('0x34')]};return db[_0x95d5('0x3a')]['count'](_0x28a05e)[_0x95d5('0x21')](function(_0xc7b674){_0x1c8626[_0x95d5('0x1a')]=_0xc7b674;if(_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x3b')]){_0x256727[_0x95d5('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x95d5('0x3d')](_0x256727);})[_0x95d5('0x21')](function(_0xb00cd0){_0x1c8626[_0x95d5('0x3e')]=_0xb00cd0;return _0x1c8626;})[_0x95d5('0x21')](respondWithFilteredResult(_0x18121f,_0x256727))[_0x95d5('0x3f')](handleError(_0x18121f,null));};exports[_0x95d5('0x40')]=function(_0x344d4f,_0x2baab8){var _0x5bc9c8={'raw':!![],'where':{'id':_0x344d4f[_0x95d5('0x41')]['id']}},_0x37238b={};_0x37238b[_0x95d5('0x2b')]=_[_0x95d5('0x42')](db['ChatQueueReport'][_0x95d5('0x27')]);_0x37238b['query']=_[_0x95d5('0x42')](_0x344d4f[_0x95d5('0x2e')]);_0x37238b[_0x95d5('0x2c')]=_[_0x95d5('0x2d')](_0x37238b[_0x95d5('0x2b')],_0x37238b['query']);_0x5bc9c8[_0x95d5('0x2f')]=_[_0x95d5('0x2d')](_0x37238b[_0x95d5('0x2b')],qs[_0x95d5('0x30')](_0x344d4f[_0x95d5('0x2e')][_0x95d5('0x30')]));_0x5bc9c8[_0x95d5('0x2f')]=_0x5bc9c8[_0x95d5('0x2f')]['length']?_0x5bc9c8['attributes']:_0x37238b[_0x95d5('0x2b')];if(_0x344d4f[_0x95d5('0x2e')][_0x95d5('0x3b')]){_0x5bc9c8['include']=[{'all':!![]}];}_0x5bc9c8=_[_0x95d5('0x37')]({},_0x5bc9c8,_0x344d4f[_0x95d5('0x39')]);return db['ChatQueueReport'][_0x95d5('0x43')](_0x5bc9c8)['then'](handleEntityNotFound(_0x2baab8,null))[_0x95d5('0x21')](respondWithResult(_0x2baab8,null))[_0x95d5('0x3f')](handleError(_0x2baab8,null));};exports[_0x95d5('0x44')]=function(_0x13419e,_0x2ebc44){return db[_0x95d5('0x3a')][_0x95d5('0x44')](_0x13419e[_0x95d5('0x45')],{})['then'](respondWithResult(_0x2ebc44,0xc9))['catch'](handleError(_0x2ebc44,null));};exports[_0x95d5('0x20')]=function(_0x1d24e8,_0x1f7efd){if(_0x1d24e8[_0x95d5('0x45')]['id']){delete _0x1d24e8[_0x95d5('0x45')]['id'];}return db['ChatQueueReport'][_0x95d5('0x43')]({'where':{'id':_0x1d24e8[_0x95d5('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f7efd,null))[_0x95d5('0x21')](saveUpdates(_0x1d24e8[_0x95d5('0x45')],null))['then'](respondWithResult(_0x1f7efd,null))[_0x95d5('0x3f')](handleError(_0x1f7efd,null));};exports[_0x95d5('0x46')]=function(_0x170116,_0x4cceae){return db[_0x95d5('0x3a')][_0x95d5('0x43')]({'where':{'id':_0x170116['params']['id']}})[_0x95d5('0x21')](handleEntityNotFound(_0x4cceae,null))[_0x95d5('0x21')](removeEntity(_0x4cceae,null))['catch'](handleError(_0x4cceae,null));};exports[_0x95d5('0x47')]=function(_0x302952,_0x4b0e15){return db['ChatQueueReport'][_0x95d5('0x47')]()[_0x95d5('0x21')](respondWithResult(_0x4b0e15,null))[_0x95d5('0x3f')](handleError(_0x4b0e15,null));};
\ No newline at end of file
+var _0x3837=['find','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length'];(function(_0x1b95df,_0x135ab4){var _0x5e530a=function(_0x4917cb){while(--_0x4917cb){_0x1b95df['push'](_0x1b95df['shift']());}};_0x5e530a(++_0x135ab4);}(_0x3837,0x1d1));var _0x7383=function(_0xac6177,_0x34af46){_0xac6177=_0xac6177-0x0;var _0x5902a9=_0x3837[_0xac6177];return _0x5902a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7383('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7383('0x1'));var rp=require('request-promise');var moment=require(_0x7383('0x2'));var BPromise=require(_0x7383('0x3'));var Mustache=require(_0x7383('0x4'));var util=require(_0x7383('0x5'));var path=require(_0x7383('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7383('0x7'));var fs=require('fs');var fs_extra=require(_0x7383('0x8'));var _=require(_0x7383('0x9'));var squel=require(_0x7383('0xa'));var crypto=require(_0x7383('0xb'));var jsforce=require(_0x7383('0xc'));var deskjs=require(_0x7383('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7383('0xe'));var Papa=require(_0x7383('0xf'));var Redis=require(_0x7383('0x10'));var authService=require(_0x7383('0x11'));var qs=require(_0x7383('0x12'));var as=require(_0x7383('0x13'));var hardwareService=require(_0x7383('0x14'));var logger=require('../../config/logger')(_0x7383('0x15'));var utils=require(_0x7383('0x16'));var config=require(_0x7383('0x17'));var licenseUtil=require(_0x7383('0x18'));var db=require(_0x7383('0x19'))['db'];function respondWithStatusCode(_0x35e5f4,_0xe359e8){_0xe359e8=_0xe359e8||0xcc;return function(_0x70b32){if(_0x70b32){return _0x35e5f4[_0x7383('0x1a')](_0xe359e8);}return _0x35e5f4[_0x7383('0x1b')](_0xe359e8)[_0x7383('0x1c')]();};}function respondWithResult(_0x5b018f,_0x43c1d6){_0x43c1d6=_0x43c1d6||0xc8;return function(_0x3a2c78){if(_0x3a2c78){return _0x5b018f[_0x7383('0x1b')](_0x43c1d6)[_0x7383('0x1d')](_0x3a2c78);}};}function respondWithFilteredResult(_0x4aa59d,_0x566949){return function(_0x47b4c4){if(_0x47b4c4){var _0x5cf093=typeof _0x566949[_0x7383('0x1e')]===_0x7383('0x1f')&&typeof _0x566949[_0x7383('0x20')]===_0x7383('0x1f');var _0x1f733d=_0x47b4c4['count'];var _0x1cf7bb=_0x5cf093?0x0:_0x566949[_0x7383('0x1e')];var _0x1c7645=_0x5cf093?_0x47b4c4[_0x7383('0x21')]:_0x566949[_0x7383('0x1e')]+_0x566949[_0x7383('0x20')];var _0x115ff6;if(_0x1c7645>=_0x1f733d){_0x1c7645=_0x1f733d;_0x115ff6=0xc8;}else{_0x115ff6=0xce;}_0x4aa59d[_0x7383('0x1b')](_0x115ff6);return _0x4aa59d[_0x7383('0x22')](_0x7383('0x23'),_0x1cf7bb+'-'+_0x1c7645+'/'+_0x1f733d)['json'](_0x47b4c4);}return null;};}function patchUpdates(_0x42d970){return function(_0x2aebe0){try{jsonpatch[_0x7383('0x24')](_0x2aebe0,_0x42d970,!![]);}catch(_0x4a65e9){return BPromise[_0x7383('0x25')](_0x4a65e9);}return _0x2aebe0[_0x7383('0x26')]();};}function saveUpdates(_0x47e145,_0x316204){return function(_0x57420d){if(_0x57420d){return _0x57420d[_0x7383('0x27')](_0x47e145)[_0x7383('0x28')](function(_0x5c617a){return _0x5c617a;});}return null;};}function removeEntity(_0x1afeab,_0x3c5467){return function(_0x1edf1d){if(_0x1edf1d){return _0x1edf1d[_0x7383('0x29')]()[_0x7383('0x28')](function(){_0x1afeab['status'](0xcc)[_0x7383('0x1c')]();});}};}function handleEntityNotFound(_0x5eaf6a,_0x4c3e40){return function(_0x388964){if(!_0x388964){_0x5eaf6a[_0x7383('0x1a')](0x194);}return _0x388964;};}function handleError(_0x82bd92,_0x208ef9){_0x208ef9=_0x208ef9||0x1f4;return function(_0x4a1840){logger[_0x7383('0x2a')](_0x4a1840['stack']);if(_0x4a1840[_0x7383('0x2b')]){delete _0x4a1840[_0x7383('0x2b')];}_0x82bd92[_0x7383('0x1b')](_0x208ef9)[_0x7383('0x2c')](_0x4a1840);};}exports[_0x7383('0x2d')]=function(_0x439d09,_0x272d78){var _0x43f7a5={},_0x2b550d={},_0x15b14c={'count':0x0,'rows':[]};var _0x512a98=_[_0x7383('0x2e')](db[_0x7383('0x2f')]['rawAttributes'],function(_0x5e52ce){return{'name':_0x5e52ce['fieldName'],'type':_0x5e52ce[_0x7383('0x30')][_0x7383('0x31')]};});_0x2b550d[_0x7383('0x32')]=_[_0x7383('0x2e')](_0x512a98,_0x7383('0x2b'));_0x2b550d[_0x7383('0x33')]=_[_0x7383('0x34')](_0x439d09[_0x7383('0x33')]);_0x2b550d[_0x7383('0x35')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],_0x2b550d[_0x7383('0x33')]);_0x43f7a5[_0x7383('0x37')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],qs[_0x7383('0x38')](_0x439d09[_0x7383('0x33')][_0x7383('0x38')]));_0x43f7a5[_0x7383('0x37')]=_0x43f7a5[_0x7383('0x37')]['length']?_0x43f7a5[_0x7383('0x37')]:_0x2b550d[_0x7383('0x32')];if(!_0x439d09['query'][_0x7383('0x39')](_0x7383('0x3a'))){_0x43f7a5[_0x7383('0x20')]=qs[_0x7383('0x20')](_0x439d09[_0x7383('0x33')]['limit']);_0x43f7a5[_0x7383('0x1e')]=qs[_0x7383('0x1e')](_0x439d09[_0x7383('0x33')][_0x7383('0x1e')]);}_0x43f7a5[_0x7383('0x3b')]=qs[_0x7383('0x3c')](_0x439d09[_0x7383('0x33')]['sort']);_0x43f7a5['where']=qs['filters'](_[_0x7383('0x3d')](_0x439d09[_0x7383('0x33')],_0x2b550d[_0x7383('0x35')]),_0x512a98);if(_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]){_0x43f7a5[_0x7383('0x3f')]=_[_0x7383('0x40')](_0x43f7a5[_0x7383('0x3f')],{'$or':_[_0x7383('0x2e')](_0x512a98,function(_0x4f307a){if(_0x4f307a[_0x7383('0x30')]!==_0x7383('0x41')){var _0x3c2795={};_0x3c2795[_0x4f307a[_0x7383('0x2b')]]={'$like':'%'+_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]+'%'};return _0x3c2795;}})});}_0x43f7a5=_['merge']({},_0x43f7a5,_0x439d09[_0x7383('0x42')]);var _0x5329a6={'where':_0x43f7a5['where']};return db[_0x7383('0x2f')][_0x7383('0x21')](_0x5329a6)[_0x7383('0x28')](function(_0x3f14a6){_0x15b14c[_0x7383('0x21')]=_0x3f14a6;if(_0x439d09['query']['includeAll']){_0x43f7a5[_0x7383('0x43')]=[{'all':!![]}];}return db[_0x7383('0x2f')]['findAll'](_0x43f7a5);})['then'](function(_0x271cd5){_0x15b14c[_0x7383('0x44')]=_0x271cd5;return _0x15b14c;})[_0x7383('0x28')](respondWithFilteredResult(_0x272d78,_0x43f7a5))[_0x7383('0x45')](handleError(_0x272d78,null));};exports[_0x7383('0x46')]=function(_0x53c999,_0x141728){var _0x5d9085={'raw':!![],'where':{'id':_0x53c999[_0x7383('0x47')]['id']}},_0x3951d1={};_0x3951d1[_0x7383('0x32')]=_[_0x7383('0x34')](db['ChatQueueReport'][_0x7383('0x48')]);_0x3951d1[_0x7383('0x33')]=_[_0x7383('0x34')](_0x53c999[_0x7383('0x33')]);_0x3951d1['filters']=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],_0x3951d1[_0x7383('0x33')]);_0x5d9085[_0x7383('0x37')]=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],qs[_0x7383('0x38')](_0x53c999[_0x7383('0x33')][_0x7383('0x38')]));_0x5d9085[_0x7383('0x37')]=_0x5d9085[_0x7383('0x37')][_0x7383('0x49')]?_0x5d9085[_0x7383('0x37')]:_0x3951d1['model'];if(_0x53c999[_0x7383('0x33')]['includeAll']){_0x5d9085[_0x7383('0x43')]=[{'all':!![]}];}_0x5d9085=_[_0x7383('0x40')]({},_0x5d9085,_0x53c999[_0x7383('0x42')]);return db['ChatQueueReport'][_0x7383('0x4a')](_0x5d9085)[_0x7383('0x28')](handleEntityNotFound(_0x141728,null))['then'](respondWithResult(_0x141728,null))[_0x7383('0x45')](handleError(_0x141728,null));};exports['create']=function(_0x10ac80,_0x49e4f1){return db[_0x7383('0x2f')]['create'](_0x10ac80[_0x7383('0x4b')],{})[_0x7383('0x28')](respondWithResult(_0x49e4f1,0xc9))[_0x7383('0x45')](handleError(_0x49e4f1,null));};exports['update']=function(_0xd6ea61,_0x15ed37){if(_0xd6ea61[_0x7383('0x4b')]['id']){delete _0xd6ea61['body']['id'];}return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0xd6ea61[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x15ed37,null))[_0x7383('0x28')](saveUpdates(_0xd6ea61[_0x7383('0x4b')],null))[_0x7383('0x28')](respondWithResult(_0x15ed37,null))[_0x7383('0x45')](handleError(_0x15ed37,null));};exports[_0x7383('0x29')]=function(_0x380316,_0x65a7d2){return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0x380316[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x65a7d2,null))[_0x7383('0x28')](removeEntity(_0x65a7d2,null))[_0x7383('0x45')](handleError(_0x65a7d2,null));};exports['describe']=function(_0x210351,_0xa7233a){return db['ChatQueueReport'][_0x7383('0x4c')]()[_0x7383('0x28')](respondWithResult(_0xa7233a,null))[_0x7383('0x45')](handleError(_0xa7233a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 5984ab4..f10ecb2 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x371a1d,_0x3591f3){var _0x4ba340=function(_0x57cfbc){while(--_0x57cfbc){_0x371a1d['push'](_0x371a1d['shift']());}};_0x4ba340(++_0x3591f3);}(_0xb10b,0x12a));var _0xbb10=function(_0x17044c,_0x208790){_0x17044c=_0x17044c-0x0;var _0x5e6db0=_0xb10b[_0x17044c];return _0x5e6db0;};'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
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x4947d7,_0x270f05){var _0x4b6e94=function(_0x469ae4){while(--_0x469ae4){_0x4947d7['push'](_0x4947d7['shift']());}};_0x4b6e94(++_0x270f05);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index ec70b2f..9343fdb 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 _0x9b03=['../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','body','options','UpdateChatQueueReport','ChatQueueReport','update','raw','where','limit','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x450653,_0x29a247){var _0x53b38e=function(_0x4c5a4f){while(--_0x4c5a4f){_0x450653['push'](_0x450653['shift']());}};_0x53b38e(++_0x29a247);}(_0x9b03,0x102));var _0x39b0=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x9b03[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x39b0('0x0'));var util=require(_0x39b0('0x1'));var moment=require('moment');var BPromise=require(_0x39b0('0x2'));var rs=require(_0x39b0('0x3'));var fs=require('fs');var Redis=require(_0x39b0('0x4'));var db=require(_0x39b0('0x5'))['db'];var utils=require(_0x39b0('0x6'));var logger=require('../../config/logger')(_0x39b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x39b0('0x8'));var client=jayson[_0x39b0('0x9')][_0x39b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c3671,_0x37bc0c,_0x3634c9){return new BPromise(function(_0x4b0e3e,_0x3ecfd8){return client[_0x39b0('0xb')](_0x3c3671,_0x3634c9)[_0x39b0('0xc')](function(_0x3b74bf){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'));logger[_0x39b0('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'),JSON[_0x39b0('0xf')](_0x3b74bf));if(_0x3b74bf[_0x39b0('0x10')]){if(_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x11')]===0x1f4){logger[_0x39b0('0x10')](_0x39b0('0x12'),_0x37bc0c,_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);return _0x3ecfd8(_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);}logger[_0x39b0('0x10')](_0x39b0('0x12'),_0x37bc0c,_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);return _0x4b0e3e(_0x3b74bf['error'][_0x39b0('0x13')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'));_0x4b0e3e(_0x3b74bf[_0x39b0('0x14')][_0x39b0('0x13')]);}})[_0x39b0('0x15')](function(_0x159543){logger['error'](_0x39b0('0x12'),_0x37bc0c,_0x159543);_0x3ecfd8(_0x159543);});});}exports[_0x39b0('0x16')]=function(_0x32fd46){var _0x2ff45f=this;return new Promise(function(_0x551678,_0x475b40){return db['ChatQueueReport'][_0x39b0('0x17')](_0x32fd46[_0x39b0('0x18')],{'raw':_0x32fd46[_0x39b0('0x19')]?_0x32fd46[_0x39b0('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x84c2cf){logger['info'](_0x39b0('0x16'),_0x32fd46);logger[_0x39b0('0xe')](_0x39b0('0x16'),_0x32fd46,JSON[_0x39b0('0xf')](_0x84c2cf));_0x551678(_0x84c2cf);})[_0x39b0('0x15')](function(_0x2a30f7){logger[_0x39b0('0x10')](_0x39b0('0x16'),_0x2a30f7['message'],_0x32fd46);_0x475b40(_0x2ff45f[_0x39b0('0x10')](0x1f4,_0x2a30f7['message']));});});};exports[_0x39b0('0x1a')]=function(_0x105ad3){var _0x576720=this;return new Promise(function(_0x3f9f0c,_0x5c444a){return db[_0x39b0('0x1b')][_0x39b0('0x1c')](_0x105ad3[_0x39b0('0x18')],{'raw':_0x105ad3[_0x39b0('0x19')]?_0x105ad3[_0x39b0('0x19')][_0x39b0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x105ad3['options']?_0x105ad3[_0x39b0('0x19')][_0x39b0('0x1e')]||null:null,'attributes':_0x105ad3['options']?_0x105ad3[_0x39b0('0x19')]['attributes']||null:null,'limit':_0x105ad3[_0x39b0('0x19')]?_0x105ad3[_0x39b0('0x19')][_0x39b0('0x1f')]||null:null})[_0x39b0('0xc')](function(_0xe8784d){logger[_0x39b0('0x20')](_0x39b0('0x1a'),_0x105ad3);logger[_0x39b0('0xe')]('UpdateChatQueueReport',_0x105ad3,JSON[_0x39b0('0xf')](_0xe8784d));_0x3f9f0c(_0xe8784d);})['catch'](function(_0x1aec95){logger[_0x39b0('0x10')]('UpdateChatQueueReport',_0x1aec95[_0x39b0('0x13')],_0x105ad3);_0x5c444a(_0x576720[_0x39b0('0x10')](0x1f4,_0x1aec95[_0x39b0('0x13')]));});});};
\ No newline at end of file
+var _0x3a00=['../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x325c35,_0x420083){var _0x420c21=function(_0x27ee88){while(--_0x27ee88){_0x325c35['push'](_0x325c35['shift']());}};_0x420c21(++_0x420083);}(_0x3a00,0xe0));var _0x03a0=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x3a00[_0x10b317];return _0x1e3054;};'use strict';var _=require(_0x03a0('0x0'));var util=require(_0x03a0('0x1'));var moment=require('moment');var BPromise=require(_0x03a0('0x2'));var rs=require(_0x03a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x03a0('0x5'))(_0x03a0('0x6'));var config=require(_0x03a0('0x7'));var jayson=require(_0x03a0('0x8'));var client=jayson['client'][_0x03a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ff322,_0x399b95,_0x2c62b4){return new BPromise(function(_0x2dd72d,_0x345ca9){return client['request'](_0x1ff322,_0x2c62b4)[_0x03a0('0xa')](function(_0x4498e7){logger[_0x03a0('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x399b95,_0x03a0('0xc'));logger[_0x03a0('0xd')](_0x03a0('0xe'),_0x399b95,_0x03a0('0xc'),JSON[_0x03a0('0xf')](_0x4498e7));if(_0x4498e7[_0x03a0('0x10')]){if(_0x4498e7['error'][_0x03a0('0x11')]===0x1f4){logger['error'](_0x03a0('0x12'),_0x399b95,_0x4498e7[_0x03a0('0x10')]['message']);return _0x345ca9(_0x4498e7[_0x03a0('0x10')]['message']);}logger[_0x03a0('0x10')](_0x03a0('0x12'),_0x399b95,_0x4498e7[_0x03a0('0x10')][_0x03a0('0x13')]);return _0x2dd72d(_0x4498e7[_0x03a0('0x10')][_0x03a0('0x13')]);}else{logger[_0x03a0('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x399b95,'request\x20sent');_0x2dd72d(_0x4498e7[_0x03a0('0x14')]['message']);}})[_0x03a0('0x15')](function(_0x17beaf){logger['error'](_0x03a0('0x12'),_0x399b95,_0x17beaf);_0x345ca9(_0x17beaf);});});}exports[_0x03a0('0x16')]=function(_0x3dc022){var _0x36c6a1=this;return new Promise(function(_0x2b88c4,_0x3c4949){return db[_0x03a0('0x17')][_0x03a0('0x18')](_0x3dc022[_0x03a0('0x19')],{'raw':_0x3dc022[_0x03a0('0x1a')]?_0x3dc022[_0x03a0('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x03a0('0xa')](function(_0x288647){logger[_0x03a0('0xb')](_0x03a0('0x16'),_0x3dc022);logger['debug'](_0x03a0('0x16'),_0x3dc022,JSON['stringify'](_0x288647));_0x2b88c4(_0x288647);})[_0x03a0('0x15')](function(_0x580da4){logger[_0x03a0('0x10')]('CreateChatQueueReport',_0x580da4[_0x03a0('0x13')],_0x3dc022);_0x3c4949(_0x36c6a1[_0x03a0('0x10')](0x1f4,_0x580da4['message']));});});};exports[_0x03a0('0x1b')]=function(_0x5c3307){var _0x1b215b=this;return new Promise(function(_0x4ce2a6,_0x142792){return db['ChatQueueReport'][_0x03a0('0x1c')](_0x5c3307[_0x03a0('0x19')],{'raw':_0x5c3307['options']?_0x5c3307['options'][_0x03a0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c3307[_0x03a0('0x1a')]?_0x5c3307[_0x03a0('0x1a')][_0x03a0('0x1e')]||null:null,'attributes':_0x5c3307['options']?_0x5c3307[_0x03a0('0x1a')][_0x03a0('0x1f')]||null:null,'limit':_0x5c3307[_0x03a0('0x1a')]?_0x5c3307[_0x03a0('0x1a')][_0x03a0('0x20')]||null:null})[_0x03a0('0xa')](function(_0x271843){logger[_0x03a0('0xb')]('UpdateChatQueueReport',_0x5c3307);logger['debug'](_0x03a0('0x1b'),_0x5c3307,JSON[_0x03a0('0xf')](_0x271843));_0x4ce2a6(_0x271843);})[_0x03a0('0x15')](function(_0x17b07f){logger[_0x03a0('0x10')](_0x03a0('0x1b'),_0x17b07f['message'],_0x5c3307);_0x142792(_0x1b215b['error'](0x1f4,_0x17b07f[_0x03a0('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 7f3b450..12f4c90 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 _0x7387=['isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x1c5643,_0x3c5cb2){var _0x1c981f=function(_0x4d3d61){while(--_0x4d3d61){_0x1c5643['push'](_0x1c5643['shift']());}};_0x1c981f(++_0x3c5cb2);}(_0x7387,0x16a));var _0x7738=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7387[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7738('0x0'));var timeout=require('connect-timeout');var express=require(_0x7738('0x1'));var router=express[_0x7738('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7738('0x3'));var interaction=require(_0x7738('0x4'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x7738('0x5')]('/',auth[_0x7738('0x6')](),controller[_0x7738('0x7')]);router['get'](_0x7738('0x8'),auth[_0x7738('0x6')](),controller['describe']);router[_0x7738('0x5')](_0x7738('0x9'),auth[_0x7738('0x6')](),controller[_0x7738('0xa')]);router['post']('/',auth[_0x7738('0x6')](),controller[_0x7738('0xb')]);router['put']('/:id',auth[_0x7738('0x6')](),controller[_0x7738('0xc')]);router[_0x7738('0xd')]('/:id',auth[_0x7738('0x6')](),controller[_0x7738('0xe')]);module[_0x7738('0xf')]=router;
\ No newline at end of file
+var _0xdb90=['/:id','show','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','describe'];(function(_0x28c54b,_0x124ccb){var _0x5b76b5=function(_0x3c32d7){while(--_0x3c32d7){_0x28c54b['push'](_0x28c54b['shift']());}};_0x5b76b5(++_0x124ccb);}(_0xdb90,0x6d));var _0x0db9=function(_0x21a173,_0x1f6b9a){_0x21a173=_0x21a173-0x0;var _0x244d96=_0xdb90[_0x21a173];return _0x244d96;};'use strict';var multer=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var path=require('path');var timeout=require(_0x0db9('0x2'));var express=require(_0x0db9('0x3'));var router=express[_0x0db9('0x4')]();var fs_extra=require(_0x0db9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0db9('0x6'));var controller=require('./chatQueueReport.controller');router[_0x0db9('0x7')]('/',auth[_0x0db9('0x8')](),controller['index']);router['get']('/describe',auth[_0x0db9('0x8')](),controller[_0x0db9('0x9')]);router[_0x0db9('0x7')](_0x0db9('0xa'),auth[_0x0db9('0x8')](),controller[_0x0db9('0xb')]);router[_0x0db9('0xc')]('/',auth[_0x0db9('0x8')](),controller[_0x0db9('0xd')]);router[_0x0db9('0xe')]('/:id',auth[_0x0db9('0x8')](),controller[_0x0db9('0xf')]);router['delete'](_0x0db9('0xa'),auth['isAuthenticated'](),controller[_0x0db9('0x10')]);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 3bc7164..3ebcedf 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x202787,_0x35d489){_0x202787=_0x202787-0x0;var _0x151e66=_0xb43b[_0x202787];return _0x151e66;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x188f90,_0xa82ba3){var _0x574df5=function(_0x47b055){while(--_0x47b055){_0x188f90['push'](_0x188f90['shift']());}};_0x574df5(++_0xa82ba3);}(_0xe706,0xa3));var _0x6e70=function(_0x1f625b,_0x276b0e){_0x1f625b=_0x1f625b-0x0;var _0x748222=_0xe706[_0x1f625b];return _0x748222;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 42207a1..34393ba 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 _0xcbe8=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','save','then','destroy','name','index','ChatTransferReport','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','keys','find','create','catch','update','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x35d7a7,_0x1383cc){var _0x38cdf0=function(_0x36d423){while(--_0x36d423){_0x35d7a7['push'](_0x35d7a7['shift']());}};_0x38cdf0(++_0x1383cc);}(_0xcbe8,0x1e4));var _0x8cbe=function(_0x394ef9,_0x4756e6){_0x394ef9=_0x394ef9-0x0;var _0x571ea0=_0xcbe8[_0x394ef9];return _0x571ea0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cbe('0x0'));var zipdir=require(_0x8cbe('0x1'));var jsonpatch=require(_0x8cbe('0x2'));var rp=require(_0x8cbe('0x3'));var moment=require(_0x8cbe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8cbe('0x5'));var path=require(_0x8cbe('0x6'));var sox=require(_0x8cbe('0x7'));var csv=require(_0x8cbe('0x8'));var ejs=require(_0x8cbe('0x9'));var fs=require('fs');var fs_extra=require(_0x8cbe('0xa'));var _=require(_0x8cbe('0xb'));var squel=require('squel');var crypto=require(_0x8cbe('0xc'));var jsforce=require(_0x8cbe('0xd'));var deskjs=require(_0x8cbe('0xe'));var toCsv=require(_0x8cbe('0x8'));var querystring=require('querystring');var Papa=require(_0x8cbe('0xf'));var Redis=require(_0x8cbe('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8cbe('0x11'));var hardwareService=require(_0x8cbe('0x12'));var logger=require(_0x8cbe('0x13'))(_0x8cbe('0x14'));var utils=require(_0x8cbe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8cbe('0x16'));var db=require(_0x8cbe('0x17'))['db'];function respondWithStatusCode(_0xb6d819,_0x2ceb7b){_0x2ceb7b=_0x2ceb7b||0xcc;return function(_0x1a546f){if(_0x1a546f){return _0xb6d819[_0x8cbe('0x18')](_0x2ceb7b);}return _0xb6d819[_0x8cbe('0x19')](_0x2ceb7b)[_0x8cbe('0x1a')]();};}function respondWithResult(_0x39640f,_0x4d6579){_0x4d6579=_0x4d6579||0xc8;return function(_0x5993ee){if(_0x5993ee){return _0x39640f[_0x8cbe('0x19')](_0x4d6579)['json'](_0x5993ee);}};}function respondWithFilteredResult(_0x564468,_0x477ce5){return function(_0x47c44e){if(_0x47c44e){var _0x3596fb=typeof _0x477ce5['offset']==='undefined'&&typeof _0x477ce5[_0x8cbe('0x1b')]===_0x8cbe('0x1c');var _0x1270dd=_0x47c44e[_0x8cbe('0x1d')];var _0x5849f6=_0x3596fb?0x0:_0x477ce5[_0x8cbe('0x1e')];var _0x469bd8=_0x3596fb?_0x47c44e[_0x8cbe('0x1d')]:_0x477ce5[_0x8cbe('0x1e')]+_0x477ce5[_0x8cbe('0x1b')];var _0x2b1073;if(_0x469bd8>=_0x1270dd){_0x469bd8=_0x1270dd;_0x2b1073=0xc8;}else{_0x2b1073=0xce;}_0x564468[_0x8cbe('0x19')](_0x2b1073);return _0x564468['set'](_0x8cbe('0x1f'),_0x5849f6+'-'+_0x469bd8+'/'+_0x1270dd)[_0x8cbe('0x20')](_0x47c44e);}return null;};}function patchUpdates(_0x12e37a){return function(_0x498825){try{jsonpatch[_0x8cbe('0x21')](_0x498825,_0x12e37a,!![]);}catch(_0x73019b){return BPromise['reject'](_0x73019b);}return _0x498825[_0x8cbe('0x22')]();};}function saveUpdates(_0x357913,_0x1aa168){return function(_0x5b973c){if(_0x5b973c){return _0x5b973c['update'](_0x357913)[_0x8cbe('0x23')](function(_0x21e567){return _0x21e567;});}return null;};}function removeEntity(_0x4587cd,_0x2ca27f){return function(_0xed33dd){if(_0xed33dd){return _0xed33dd[_0x8cbe('0x24')]()[_0x8cbe('0x23')](function(){_0x4587cd[_0x8cbe('0x19')](0xcc)[_0x8cbe('0x1a')]();});}};}function handleEntityNotFound(_0x5ed8d6,_0xf6a184){return function(_0x30c07c){if(!_0x30c07c){_0x5ed8d6[_0x8cbe('0x18')](0x194);}return _0x30c07c;};}function handleError(_0x139496,_0x47d479){_0x47d479=_0x47d479||0x1f4;return function(_0x2406bb){logger['error'](_0x2406bb['stack']);if(_0x2406bb[_0x8cbe('0x25')]){delete _0x2406bb[_0x8cbe('0x25')];}_0x139496[_0x8cbe('0x19')](_0x47d479)['send'](_0x2406bb);};}exports[_0x8cbe('0x26')]=function(_0x56b0b1,_0x3f6320){var _0x3b5cc9={},_0x56338f={},_0x51eda4={'count':0x0,'rows':[]};var _0x33813e=_['map'](db[_0x8cbe('0x27')]['rawAttributes'],function(_0x3af13b){return{'name':_0x3af13b['fieldName'],'type':_0x3af13b[_0x8cbe('0x28')][_0x8cbe('0x29')]};});_0x56338f[_0x8cbe('0x2a')]=_[_0x8cbe('0x2b')](_0x33813e,_0x8cbe('0x25'));_0x56338f[_0x8cbe('0x2c')]=_['keys'](_0x56b0b1[_0x8cbe('0x2c')]);_0x56338f[_0x8cbe('0x2d')]=_[_0x8cbe('0x2e')](_0x56338f[_0x8cbe('0x2a')],_0x56338f[_0x8cbe('0x2c')]);_0x3b5cc9[_0x8cbe('0x2f')]=_[_0x8cbe('0x2e')](_0x56338f[_0x8cbe('0x2a')],qs[_0x8cbe('0x30')](_0x56b0b1[_0x8cbe('0x2c')][_0x8cbe('0x30')]));_0x3b5cc9[_0x8cbe('0x2f')]=_0x3b5cc9[_0x8cbe('0x2f')][_0x8cbe('0x31')]?_0x3b5cc9['attributes']:_0x56338f[_0x8cbe('0x2a')];if(!_0x56b0b1[_0x8cbe('0x2c')]['hasOwnProperty'](_0x8cbe('0x32'))){_0x3b5cc9[_0x8cbe('0x1b')]=qs[_0x8cbe('0x1b')](_0x56b0b1['query'][_0x8cbe('0x1b')]);_0x3b5cc9['offset']=qs[_0x8cbe('0x1e')](_0x56b0b1[_0x8cbe('0x2c')]['offset']);}_0x3b5cc9[_0x8cbe('0x33')]=qs[_0x8cbe('0x34')](_0x56b0b1[_0x8cbe('0x2c')]['sort']);_0x3b5cc9[_0x8cbe('0x35')]=qs['filters'](_[_0x8cbe('0x36')](_0x56b0b1[_0x8cbe('0x2c')],_0x56338f[_0x8cbe('0x2d')]),_0x33813e);if(_0x56b0b1[_0x8cbe('0x2c')][_0x8cbe('0x37')]){_0x3b5cc9['where']=_['merge'](_0x3b5cc9[_0x8cbe('0x35')],{'$or':_[_0x8cbe('0x2b')](_0x33813e,function(_0x244dda){if(_0x244dda[_0x8cbe('0x28')]!==_0x8cbe('0x38')){var _0x3e3e41={};_0x3e3e41[_0x244dda[_0x8cbe('0x25')]]={'$like':'%'+_0x56b0b1[_0x8cbe('0x2c')][_0x8cbe('0x37')]+'%'};return _0x3e3e41;}})});}_0x3b5cc9=_['merge']({},_0x3b5cc9,_0x56b0b1[_0x8cbe('0x39')]);var _0x184502={'where':_0x3b5cc9[_0x8cbe('0x35')]};return db[_0x8cbe('0x27')][_0x8cbe('0x1d')](_0x184502)[_0x8cbe('0x23')](function(_0x455e63){_0x51eda4[_0x8cbe('0x1d')]=_0x455e63;if(_0x56b0b1[_0x8cbe('0x2c')][_0x8cbe('0x3a')]){_0x3b5cc9[_0x8cbe('0x3b')]=[{'all':!![]}];}return db[_0x8cbe('0x27')]['findAll'](_0x3b5cc9);})[_0x8cbe('0x23')](function(_0x2a1bd3){_0x51eda4[_0x8cbe('0x3c')]=_0x2a1bd3;return _0x51eda4;})[_0x8cbe('0x23')](respondWithFilteredResult(_0x3f6320,_0x3b5cc9))['catch'](handleError(_0x3f6320,null));};exports[_0x8cbe('0x3d')]=function(_0x3099e9,_0x5d2e64){var _0x28b65a={'raw':!![],'where':{'id':_0x3099e9['params']['id']}},_0x29efcb={};_0x29efcb[_0x8cbe('0x2a')]=_['keys'](db[_0x8cbe('0x27')]['rawAttributes']);_0x29efcb[_0x8cbe('0x2c')]=_[_0x8cbe('0x3e')](_0x3099e9[_0x8cbe('0x2c')]);_0x29efcb[_0x8cbe('0x2d')]=_[_0x8cbe('0x2e')](_0x29efcb[_0x8cbe('0x2a')],_0x29efcb[_0x8cbe('0x2c')]);_0x28b65a['attributes']=_['intersection'](_0x29efcb['model'],qs['fields'](_0x3099e9[_0x8cbe('0x2c')][_0x8cbe('0x30')]));_0x28b65a[_0x8cbe('0x2f')]=_0x28b65a[_0x8cbe('0x2f')][_0x8cbe('0x31')]?_0x28b65a[_0x8cbe('0x2f')]:_0x29efcb[_0x8cbe('0x2a')];if(_0x3099e9[_0x8cbe('0x2c')][_0x8cbe('0x3a')]){_0x28b65a['include']=[{'all':!![]}];}_0x28b65a=_['merge']({},_0x28b65a,_0x3099e9['options']);return db[_0x8cbe('0x27')][_0x8cbe('0x3f')](_0x28b65a)['then'](handleEntityNotFound(_0x5d2e64,null))[_0x8cbe('0x23')](respondWithResult(_0x5d2e64,null))['catch'](handleError(_0x5d2e64,null));};exports[_0x8cbe('0x40')]=function(_0x2ab603,_0x150334){return db[_0x8cbe('0x27')][_0x8cbe('0x40')](_0x2ab603['body'],{})['then'](respondWithResult(_0x150334,0xc9))[_0x8cbe('0x41')](handleError(_0x150334,null));};exports[_0x8cbe('0x42')]=function(_0x310277,_0x48d9dc){if(_0x310277[_0x8cbe('0x43')]['id']){delete _0x310277[_0x8cbe('0x43')]['id'];}return db[_0x8cbe('0x27')][_0x8cbe('0x3f')]({'where':{'id':_0x310277[_0x8cbe('0x44')]['id']}})['then'](handleEntityNotFound(_0x48d9dc,null))['then'](saveUpdates(_0x310277[_0x8cbe('0x43')],null))[_0x8cbe('0x23')](respondWithResult(_0x48d9dc,null))[_0x8cbe('0x41')](handleError(_0x48d9dc,null));};exports[_0x8cbe('0x24')]=function(_0xd0c356,_0x4ebedc){return db[_0x8cbe('0x27')]['find']({'where':{'id':_0xd0c356[_0x8cbe('0x44')]['id']}})[_0x8cbe('0x23')](handleEntityNotFound(_0x4ebedc,null))[_0x8cbe('0x23')](removeEntity(_0x4ebedc,null))[_0x8cbe('0x41')](handleError(_0x4ebedc,null));};exports[_0x8cbe('0x45')]=function(_0x4dadfa,_0x52efbb){return db[_0x8cbe('0x27')][_0x8cbe('0x45')]()[_0x8cbe('0x23')](respondWithResult(_0x52efbb,null))[_0x8cbe('0x41')](handleError(_0x52efbb,null));};
\ No newline at end of file
+var _0x7e06=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length'];(function(_0x31ead7,_0x2e9a7c){var _0x3516f0=function(_0x47fa36){while(--_0x47fa36){_0x31ead7['push'](_0x31ead7['shift']());}};_0x3516f0(++_0x2e9a7c);}(_0x7e06,0x1d6));var _0x67e0=function(_0x523ba7,_0x40a2c6){_0x523ba7=_0x523ba7-0x0;var _0x4c45ea=_0x7e06[_0x523ba7];return _0x4c45ea;};'use strict';var emlformat=require(_0x67e0('0x0'));var rimraf=require(_0x67e0('0x1'));var zipdir=require(_0x67e0('0x2'));var jsonpatch=require(_0x67e0('0x3'));var rp=require(_0x67e0('0x4'));var moment=require('moment');var BPromise=require(_0x67e0('0x5'));var Mustache=require(_0x67e0('0x6'));var util=require(_0x67e0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x67e0('0x8'));var ejs=require(_0x67e0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67e0('0xa'));var squel=require(_0x67e0('0xb'));var crypto=require('crypto');var jsforce=require(_0x67e0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x67e0('0xd'));var Papa=require(_0x67e0('0xe'));var Redis=require(_0x67e0('0xf'));var authService=require(_0x67e0('0x10'));var qs=require(_0x67e0('0x11'));var as=require(_0x67e0('0x12'));var hardwareService=require(_0x67e0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x67e0('0x14'));var config=require(_0x67e0('0x15'));var licenseUtil=require(_0x67e0('0x16'));var db=require(_0x67e0('0x17'))['db'];function respondWithStatusCode(_0x519638,_0xf5a7a2){_0xf5a7a2=_0xf5a7a2||0xcc;return function(_0x198ed2){if(_0x198ed2){return _0x519638['sendStatus'](_0xf5a7a2);}return _0x519638[_0x67e0('0x18')](_0xf5a7a2)[_0x67e0('0x19')]();};}function respondWithResult(_0x283fdc,_0x379aaf){_0x379aaf=_0x379aaf||0xc8;return function(_0x3cd5a3){if(_0x3cd5a3){return _0x283fdc[_0x67e0('0x18')](_0x379aaf)['json'](_0x3cd5a3);}};}function respondWithFilteredResult(_0x568ae2,_0x5456c5){return function(_0x44cf77){if(_0x44cf77){var _0x7db199=typeof _0x5456c5[_0x67e0('0x1a')]===_0x67e0('0x1b')&&typeof _0x5456c5[_0x67e0('0x1c')]==='undefined';var _0x3ebad5=_0x44cf77[_0x67e0('0x1d')];var _0x5270f3=_0x7db199?0x0:_0x5456c5[_0x67e0('0x1a')];var _0x2ca948=_0x7db199?_0x44cf77[_0x67e0('0x1d')]:_0x5456c5[_0x67e0('0x1a')]+_0x5456c5[_0x67e0('0x1c')];var _0x10a749;if(_0x2ca948>=_0x3ebad5){_0x2ca948=_0x3ebad5;_0x10a749=0xc8;}else{_0x10a749=0xce;}_0x568ae2[_0x67e0('0x18')](_0x10a749);return _0x568ae2[_0x67e0('0x1e')]('Content-Range',_0x5270f3+'-'+_0x2ca948+'/'+_0x3ebad5)['json'](_0x44cf77);}return null;};}function patchUpdates(_0x3fae26){return function(_0x1a4567){try{jsonpatch['apply'](_0x1a4567,_0x3fae26,!![]);}catch(_0x3ece77){return BPromise[_0x67e0('0x1f')](_0x3ece77);}return _0x1a4567[_0x67e0('0x20')]();};}function saveUpdates(_0x3d9d3e,_0x4ace72){return function(_0x42e99c){if(_0x42e99c){return _0x42e99c[_0x67e0('0x21')](_0x3d9d3e)[_0x67e0('0x22')](function(_0x67b71){return _0x67b71;});}return null;};}function removeEntity(_0xd60cdd,_0x2630b8){return function(_0x3f9b18){if(_0x3f9b18){return _0x3f9b18[_0x67e0('0x23')]()[_0x67e0('0x22')](function(){_0xd60cdd[_0x67e0('0x18')](0xcc)[_0x67e0('0x19')]();});}};}function handleEntityNotFound(_0x18066d,_0xa31093){return function(_0x24527d){if(!_0x24527d){_0x18066d[_0x67e0('0x24')](0x194);}return _0x24527d;};}function handleError(_0x69aa2d,_0x456be6){_0x456be6=_0x456be6||0x1f4;return function(_0x216ae7){logger[_0x67e0('0x25')](_0x216ae7[_0x67e0('0x26')]);if(_0x216ae7['name']){delete _0x216ae7[_0x67e0('0x27')];}_0x69aa2d['status'](_0x456be6)[_0x67e0('0x28')](_0x216ae7);};}exports[_0x67e0('0x29')]=function(_0x240a2c,_0x3ad743){var _0x17debb={},_0x149d2c={},_0x1055fd={'count':0x0,'rows':[]};var _0x5c221d=_[_0x67e0('0x2a')](db[_0x67e0('0x2b')][_0x67e0('0x2c')],function(_0x4a6efe){return{'name':_0x4a6efe['fieldName'],'type':_0x4a6efe[_0x67e0('0x2d')][_0x67e0('0x2e')]};});_0x149d2c['model']=_[_0x67e0('0x2a')](_0x5c221d,'name');_0x149d2c[_0x67e0('0x2f')]=_[_0x67e0('0x30')](_0x240a2c['query']);_0x149d2c[_0x67e0('0x31')]=_['intersection'](_0x149d2c[_0x67e0('0x32')],_0x149d2c['query']);_0x17debb[_0x67e0('0x33')]=_[_0x67e0('0x34')](_0x149d2c[_0x67e0('0x32')],qs[_0x67e0('0x35')](_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x35')]));_0x17debb['attributes']=_0x17debb[_0x67e0('0x33')][_0x67e0('0x36')]?_0x17debb['attributes']:_0x149d2c['model'];if(!_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x37')](_0x67e0('0x38'))){_0x17debb[_0x67e0('0x1c')]=qs[_0x67e0('0x1c')](_0x240a2c[_0x67e0('0x2f')]['limit']);_0x17debb[_0x67e0('0x1a')]=qs[_0x67e0('0x1a')](_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x1a')]);}_0x17debb[_0x67e0('0x39')]=qs[_0x67e0('0x3a')](_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x3a')]);_0x17debb[_0x67e0('0x3b')]=qs['filters'](_[_0x67e0('0x3c')](_0x240a2c[_0x67e0('0x2f')],_0x149d2c[_0x67e0('0x31')]),_0x5c221d);if(_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x3d')]){_0x17debb[_0x67e0('0x3b')]=_[_0x67e0('0x3e')](_0x17debb[_0x67e0('0x3b')],{'$or':_['map'](_0x5c221d,function(_0x3fa7db){if(_0x3fa7db['type']!=='VIRTUAL'){var _0x132264={};_0x132264[_0x3fa7db[_0x67e0('0x27')]]={'$like':'%'+_0x240a2c[_0x67e0('0x2f')]['filter']+'%'};return _0x132264;}})});}_0x17debb=_[_0x67e0('0x3e')]({},_0x17debb,_0x240a2c[_0x67e0('0x3f')]);var _0x4d344e={'where':_0x17debb[_0x67e0('0x3b')]};return db[_0x67e0('0x2b')][_0x67e0('0x1d')](_0x4d344e)[_0x67e0('0x22')](function(_0x1bd8e7){_0x1055fd[_0x67e0('0x1d')]=_0x1bd8e7;if(_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x40')]){_0x17debb['include']=[{'all':!![]}];}return db[_0x67e0('0x2b')][_0x67e0('0x41')](_0x17debb);})['then'](function(_0x508371){_0x1055fd[_0x67e0('0x42')]=_0x508371;return _0x1055fd;})[_0x67e0('0x22')](respondWithFilteredResult(_0x3ad743,_0x17debb))['catch'](handleError(_0x3ad743,null));};exports[_0x67e0('0x43')]=function(_0x2e3004,_0x47972e){var _0x1f3165={'raw':!![],'where':{'id':_0x2e3004['params']['id']}},_0x510d21={};_0x510d21['model']=_[_0x67e0('0x30')](db[_0x67e0('0x2b')][_0x67e0('0x2c')]);_0x510d21[_0x67e0('0x2f')]=_[_0x67e0('0x30')](_0x2e3004[_0x67e0('0x2f')]);_0x510d21[_0x67e0('0x31')]=_[_0x67e0('0x34')](_0x510d21[_0x67e0('0x32')],_0x510d21['query']);_0x1f3165['attributes']=_[_0x67e0('0x34')](_0x510d21[_0x67e0('0x32')],qs['fields'](_0x2e3004[_0x67e0('0x2f')][_0x67e0('0x35')]));_0x1f3165[_0x67e0('0x33')]=_0x1f3165[_0x67e0('0x33')][_0x67e0('0x36')]?_0x1f3165[_0x67e0('0x33')]:_0x510d21[_0x67e0('0x32')];if(_0x2e3004['query']['includeAll']){_0x1f3165[_0x67e0('0x44')]=[{'all':!![]}];}_0x1f3165=_[_0x67e0('0x3e')]({},_0x1f3165,_0x2e3004[_0x67e0('0x3f')]);return db['ChatTransferReport'][_0x67e0('0x45')](_0x1f3165)[_0x67e0('0x22')](handleEntityNotFound(_0x47972e,null))['then'](respondWithResult(_0x47972e,null))[_0x67e0('0x46')](handleError(_0x47972e,null));};exports[_0x67e0('0x47')]=function(_0x15db0d,_0x554baa){return db[_0x67e0('0x2b')][_0x67e0('0x47')](_0x15db0d[_0x67e0('0x48')],{})['then'](respondWithResult(_0x554baa,0xc9))[_0x67e0('0x46')](handleError(_0x554baa,null));};exports[_0x67e0('0x21')]=function(_0x125676,_0x2f7e65){if(_0x125676[_0x67e0('0x48')]['id']){delete _0x125676[_0x67e0('0x48')]['id'];}return db['ChatTransferReport'][_0x67e0('0x45')]({'where':{'id':_0x125676[_0x67e0('0x49')]['id']}})[_0x67e0('0x22')](handleEntityNotFound(_0x2f7e65,null))['then'](saveUpdates(_0x125676['body'],null))[_0x67e0('0x22')](respondWithResult(_0x2f7e65,null))[_0x67e0('0x46')](handleError(_0x2f7e65,null));};exports['destroy']=function(_0x23e29b,_0x4019d){return db['ChatTransferReport'][_0x67e0('0x45')]({'where':{'id':_0x23e29b[_0x67e0('0x49')]['id']}})[_0x67e0('0x22')](handleEntityNotFound(_0x4019d,null))[_0x67e0('0x22')](removeEntity(_0x4019d,null))[_0x67e0('0x46')](handleError(_0x4019d,null));};exports[_0x67e0('0x4a')]=function(_0x2acd45,_0x4dd803){return db[_0x67e0('0x2b')][_0x67e0('0x4a')]()[_0x67e0('0x22')](respondWithResult(_0x4dd803,null))['catch'](handleError(_0x4dd803,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 0aab79d..dc1c99c 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 _0x12c8=['path','../../config/environment','ChatTransferReport','report_chat_transfer','uniqueid','lodash','moment','bluebird','request-promise'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x12c8,0x1be));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x812c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x812c('0x1'));var BPromise=require(_0x812c('0x2'));var rp=require(_0x812c('0x3'));var fs=require('fs');var path=require(_0x812c('0x4'));var rimraf=require('rimraf');var config=require(_0x812c('0x5'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x50853f,_0x3e5d43){return _0x50853f['define'](_0x812c('0x6'),attributes,{'tableName':_0x812c('0x7'),'paranoid':![],'indexes':[{'name':_0x812c('0x8'),'fields':[_0x812c('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xda9e=['report_chat_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x17527f,_0x194435){var _0x2ccfa6=function(_0xd753f6){while(--_0xd753f6){_0x17527f['push'](_0x17527f['shift']());}};_0x2ccfa6(++_0x194435);}(_0xda9e,0x195));var _0xeda9=function(_0x2a7bf1,_0x2c1220){_0x2a7bf1=_0x2a7bf1-0x0;var _0x4d5458=_0xda9e[_0x2a7bf1];return _0x4d5458;};'use strict';var _=require('lodash');var util=require(_0xeda9('0x0'));var logger=require(_0xeda9('0x1'))(_0xeda9('0x2'));var moment=require(_0xeda9('0x3'));var BPromise=require('bluebird');var rp=require(_0xeda9('0x4'));var fs=require('fs');var path=require(_0xeda9('0x5'));var rimraf=require('rimraf');var config=require(_0xeda9('0x6'));var attributes=require(_0xeda9('0x7'));module[_0xeda9('0x8')]=function(_0x4fe61e,_0x1badf0){return _0x4fe61e[_0xeda9('0x9')](_0xeda9('0xa'),attributes,{'tableName':_0xeda9('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xeda9('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 4c6c8ed..64125bc 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 _0x1b86=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5ad794,_0x330eb1){var _0x58d45e=function(_0x28c899){while(--_0x28c899){_0x5ad794['push'](_0x5ad794['shift']());}};_0x58d45e(++_0x330eb1);}(_0x1b86,0x163));var _0x61b8=function(_0x588828,_0x4dad43){_0x588828=_0x588828-0x0;var _0x15117f=_0x1b86[_0x588828];return _0x15117f;};'use strict';var _=require(_0x61b8('0x0'));var util=require(_0x61b8('0x1'));var moment=require(_0x61b8('0x2'));var BPromise=require(_0x61b8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61b8('0x4'))['db'];var utils=require(_0x61b8('0x5'));var logger=require(_0x61b8('0x6'))(_0x61b8('0x7'));var config=require(_0x61b8('0x8'));var jayson=require(_0x61b8('0x9'));var client=jayson[_0x61b8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23d5a5,_0x443d46,_0x2d4e0){return new BPromise(function(_0x38eecb,_0x11344c){return client['request'](_0x23d5a5,_0x2d4e0)['then'](function(_0x5c9522){logger[_0x61b8('0xb')](_0x61b8('0xc'),_0x443d46,_0x61b8('0xd'));logger[_0x61b8('0xe')](_0x61b8('0xf'),_0x443d46,'request\x20sent',JSON[_0x61b8('0x10')](_0x5c9522));if(_0x5c9522[_0x61b8('0x11')]){if(_0x5c9522[_0x61b8('0x11')][_0x61b8('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x443d46,_0x5c9522[_0x61b8('0x11')][_0x61b8('0x13')]);return _0x11344c(_0x5c9522[_0x61b8('0x11')][_0x61b8('0x13')]);}logger[_0x61b8('0x11')](_0x61b8('0xc'),_0x443d46,_0x5c9522[_0x61b8('0x11')][_0x61b8('0x13')]);return _0x38eecb(_0x5c9522[_0x61b8('0x11')]['message']);}else{logger[_0x61b8('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x443d46,_0x61b8('0xd'));_0x38eecb(_0x5c9522[_0x61b8('0x14')]['message']);}})[_0x61b8('0x15')](function(_0x350316){logger[_0x61b8('0x11')](_0x61b8('0xc'),_0x443d46,_0x350316);_0x11344c(_0x350316);});});}
\ No newline at end of file
+var _0xa19a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2867f0,_0x1e5c4a){var _0x31b383=function(_0x59ccef){while(--_0x59ccef){_0x2867f0['push'](_0x2867f0['shift']());}};_0x31b383(++_0x1e5c4a);}(_0xa19a,0x14b));var _0xaa19=function(_0x377a56,_0x5d3477){_0x377a56=_0x377a56-0x0;var _0x558cbf=_0xa19a[_0x377a56];return _0x558cbf;};'use strict';var _=require(_0xaa19('0x0'));var util=require(_0xaa19('0x1'));var moment=require(_0xaa19('0x2'));var BPromise=require(_0xaa19('0x3'));var rs=require(_0xaa19('0x4'));var fs=require('fs');var Redis=require(_0xaa19('0x5'));var db=require(_0xaa19('0x6'))['db'];var utils=require(_0xaa19('0x7'));var logger=require(_0xaa19('0x8'))(_0xaa19('0x9'));var config=require(_0xaa19('0xa'));var jayson=require(_0xaa19('0xb'));var client=jayson[_0xaa19('0xc')][_0xaa19('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d797c,_0xf09dd3,_0x6612cf){return new BPromise(function(_0x2f8854,_0x369a55){return client[_0xaa19('0xe')](_0x4d797c,_0x6612cf)['then'](function(_0x81fcdd){logger[_0xaa19('0xf')](_0xaa19('0x10'),_0xf09dd3,'request\x20sent');logger['debug'](_0xaa19('0x11'),_0xf09dd3,_0xaa19('0x12'),JSON[_0xaa19('0x13')](_0x81fcdd));if(_0x81fcdd[_0xaa19('0x14')]){if(_0x81fcdd['error']['code']===0x1f4){logger[_0xaa19('0x14')](_0xaa19('0x10'),_0xf09dd3,_0x81fcdd[_0xaa19('0x14')][_0xaa19('0x15')]);return _0x369a55(_0x81fcdd[_0xaa19('0x14')][_0xaa19('0x15')]);}logger['error'](_0xaa19('0x10'),_0xf09dd3,_0x81fcdd[_0xaa19('0x14')][_0xaa19('0x15')]);return _0x2f8854(_0x81fcdd[_0xaa19('0x14')][_0xaa19('0x15')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xf09dd3,_0xaa19('0x12'));_0x2f8854(_0x81fcdd[_0xaa19('0x16')][_0xaa19('0x15')]);}})[_0xaa19('0x17')](function(_0x40944c){logger[_0xaa19('0x14')](_0xaa19('0x10'),_0xf09dd3,_0x40944c);_0x369a55(_0x40944c);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index dee0191..fac7062 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 _0xf64c=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x13d82c,_0x4f9f64){var _0x2ba899=function(_0x520617){while(--_0x520617){_0x13d82c['push'](_0x13d82c['shift']());}};_0x2ba899(++_0x4f9f64);}(_0xf64c,0x125));var _0xcf64=function(_0x361367,_0x2b888d){_0x361367=_0x361367-0x0;var _0x1fe5ff=_0xf64c[_0x361367];return _0x1fe5ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcf64('0x0'));var timeout=require(_0xcf64('0x1'));var express=require(_0xcf64('0x2'));var router=express[_0xcf64('0x3')]();var fs_extra=require(_0xcf64('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcf64('0x5'));var config=require(_0xcf64('0x6'));var controller=require(_0xcf64('0x7'));router[_0xcf64('0x8')]('/',auth[_0xcf64('0x9')](),controller[_0xcf64('0xa')]);router[_0xcf64('0x8')](_0xcf64('0xb'),auth[_0xcf64('0x9')](),controller[_0xcf64('0xc')]);router['get'](_0xcf64('0xd'),auth[_0xcf64('0x9')](),controller['show']);router['post']('/',auth[_0xcf64('0x9')](),controller[_0xcf64('0xe')]);router[_0xcf64('0xf')](_0xcf64('0xd'),auth['isAuthenticated'](),controller[_0xcf64('0x10')]);router[_0xcf64('0x11')](_0xcf64('0xd'),auth[_0xcf64('0x9')](),controller[_0xcf64('0x12')]);module[_0xcf64('0x13')]=router;
\ No newline at end of file
+var _0xef29=['put','update','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create'];(function(_0x37ad39,_0x5909d4){var _0x29fed5=function(_0x4a753c){while(--_0x4a753c){_0x37ad39['push'](_0x37ad39['shift']());}};_0x29fed5(++_0x5909d4);}(_0xef29,0x12a));var _0x9ef2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xef29[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x9ef2('0x0'));var util=require(_0x9ef2('0x1'));var path=require(_0x9ef2('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ef2('0x3'));var router=express[_0x9ef2('0x4')]();var fs_extra=require(_0x9ef2('0x5'));var auth=require(_0x9ef2('0x6'));var interaction=require(_0x9ef2('0x7'));var config=require('../../config/environment');var controller=require(_0x9ef2('0x8'));router['get']('/',auth[_0x9ef2('0x9')](),controller[_0x9ef2('0xa')]);router[_0x9ef2('0xb')](_0x9ef2('0xc'),auth['isAuthenticated'](),controller[_0x9ef2('0xd')]);router[_0x9ef2('0xb')]('/:id',auth[_0x9ef2('0x9')](),controller[_0x9ef2('0xe')]);router[_0x9ef2('0xf')]('/',auth[_0x9ef2('0x9')](),controller[_0x9ef2('0x10')]);router[_0x9ef2('0x11')]('/:id',auth[_0x9ef2('0x9')](),controller[_0x9ef2('0x12')]);router['delete'](_0x9ef2('0x13'),auth[_0x9ef2('0x9')](),controller['destroy']);module[_0x9ef2('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 799dcb4..84fffbe 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 _0x54ef=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','rounded','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','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'];(function(_0xedb29f,_0x18fa51){var _0xdee9a=function(_0xe2df8b){while(--_0xe2df8b){_0xedb29f['push'](_0xedb29f['shift']());}};_0xdee9a(++_0x18fa51);}(_0x54ef,0x112));var _0xf54e=function(_0x5cd829,_0x17d802){_0x5cd829=_0x5cd829-0x0;var _0x22db18=_0x54ef[_0x5cd829];return _0x22db18;};'use strict';var Sequelize=require(_0xf54e('0x0'));var rs=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'unique':_0xf54e('0x4')},'description':{'type':Sequelize[_0xf54e('0x3')]},'mapKey':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x5')},'mapKeyOffline':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x6')},'customerAlias':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':_0xf54e('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf54e('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf54e('0x3')]},'animation':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf54e('0xa'),_0xf54e('0xb')),'defaultValue':_0xf54e('0xa')},'header_online':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0xc')},'header_offline':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xd')},'download_transcript':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf54e('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x12')},'placeholderMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x13')},'closingMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x14')},'closingMessageButton':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xc')},'skipMessageButton':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x15')},'conditionAgreement':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x16')},'ratingType':{'type':Sequelize[_0xf54e('0x17')](_0xf54e('0x18'),_0xf54e('0x19')),'defaultValue':_0xf54e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return JSON[_0xf54e('0x1a')]({'items':[{'type':_0xf54e('0x1b'),'variable':null,'config':{'placeholder':_0xf54e('0x1c'),'type':_0xf54e('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xf54e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf54e('0x5'),'type':_0xf54e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf54e('0x1e')](_0xf54e('0x1f'))?JSON[_0xf54e('0x20')](this[_0xf54e('0x1e')](_0xf54e('0x1f'))):{};},'set':function(_0x43488d){return this[_0xf54e('0x21')](_0xf54e('0x1f'),JSON[_0xf54e('0x1a')](_0x43488d));}},'offlineForm':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return JSON[_0xf54e('0x1a')]({'items':[{'type':'input','props':{'title':_0xf54e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf54e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf54e('0x22')},'props':{'title':_0xf54e('0x22'),'helpText':_0xf54e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xf54e('0x1e')](_0xf54e('0x24'))?JSON[_0xf54e('0x20')](this[_0xf54e('0x1e')]('offlineForm')):{};},'set':function(_0x4b3c73){return this[_0xf54e('0x21')](_0xf54e('0x24'),JSON[_0xf54e('0x1a')](_0x4b3c73));}},'token':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':function(){return rs[_0xf54e('0x25')]();}},'autoclose':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf54e('0x3')]},'forwardOffline':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x26')},'waitingMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x27')},'offlineMessageBody':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x15')},'sendUnmanaged':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return _0xf54e('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2c')},'messagesAlignment':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2d')},'defaultTitle':{'type':Sequelize[_0xf54e('0x3')]},'customerAvatar':{'type':Sequelize[_0xf54e('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':_0xf54e('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf54e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2f')},'systemAvatar':{'type':Sequelize[_0xf54e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf54e('0x8')],'comment':_0xf54e('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![],'comment':_0xf54e('0x31'),'set':function(_0x2087b3){if(!_0x2087b3)this[_0xf54e('0x21')](_0xf54e('0x32'),null);this[_0xf54e('0x21')](_0xf54e('0x33'),_0x2087b3);}},'vidaooEscalation':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':function(){return _0xf54e('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf54e('0xf')]}};
\ No newline at end of file
+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(_0xe4a5ce,_0xb35d50){var _0x22133e=function(_0x2b4c14){while(--_0x2b4c14){_0xe4a5ce['push'](_0xe4a5ce['shift']());}};_0x22133e(++_0xb35d50);}(_0xb821,0xa7));var _0x1b82=function(_0x17ef4a,_0x354902){_0x17ef4a=_0x17ef4a-0x0;var _0xe65f66=_0xb821[_0x17ef4a];return _0xe65f66;};'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
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 5d7c958..0db24bd 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 _0x3386=['some','readFileSync','stringify','x-real-ip','remoteAddress','alignment','verticalAlignment','textColor','textButtonColor','color_button','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','online','false','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','path','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','Content-Range','json','destroy','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','join','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','account','applications','Applications','list','orderBy','priority','asc','mapKey','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','format','%s\x20%s','unknown','version','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','increment','chatLicenseExceeded','Intervals','all'];(function(_0x534c16,_0x4f3d34){var _0x54cbad=function(_0x97ba34){while(--_0x97ba34){_0x534c16['push'](_0x534c16['shift']());}};_0x54cbad(++_0x4f3d34);}(_0x3386,0x145));var _0x6338=function(_0xe27035,_0x1f4876){_0xe27035=_0xe27035-0x0;var _0x3745bc=_0x3386[_0xe27035];return _0x3745bc;};'use strict';var BPromise=require(_0x6338('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6338('0x1'));var ejs=require(_0x6338('0x2'));var fs=require('fs');var fs_extra=require(_0x6338('0x3'));var _=require(_0x6338('0x4'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0x6338('0x5'));var logger=require(_0x6338('0x6'))(_0x6338('0x7'));var config=require('../../config/environment');var db=require(_0x6338('0x8'))['db'];config[_0x6338('0x9')]=_[_0x6338('0xa')](config[_0x6338('0x9')],{'host':_0x6338('0xb'),'port':0x18eb});var socket=require(_0x6338('0xc'))(new Redis(config[_0x6338('0x9')]));require('./chatWebsite.socket')[_0x6338('0xd')](socket);var htmlToText=require(_0x6338('0xe'));var jayson=require(_0x6338('0xf'));var client=jayson[_0x6338('0x10')][_0x6338('0x11')]({'port':0x232c});var client9002=jayson[_0x6338('0x10')][_0x6338('0x11')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x6338('0x10')][_0x6338('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x124127,_0x17ee6f,_0x25acef,_0x1d76ae){return new BPromise(function(_0x38202d,_0x3f94c5){var _0xb246b1=_0x1d76ae||client;return _0xb246b1[_0x6338('0x12')](_0x124127,_0x25acef)[_0x6338('0x13')](function(_0x5112f4){logger[_0x6338('0x14')](_0x6338('0x15'),_0x17ee6f,_0x6338('0x16'));logger['debug'](_0x6338('0x17'),_0x17ee6f,_0x6338('0x16'),JSON['stringify'](_0x5112f4));if(_0x5112f4['error']){if(_0x5112f4[_0x6338('0x18')][_0x6338('0x19')]===0x1f4){logger[_0x6338('0x18')](_0x6338('0x15'),_0x17ee6f,_0x5112f4[_0x6338('0x18')][_0x6338('0x1a')]);return _0x3f94c5(_0x5112f4[_0x6338('0x18')]['message']);}logger[_0x6338('0x18')](_0x6338('0x15'),_0x17ee6f,_0x5112f4[_0x6338('0x18')][_0x6338('0x1a')]);return _0x38202d(_0x5112f4['error'][_0x6338('0x1a')]);}else{logger['info'](_0x6338('0x15'),_0x17ee6f,_0x6338('0x16'));_0x38202d(_0x5112f4[_0x6338('0x1b')]['message']);}})[_0x6338('0x1c')](function(_0xa8ef97){logger[_0x6338('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x17ee6f,_0xa8ef97);_0x3f94c5(_0xa8ef97);});});}function respondWithStatusCode(_0x250e98,_0x189cc2){_0x189cc2=_0x189cc2||0xcc;return function(_0x2c0f03){if(_0x2c0f03){return _0x250e98[_0x6338('0x1d')](_0x189cc2);}return _0x250e98[_0x6338('0x1e')](_0x189cc2)['end']();};}function respondWithResult(_0x5e78ef,_0x23ac9a){_0x23ac9a=_0x23ac9a||0xc8;return function(_0x22c026){if(_0x22c026){return _0x5e78ef[_0x6338('0x1e')](_0x23ac9a)['json'](_0x22c026);}};}function respondWithFilteredResult(_0x268e64,_0x148721){return function(_0x36c6c8){if(_0x36c6c8){var _0x3fe509=typeof _0x148721['offset']===_0x6338('0x1f')&&typeof _0x148721[_0x6338('0x20')]===_0x6338('0x1f');var _0x16df91=_0x36c6c8[_0x6338('0x21')];var _0x268e24=_0x3fe509?0x0:_0x148721['offset'];var _0x39e620=_0x3fe509?_0x36c6c8[_0x6338('0x21')]:_0x148721[_0x6338('0x22')]+_0x148721[_0x6338('0x20')];var _0x45a726;if(_0x39e620>=_0x16df91){_0x39e620=_0x16df91;_0x45a726=0xc8;}else{_0x45a726=0xce;}_0x268e64['status'](_0x45a726);return _0x268e64['set'](_0x6338('0x23'),_0x268e24+'-'+_0x39e620+'/'+_0x16df91)[_0x6338('0x24')](_0x36c6c8);}return null;};}function saveUpdates(_0x1e2599){return function(_0x325f4f){if(_0x325f4f){return _0x325f4f['update'](_0x1e2599)[_0x6338('0x13')](function(_0x157c30){return _0x157c30;});}return null;};}function removeEntity(_0x424722){return function(_0x295a4c){if(_0x295a4c){return _0x295a4c[_0x6338('0x25')]()[_0x6338('0x13')](function(){var _0x3e9907=_0x295a4c['get']({'plain':!![]});var _0x5cbab6=_0x6338('0x26');return db[_0x6338('0x27')]['destroy']({'where':{'type':_0x5cbab6,'resourceId':_0x3e9907['id']}})['then'](function(){return _0x295a4c;});})[_0x6338('0x13')](function(){_0x424722['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9bc2a5){return function(_0x5f5808){if(!_0x5f5808){_0x9bc2a5[_0x6338('0x1d')](0x194);}return _0x5f5808;};}function handleError(_0x17af72,_0x2774c7){_0x2774c7=_0x2774c7||0x1f4;return function(_0x5270d9){logger[_0x6338('0x18')](_0x5270d9[_0x6338('0x28')]);if(_0x5270d9[_0x6338('0x29')]){delete _0x5270d9['name'];}_0x17af72[_0x6338('0x1e')](_0x2774c7)['send'](_0x5270d9);};}exports[_0x6338('0x2a')]=function(_0x18200c,_0x14b64d){var _0x6a071d={'include':[{'model':db[_0x6338('0x2b')],'as':_0x6338('0x2c')}]},_0x607e86={},_0x331ef6={'count':0x0,'rows':[]};var _0x123f70=_[_0x6338('0x2d')](db[_0x6338('0x2e')]['rawAttributes'],function(_0x3226c5){return{'name':_0x3226c5[_0x6338('0x2f')],'type':_0x3226c5[_0x6338('0x30')][_0x6338('0x31')]};});_0x607e86[_0x6338('0x32')]=_[_0x6338('0x2d')](_0x123f70,'name');_0x607e86[_0x6338('0x33')]=_[_0x6338('0x34')](_0x18200c[_0x6338('0x33')]);_0x607e86['filters']=_[_0x6338('0x35')](_0x607e86[_0x6338('0x32')],_0x607e86[_0x6338('0x33')]);_0x6a071d['attributes']=_[_0x6338('0x35')](_0x607e86[_0x6338('0x32')],qs[_0x6338('0x36')](_0x18200c[_0x6338('0x33')][_0x6338('0x36')]));_0x6a071d[_0x6338('0x37')]=_0x6a071d[_0x6338('0x37')][_0x6338('0x38')]?_0x6a071d[_0x6338('0x37')]:_0x607e86[_0x6338('0x32')];if(!_0x18200c[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x6a071d[_0x6338('0x20')]=qs[_0x6338('0x20')](_0x18200c[_0x6338('0x33')][_0x6338('0x20')]);_0x6a071d[_0x6338('0x22')]=qs[_0x6338('0x22')](_0x18200c[_0x6338('0x33')][_0x6338('0x22')]);}_0x6a071d[_0x6338('0x3b')]=qs[_0x6338('0x3c')](_0x18200c[_0x6338('0x33')][_0x6338('0x3c')]);_0x6a071d['where']=qs[_0x6338('0x3d')](_[_0x6338('0x3e')](_0x18200c[_0x6338('0x33')],_0x607e86[_0x6338('0x3d')]),_0x123f70);if(_0x18200c[_0x6338('0x33')]['filter']){_0x6a071d[_0x6338('0x3f')]=_[_0x6338('0x40')](_0x6a071d['where'],{'$or':_[_0x6338('0x2d')](_0x123f70,function(_0x5d1e18){if(_0x5d1e18[_0x6338('0x30')]!==_0x6338('0x41')){var _0x3c829e={};_0x3c829e[_0x5d1e18[_0x6338('0x29')]]={'$like':'%'+_0x18200c[_0x6338('0x33')][_0x6338('0x42')]+'%'};return _0x3c829e;}})});}_0x6a071d=_['merge']({},_0x6a071d,_0x18200c[_0x6338('0x43')]);var _0x4ebb38={'where':_0x6a071d[_0x6338('0x3f')]};return db['ChatWebsite'][_0x6338('0x21')](_0x4ebb38)[_0x6338('0x13')](function(_0x283cca){_0x331ef6[_0x6338('0x21')]=_0x283cca;if(_0x18200c[_0x6338('0x33')][_0x6338('0x44')]){_0x6a071d['include']=[{'all':!![]}];}return db[_0x6338('0x2e')][_0x6338('0x45')](_0x6a071d);})[_0x6338('0x13')](function(_0x3c3fa5){_0x331ef6[_0x6338('0x46')]=_0x3c3fa5;return _0x331ef6;})['then'](respondWithFilteredResult(_0x14b64d,_0x6a071d))[_0x6338('0x1c')](handleError(_0x14b64d,null));};exports['show']=function(_0x16e9e1,_0x2ef92c){var _0x4e2364={'raw':![],'where':{'id':_0x16e9e1['params']['id']},'include':[{'model':db['Pause'],'as':_0x6338('0x2c')}]},_0x35c952={};_0x35c952[_0x6338('0x32')]=_[_0x6338('0x34')](db['ChatWebsite'][_0x6338('0x47')]);_0x35c952[_0x6338('0x33')]=_['keys'](_0x16e9e1['query']);_0x35c952['filters']=_[_0x6338('0x35')](_0x35c952[_0x6338('0x32')],_0x35c952['query']);_0x4e2364['attributes']=_[_0x6338('0x35')](_0x35c952[_0x6338('0x32')],qs[_0x6338('0x36')](_0x16e9e1[_0x6338('0x33')][_0x6338('0x36')]));_0x4e2364['attributes']=_0x4e2364[_0x6338('0x37')]['length']?_0x4e2364[_0x6338('0x37')]:_0x35c952[_0x6338('0x32')];if(_0x16e9e1[_0x6338('0x33')][_0x6338('0x44')]){_0x4e2364['include']=[{'all':!![]}];}_0x4e2364=_['merge']({},_0x4e2364,_0x16e9e1['options']);return db[_0x6338('0x2e')][_0x6338('0x48')](_0x4e2364)[_0x6338('0x13')](handleEntityNotFound(_0x2ef92c,null))[_0x6338('0x13')](respondWithResult(_0x2ef92c,null))[_0x6338('0x1c')](handleError(_0x2ef92c,null));};exports[_0x6338('0x49')]=function(_0x22c57d,_0x51080f){return db[_0x6338('0x2e')][_0x6338('0x49')](_0x22c57d['body'],{})[_0x6338('0x13')](function(_0x193f25){var _0x2e183e=_0x22c57d[_0x6338('0x4a')][_0x6338('0x4b')]({'plain':!![]});if(!_0x2e183e)throw new Error(_0x6338('0x4c'));if(_0x2e183e['role']===_0x6338('0x4a')){var _0x3990e2=_0x193f25['get']({'plain':!![]});var _0x521ef5=_0x6338('0x26');return db[_0x6338('0x4d')]['find']({'where':{'name':_0x521ef5,'userProfileId':_0x2e183e[_0x6338('0x4e')]},'raw':!![]})['then'](function(_0x2a7888){if(_0x2a7888&&_0x2a7888['autoAssociation']===0x0){return db[_0x6338('0x27')]['create']({'name':_0x3990e2[_0x6338('0x29')],'resourceId':_0x3990e2['id'],'type':_0x2a7888[_0x6338('0x29')],'sectionId':_0x2a7888['id']},{})[_0x6338('0x13')](function(){return _0x193f25;});}else{return _0x193f25;}})['catch'](function(_0x515dc9){logger[_0x6338('0x18')](_0x6338('0x4f'),_0x515dc9);throw _0x515dc9;});}return _0x193f25;})[_0x6338('0x13')](respondWithResult(_0x51080f,0xc9))['catch'](handleError(_0x51080f,null));};exports['update']=function(_0x34b7b5,_0x40755c){if(_0x34b7b5[_0x6338('0x50')]['id']){delete _0x34b7b5[_0x6338('0x50')]['id'];}return db[_0x6338('0x2e')]['find']({'where':{'id':_0x34b7b5[_0x6338('0x51')]['id']},'include':[{'model':db[_0x6338('0x2b')],'as':_0x6338('0x2c')}]})[_0x6338('0x13')](handleEntityNotFound(_0x40755c,null))[_0x6338('0x13')](saveUpdates(_0x34b7b5[_0x6338('0x50')],null))['then'](respondWithResult(_0x40755c,null))[_0x6338('0x1c')](handleError(_0x40755c,null));};exports[_0x6338('0x25')]=function(_0x27cca9,_0xe88101){return db['ChatWebsite'][_0x6338('0x48')]({'where':{'id':_0x27cca9[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0xe88101,null))[_0x6338('0x13')](removeEntity(_0xe88101,null))['catch'](handleError(_0xe88101,null));};exports[_0x6338('0x52')]=function(_0x459cbc,_0x31f3d1){return db[_0x6338('0x2e')][_0x6338('0x52')]()['then'](respondWithResult(_0x31f3d1,null))[_0x6338('0x1c')](handleError(_0x31f3d1,null));};exports[_0x6338('0x53')]=function(_0x5b4d5a,_0x5a68e5){if(_0x5b4d5a[_0x6338('0x50')]['id']){delete _0x5b4d5a[_0x6338('0x50')]['id'];}return db[_0x6338('0x2e')]['find']({'where':{'id':_0x5b4d5a[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x5a68e5,null))[_0x6338('0x13')](function(_0x5c9b89){if(_0x5c9b89){_0x5b4d5a['body'][_0x6338('0x54')]=_0x5c9b89['id'];return db[_0x6338('0x55')][_0x6338('0x49')](_0x5b4d5a[_0x6338('0x50')]);}})[_0x6338('0x13')](respondWithResult(_0x5a68e5,null))[_0x6338('0x1c')](handleError(_0x5a68e5,null));};exports[_0x6338('0x56')]=function(_0x24842c,_0x2b8f24){var _0x1e384c={'raw':![],'where':{}};var _0x5abaae={};var _0x557127={'count':0x0,'rows':[]};return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x24842c[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x2b8f24,null))['then'](function(_0x54d8e9){if(_0x54d8e9){_0x5abaae['model']=_[_0x6338('0x34')](db[_0x6338('0x55')][_0x6338('0x47')]);_0x5abaae['query']=_[_0x6338('0x34')](_0x24842c[_0x6338('0x33')]);_0x5abaae[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x5abaae[_0x6338('0x32')],_0x5abaae[_0x6338('0x33')]);_0x1e384c[_0x6338('0x37')]=_[_0x6338('0x35')](_0x5abaae[_0x6338('0x32')],qs[_0x6338('0x36')](_0x24842c['query'][_0x6338('0x36')]));_0x1e384c[_0x6338('0x37')]=_0x1e384c['attributes'][_0x6338('0x38')]?_0x1e384c['attributes']:_0x5abaae['model'];if(!_0x24842c[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x1e384c[_0x6338('0x20')]=qs['limit'](_0x24842c[_0x6338('0x33')]['limit']);_0x1e384c[_0x6338('0x22')]=qs[_0x6338('0x22')](_0x24842c['query']['offset']);}_0x1e384c[_0x6338('0x3b')]=qs['sort'](_0x24842c[_0x6338('0x33')][_0x6338('0x3c')]);_0x1e384c[_0x6338('0x3f')]=qs['filters'](_[_0x6338('0x3e')](_0x24842c[_0x6338('0x33')],_0x5abaae['filters']));_0x1e384c[_0x6338('0x3f')][_0x6338('0x54')]=_0x54d8e9['id'];if(_0x24842c[_0x6338('0x33')][_0x6338('0x42')]){_0x1e384c[_0x6338('0x3f')]=_[_0x6338('0x40')](_0x1e384c[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x1e384c[_0x6338('0x37')],function(_0x5a3b29){var _0xe4f23c={};_0xe4f23c[_0x5a3b29]={'$like':'%'+_0x24842c['query'][_0x6338('0x42')]+'%'};return _0xe4f23c;})});}_0x1e384c=_[_0x6338('0x40')]({},_0x1e384c,_0x24842c[_0x6338('0x43')]);return db[_0x6338('0x55')][_0x6338('0x21')]({'where':_0x1e384c['where']})[_0x6338('0x13')](function(_0x15c7fb){_0x557127[_0x6338('0x21')]=_0x15c7fb;if(_0x24842c[_0x6338('0x33')][_0x6338('0x44')]){_0x1e384c[_0x6338('0x58')]=[{'all':!![]}];}return db[_0x6338('0x55')]['findAll'](_0x1e384c);})[_0x6338('0x13')](function(_0x1fd3be){_0x557127[_0x6338('0x46')]=_0x1fd3be;return _0x557127;});}})[_0x6338('0x13')](respondWithFilteredResult(_0x2b8f24,_0x1e384c))[_0x6338('0x1c')](handleError(_0x2b8f24,null));};exports[_0x6338('0x59')]=function(_0x1fcbee,_0x1da507){return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x1fcbee['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x1da507,null))['then'](function(_0x1da729){if(_0x1da729){return _0x1da729['removeDispositions'](_0x1fcbee[_0x6338('0x33')][_0x6338('0x5a')]);}})['then'](respondWithStatusCode(_0x1da507,null))[_0x6338('0x1c')](handleError(_0x1da507,null));};exports[_0x6338('0x5b')]=function(_0x230a79,_0x16622e){if(_0x230a79['body']['id']){delete _0x230a79[_0x6338('0x50')]['id'];}return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x230a79['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x16622e,null))[_0x6338('0x13')](function(_0x52357e){if(_0x52357e){_0x230a79[_0x6338('0x50')][_0x6338('0x54')]=_0x52357e['id'];return db[_0x6338('0x5c')][_0x6338('0x49')](_0x230a79['body']);}})['then'](respondWithResult(_0x16622e,null))[_0x6338('0x1c')](handleError(_0x16622e,null));};exports[_0x6338('0x5d')]=function(_0x253086,_0x1fbee1){var _0x56739d={'raw':![],'where':{}};var _0x1b4b9c={};var _0x303266={'count':0x0,'rows':[]};return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x253086['params']['id']}})['then'](handleEntityNotFound(_0x1fbee1,null))['then'](function(_0x1c9236){if(_0x1c9236){_0x1b4b9c[_0x6338('0x32')]=_['keys'](db[_0x6338('0x5c')][_0x6338('0x47')]);_0x1b4b9c[_0x6338('0x33')]=_['keys'](_0x253086[_0x6338('0x33')]);_0x1b4b9c['filters']=_[_0x6338('0x35')](_0x1b4b9c['model'],_0x1b4b9c[_0x6338('0x33')]);_0x56739d[_0x6338('0x37')]=_[_0x6338('0x35')](_0x1b4b9c[_0x6338('0x32')],qs['fields'](_0x253086['query'][_0x6338('0x36')]));_0x56739d['attributes']=_0x56739d['attributes'][_0x6338('0x38')]?_0x56739d['attributes']:_0x1b4b9c[_0x6338('0x32')];if(!_0x253086[_0x6338('0x33')]['hasOwnProperty'](_0x6338('0x3a'))){_0x56739d[_0x6338('0x20')]=qs[_0x6338('0x20')](_0x253086[_0x6338('0x33')]['limit']);_0x56739d['offset']=qs[_0x6338('0x22')](_0x253086[_0x6338('0x33')][_0x6338('0x22')]);}_0x56739d[_0x6338('0x3b')]=qs['sort'](_0x253086['query'][_0x6338('0x3c')]);_0x56739d['where']=qs[_0x6338('0x3d')](_[_0x6338('0x3e')](_0x253086['query'],_0x1b4b9c[_0x6338('0x3d')]));_0x56739d['where'][_0x6338('0x54')]=_0x1c9236['id'];if(_0x253086['query'][_0x6338('0x42')]){_0x56739d[_0x6338('0x3f')]=_['merge'](_0x56739d[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x56739d[_0x6338('0x37')],function(_0x33a2d7){var _0x207e3e={};_0x207e3e[_0x33a2d7]={'$like':'%'+_0x253086[_0x6338('0x33')][_0x6338('0x42')]+'%'};return _0x207e3e;})});}_0x56739d=_[_0x6338('0x40')]({},_0x56739d,_0x253086[_0x6338('0x43')]);return db[_0x6338('0x5c')][_0x6338('0x21')]({'where':_0x56739d[_0x6338('0x3f')]})['then'](function(_0x47cc31){_0x303266[_0x6338('0x21')]=_0x47cc31;if(_0x253086['query']['includeAll']){_0x56739d['include']=[{'all':!![]}];}return db[_0x6338('0x5c')][_0x6338('0x45')](_0x56739d);})[_0x6338('0x13')](function(_0x2105fe){_0x303266[_0x6338('0x46')]=_0x2105fe;return _0x303266;});}})[_0x6338('0x13')](respondWithFilteredResult(_0x1fbee1,_0x56739d))[_0x6338('0x1c')](handleError(_0x1fbee1,null));};exports[_0x6338('0x5e')]=function(_0x56de02,_0x405bff){return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x56de02['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x405bff,null))[_0x6338('0x13')](function(_0x343095){if(_0x343095){return _0x343095[_0x6338('0x5e')](_0x56de02[_0x6338('0x33')][_0x6338('0x5a')]);}})[_0x6338('0x13')](respondWithStatusCode(_0x405bff,null))[_0x6338('0x1c')](handleError(_0x405bff,null));};exports[_0x6338('0x5f')]=function(_0x4c00bb,_0x3d9f9a){_0x4c00bb[_0x6338('0x50')][_0x6338('0x60')]=_0x4c00bb['file'][_0x6338('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x4c00bb[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x3d9f9a,null))[_0x6338('0x13')](saveUpdates(_0x4c00bb['body'],null))[_0x6338('0x13')](respondWithResult(_0x3d9f9a,null))[_0x6338('0x1c')](handleError(_0x3d9f9a,null));};exports[_0x6338('0x62')]=function(_0x462c20,_0x56d912){_0x462c20[_0x6338('0x50')][_0x6338('0x63')]=_0x462c20[_0x6338('0x64')]['filename'];return db[_0x6338('0x2e')]['find']({'where':{'id':_0x462c20[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0x56d912,null))[_0x6338('0x13')](saveUpdates(_0x462c20[_0x6338('0x50')],null))[_0x6338('0x13')](respondWithResult(_0x56d912,null))[_0x6338('0x1c')](handleError(_0x56d912,null));};exports[_0x6338('0x65')]=function(_0x263555,_0x1326ca){_0x263555[_0x6338('0x50')]['customerAvatar']=_0x263555[_0x6338('0x64')][_0x6338('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x263555[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0x1326ca,null))[_0x6338('0x13')](saveUpdates(_0x263555[_0x6338('0x50')],null))[_0x6338('0x13')](respondWithResult(_0x1326ca,null))[_0x6338('0x1c')](handleError(_0x1326ca,null));};exports[_0x6338('0x66')]=function(_0x578042,_0x496be1){_0x578042[_0x6338('0x50')][_0x6338('0x67')]=_0x578042['file']['filename'];return db[_0x6338('0x2e')]['find']({'where':{'id':_0x578042[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0x496be1,null))[_0x6338('0x13')](saveUpdates(_0x578042[_0x6338('0x50')],null))[_0x6338('0x13')](respondWithResult(_0x496be1,null))['catch'](handleError(_0x496be1,null));};exports[_0x6338('0x68')]=function(_0x4890bd,_0x423b54){var _0x3c80aa=path['join'](config[_0x6338('0x69')],_0x6338('0x6a'));var _0x2c87c9={'where':{'id':_0x4890bd[_0x6338('0x51')]['id']},'attributes':['id',_0x6338('0x60')],'raw':!![]};var _0x4dfb32=![];return require(_0x6338('0x6b'))[_0x6338('0x6c')]()[_0x6338('0x13')](function(_0x440ba0){if(_0x440ba0){_0x4dfb32=_0x440ba0[_0x6338('0x6d')];}})[_0x6338('0x13')](function(){return db[_0x6338('0x2e')][_0x6338('0x48')](_0x2c87c9);})[_0x6338('0x13')](handleEntityNotFound(_0x423b54,null))[_0x6338('0x13')](function(_0x19a78c){if(_0x19a78c){if(!_[_0x6338('0x6e')](_0x19a78c[_0x6338('0x60')])){if(fs[_0x6338('0x6f')](path['join'](config[_0x6338('0x69')],_0x6338('0x70'),_0x19a78c[_0x6338('0x60')]))&&_0x4dfb32){_0x3c80aa=path[_0x6338('0x71')](config['root'],'server/files/images/logos/',_0x19a78c['sitepic']);}}return _0x423b54[_0x6338('0x72')](_0x3c80aa);}})[_0x6338('0x1c')](handleError(_0x423b54,null));};exports['getAvatar']=function(_0x33f7da,_0x3b6e8b){var _0x363679=path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0x73'));var _0x269d95={'where':{'id':_0x33f7da[_0x6338('0x51')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6338('0x2e')][_0x6338('0x48')](_0x269d95)[_0x6338('0x13')](handleEntityNotFound(_0x3b6e8b,null))[_0x6338('0x13')](function(_0x52230b){if(_0x52230b){if(!_['isNil'](_0x52230b[_0x6338('0x63')])){if(fs[_0x6338('0x6f')](path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0x74'),_0x52230b[_0x6338('0x63')]))){_0x363679=path[_0x6338('0x71')](config['root'],'server/files/images/avatars/',_0x52230b[_0x6338('0x63')]);}}return _0x3b6e8b[_0x6338('0x72')](_0x363679);}})['catch'](handleError(_0x3b6e8b,null));};exports[_0x6338('0x75')]=function(_0x1069be,_0x3d4e73){var _0x36cfd5=path[_0x6338('0x71')](config['root'],_0x6338('0x76'));var _0x33a4b8={'where':{'id':_0x1069be[_0x6338('0x51')]['id']},'attributes':['id',_0x6338('0x77'),_0x6338('0x78')],'raw':!![]};return db[_0x6338('0x2e')][_0x6338('0x48')](_0x33a4b8)[_0x6338('0x13')](handleEntityNotFound(_0x3d4e73,null))[_0x6338('0x13')](function(_0x571486){if(_0x571486){if(!_[_0x6338('0x6e')](_0x571486[_0x6338('0x77')])){if(fs[_0x6338('0x6f')](path[_0x6338('0x71')](config['root'],_0x6338('0x74'),_0x571486[_0x6338('0x77')]))&&_0x571486[_0x6338('0x78')]){_0x36cfd5=path['join'](config['root'],'server/files/images/avatars/',_0x571486[_0x6338('0x77')]);}}return _0x3d4e73['download'](_0x36cfd5);}})['catch'](handleError(_0x3d4e73,null));};exports[_0x6338('0x79')]=function(_0x2085e9,_0xec8193){var _0xd70687=path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0x7a'));var _0xdd5d30={'where':{'id':_0x2085e9['params']['id']},'attributes':['id',_0x6338('0x67')],'raw':!![]};return db[_0x6338('0x2e')][_0x6338('0x48')](_0xdd5d30)[_0x6338('0x13')](handleEntityNotFound(_0xec8193,null))[_0x6338('0x13')](function(_0x1791e1){if(_0x1791e1){if(!_[_0x6338('0x6e')](_0x1791e1['systemAvatar'])){if(fs['existsSync'](path[_0x6338('0x71')](config[_0x6338('0x69')],'server/files/images/avatars/',_0x1791e1['systemAvatar']))){_0xd70687=path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0x74'),_0x1791e1[_0x6338('0x67')]);}}return _0xec8193[_0x6338('0x72')](_0xd70687);}})[_0x6338('0x1c')](handleError(_0xec8193,null));};exports[_0x6338('0x7b')]=function(_0x53070b,_0x5b553e){var _0x3488dc=require(_0x6338('0x7c'));var _0x1473bd=new _0x3488dc();var _0x102690=_0x1473bd['setUA'](_0x53070b[_0x6338('0x7d')][_0x6338('0x7e')])[_0x6338('0x7f')]();var _0x139306={'body':_0x53070b['body'],'channel':_0x6338('0x80')};var _0x1b0157=[];var _0x1696be=[];var _0x336cdb={};var _0x40121d=![];return db['CmContact']['describe']()['then'](function(_0x6fe74){if(!_0x6fe74){throw new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x83'));}_0x1b0157=_[_0x6338('0x84')](_[_0x6338('0x34')](_0x6fe74),[_0x6338('0x85'),_0x6338('0x86')]);_0x1696be=_[_0x6338('0x84')](_['keys'](_0x6fe74),[_0x6338('0x85'),'updatedAt',_0x6338('0x87'),_0x6338('0x88')]);if(_0x53070b[_0x6338('0x50')]['id']){delete _0x53070b[_0x6338('0x50')]['id'];}if(_[_0x6338('0x6e')](_0x53070b['body'][_0x6338('0x89')])){throw new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x8a'));}if(_[_0x6338('0x6e')](_0x53070b[_0x6338('0x50')][_0x6338('0x50')])||_0x53070b[_0x6338('0x50')][_0x6338('0x50')]===''){throw new db[(_0x6338('0x81'))]['ValidationError'](_0x6338('0x8b'));}if(_[_0x6338('0x6e')](_0x53070b[_0x6338('0x50')]['mapKey'])){throw new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x8c')+_0x1696be);}if(!_[_0x6338('0x8d')](_0x1696be,_0x53070b['body']['mapKey'])){throw new db[(_0x6338('0x81'))]['ValidationError'](_0x6338('0x8e')+_0x1696be);}_0x336cdb[_0x53070b[_0x6338('0x50')]['mapKey']]=_0x53070b[_0x6338('0x50')][_0x6338('0x89')];})['then'](function(){return db['ChatWebsite'][_0x6338('0x48')]({'where':{'id':_0x53070b[_0x6338('0x51')]['id']},'include':[{'model':db[_0x6338('0x8f')],'as':_0x6338('0x90'),'include':[{'model':db[_0x6338('0x91')],'as':_0x6338('0x92'),'where':_0x336cdb,'limit':0x1,'order':[[_0x6338('0x86'),_0x6338('0x93')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x5b553e,null))[_0x6338('0x13')](function(_0x275af0){if(_0x275af0&&_0x275af0[_0x6338('0x90')]){_0x139306[_0x6338('0x94')]=_0x275af0;_0x139306[_0x6338('0x95')]=_0x275af0[_0x6338('0x96')];_0x139306[_0x6338('0x97')]=_0x275af0[_0x6338('0x90')];_0x139306['applications']=_[_0x6338('0x98')](_0x139306[_0x6338('0x95')],[_0x6338('0x99')],[_0x6338('0x9a')]);if(_0x139306[_0x6338('0x94')][_0x6338('0x96')]){delete _0x139306[_0x6338('0x94')][_0x6338('0x96')];}if(_0x139306['account'][_0x6338('0x90')]&&_0x139306['account'][_0x6338('0x90')]['Contacts'][_0x6338('0x38')]){return _0x139306[_0x6338('0x94')]['List'][_0x6338('0x92')][0x0];}var _0x33f444=_[_0x6338('0xa')](_0x53070b['body'],{'firstName':_0x53070b['body'][_0x6338('0x89')],'ListId':_0x275af0[_0x6338('0x88')]});_0x33f444[_0x53070b[_0x6338('0x50')][_0x6338('0x9b')]]=_0x53070b['body']['from'];return db[_0x6338('0x91')]['create'](_0x33f444,{'fields':_0x1b0157,'raw':!![]});}})[_0x6338('0x13')](handleEntityNotFound(_0x5b553e,null))[_0x6338('0x13')](function(_0x55ce94){_0x139306[_0x6338('0x9c')]=_0x55ce94;var _0x345810=_0x53070b['body'][_0x6338('0x9d')];if(_0x53070b['headers'][_0x6338('0x9e')]){_0x345810=_0x53070b['headers'][_0x6338('0x9e')];}else if(_0x53070b[_0x6338('0x7d')][_0x6338('0x9f')]){_0x345810=_[_0x6338('0xa0')](_0x53070b[_0x6338('0x7d')][_0x6338('0x9f')][_0x6338('0xa1')](','));}if(_0x55ce94){var _0x367e51={'ContactId':_0x55ce94['id'],'ChatWebsiteId':_0x53070b[_0x6338('0x51')]['id'],'from':(_0x55ce94['firstName']||'')+'\x20'+(_0x55ce94[_0x6338('0xa2')]||''),'customerIp':_0x345810,'customerPort':_0x53070b[_0x6338('0x7d')][_0x6338('0xa3')]?_0x53070b[_0x6338('0x7d')]['x-real-port']:null,'referer':_0x53070b['body'][_0x6338('0xa4')],'browserName':_0x102690[_0x6338('0xa5')]['name']&&_0x102690[_0x6338('0xa5')]['version']?util[_0x6338('0xa6')](_0x6338('0xa7'),_0x102690[_0x6338('0xa5')][_0x6338('0x29')],_0x102690[_0x6338('0xa5')]['version']):_0x6338('0xa8'),'browserVersion':_0x102690[_0x6338('0xa5')][_0x6338('0xa9')]||_0x6338('0xa8'),'osName':util['format'](_0x6338('0xa7'),_0x102690['os'][_0x6338('0x29')],_0x102690['os'][_0x6338('0xa9')]),'osVersion':_0x102690['os']['version'],'deviceModel':_0x102690['device'][_0x6338('0x32')]&&_0x102690[_0x6338('0xaa')][_0x6338('0xab')]?util[_0x6338('0xa6')]('%s\x20%s\x20%s',_0x102690[_0x6338('0xaa')][_0x6338('0x32')],_0x102690['device']['vendor'],_0x102690[_0x6338('0xaa')][_0x6338('0x30')]):null,'deviceVendor':_0x102690[_0x6338('0xaa')][_0x6338('0xab')],'deviceType':_0x102690['device'][_0x6338('0x30')],'formData':JSON['stringify'](_0x53070b[_0x6338('0x50')])};var _0x90f96d={'ChatWebsiteId':_0x53070b[_0x6338('0x51')]['id'],'closed':![]};if(_0x53070b['body'][_0x6338('0xac')]){_0x90f96d['threadId']=_0x53070b[_0x6338('0x50')][_0x6338('0xac')];return db[_0x6338('0xad')][_0x6338('0x48')]({'where':_0x90f96d})['then'](function(_0x24208a){if(_0x24208a){return[_0x24208a,![]];}_0x367e51[_0x6338('0xac')]=_0x53070b[_0x6338('0x50')][_0x6338('0xac')];_0x367e51[_0x6338('0xae')]=_0x53070b[_0x6338('0x50')]['externalUrl'];return db[_0x6338('0xad')][_0x6338('0x49')](_0x367e51)[_0x6338('0x13')](function(_0x194a36){return[_0x194a36,!![]];});});}_0x90f96d['ContactId']=_0x55ce94['id'];if(_0x53070b[_0x6338('0x50')]['interaction']&&_0x53070b[_0x6338('0x50')]['interaction']['id']){_0x90f96d['id']=_0x53070b['body'][_0x6338('0xaf')]['id'];return db[_0x6338('0xad')][_0x6338('0x48')]({'where':_0x90f96d})[_0x6338('0x13')](function(_0x46123a){if(_0x46123a){return[_0x46123a,![]];}return db[_0x6338('0xad')][_0x6338('0x49')](_0x367e51)['then'](function(_0x1ce1fa){return[_0x1ce1fa,!![]];});});}return db[_0x6338('0xad')][_0x6338('0x49')](_0x367e51)['then'](function(_0x484276){return[_0x484276,!![]];});}})[_0x6338('0xb0')](function(_0x11b549,_0x32b031){if(_0x11b549){_0x40121d=_0x32b031;if(!_0x32b031){var _0x1ce1cf={'from':(_0x139306[_0x6338('0x9c')][_0x6338('0xb1')]||'')+'\x20'+(_0x139306[_0x6338('0x9c')][_0x6338('0xa2')]||'')};if(_0x53070b['body']['threadId']&&_0x53070b[_0x6338('0x50')][_0x6338('0xb2')]&&_0x53070b[_0x6338('0x50')][_0x6338('0xac')]!=_0x53070b[_0x6338('0x50')][_0x6338('0xb2')]){_0x1ce1cf[_0x6338('0xac')]=_0x53070b[_0x6338('0x50')]['messageId'];}return _0x11b549['update'](_0x1ce1cf);}else{return _0x11b549;}}})[_0x6338('0x13')](function(_0x277c8e){_0x139306[_0x6338('0xaf')]=_0x277c8e[_0x6338('0x4b')]({'plain':!![]});_0x139306[_0x6338('0xaf')][_0x6338('0xb3')]=_0x40121d;if(_0x139306[_0x6338('0xaf')]['created']){if(_0x139306[_0x6338('0x94')][_0x6338('0xb4')]){_0x139306[_0x6338('0x95')][_0x6338('0xb5')]({'id':0x0,'priority':_0x139306['applications']['length']+0x1,'app':_0x6338('0xb6'),'appdata':_0x6338('0xb7'),'interval':_0x6338('0xb8')});}}return db[_0x6338('0xb9')][_0x6338('0x49')]({'body':_0x53070b[_0x6338('0x50')]['body'],'ChatWebsiteId':_0x53070b[_0x6338('0x51')]['id'],'ChatInteractionId':_0x277c8e['id'],'direction':'in','ContactId':_0x139306['contact']['id'],'AttachmentId':_0x53070b['body'][_0x6338('0xba')]});})[_0x6338('0x13')](function(_0x3a0c63){_0x139306['message']=_0x3a0c63;if(_0x139306[_0x6338('0xaf')][_0x6338('0xbb')]){return db[_0x6338('0xbc')][_0x6338('0x48')]({'attributes':['id',_0x6338('0x29')],'where':{'id':_0x139306[_0x6338('0xaf')]['UserId']}})[_0x6338('0x13')](function(_0x4732e7){if(_0x4732e7){_0x139306[_0x6338('0x95')][_0x6338('0xbd')]({'id':0x0,'priority':0x0,'app':_0x6338('0xbe'),'appdata':_0x4732e7['name']+','+(_0x139306[_0x6338('0x94')][_0x6338('0xbf')]||0xa),'interval':_0x6338('0xb8')});_0x139306['forcedOwnership']=!![];}return respondWithRpcPromise(_0x6338('0xc0'),_0x6338('0xc1'),_0x139306);});}return respondWithRpcPromise(_0x6338('0xc0'),'startRouting',_0x139306);})[_0x6338('0x13')](function(_0x550b18){respondWithRpcPromise(_0x6338('0xc2'),'EventManager',{'event':_0x6338('0x7b'),'message':_0x550b18},client9002);return _0x550b18;})['then'](respondWithResult(_0x5b553e,null))['catch'](handleError(_0x5b553e,null));};exports[_0x6338('0xc3')]=function(_0x366dd1,_0x5a91ed){var _0x43113b,_0x42fb9b,_0x1bae0d;var _0x49960f=[];var _0x29dd18={};var _0x54001f=_0x366dd1[_0x6338('0xc4')]||[];var _0x339b6f=[];var _0x182316;return db[_0x6338('0x91')]['describe']()[_0x6338('0x13')](function(_0x3a3bd1){if(!_0x3a3bd1){throw new db[(_0x6338('0x81'))]['ValidationError']('no\x20available\x20attributes');}_0x49960f=_[_0x6338('0x84')](_[_0x6338('0x34')](_0x3a3bd1),[_0x6338('0x85'),_0x6338('0x86'),_0x6338('0x87'),'ListId']);if(_0x366dd1[_0x6338('0x50')]['id']){delete _0x366dd1[_0x6338('0x50')]['id'];}if(_[_0x6338('0x6e')](_0x366dd1[_0x6338('0x50')]['from'])){throw _0x5a91ed[_0x6338('0x1e')](0x1f4)['send'](new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x8a')));}if(_[_0x6338('0x6e')](_0x366dd1[_0x6338('0x50')][_0x6338('0x50')])||_0x366dd1['body'][_0x6338('0x50')]===''){throw _0x5a91ed[_0x6338('0x1e')](0x1f4)[_0x6338('0xc5')](new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x8b')));}if(_[_0x6338('0x6e')](_0x366dd1['body']['mapKeyOffline'])){throw _0x5a91ed[_0x6338('0x1e')](0x1f4)[_0x6338('0xc5')](new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0xc6')+_0x49960f));}if(!_[_0x6338('0x8d')](_0x49960f,_0x366dd1[_0x6338('0x50')][_0x6338('0xc7')])){throw _0x5a91ed['status'](0x1f4)[_0x6338('0xc5')](new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0xc8')+_0x49960f));}_0x29dd18[_0x366dd1['body'][_0x6338('0xc7')]]=_0x366dd1[_0x6338('0x50')][_0x6338('0x89')];})[_0x6338('0x13')](function(){return db[_0x6338('0x2e')]['find']({'where':{'id':_0x366dd1[_0x6338('0x51')]['id']},'include':[{'model':db[_0x6338('0x8f')],'as':_0x6338('0x90')},{'model':db[_0x6338('0xc9')],'as':_0x6338('0xc9')}]});})[_0x6338('0x13')](handleEntityNotFound(_0x5a91ed,null))[_0x6338('0x13')](function(_0xfff942){if(_0xfff942&&_0xfff942['List']){_0x42fb9b=_0xfff942;var _0x491b0c=_[_0x6338('0xa')](_0x366dd1[_0x6338('0x50')],{'firstName':_0x366dd1[_0x6338('0x50')][_0x6338('0x89')],'phone':_0x366dd1['body'][_0x6338('0x89')],'ListId':_0xfff942[_0x6338('0x88')]});_0x491b0c[_0x366dd1[_0x6338('0x50')][_0x6338('0xc7')]]=_0x366dd1[_0x6338('0x50')]['from'];return db['CmContact'][_0x6338('0xca')]({'where':_0x29dd18,'defaults':_0x491b0c});}})[_0x6338('0xb0')](function(_0x45ea5f){if(_0x45ea5f){_0x1bae0d=_0x45ea5f;var _0x1a10e0=fs['readFileSync'](path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0xcb')),_0x6338('0xcc'));var _0x310eaf=ejs[_0x6338('0xcd')](_0x1a10e0,{'body':_['toPairs'](_0x366dd1['body'][_0x6338('0x50')]),'bodyTitle':_0x42fb9b[_0x6338('0xce')]});return db[_0x6338('0xcf')][_0x6338('0x49')]({'body':_0x310eaf,'plainBody':htmlToText[_0x6338('0xd0')](_0x310eaf),'ContactId':_0x45ea5f['id'],'ChatWebsiteId':_0x42fb9b['id']});}})[_0x6338('0x13')](function(_0x3099b7){_0x182316=_0x3099b7;if(_0x54001f[_0x6338('0x38')]){var _0xff60b0=_0x54001f[_0x6338('0x2d')](function(_0x3973e0){return{'name':_0x3973e0['originalname'],'basename':_0x3973e0[_0x6338('0x61')],'type':_0x3973e0[_0x6338('0xd1')],'ChatOfflineMessageId':_0x3099b7['id']};});_0x339b6f=_0xff60b0[_0x6338('0x2d')](_0x3d6ccd=>{var _0x5a4458={'filename':_0x3d6ccd[_0x6338('0x29')],'path':path['join'](config[_0x6338('0x69')],'server','files',_0x6338('0xd2'),_0x6338('0xd3'),_0x3d6ccd[_0x6338('0xd4')])};return _0x5a4458;});if(!_0x42fb9b[_0x6338('0xd5')]){return db[_0x6338('0xd6')][_0x6338('0xd7')](function(_0x3fc768){return db[_0x6338('0xd8')][_0x6338('0xd9')](_0xff60b0,{'transaction':_0x3fc768});});}}})[_0x6338('0x13')](function(){if(_0x182316){_0x43113b=_0x182316;return db[_0x6338('0xc9')][_0x6338('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0x6338('0xda')],'as':_0x6338('0xdb'),'raw':!![],'include':[{'model':db[_0x6338('0xdc')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x6338('0x13')](function(_0x41bfe7){if(_0x41bfe7&&_0x41bfe7[_0x6338('0xdb')]&&_0x42fb9b[_0x6338('0xdd')]&&_0x42fb9b['forwardOfflineAddress']){var _0x1c0974=_0x41bfe7[_0x6338('0xde')]();return respondWithRpcPromise(_0x6338('0xdf'),'sendMail',{'account':_0x1c0974,'message':{'from':util[_0x6338('0xa6')](_0x6338('0xe0'),_0x41bfe7['name'],_0x41bfe7[_0x6338('0xe1')]||_0x41bfe7[_0x6338('0xdb')][_0x6338('0x4a')]),'to':_0x42fb9b['forwardOfflineAddress'],'subject':_0x42fb9b['offlineMessageSubject'],'html':_0x43113b[_0x6338('0x50')],'attachments':_0x339b6f}},client9003)['then'](function(){return _0x43113b;})[_0x6338('0x1c')](function(_0x3e9d89){logger[_0x6338('0x18')](_0x3e9d89);});}})[_0x6338('0x13')](function(){if(_0x42fb9b&&_0x42fb9b['openNewInteraction']&&_0x42fb9b[_0x6338('0xe2')]){var _0x56013=[];if(_0x54001f['length']){_0x56013=_0x54001f['map'](function(_0x4294ff){return{'name':_0x4294ff[_0x6338('0xe3')],'basename':_0x4294ff[_0x6338('0x61')],'type':_0x4294ff['mimetype'],'ChatOfflineMessageId':_0x182316['id']};});}var _0x3deb21;if(!_[_0x6338('0x6e')](_0x42fb9b[_0x6338('0xe4')])){var _0x4787bf=_[_0x6338('0x2d')](_0x366dd1[_0x6338('0x50')],function(_0x1a5210){return _0x1a5210;});var _0x41580a=_[_0x6338('0xe5')](_0x4787bf)[0x0];var _0x27a87c=_['mapValues'](_0x41580a,function(_0x5c27f8){return _0x5c27f8;});_0x3deb21=_0x27a87c[0x1][_0x42fb9b[_0x6338('0xe4')]];}var _0x4be38a={'from':_0x1bae0d[_0x6338('0xe1')],'firstName':_0x1bae0d[_0x6338('0xb1')],'lastName':_0x1bae0d[_0x6338('0xa2')],'mapKey':'email','message':{'from':_0x1bae0d[_0x6338('0xe1')],'to':_0x42fb9b[_0x6338('0xc9')][_0x6338('0xe1')],'cc':'','subject':_[_0x6338('0x6e')](_0x3deb21)?_0x42fb9b[_0x6338('0xe6')]:_0x3deb21,'messageId':'','sentAt':new Date(),'attach':_0x56013['length'],'attachments':_0x56013,'originChannel':_0x6338('0xe7'),'ChatWebsiteId':_0x42fb9b['id'],'ChatOfflineMessageId':_0x43113b['id'],'originTo':_0x42fb9b['MailAccount'][_0x6338('0xe1')]},'body':_0x43113b[_0x6338('0x50')]};var _0x4d2c90={'account':{'id':_0x42fb9b[_0x6338('0xe2')]},'body':_0x4be38a,'log':_0x6338('0xe8')};return respondWithRpcPromise(_0x6338('0xe8'),_0x6338('0xe9'),_0x4d2c90,client9001)['then'](function(){return _0x43113b;})['catch'](function(_0x51acee){logger['error'](_0x51acee);});}return;})[_0x6338('0x13')](function(){if(_0x43113b){return _0x43113b;}})[_0x6338('0x13')](respondWithResult(_0x5a91ed,null))['catch'](function(_0x72b619){logger[_0x6338('0x18')](_0x6338('0x1c'),_0x72b619);for(var _0x48d27d of _0x54001f){var _0x444d99=path['join'](config['root'],_0x6338('0xea'),'files',_0x6338('0xd2'),'offline-chat',_0x48d27d[_0x6338('0x61')]);fs_extra[_0x6338('0xeb')](_0x444d99)[_0x6338('0x1c')](function(_0x966e57){logger[_0x6338('0x18')](_0x6338('0xec'),_0x444d99,_0x966e57);});}});};exports[_0x6338('0xed')]=function(_0x5f5a0f,_0x520117){return db[_0x6338('0xad')][_0x6338('0x48')]({'where':{'id':_0x5f5a0f[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x520117,null))[_0x6338('0x13')](function(_0xb2a369){if(_0xb2a369){return _0xb2a369[_0x6338('0xed')](_0x5f5a0f[_0x6338('0x50')][_0x6338('0x5a')],_['omit'](_0x5f5a0f[_0x6338('0x50')],[_0x6338('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x520117,null))[_0x6338('0x1c')](handleError(_0x520117,null));};exports[_0x6338('0xee')]=function(_0x4272d8,_0x3d0661){var _0x433395={'raw':![],'where':{}};var _0x582b9c={};var _0x4985c3={'count':0x0,'rows':[]};return db[_0x6338('0x2e')]['findOne']({'where':{'id':_0x4272d8[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x3d0661,null))[_0x6338('0x13')](function(_0x51b074){if(_0x51b074){_0x582b9c['model']=_['keys'](db[_0x6338('0xad')][_0x6338('0x47')]);_0x582b9c[_0x6338('0x33')]=_[_0x6338('0x34')](_0x4272d8['query']);_0x582b9c[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x582b9c[_0x6338('0x32')],_0x582b9c['query']);_0x433395[_0x6338('0x37')]=_[_0x6338('0x35')](_0x582b9c[_0x6338('0x32')],qs['fields'](_0x4272d8['query'][_0x6338('0x36')]));_0x433395['attributes']=_0x433395[_0x6338('0x37')][_0x6338('0x38')]?_0x433395[_0x6338('0x37')]:_0x582b9c['model'];if(!_0x4272d8[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x433395[_0x6338('0x20')]=qs['limit'](_0x4272d8[_0x6338('0x33')][_0x6338('0x20')]);_0x433395[_0x6338('0x22')]=qs[_0x6338('0x22')](_0x4272d8[_0x6338('0x33')][_0x6338('0x22')]);}_0x433395['order']=qs['sort'](_0x4272d8[_0x6338('0x33')][_0x6338('0x3c')]);_0x433395['where']=qs[_0x6338('0x3d')](_[_0x6338('0x3e')](_0x4272d8[_0x6338('0x33')],_0x582b9c['filters']));_0x433395[_0x6338('0x3f')][_0x6338('0x54')]=_0x51b074['id'];if(_0x4272d8[_0x6338('0x33')][_0x6338('0x42')]){_0x433395[_0x6338('0x3f')]=_['merge'](_0x433395['where'],{'$or':_[_0x6338('0x2d')](_0x433395[_0x6338('0x37')],function(_0x3eebff){var _0x82187a={};_0x82187a[_0x3eebff]={'$like':'%'+_0x4272d8[_0x6338('0x33')][_0x6338('0x42')]+'%'};return _0x82187a;})});}_0x433395=_[_0x6338('0x40')]({},_0x433395,_0x4272d8[_0x6338('0x43')]);return db[_0x6338('0xad')][_0x6338('0x21')]({'where':_0x433395[_0x6338('0x3f')]})['then'](function(_0x1afa88){_0x4985c3[_0x6338('0x21')]=_0x1afa88;if(_0x4272d8['query']['includeAll']){_0x433395[_0x6338('0x58')]=[{'model':db[_0x6338('0x91')],'as':_0x6338('0xef'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x6338('0x29'),_0x6338('0xf0'),'internal'],'required':![]},{'model':db[_0x6338('0xf1')],'as':_0x6338('0xf2'),'attributes':['id',_0x6338('0x29'),_0x6338('0xf3')],'where':_0x4272d8[_0x6338('0x33')][_0x6338('0xf4')]?{'id':_0x4272d8[_0x6338('0x33')]['tag']}:undefined,'required':_0x4272d8[_0x6338('0x33')][_0x6338('0xf4')]?!![]:![]}];}return db['ChatInteraction'][_0x6338('0x45')](_0x433395);})[_0x6338('0x13')](function(_0xc490e){_0x4985c3['rows']=_0xc490e;return _0x4985c3;});}})[_0x6338('0x13')](respondWithFilteredResult(_0x3d0661,_0x433395))['catch'](handleError(_0x3d0661,null));};function iftimePromise(_0x193b47,_0x2f11cb){return respondWithRpcPromise(_0x6338('0xf5'),_0x6338('0xf6'),{'command':_0x2f11cb[_0x6338('0xf7')]?util[_0x6338('0xa6')](_0x6338('0xf8'),_0x193b47[_0x6338('0xf9')],_0x2f11cb[_0x6338('0xf7')]):util[_0x6338('0xa6')](_0x6338('0xfa'),_0x193b47[_0x6338('0xf9')])},client9002)[_0x6338('0x13')](function(_0x30e8e1){var _0x26507a=_0x30e8e1&&_0x30e8e1['indexOf'](_0x6338('0xfb'))>=0x0?!![]:![];logger[_0x6338('0x14')](_0x6338('0xfc'),_0x2f11cb['id'],_0x193b47['id'],_0x193b47[_0x6338('0xf9')],_0x26507a?_0x6338('0xfd'):'OFFLINE',_0x2f11cb[_0x6338('0xf7')]?_0x2f11cb[_0x6338('0xf7')]:_0x6338('0xfe'));return _0x26507a;})['catch'](function(_0x235383){logger[_0x6338('0x18')](_0x6338('0xfc'),_0x2f11cb['id'],_0x193b47['id'],_0x193b47['interval'],util[_0x6338('0xff')](_0x235383,{'showHidden':![],'depth':null}),_0x2f11cb[_0x6338('0xf7')]?_0x2f11cb['timezone']:_0x6338('0xfe'));return![];});}exports[_0x6338('0xf6')]=function(_0x4b2116,_0x5313a1){var _0x5716f6=0x0;var _0x4998d8=0x0;var _0x20a4a0=![];var _0x5aa22e;var _0x22177c;return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x4b2116[_0x6338('0x51')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x6338('0x100')],'as':'Intervals','attributes':['id',_0x6338('0xf9')],'raw':!![]}]}]})[_0x6338('0x13')](handleEntityNotFound(_0x5313a1,null))['then'](function(_0x480fc8){if(_0x480fc8){_0x5aa22e=_0x480fc8;return _0x480fc8[_0x6338('0x101')]({'raw':!![]});}})[_0x6338('0x13')](function(_0x5520de){if(_0x5aa22e){if(_0x5520de){_0x22177c=_0x5520de;}}return require(_0x6338('0x6b'))[_0x6338('0x6c')]();})['then'](function(_0x5a45a7){if(_0x5a45a7){_0x4998d8=_0x5a45a7[_0x6338('0x102')];_0x20a4a0=_0x5a45a7[_0x6338('0x6d')];}})['then'](function(){return db['ChatInteraction'][_0x6338('0x21')]({'where':{'closed':![]}});})[_0x6338('0x13')](function(_0xd35c3f){_0x5716f6=_0xd35c3f;if(_0x4998d8&&_0xd35c3f>_0x4998d8){return db['License'][_0x6338('0x57')]({'where':{'id':0x1}})['then'](function(_0x43b757){if(_0x43b757){_0x43b757[_0x6338('0x103')](_0x6338('0x104'));}});}})['then'](function(){if(_0x5aa22e['Interval']&&_0x5aa22e[_0x6338('0x100')]['Intervals']){var _0x120b1f=[];for(var _0x148668=0x0;_0x148668<_0x5aa22e[_0x6338('0x100')]['Intervals']['length'];_0x148668++){var _0x3d33a7=_0x5aa22e['Interval'][_0x6338('0x105')][_0x148668]['get']({'plain':!![]});_0x120b1f[_0x6338('0xb5')](iftimePromise(_0x3d33a7,_0x5aa22e));}return BPromise[_0x6338('0x106')](_0x120b1f)['then'](function(_0x52f212){return _[_0x6338('0x107')](_0x52f212);});}else{return!![];}})[_0x6338('0x13')](function(_0x4aeacd){var _0x4f43e9=fs[_0x6338('0x108')](path['join'](config[_0x6338('0x69')],'server/files/chat/iframe.ejs'),_0x6338('0xcc'));var _0x3cfdd0={'remote':_0x5aa22e['remote'],'query':querystring[_0x6338('0x109')](_[_0x6338('0x40')](_0x5aa22e[_0x6338('0x4b')]({'plain':!![]}),{'customerIp':_0x4b2116[_0x6338('0x7d')][_0x6338('0x9f')]||_0x4b2116['headers'][_0x6338('0x10a')]||_0x4b2116['connection'][_0x6338('0x10b')]||_0x4b2116['ip'],'referer':_0x4b2116['headers'][_0x6338('0xa4')],'openedInteractions':_0x5716f6,'maxInteractions':_0x4998d8,'virtual':_0x20a4a0[_0x6338('0x102')],'online':_0x4aeacd,'custom':_0x20a4a0}))['replace'](/'/g,'\x5c\x27')};_0x5313a1[_0x6338('0xc5')](ejs['render'](Mustache['render'](_0x4f43e9,_0x3cfdd0),{'proactiveActions':_0x22177c,'alignment':_0x5aa22e[_0x6338('0x10c')],'verticalAlignment':_0x5aa22e[_0x6338('0x10d')],'div_color':_0x5aa22e[_0x6338('0xf3')],'labelText':_0x5aa22e['labelText'],'text_color':_0x5aa22e[_0x6338('0x10e')],'text_button_color':_0x5aa22e[_0x6338('0x10f')],'button_color':_0x5aa22e[_0x6338('0x110')],'background_color':_0x5aa22e['backgroundColor'],'hideWhenOffline':_0x5aa22e['hideWhenOffline'],'interval':_0x5aa22e[_0x6338('0x111')]}));})[_0x6338('0x1c')](handleError(_0x5313a1,null));};exports[_0x6338('0x112')]=function(_0x49aaa5,_0x13e062){var _0x5c85ad=_0x49aaa5[_0x6338('0x51')]['id'];var _0x278aea=_0x49aaa5['body'];var _0x209232=0xc8;var _0x77db06=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x6338('0xd6')][_0x6338('0x113')][_0x6338('0x114')]['READ_COMMITTED']},function(_0x1fc3a4){return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x5c85ad},'transaction':_0x1fc3a4})['then'](function(_0x947a80){if(_0x947a80){return db[_0x6338('0x115')]['destroy']({'where':{'ChatWebsiteId':_0x5c85ad},'transaction':_0x1fc3a4})['then'](function(){var _0x153c49=_['map'](_0x278aea,function(_0x53f642){_0x53f642[_0x6338('0x54')]=_0x5c85ad;return _0x53f642;});return db['ChatApplication'][_0x6338('0xd9')](_0x153c49,{'transaction':_0x1fc3a4});});}else{_0x209232=0x194;_0x77db06=[];}});})[_0x6338('0x13')](function(){if(_0x209232!==0x194){return db[_0x6338('0x115')][_0x6338('0x116')]({'where':{'ChatWebsiteId':_0x5c85ad},'order':_0x6338('0x99')})[_0x6338('0x13')](function(_0x336e14){_0x77db06=_0x336e14;});}})[_0x6338('0x1c')](function(_0x4fd6e2){_0x209232=0x1f4;logger[_0x6338('0x18')](_0x4fd6e2['stack']);if(_0x4fd6e2['name']){delete _0x4fd6e2[_0x6338('0x29')];}_0x77db06=_0x4fd6e2;})['finally'](function(){if(_0x77db06===null){_0x13e062[_0x6338('0x1d')](_0x209232);}else{if(_0x209232===0x1f4){_0x13e062[_0x6338('0x1e')](_0x209232)[_0x6338('0xc5')](_0x77db06);}else{_0x13e062[_0x6338('0x1e')](_0x209232)['json'](_0x77db06);}}});};exports[_0x6338('0x117')]=function(_0x5e890b,_0x39d535){var _0x4783af={};var _0x4b8184={};var _0x2f5792;var _0x568cd3;return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x5e890b['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x39d535,null))[_0x6338('0x13')](function(_0x596b54){if(_0x596b54){_0x2f5792=_0x596b54;_0x4b8184[_0x6338('0x32')]=_['keys'](db[_0x6338('0x115')][_0x6338('0x47')]);_0x4b8184[_0x6338('0x33')]=_[_0x6338('0x34')](_0x5e890b[_0x6338('0x33')]);_0x4b8184[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x4b8184['model'],_0x4b8184[_0x6338('0x33')]);_0x4783af['attributes']=_[_0x6338('0x35')](_0x4b8184[_0x6338('0x32')],qs[_0x6338('0x36')](_0x5e890b[_0x6338('0x33')][_0x6338('0x36')]));_0x4783af[_0x6338('0x37')]=_0x4783af[_0x6338('0x37')][_0x6338('0x38')]?_0x4783af[_0x6338('0x37')]:_0x4b8184['model'];_0x4783af[_0x6338('0x3b')]=qs[_0x6338('0x3c')](_0x5e890b['query']['sort']);_0x4783af[_0x6338('0x3f')]=qs['filters'](_['pick'](_0x5e890b['query'],_0x4b8184[_0x6338('0x3d')]));if(_0x5e890b[_0x6338('0x33')][_0x6338('0x42')]){_0x4783af[_0x6338('0x3f')]=_[_0x6338('0x40')](_0x4783af[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x4783af['attributes'],function(_0x573a73){var _0x5b0ae6={};_0x5b0ae6[_0x573a73]={'$like':'%'+_0x5e890b[_0x6338('0x33')]['filter']+'%'};return _0x5b0ae6;})});}_0x4783af=_['merge']({},_0x4783af,_0x5e890b['options']);return _0x2f5792[_0x6338('0x117')](_0x4783af);}})['then'](function(_0x136577){if(_0x136577){_0x568cd3=_0x136577[_0x6338('0x38')];if(!_0x5e890b[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x4783af[_0x6338('0x20')]=qs[_0x6338('0x20')](_0x5e890b['query'][_0x6338('0x20')]);_0x4783af['offset']=qs[_0x6338('0x22')](_0x5e890b['query'][_0x6338('0x22')]);}return _0x2f5792[_0x6338('0x117')](_0x4783af);}})['then'](function(_0x1e69bf){if(_0x1e69bf){return _0x1e69bf?{'count':_0x568cd3,'rows':_0x1e69bf}:null;}})[_0x6338('0x13')](respondWithResult(_0x39d535,null))[_0x6338('0x1c')](handleError(_0x39d535,null));};exports[_0x6338('0x118')]=function(_0x283a8c,_0x75fae3){return db[_0x6338('0x119')][_0x6338('0x48')]({'where':{'id':_0x283a8c[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x75fae3,null))[_0x6338('0x13')](function(_0x3c9d60){if(_0x3c9d60){return _0x3c9d60[_0x6338('0x118')](_0x283a8c['body'][_0x6338('0x5a')],_['omit'](_0x283a8c[_0x6338('0x50')],[_0x6338('0x5a'),'id'])||{});}})[_0x6338('0x13')](respondWithResult(_0x75fae3,null))[_0x6338('0x1c')](handleError(_0x75fae3,null));};exports['getProactiveActions']=function(_0x1e07c2,_0x2d93da){var _0x5fe76c={};var _0x420798={};var _0x305d1f;var _0x17b4db;return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x1e07c2[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d93da,null))[_0x6338('0x13')](function(_0x3c80bc){if(_0x3c80bc){_0x305d1f=_0x3c80bc;_0x420798[_0x6338('0x32')]=_[_0x6338('0x34')](db['ChatProactiveAction'][_0x6338('0x47')]);_0x420798['query']=_['keys'](_0x1e07c2[_0x6338('0x33')]);_0x420798['filters']=_[_0x6338('0x35')](_0x420798[_0x6338('0x32')],_0x420798[_0x6338('0x33')]);_0x5fe76c['attributes']=_[_0x6338('0x35')](_0x420798[_0x6338('0x32')],qs[_0x6338('0x36')](_0x1e07c2['query'][_0x6338('0x36')]));_0x5fe76c['attributes']=_0x5fe76c[_0x6338('0x37')]['length']?_0x5fe76c[_0x6338('0x37')]:_0x420798[_0x6338('0x32')];_0x5fe76c['order']=qs['sort'](_0x1e07c2[_0x6338('0x33')][_0x6338('0x3c')]);_0x5fe76c[_0x6338('0x3f')]=qs['filters'](_['pick'](_0x1e07c2[_0x6338('0x33')],_0x420798[_0x6338('0x3d')]));if(_0x1e07c2[_0x6338('0x33')][_0x6338('0x42')]){_0x5fe76c[_0x6338('0x3f')]=_['merge'](_0x5fe76c[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x5fe76c[_0x6338('0x37')],function(_0x1accd9){var _0x7282cd={};_0x7282cd[_0x1accd9]={'$like':'%'+_0x1e07c2[_0x6338('0x33')]['filter']+'%'};return _0x7282cd;})});}_0x5fe76c=_[_0x6338('0x40')]({},_0x5fe76c,_0x1e07c2[_0x6338('0x43')]);return _0x305d1f[_0x6338('0x101')](_0x5fe76c);}})[_0x6338('0x13')](function(_0x32cf57){if(_0x32cf57){_0x17b4db=_0x32cf57[_0x6338('0x38')];if(!_0x1e07c2[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x5fe76c[_0x6338('0x20')]=qs[_0x6338('0x20')](_0x1e07c2[_0x6338('0x33')][_0x6338('0x20')]);_0x5fe76c[_0x6338('0x22')]=qs[_0x6338('0x22')](_0x1e07c2['query'][_0x6338('0x22')]);}return _0x305d1f[_0x6338('0x101')](_0x5fe76c);}})[_0x6338('0x13')](function(_0xca126b){if(_0xca126b){return _0xca126b?{'count':_0x17b4db,'rows':_0xca126b}:null;}})[_0x6338('0x13')](respondWithResult(_0x2d93da,null))[_0x6338('0x1c')](handleError(_0x2d93da,null));};exports['getFields']=function(_0x56d74d,_0x5204ec){var _0x1cb7cf=_0x56d74d[_0x6338('0x33')][_0x6338('0x11a')]===_0x6338('0x11b')?'offlineForm':'onlineForm';return db['ChatWebsite'][_0x6338('0x48')]({'attributes':['id',_0x1cb7cf],'where':{'id':_0x56d74d['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x5204ec,null))[_0x6338('0x13')](function(_0x43cde7){if(_0x43cde7){var _0x4fe2a8=_0x43cde7[_0x1cb7cf];var _0x313ecd=_0x4fe2a8&&_0x4fe2a8[_0x6338('0x11c')]?_0x4fe2a8[_0x6338('0x11c')]:[];_0x5204ec[_0x6338('0xc5')]({'fromKey':_[_0x6338('0x6e')](_0x4fe2a8['fromKey'])?undefined:_0x4fe2a8[_0x6338('0x11d')],'count':_0x313ecd[_0x6338('0x38')],'rows':_0x313ecd});}})[_0x6338('0x1c')](handleError(_0x5204ec,null));};exports[_0x6338('0x11e')]=function(_0x228b41,_0x1788f4){var _0x576b35={'raw':![],'where':{}};var _0x264904={};var _0x4568a7={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x228b41[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x1788f4,null))['then'](function(_0x41eb01){if(_0x41eb01){_0x264904[_0x6338('0x32')]=_[_0x6338('0x34')](db[_0x6338('0xcf')][_0x6338('0x47')]);_0x264904[_0x6338('0x33')]=_[_0x6338('0x34')](_0x228b41[_0x6338('0x33')]);_0x264904[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x264904[_0x6338('0x32')],_0x264904[_0x6338('0x33')]);_0x576b35['attributes']=_[_0x6338('0x35')](_0x264904[_0x6338('0x32')],qs['fields'](_0x228b41[_0x6338('0x33')][_0x6338('0x36')]));_0x576b35[_0x6338('0x37')]=_0x576b35[_0x6338('0x37')][_0x6338('0x38')]?_0x576b35[_0x6338('0x37')]:_0x264904[_0x6338('0x32')];if(!_0x228b41[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x576b35[_0x6338('0x20')]=qs['limit'](_0x228b41['query'][_0x6338('0x20')]);_0x576b35['offset']=qs[_0x6338('0x22')](_0x228b41[_0x6338('0x33')][_0x6338('0x22')]);}_0x576b35[_0x6338('0x3b')]=qs['sort'](_0x228b41[_0x6338('0x33')][_0x6338('0x3c')]);_0x576b35['where']=qs['filters'](_[_0x6338('0x3e')](_0x228b41[_0x6338('0x33')],_0x264904[_0x6338('0x3d')]));_0x576b35[_0x6338('0x3f')][_0x6338('0x54')]=_0x41eb01['id'];if(_0x228b41[_0x6338('0x33')][_0x6338('0x42')]){_0x576b35[_0x6338('0x3f')]=_[_0x6338('0x40')](_0x576b35[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x576b35['attributes'],function(_0x5b3723){var _0x5c81ff={};_0x5c81ff[_0x5b3723]={'$like':'%'+_0x228b41['query'][_0x6338('0x42')]+'%'};return _0x5c81ff;})});}_0x576b35=_[_0x6338('0x40')]({},_0x576b35,_0x228b41[_0x6338('0x43')]);return db[_0x6338('0xcf')]['count']({'where':_0x576b35['where']})[_0x6338('0x13')](function(_0x9fd01){_0x4568a7[_0x6338('0x21')]=_0x9fd01;if(_0x228b41[_0x6338('0x33')][_0x6338('0x44')]){_0x576b35[_0x6338('0x58')]=[{'all':!![]}];}else{_0x576b35['include']=[{'model':db[_0x6338('0x91')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x6338('0x45')](_0x576b35);})['then'](function(_0x22f3f3){_0x4568a7[_0x6338('0x46')]=_0x22f3f3;return _0x4568a7;});}})['then'](respondWithFilteredResult(_0x1788f4,_0x576b35))[_0x6338('0x1c')](handleError(_0x1788f4,null));};exports[_0x6338('0x11f')]=function(_0x3d1971,_0x30408b){return db[_0x6338('0x2e')]['find']({'where':{'id':_0x3d1971[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x30408b,null))[_0x6338('0x13')](function(_0x1c2fc5){if(_0x1c2fc5){return _0x1c2fc5[_0x6338('0x11f')](_0x3d1971['body']['ids'],_['omit'](_0x3d1971[_0x6338('0x50')],[_0x6338('0x5a'),'id'])||{})['spread'](function(_0x4b8545){for(var _0x551005=0x0;_0x551005<_0x3d1971['body'][_0x6338('0x5a')][_0x6338('0x38')];_0x551005+=0x1){socket[_0x6338('0x120')](_0x6338('0x121'),{'UserId':Number(_0x3d1971[_0x6338('0x50')][_0x6338('0x5a')][_0x551005]),'ChatWebsiteId':Number(_0x3d1971[_0x6338('0x51')]['id'])});}return _0x4b8545;});}})[_0x6338('0x13')](respondWithResult(_0x30408b,null))[_0x6338('0x1c')](handleError(_0x30408b,null));};exports[_0x6338('0x122')]=function(_0x4264e7,_0x349d41){return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x4264e7['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x349d41,null))[_0x6338('0x13')](function(_0x1bc6c5){if(_0x1bc6c5){return _0x1bc6c5[_0x6338('0x122')](_0x4264e7['query'][_0x6338('0x5a')])['then'](function(){if(_[_0x6338('0x123')](_0x4264e7[_0x6338('0x33')][_0x6338('0x5a')])){for(var _0x1c9a4f=0x0;_0x1c9a4f<_0x4264e7[_0x6338('0x33')][_0x6338('0x5a')][_0x6338('0x38')];_0x1c9a4f+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x4264e7[_0x6338('0x33')][_0x6338('0x5a')][_0x1c9a4f]),'ChatWebsiteId':Number(_0x4264e7[_0x6338('0x51')]['id'])});}}else{socket[_0x6338('0x120')](_0x6338('0x124'),{'UserId':Number(_0x4264e7[_0x6338('0x33')][_0x6338('0x5a')]),'ChatWebsiteId':Number(_0x4264e7[_0x6338('0x51')]['id'])});}});}})[_0x6338('0x13')](respondWithStatusCode(_0x349d41,null))['catch'](handleError(_0x349d41,null));};exports[_0x6338('0x125')]=function(_0x33abc0,_0x3a15ed){var _0x17787c={};var _0x580922={};var _0xa5bc22;var _0xe48063;return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x33abc0['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x3a15ed,null))[_0x6338('0x13')](function(_0x34882f){if(_0x34882f){_0xa5bc22=_0x34882f;_0x580922['model']=_[_0x6338('0x34')](db[_0x6338('0xbc')]['rawAttributes']);_0x580922[_0x6338('0x33')]=_[_0x6338('0x34')](_0x33abc0['query']);_0x580922[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x580922[_0x6338('0x32')],_0x580922[_0x6338('0x33')]);_0x17787c[_0x6338('0x37')]=_[_0x6338('0x35')](_0x580922['model'],qs['fields'](_0x33abc0[_0x6338('0x33')]['fields']));_0x17787c['attributes']=_0x17787c[_0x6338('0x37')][_0x6338('0x38')]?_0x17787c['attributes']:_0x580922[_0x6338('0x32')];_0x17787c[_0x6338('0x3b')]=qs[_0x6338('0x3c')](_0x33abc0[_0x6338('0x33')][_0x6338('0x3c')]);_0x17787c[_0x6338('0x3f')]=qs[_0x6338('0x3d')](_[_0x6338('0x3e')](_0x33abc0[_0x6338('0x33')],_0x580922[_0x6338('0x3d')]));if(_0x33abc0[_0x6338('0x33')][_0x6338('0x42')]){_0x17787c[_0x6338('0x3f')]=_['merge'](_0x17787c[_0x6338('0x3f')],{'$or':_['map'](_0x17787c['attributes'],function(_0x483388){var _0x46cfd9={};_0x46cfd9[_0x483388]={'$like':'%'+_0x33abc0[_0x6338('0x33')][_0x6338('0x42')]+'%'};return _0x46cfd9;})});}_0x17787c=_['merge']({},_0x17787c,_0x33abc0['options']);return _0xa5bc22[_0x6338('0x125')](_0x17787c);}})[_0x6338('0x13')](function(_0x226549){if(_0x226549){_0xe48063=_0x226549['length'];if(!_0x33abc0[_0x6338('0x33')][_0x6338('0x39')]('nolimit')){_0x17787c['limit']=qs['limit'](_0x33abc0[_0x6338('0x33')]['limit']);_0x17787c['offset']=qs[_0x6338('0x22')](_0x33abc0[_0x6338('0x33')][_0x6338('0x22')]);}return _0xa5bc22['getAgents'](_0x17787c);}})[_0x6338('0x13')](function(_0x224ee6){if(_0x224ee6){return _0x224ee6?{'count':_0xe48063,'rows':_0x224ee6}:null;}})[_0x6338('0x13')](respondWithResult(_0x3a15ed,null))[_0x6338('0x1c')](handleError(_0x3a15ed,null));};
\ No newline at end of file
+var _0x8050=['destroy','then','get','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','query','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','addAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','root','custom','existsSync','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','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','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','Contacts','defaults','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','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','spread','messageId','created','push','close','unmanaged','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','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','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','files','attachments','offline-chat','sequelize','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','originalname','toPairsIn','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','internal','Tags','color','tag','findAll','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','addApplications','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','html-to-text','jayson/promise','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','update'];(function(_0x46e603,_0x324b67){var _0xbba20e=function(_0x3a2b04){while(--_0x3a2b04){_0x46e603['push'](_0x46e603['shift']());}};_0xbba20e(++_0x324b67);}(_0x8050,0xff));var _0x0805=function(_0x38c71d,_0x49e6b7){_0x38c71d=_0x38c71d-0x0;var _0x1953d8=_0x8050[_0x38c71d];return _0x1953d8;};'use strict';var BPromise=require(_0x0805('0x0'));var Mustache=require(_0x0805('0x1'));var util=require(_0x0805('0x2'));var path=require(_0x0805('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0805('0x4'));var _=require('lodash');var querystring=require(_0x0805('0x5'));var Redis=require(_0x0805('0x6'));var qs=require(_0x0805('0x7'));var logger=require(_0x0805('0x8'))('api');var config=require(_0x0805('0x9'));var db=require(_0x0805('0xa'))['db'];config[_0x0805('0xb')]=_['defaults'](config['redis'],{'host':_0x0805('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0805('0xb')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0x0805('0xd'));var jayson=require(_0x0805('0xe'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0805('0xf')]['http']({'port':0x232a});var client9003=jayson[_0x0805('0xf')][_0x0805('0x10')]({'port':0x232b});var client9001=jayson[_0x0805('0xf')][_0x0805('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x12f5b4,_0x107cc0,_0x579291,_0x297480){return new BPromise(function(_0x821163,_0xece44a){var _0x25dd1c=_0x297480||client;return _0x25dd1c[_0x0805('0x11')](_0x12f5b4,_0x579291)['then'](function(_0x13cd70){logger['info'](_0x0805('0x12'),_0x107cc0,_0x0805('0x13'));logger[_0x0805('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x107cc0,_0x0805('0x13'),JSON[_0x0805('0x15')](_0x13cd70));if(_0x13cd70[_0x0805('0x16')]){if(_0x13cd70[_0x0805('0x16')][_0x0805('0x17')]===0x1f4){logger[_0x0805('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x107cc0,_0x13cd70[_0x0805('0x16')][_0x0805('0x18')]);return _0xece44a(_0x13cd70['error']['message']);}logger['error'](_0x0805('0x12'),_0x107cc0,_0x13cd70['error']['message']);return _0x821163(_0x13cd70['error'][_0x0805('0x18')]);}else{logger['info'](_0x0805('0x12'),_0x107cc0,'request\x20sent');_0x821163(_0x13cd70[_0x0805('0x19')][_0x0805('0x18')]);}})[_0x0805('0x1a')](function(_0x56b268){logger[_0x0805('0x16')](_0x0805('0x12'),_0x107cc0,_0x56b268);_0xece44a(_0x56b268);});});}function respondWithStatusCode(_0x3040b0,_0x31d4d8){_0x31d4d8=_0x31d4d8||0xcc;return function(_0x181786){if(_0x181786){return _0x3040b0[_0x0805('0x1b')](_0x31d4d8);}return _0x3040b0[_0x0805('0x1c')](_0x31d4d8)[_0x0805('0x1d')]();};}function respondWithResult(_0x43061f,_0x578486){_0x578486=_0x578486||0xc8;return function(_0x38f7ec){if(_0x38f7ec){return _0x43061f[_0x0805('0x1c')](_0x578486)[_0x0805('0x1e')](_0x38f7ec);}};}function respondWithFilteredResult(_0x2d84f0,_0x444632){return function(_0x2fa1f5){if(_0x2fa1f5){var _0x19b957=typeof _0x444632[_0x0805('0x1f')]==='undefined'&&typeof _0x444632['limit']===_0x0805('0x20');var _0xf37a6=_0x2fa1f5[_0x0805('0x21')];var _0x15acd7=_0x19b957?0x0:_0x444632[_0x0805('0x1f')];var _0x57286d=_0x19b957?_0x2fa1f5['count']:_0x444632[_0x0805('0x1f')]+_0x444632['limit'];var _0x4a59a9;if(_0x57286d>=_0xf37a6){_0x57286d=_0xf37a6;_0x4a59a9=0xc8;}else{_0x4a59a9=0xce;}_0x2d84f0[_0x0805('0x1c')](_0x4a59a9);return _0x2d84f0[_0x0805('0x22')]('Content-Range',_0x15acd7+'-'+_0x57286d+'/'+_0xf37a6)['json'](_0x2fa1f5);}return null;};}function saveUpdates(_0x265675){return function(_0x369cea){if(_0x369cea){return _0x369cea[_0x0805('0x23')](_0x265675)['then'](function(_0x2305d1){return _0x2305d1;});}return null;};}function removeEntity(_0xc0085){return function(_0x1c5378){if(_0x1c5378){return _0x1c5378[_0x0805('0x24')]()[_0x0805('0x25')](function(){var _0x377f7a=_0x1c5378[_0x0805('0x26')]({'plain':!![]});var _0x4d7b18=_0x0805('0x27');return db[_0x0805('0x28')]['destroy']({'where':{'type':_0x4d7b18,'resourceId':_0x377f7a['id']}})[_0x0805('0x25')](function(){return _0x1c5378;});})[_0x0805('0x25')](function(){_0xc0085['status'](0xcc)[_0x0805('0x1d')]();});}};}function handleEntityNotFound(_0x45d150){return function(_0x359234){if(!_0x359234){_0x45d150[_0x0805('0x1b')](0x194);}return _0x359234;};}function handleError(_0x56978d,_0x190509){_0x190509=_0x190509||0x1f4;return function(_0x3b56b4){logger[_0x0805('0x16')](_0x3b56b4['stack']);if(_0x3b56b4[_0x0805('0x29')]){delete _0x3b56b4[_0x0805('0x29')];}_0x56978d['status'](_0x190509)[_0x0805('0x2a')](_0x3b56b4);};}exports[_0x0805('0x2b')]=function(_0x1f6f5a,_0x3bdb7d){var _0x41519a={'include':[{'model':db[_0x0805('0x2c')],'as':_0x0805('0x2d')}]},_0x35568d={},_0x2f86cb={'count':0x0,'rows':[]};var _0x4db594=_[_0x0805('0x2e')](db[_0x0805('0x2f')][_0x0805('0x30')],function(_0x512898){return{'name':_0x512898[_0x0805('0x31')],'type':_0x512898['type']['key']};});_0x35568d[_0x0805('0x32')]=_['map'](_0x4db594,'name');_0x35568d[_0x0805('0x33')]=_['keys'](_0x1f6f5a[_0x0805('0x33')]);_0x35568d['filters']=_['intersection'](_0x35568d[_0x0805('0x32')],_0x35568d[_0x0805('0x33')]);_0x41519a['attributes']=_['intersection'](_0x35568d[_0x0805('0x32')],qs[_0x0805('0x34')](_0x1f6f5a['query'][_0x0805('0x34')]));_0x41519a[_0x0805('0x35')]=_0x41519a['attributes'][_0x0805('0x36')]?_0x41519a['attributes']:_0x35568d['model'];if(!_0x1f6f5a[_0x0805('0x33')][_0x0805('0x37')]('nolimit')){_0x41519a[_0x0805('0x38')]=qs[_0x0805('0x38')](_0x1f6f5a[_0x0805('0x33')][_0x0805('0x38')]);_0x41519a[_0x0805('0x1f')]=qs['offset'](_0x1f6f5a[_0x0805('0x33')][_0x0805('0x1f')]);}_0x41519a[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x1f6f5a['query'][_0x0805('0x3a')]);_0x41519a[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x1f6f5a[_0x0805('0x33')],_0x35568d[_0x0805('0x3c')]),_0x4db594);if(_0x1f6f5a[_0x0805('0x33')][_0x0805('0x3e')]){_0x41519a[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x41519a[_0x0805('0x3b')],{'$or':_['map'](_0x4db594,function(_0x3bf916){if(_0x3bf916[_0x0805('0x40')]!==_0x0805('0x41')){var _0x4495ef={};_0x4495ef[_0x3bf916[_0x0805('0x29')]]={'$like':'%'+_0x1f6f5a[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0x4495ef;}})});}_0x41519a=_[_0x0805('0x3f')]({},_0x41519a,_0x1f6f5a[_0x0805('0x42')]);var _0x556287={'where':_0x41519a['where']};return db[_0x0805('0x2f')][_0x0805('0x21')](_0x556287)[_0x0805('0x25')](function(_0x53f09e){_0x2f86cb[_0x0805('0x21')]=_0x53f09e;if(_0x1f6f5a['query'][_0x0805('0x43')]){_0x41519a[_0x0805('0x44')]=[{'all':!![]}];}return db[_0x0805('0x2f')]['findAll'](_0x41519a);})[_0x0805('0x25')](function(_0x2f6e62){_0x2f86cb[_0x0805('0x45')]=_0x2f6e62;return _0x2f86cb;})['then'](respondWithFilteredResult(_0x3bdb7d,_0x41519a))['catch'](handleError(_0x3bdb7d,null));};exports[_0x0805('0x46')]=function(_0x1af756,_0x281b31){var _0x1c1058={'raw':![],'where':{'id':_0x1af756[_0x0805('0x47')]['id']},'include':[{'model':db[_0x0805('0x2c')],'as':_0x0805('0x2d')}]},_0x44ee5e={};_0x44ee5e[_0x0805('0x32')]=_['keys'](db['ChatWebsite'][_0x0805('0x30')]);_0x44ee5e['query']=_[_0x0805('0x48')](_0x1af756['query']);_0x44ee5e[_0x0805('0x3c')]=_[_0x0805('0x49')](_0x44ee5e[_0x0805('0x32')],_0x44ee5e['query']);_0x1c1058['attributes']=_['intersection'](_0x44ee5e['model'],qs[_0x0805('0x34')](_0x1af756[_0x0805('0x33')][_0x0805('0x34')]));_0x1c1058['attributes']=_0x1c1058[_0x0805('0x35')][_0x0805('0x36')]?_0x1c1058[_0x0805('0x35')]:_0x44ee5e[_0x0805('0x32')];if(_0x1af756[_0x0805('0x33')][_0x0805('0x43')]){_0x1c1058[_0x0805('0x44')]=[{'all':!![]}];}_0x1c1058=_[_0x0805('0x3f')]({},_0x1c1058,_0x1af756[_0x0805('0x42')]);return db[_0x0805('0x2f')][_0x0805('0x4a')](_0x1c1058)[_0x0805('0x25')](handleEntityNotFound(_0x281b31,null))['then'](respondWithResult(_0x281b31,null))[_0x0805('0x1a')](handleError(_0x281b31,null));};exports[_0x0805('0x4b')]=function(_0x3ab97a,_0x383872){return db[_0x0805('0x2f')]['create'](_0x3ab97a[_0x0805('0x4c')],{})[_0x0805('0x25')](function(_0x445b58){var _0xa08631=_0x3ab97a['user'][_0x0805('0x26')]({'plain':!![]});if(!_0xa08631)throw new Error(_0x0805('0x4d'));if(_0xa08631[_0x0805('0x4e')]===_0x0805('0x4f')){var _0x10ff0f=_0x445b58['get']({'plain':!![]});var _0x484f14=_0x0805('0x27');return db['UserProfileSection'][_0x0805('0x4a')]({'where':{'name':_0x484f14,'userProfileId':_0xa08631['userProfileId']},'raw':!![]})[_0x0805('0x25')](function(_0x5dd867){if(_0x5dd867&&_0x5dd867[_0x0805('0x50')]===0x0){return db[_0x0805('0x28')]['create']({'name':_0x10ff0f[_0x0805('0x29')],'resourceId':_0x10ff0f['id'],'type':_0x5dd867[_0x0805('0x29')],'sectionId':_0x5dd867['id']},{})[_0x0805('0x25')](function(){return _0x445b58;});}else{return _0x445b58;}})[_0x0805('0x1a')](function(_0x5c83d8){logger[_0x0805('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c83d8);throw _0x5c83d8;});}return _0x445b58;})['then'](respondWithResult(_0x383872,0xc9))[_0x0805('0x1a')](handleError(_0x383872,null));};exports['update']=function(_0x1f45bd,_0x13b16c){if(_0x1f45bd[_0x0805('0x4c')]['id']){delete _0x1f45bd[_0x0805('0x4c')]['id'];}return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x1f45bd[_0x0805('0x47')]['id']},'include':[{'model':db[_0x0805('0x2c')],'as':'mandatoryDispositionPause'}]})[_0x0805('0x25')](handleEntityNotFound(_0x13b16c,null))['then'](saveUpdates(_0x1f45bd['body'],null))[_0x0805('0x25')](respondWithResult(_0x13b16c,null))[_0x0805('0x1a')](handleError(_0x13b16c,null));};exports[_0x0805('0x24')]=function(_0x41c4a6,_0x512743){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x41c4a6['params']['id']}})['then'](handleEntityNotFound(_0x512743,null))[_0x0805('0x25')](removeEntity(_0x512743,null))['catch'](handleError(_0x512743,null));};exports[_0x0805('0x51')]=function(_0x2a7db1,_0xf13252){return db['ChatWebsite'][_0x0805('0x51')]()[_0x0805('0x25')](respondWithResult(_0xf13252,null))[_0x0805('0x1a')](handleError(_0xf13252,null));};exports[_0x0805('0x52')]=function(_0x5750eb,_0x3cf35d){if(_0x5750eb[_0x0805('0x4c')]['id']){delete _0x5750eb[_0x0805('0x4c')]['id'];}return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x5750eb['params']['id']}})['then'](handleEntityNotFound(_0x3cf35d,null))[_0x0805('0x25')](function(_0x250f00){if(_0x250f00){_0x5750eb[_0x0805('0x4c')][_0x0805('0x53')]=_0x250f00['id'];return db[_0x0805('0x54')][_0x0805('0x4b')](_0x5750eb[_0x0805('0x4c')]);}})[_0x0805('0x25')](respondWithResult(_0x3cf35d,null))['catch'](handleError(_0x3cf35d,null));};exports[_0x0805('0x55')]=function(_0x10e383,_0x45dc5a){var _0x2e100e={'raw':![],'where':{}};var _0x4f97f1={};var _0x25d0b8={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x10e383[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x45dc5a,null))[_0x0805('0x25')](function(_0x1954a3){if(_0x1954a3){_0x4f97f1[_0x0805('0x32')]=_[_0x0805('0x48')](db['Disposition'][_0x0805('0x30')]);_0x4f97f1[_0x0805('0x33')]=_[_0x0805('0x48')](_0x10e383[_0x0805('0x33')]);_0x4f97f1['filters']=_['intersection'](_0x4f97f1[_0x0805('0x32')],_0x4f97f1[_0x0805('0x33')]);_0x2e100e['attributes']=_[_0x0805('0x49')](_0x4f97f1[_0x0805('0x32')],qs[_0x0805('0x34')](_0x10e383[_0x0805('0x33')][_0x0805('0x34')]));_0x2e100e[_0x0805('0x35')]=_0x2e100e[_0x0805('0x35')][_0x0805('0x36')]?_0x2e100e[_0x0805('0x35')]:_0x4f97f1[_0x0805('0x32')];if(!_0x10e383['query'][_0x0805('0x37')](_0x0805('0x56'))){_0x2e100e['limit']=qs['limit'](_0x10e383[_0x0805('0x33')][_0x0805('0x38')]);_0x2e100e[_0x0805('0x1f')]=qs[_0x0805('0x1f')](_0x10e383[_0x0805('0x33')][_0x0805('0x1f')]);}_0x2e100e[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x10e383[_0x0805('0x33')][_0x0805('0x3a')]);_0x2e100e['where']=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x10e383[_0x0805('0x33')],_0x4f97f1['filters']));_0x2e100e['where'][_0x0805('0x53')]=_0x1954a3['id'];if(_0x10e383['query'][_0x0805('0x3e')]){_0x2e100e[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x2e100e[_0x0805('0x3b')],{'$or':_[_0x0805('0x2e')](_0x2e100e[_0x0805('0x35')],function(_0x5e62e7){var _0x54406e={};_0x54406e[_0x5e62e7]={'$like':'%'+_0x10e383['query'][_0x0805('0x3e')]+'%'};return _0x54406e;})});}_0x2e100e=_['merge']({},_0x2e100e,_0x10e383[_0x0805('0x42')]);return db['Disposition'][_0x0805('0x21')]({'where':_0x2e100e[_0x0805('0x3b')]})[_0x0805('0x25')](function(_0x48af2f){_0x25d0b8['count']=_0x48af2f;if(_0x10e383['query'][_0x0805('0x43')]){_0x2e100e[_0x0805('0x44')]=[{'all':!![]}];}return db[_0x0805('0x54')]['findAll'](_0x2e100e);})['then'](function(_0x1b0448){_0x25d0b8[_0x0805('0x45')]=_0x1b0448;return _0x25d0b8;});}})['then'](respondWithFilteredResult(_0x45dc5a,_0x2e100e))[_0x0805('0x1a')](handleError(_0x45dc5a,null));};exports['removeDispositions']=function(_0x40404e,_0x47a328){return db[_0x0805('0x2f')]['find']({'where':{'id':_0x40404e[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x47a328,null))[_0x0805('0x25')](function(_0x3a7a79){if(_0x3a7a79){return _0x3a7a79[_0x0805('0x57')](_0x40404e['query'][_0x0805('0x58')]);}})[_0x0805('0x25')](respondWithStatusCode(_0x47a328,null))[_0x0805('0x1a')](handleError(_0x47a328,null));};exports[_0x0805('0x59')]=function(_0x19f473,_0x75ecf0){if(_0x19f473[_0x0805('0x4c')]['id']){delete _0x19f473[_0x0805('0x4c')]['id'];}return db[_0x0805('0x2f')]['find']({'where':{'id':_0x19f473[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x75ecf0,null))[_0x0805('0x25')](function(_0x360388){if(_0x360388){_0x19f473[_0x0805('0x4c')][_0x0805('0x53')]=_0x360388['id'];return db[_0x0805('0x5a')]['create'](_0x19f473[_0x0805('0x4c')]);}})[_0x0805('0x25')](respondWithResult(_0x75ecf0,null))[_0x0805('0x1a')](handleError(_0x75ecf0,null));};exports[_0x0805('0x5b')]=function(_0x48804b,_0x5c7da9){var _0x2c5834={'raw':![],'where':{}};var _0x24279f={};var _0x1de493={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0805('0x5c')]({'where':{'id':_0x48804b['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x5c7da9,null))[_0x0805('0x25')](function(_0x4235e0){if(_0x4235e0){_0x24279f[_0x0805('0x32')]=_[_0x0805('0x48')](db['CannedAnswer'][_0x0805('0x30')]);_0x24279f[_0x0805('0x33')]=_['keys'](_0x48804b[_0x0805('0x33')]);_0x24279f[_0x0805('0x3c')]=_[_0x0805('0x49')](_0x24279f[_0x0805('0x32')],_0x24279f[_0x0805('0x33')]);_0x2c5834[_0x0805('0x35')]=_['intersection'](_0x24279f[_0x0805('0x32')],qs[_0x0805('0x34')](_0x48804b[_0x0805('0x33')][_0x0805('0x34')]));_0x2c5834[_0x0805('0x35')]=_0x2c5834[_0x0805('0x35')][_0x0805('0x36')]?_0x2c5834['attributes']:_0x24279f[_0x0805('0x32')];if(!_0x48804b[_0x0805('0x33')][_0x0805('0x37')](_0x0805('0x56'))){_0x2c5834[_0x0805('0x38')]=qs[_0x0805('0x38')](_0x48804b[_0x0805('0x33')][_0x0805('0x38')]);_0x2c5834[_0x0805('0x1f')]=qs['offset'](_0x48804b[_0x0805('0x33')][_0x0805('0x1f')]);}_0x2c5834[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x48804b[_0x0805('0x33')][_0x0805('0x3a')]);_0x2c5834[_0x0805('0x3b')]=qs['filters'](_['pick'](_0x48804b[_0x0805('0x33')],_0x24279f[_0x0805('0x3c')]));_0x2c5834[_0x0805('0x3b')][_0x0805('0x53')]=_0x4235e0['id'];if(_0x48804b[_0x0805('0x33')][_0x0805('0x3e')]){_0x2c5834['where']=_[_0x0805('0x3f')](_0x2c5834[_0x0805('0x3b')],{'$or':_[_0x0805('0x2e')](_0x2c5834[_0x0805('0x35')],function(_0x5069ea){var _0x366bb0={};_0x366bb0[_0x5069ea]={'$like':'%'+_0x48804b['query'][_0x0805('0x3e')]+'%'};return _0x366bb0;})});}_0x2c5834=_['merge']({},_0x2c5834,_0x48804b['options']);return db[_0x0805('0x5a')]['count']({'where':_0x2c5834[_0x0805('0x3b')]})['then'](function(_0x57f83e){_0x1de493['count']=_0x57f83e;if(_0x48804b[_0x0805('0x33')]['includeAll']){_0x2c5834[_0x0805('0x44')]=[{'all':!![]}];}return db[_0x0805('0x5a')]['findAll'](_0x2c5834);})[_0x0805('0x25')](function(_0x2bc428){_0x1de493[_0x0805('0x45')]=_0x2bc428;return _0x1de493;});}})['then'](respondWithFilteredResult(_0x5c7da9,_0x2c5834))[_0x0805('0x1a')](handleError(_0x5c7da9,null));};exports['removeAnswers']=function(_0x356549,_0x4054cc){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x356549['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x4054cc,null))[_0x0805('0x25')](function(_0x57d9f6){if(_0x57d9f6){return _0x57d9f6[_0x0805('0x5d')](_0x356549['query'][_0x0805('0x58')]);}})[_0x0805('0x25')](respondWithStatusCode(_0x4054cc,null))[_0x0805('0x1a')](handleError(_0x4054cc,null));};exports[_0x0805('0x5e')]=function(_0x3b18a2,_0x24770a){_0x3b18a2[_0x0805('0x4c')][_0x0805('0x5f')]=_0x3b18a2[_0x0805('0x60')]['filename'];return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x3b18a2['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x24770a,null))[_0x0805('0x25')](saveUpdates(_0x3b18a2[_0x0805('0x4c')],null))[_0x0805('0x25')](respondWithResult(_0x24770a,null))[_0x0805('0x1a')](handleError(_0x24770a,null));};exports[_0x0805('0x61')]=function(_0x354c36,_0x50f80d){_0x354c36[_0x0805('0x4c')]['agentAvatar']=_0x354c36[_0x0805('0x60')]['filename'];return db[_0x0805('0x2f')]['find']({'where':{'id':_0x354c36[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x50f80d,null))[_0x0805('0x25')](saveUpdates(_0x354c36['body'],null))['then'](respondWithResult(_0x50f80d,null))[_0x0805('0x1a')](handleError(_0x50f80d,null));};exports['addCustomerAvatar']=function(_0x14ea1d,_0x29e7a4){_0x14ea1d[_0x0805('0x4c')][_0x0805('0x62')]=_0x14ea1d['file'][_0x0805('0x63')];return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x14ea1d[_0x0805('0x47')]['id']}})['then'](handleEntityNotFound(_0x29e7a4,null))[_0x0805('0x25')](saveUpdates(_0x14ea1d[_0x0805('0x4c')],null))['then'](respondWithResult(_0x29e7a4,null))[_0x0805('0x1a')](handleError(_0x29e7a4,null));};exports[_0x0805('0x64')]=function(_0x11aa2c,_0x4e44a5){_0x11aa2c['body'][_0x0805('0x65')]=_0x11aa2c[_0x0805('0x60')][_0x0805('0x63')];return db['ChatWebsite'][_0x0805('0x4a')]({'where':{'id':_0x11aa2c['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x4e44a5,null))[_0x0805('0x25')](saveUpdates(_0x11aa2c[_0x0805('0x4c')],null))['then'](respondWithResult(_0x4e44a5,null))['catch'](handleError(_0x4e44a5,null));};exports[_0x0805('0x66')]=function(_0x5529d3,_0x4a5ca4){var _0x24c151=path['join'](config[_0x0805('0x67')],'server/files/images/logos/default_logo.svg');var _0x5055be={'where':{'id':_0x5529d3['params']['id']},'attributes':['id',_0x0805('0x5f')],'raw':!![]};var _0x5193c9=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x2851a5){if(_0x2851a5){_0x5193c9=_0x2851a5[_0x0805('0x68')];}})[_0x0805('0x25')](function(){return db[_0x0805('0x2f')][_0x0805('0x4a')](_0x5055be);})[_0x0805('0x25')](handleEntityNotFound(_0x4a5ca4,null))[_0x0805('0x25')](function(_0xbb03c4){if(_0xbb03c4){if(!_['isNil'](_0xbb03c4[_0x0805('0x5f')])){if(fs[_0x0805('0x69')](path['join'](config[_0x0805('0x67')],_0x0805('0x6a'),_0xbb03c4[_0x0805('0x5f')]))&&_0x5193c9){_0x24c151=path[_0x0805('0x6b')](config['root'],_0x0805('0x6a'),_0xbb03c4[_0x0805('0x5f')]);}}return _0x4a5ca4[_0x0805('0x6c')](_0x24c151);}})[_0x0805('0x1a')](handleError(_0x4a5ca4,null));};exports[_0x0805('0x6d')]=function(_0x498aaa,_0x1fa22e){var _0xe33e23=path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0x6e'));var _0x4dbcf0={'where':{'id':_0x498aaa[_0x0805('0x47')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0805('0x2f')][_0x0805('0x4a')](_0x4dbcf0)[_0x0805('0x25')](handleEntityNotFound(_0x1fa22e,null))[_0x0805('0x25')](function(_0x905a4e){if(_0x905a4e){if(!_[_0x0805('0x6f')](_0x905a4e[_0x0805('0x70')])){if(fs['existsSync'](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0x71'),_0x905a4e[_0x0805('0x70')]))){_0xe33e23=path[_0x0805('0x6b')](config[_0x0805('0x67')],'server/files/images/avatars/',_0x905a4e['agentAvatar']);}}return _0x1fa22e[_0x0805('0x6c')](_0xe33e23);}})[_0x0805('0x1a')](handleError(_0x1fa22e,null));};exports['getCustomerAvatar']=function(_0x51a30d,_0x5c4ead){var _0x28c5da=path[_0x0805('0x6b')](config[_0x0805('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x20f6c5={'where':{'id':_0x51a30d['params']['id']},'attributes':['id',_0x0805('0x62'),_0x0805('0x72')],'raw':!![]};return db[_0x0805('0x2f')][_0x0805('0x4a')](_0x20f6c5)[_0x0805('0x25')](handleEntityNotFound(_0x5c4ead,null))[_0x0805('0x25')](function(_0xa8a160){if(_0xa8a160){if(!_[_0x0805('0x6f')](_0xa8a160['customerAvatar'])){if(fs['existsSync'](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0x71'),_0xa8a160[_0x0805('0x62')]))&&_0xa8a160['showCustomerAvatar']){_0x28c5da=path['join'](config[_0x0805('0x67')],_0x0805('0x71'),_0xa8a160[_0x0805('0x62')]);}}return _0x5c4ead[_0x0805('0x6c')](_0x28c5da);}})[_0x0805('0x1a')](handleError(_0x5c4ead,null));};exports[_0x0805('0x73')]=function(_0x176a73,_0x41b354){var _0x298b48=path['join'](config['root'],_0x0805('0x74'));var _0x2e5e26={'where':{'id':_0x176a73['params']['id']},'attributes':['id',_0x0805('0x65')],'raw':!![]};return db[_0x0805('0x2f')]['find'](_0x2e5e26)['then'](handleEntityNotFound(_0x41b354,null))[_0x0805('0x25')](function(_0x17d2da){if(_0x17d2da){if(!_['isNil'](_0x17d2da[_0x0805('0x65')])){if(fs['existsSync'](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0x71'),_0x17d2da[_0x0805('0x65')]))){_0x298b48=path[_0x0805('0x6b')](config['root'],'server/files/images/avatars/',_0x17d2da['systemAvatar']);}}return _0x41b354[_0x0805('0x6c')](_0x298b48);}})['catch'](handleError(_0x41b354,null));};exports['notify']=function(_0x26daf2,_0xb46681){var _0x264359=require('user-agent-parser');var _0x53921a=new _0x264359();var _0x4c657e=_0x53921a['setUA'](_0x26daf2[_0x0805('0x75')][_0x0805('0x76')])['getResult']();var _0x386e64={'body':_0x26daf2[_0x0805('0x4c')],'channel':'chat'};var _0x4b87a7=[];var _0x5d1bb9=[];var _0x2b8810={};var _0x3b45e2=![];return db[_0x0805('0x77')][_0x0805('0x51')]()[_0x0805('0x25')](function(_0xd2d725){if(!_0xd2d725){throw new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0x7a'));}_0x4b87a7=_[_0x0805('0x7b')](_[_0x0805('0x48')](_0xd2d725),[_0x0805('0x7c'),'updatedAt']);_0x5d1bb9=_[_0x0805('0x7b')](_[_0x0805('0x48')](_0xd2d725),['createdAt',_0x0805('0x7d'),'CompanyId','ListId']);if(_0x26daf2[_0x0805('0x4c')]['id']){delete _0x26daf2[_0x0805('0x4c')]['id'];}if(_['isNil'](_0x26daf2[_0x0805('0x4c')][_0x0805('0x7e')])){throw new db[(_0x0805('0x78'))][(_0x0805('0x79'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x26daf2['body'][_0x0805('0x4c')])||_0x26daf2[_0x0805('0x4c')][_0x0805('0x4c')]===''){throw new db['Sequelize']['ValidationError'](_0x0805('0x7f'));}if(_[_0x0805('0x6f')](_0x26daf2[_0x0805('0x4c')][_0x0805('0x80')])){throw new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0x81')+_0x5d1bb9);}if(!_[_0x0805('0x82')](_0x5d1bb9,_0x26daf2[_0x0805('0x4c')][_0x0805('0x80')])){throw new db['Sequelize'][(_0x0805('0x79'))](_0x0805('0x83')+_0x5d1bb9);}_0x2b8810[_0x26daf2[_0x0805('0x4c')][_0x0805('0x80')]]=_0x26daf2[_0x0805('0x4c')][_0x0805('0x7e')];})[_0x0805('0x25')](function(){return db['ChatWebsite'][_0x0805('0x4a')]({'where':{'id':_0x26daf2[_0x0805('0x47')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0805('0x77')],'as':'Contacts','where':_0x2b8810,'limit':0x1,'order':[[_0x0805('0x7d'),'DESC']]}]},{'model':db[_0x0805('0x84')],'as':_0x0805('0x85')}]});})[_0x0805('0x25')](handleEntityNotFound(_0xb46681,null))['then'](function(_0x565b1d){if(_0x565b1d&&_0x565b1d[_0x0805('0x86')]){_0x386e64[_0x0805('0x87')]=_0x565b1d;_0x386e64[_0x0805('0x88')]=_0x565b1d[_0x0805('0x85')];_0x386e64[_0x0805('0x89')]=_0x565b1d[_0x0805('0x86')];_0x386e64[_0x0805('0x88')]=_[_0x0805('0x8a')](_0x386e64[_0x0805('0x88')],[_0x0805('0x8b')],[_0x0805('0x8c')]);if(_0x386e64[_0x0805('0x87')][_0x0805('0x85')]){delete _0x386e64['account'][_0x0805('0x85')];}if(_0x386e64[_0x0805('0x87')][_0x0805('0x86')]&&_0x386e64[_0x0805('0x87')][_0x0805('0x86')][_0x0805('0x8d')]['length']){return _0x386e64[_0x0805('0x87')][_0x0805('0x86')]['Contacts'][0x0];}var _0x4cf847=_[_0x0805('0x8e')](_0x26daf2[_0x0805('0x4c')],{'firstName':_0x26daf2[_0x0805('0x4c')][_0x0805('0x7e')],'ListId':_0x565b1d[_0x0805('0x8f')]});_0x4cf847[_0x26daf2[_0x0805('0x4c')]['mapKey']]=_0x26daf2[_0x0805('0x4c')]['from'];return db[_0x0805('0x77')]['create'](_0x4cf847,{'fields':_0x4b87a7,'raw':!![]});}})[_0x0805('0x25')](handleEntityNotFound(_0xb46681,null))[_0x0805('0x25')](function(_0x31aa47){_0x386e64[_0x0805('0x90')]=_0x31aa47;var _0x2d7839=_0x26daf2[_0x0805('0x4c')][_0x0805('0x91')];if(_0x26daf2['headers'][_0x0805('0x92')]){_0x2d7839=_0x26daf2[_0x0805('0x75')][_0x0805('0x92')];}else if(_0x26daf2[_0x0805('0x75')][_0x0805('0x93')]){_0x2d7839=_[_0x0805('0x94')](_0x26daf2[_0x0805('0x75')]['x-forwarded-for']['split'](','));}if(_0x31aa47){var _0x6a0345={'ContactId':_0x31aa47['id'],'ChatWebsiteId':_0x26daf2['params']['id'],'from':(_0x31aa47[_0x0805('0x95')]||'')+'\x20'+(_0x31aa47[_0x0805('0x96')]||''),'customerIp':_0x2d7839,'customerPort':_0x26daf2['headers'][_0x0805('0x97')]?_0x26daf2[_0x0805('0x75')][_0x0805('0x97')]:null,'referer':_0x26daf2[_0x0805('0x4c')][_0x0805('0x98')],'browserName':_0x4c657e[_0x0805('0x99')]['name']&&_0x4c657e[_0x0805('0x99')][_0x0805('0x9a')]?util[_0x0805('0x9b')](_0x0805('0x9c'),_0x4c657e[_0x0805('0x99')]['name'],_0x4c657e['browser'][_0x0805('0x9a')]):_0x0805('0x9d'),'browserVersion':_0x4c657e[_0x0805('0x99')][_0x0805('0x9a')]||_0x0805('0x9d'),'osName':util[_0x0805('0x9b')](_0x0805('0x9c'),_0x4c657e['os'][_0x0805('0x29')],_0x4c657e['os'][_0x0805('0x9a')]),'osVersion':_0x4c657e['os']['version'],'deviceModel':_0x4c657e[_0x0805('0x9e')][_0x0805('0x32')]&&_0x4c657e['device']['vendor']?util[_0x0805('0x9b')](_0x0805('0x9f'),_0x4c657e['device'][_0x0805('0x32')],_0x4c657e[_0x0805('0x9e')][_0x0805('0xa0')],_0x4c657e[_0x0805('0x9e')][_0x0805('0x40')]):null,'deviceVendor':_0x4c657e[_0x0805('0x9e')][_0x0805('0xa0')],'deviceType':_0x4c657e[_0x0805('0x9e')][_0x0805('0x40')],'formData':JSON[_0x0805('0x15')](_0x26daf2[_0x0805('0x4c')])};var _0x386aaa={'ChatWebsiteId':_0x26daf2[_0x0805('0x47')]['id'],'closed':![]};if(_0x26daf2[_0x0805('0x4c')][_0x0805('0xa1')]){_0x386aaa[_0x0805('0xa1')]=_0x26daf2[_0x0805('0x4c')][_0x0805('0xa1')];return db[_0x0805('0xa2')][_0x0805('0x4a')]({'where':_0x386aaa})[_0x0805('0x25')](function(_0x20d4ba){if(_0x20d4ba){return[_0x20d4ba,![]];}_0x6a0345[_0x0805('0xa1')]=_0x26daf2[_0x0805('0x4c')][_0x0805('0xa1')];_0x6a0345[_0x0805('0xa3')]=_0x26daf2[_0x0805('0x4c')][_0x0805('0xa3')];return db[_0x0805('0xa2')][_0x0805('0x4b')](_0x6a0345)[_0x0805('0x25')](function(_0x1a45a4){return[_0x1a45a4,!![]];});});}_0x386aaa[_0x0805('0xa4')]=_0x31aa47['id'];if(_0x26daf2[_0x0805('0x4c')][_0x0805('0xa5')]&&_0x26daf2['body'][_0x0805('0xa5')]['id']){_0x386aaa['id']=_0x26daf2['body'][_0x0805('0xa5')]['id'];return db[_0x0805('0xa2')][_0x0805('0x4a')]({'where':_0x386aaa})[_0x0805('0x25')](function(_0x579496){if(_0x579496){return[_0x579496,![]];}return db[_0x0805('0xa2')]['create'](_0x6a0345)['then'](function(_0x3f3c1e){return[_0x3f3c1e,!![]];});});}return db[_0x0805('0xa2')][_0x0805('0x4b')](_0x6a0345)[_0x0805('0x25')](function(_0x196430){return[_0x196430,!![]];});}})[_0x0805('0xa6')](function(_0x34eeb3,_0x3f91da){if(_0x34eeb3){_0x3b45e2=_0x3f91da;if(!_0x3f91da){var _0x55ecf8={'from':(_0x386e64[_0x0805('0x90')]['firstName']||'')+'\x20'+(_0x386e64[_0x0805('0x90')]['lastName']||'')};if(_0x26daf2[_0x0805('0x4c')]['threadId']&&_0x26daf2[_0x0805('0x4c')][_0x0805('0xa7')]&&_0x26daf2[_0x0805('0x4c')][_0x0805('0xa1')]!=_0x26daf2['body'][_0x0805('0xa7')]){_0x55ecf8[_0x0805('0xa1')]=_0x26daf2[_0x0805('0x4c')][_0x0805('0xa7')];}return _0x34eeb3[_0x0805('0x23')](_0x55ecf8);}else{return _0x34eeb3;}}})[_0x0805('0x25')](function(_0x18cccc){_0x386e64[_0x0805('0xa5')]=_0x18cccc[_0x0805('0x26')]({'plain':!![]});_0x386e64[_0x0805('0xa5')][_0x0805('0xa8')]=_0x3b45e2;if(_0x386e64[_0x0805('0xa5')][_0x0805('0xa8')]){if(_0x386e64[_0x0805('0x87')]['autoclose']){_0x386e64[_0x0805('0x88')][_0x0805('0xa9')]({'id':0x0,'priority':_0x386e64[_0x0805('0x88')][_0x0805('0x36')]+0x1,'app':_0x0805('0xaa'),'appdata':_0x0805('0xab'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x0805('0x4b')]({'body':_0x26daf2[_0x0805('0x4c')][_0x0805('0x4c')],'ChatWebsiteId':_0x26daf2[_0x0805('0x47')]['id'],'ChatInteractionId':_0x18cccc['id'],'direction':'in','ContactId':_0x386e64['contact']['id'],'AttachmentId':_0x26daf2[_0x0805('0x4c')][_0x0805('0xac')]});})[_0x0805('0x25')](function(_0x360810){_0x386e64['message']=_0x360810;if(_0x386e64[_0x0805('0xa5')][_0x0805('0xad')]){return db['User'][_0x0805('0x4a')]({'attributes':['id',_0x0805('0x29')],'where':{'id':_0x386e64[_0x0805('0xa5')][_0x0805('0xad')]}})[_0x0805('0x25')](function(_0x11a773){if(_0x11a773){_0x386e64[_0x0805('0x88')][_0x0805('0xae')]({'id':0x0,'priority':0x0,'app':_0x0805('0xaf'),'appdata':_0x11a773[_0x0805('0x29')]+','+(_0x386e64[_0x0805('0x87')][_0x0805('0xb0')]||0xa),'interval':_0x0805('0xb1')});_0x386e64[_0x0805('0xb2')]=!![];}return respondWithRpcPromise(_0x0805('0xb3'),'startRouting',_0x386e64);});}return respondWithRpcPromise(_0x0805('0xb3'),_0x0805('0xb4'),_0x386e64);})[_0x0805('0x25')](function(_0x20167e){respondWithRpcPromise(_0x0805('0xb5'),'EventManager',{'event':'notify','message':_0x20167e},client9002);return _0x20167e;})[_0x0805('0x25')](respondWithResult(_0xb46681,null))[_0x0805('0x1a')](handleError(_0xb46681,null));};exports[_0x0805('0xb6')]=function(_0x329ecc,_0xd60f85){var _0x1ed87a,_0x34f830,_0x283490;var _0x1f9c07=[];var _0x23a1a5={};var _0x7f2651=_0x329ecc['files']||[];var _0x80ef78=[];var _0x5a670c;return db['CmContact']['describe']()[_0x0805('0x25')](function(_0xf466dd){if(!_0xf466dd){throw new db['Sequelize'][(_0x0805('0x79'))](_0x0805('0x7a'));}_0x1f9c07=_[_0x0805('0x7b')](_[_0x0805('0x48')](_0xf466dd),['createdAt',_0x0805('0x7d'),_0x0805('0xb7'),_0x0805('0x8f')]);if(_0x329ecc[_0x0805('0x4c')]['id']){delete _0x329ecc[_0x0805('0x4c')]['id'];}if(_[_0x0805('0x6f')](_0x329ecc[_0x0805('0x4c')][_0x0805('0x7e')])){throw _0xd60f85[_0x0805('0x1c')](0x1f4)[_0x0805('0x2a')](new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0xb8')));}if(_[_0x0805('0x6f')](_0x329ecc['body'][_0x0805('0x4c')])||_0x329ecc[_0x0805('0x4c')]['body']===''){throw _0xd60f85['status'](0x1f4)['send'](new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0x7f')));}if(_[_0x0805('0x6f')](_0x329ecc[_0x0805('0x4c')][_0x0805('0xb9')])){throw _0xd60f85[_0x0805('0x1c')](0x1f4)[_0x0805('0x2a')](new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0xba')+_0x1f9c07));}if(!_[_0x0805('0x82')](_0x1f9c07,_0x329ecc[_0x0805('0x4c')][_0x0805('0xb9')])){throw _0xd60f85['status'](0x1f4)[_0x0805('0x2a')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f9c07));}_0x23a1a5[_0x329ecc[_0x0805('0x4c')][_0x0805('0xb9')]]=_0x329ecc[_0x0805('0x4c')][_0x0805('0x7e')];})[_0x0805('0x25')](function(){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x329ecc[_0x0805('0x47')]['id']},'include':[{'model':db[_0x0805('0xbb')],'as':_0x0805('0x86')},{'model':db[_0x0805('0xbc')],'as':'MailAccount'}]});})[_0x0805('0x25')](handleEntityNotFound(_0xd60f85,null))[_0x0805('0x25')](function(_0x294246){if(_0x294246&&_0x294246[_0x0805('0x86')]){_0x34f830=_0x294246;var _0x4cdd48=_[_0x0805('0x8e')](_0x329ecc[_0x0805('0x4c')],{'firstName':_0x329ecc[_0x0805('0x4c')][_0x0805('0x7e')],'phone':_0x329ecc['body'][_0x0805('0x7e')],'ListId':_0x294246[_0x0805('0x8f')]});_0x4cdd48[_0x329ecc[_0x0805('0x4c')][_0x0805('0xb9')]]=_0x329ecc['body'][_0x0805('0x7e')];return db[_0x0805('0x77')][_0x0805('0xbd')]({'where':_0x23a1a5,'defaults':_0x4cdd48});}})[_0x0805('0xa6')](function(_0x16a461){if(_0x16a461){_0x283490=_0x16a461;var _0x55febf=fs[_0x0805('0xbe')](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0xbf')),_0x0805('0xc0'));var _0x1cb2fc=ejs[_0x0805('0xc1')](_0x55febf,{'body':_[_0x0805('0xc2')](_0x329ecc[_0x0805('0x4c')][_0x0805('0x4c')]),'bodyTitle':_0x34f830[_0x0805('0xc3')]});return db[_0x0805('0xc4')]['create']({'body':_0x1cb2fc,'plainBody':htmlToText[_0x0805('0xc5')](_0x1cb2fc),'ContactId':_0x16a461['id'],'ChatWebsiteId':_0x34f830['id']});}})[_0x0805('0x25')](function(_0x399ea0){_0x5a670c=_0x399ea0;if(_0x7f2651[_0x0805('0x36')]){var _0x4974af=_0x7f2651['map'](function(_0xca89ca){return{'name':_0xca89ca['originalname'],'basename':_0xca89ca[_0x0805('0x63')],'type':_0xca89ca[_0x0805('0xc6')],'ChatOfflineMessageId':_0x399ea0['id']};});_0x80ef78=_0x4974af[_0x0805('0x2e')](_0x390009=>{var _0x469f85={'filename':_0x390009['name'],'path':path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0xc7'),_0x0805('0xc8'),_0x0805('0xc9'),_0x0805('0xca'),_0x390009['basename'])};return _0x469f85;});if(!_0x34f830['openNewInteraction']){return db[_0x0805('0xcb')]['transaction'](function(_0x5c1113){return db['Attachment'][_0x0805('0xcc')](_0x4974af,{'transaction':_0x5c1113});});}}})['then'](function(){if(_0x5a670c){_0x1ed87a=_0x5a670c;return db[_0x0805('0xbc')][_0x0805('0x5c')]({'where':{'service':!![]},'include':[{'model':db[_0x0805('0xcd')],'as':_0x0805('0xce'),'raw':!![],'include':[{'model':db[_0x0805('0xcf')],'as':_0x0805('0xcf'),'raw':!![]}]}]});}})[_0x0805('0x25')](function(_0x891d8a){if(_0x891d8a&&_0x891d8a[_0x0805('0xce')]&&_0x34f830[_0x0805('0xd0')]&&_0x34f830['forwardOfflineAddress']){var _0x2ac8b7=_0x891d8a[_0x0805('0xd1')]();return respondWithRpcPromise(_0x0805('0xd2'),'sendMail',{'account':_0x2ac8b7,'message':{'from':util['format'](_0x0805('0xd3'),_0x891d8a[_0x0805('0x29')],_0x891d8a[_0x0805('0xd4')]||_0x891d8a[_0x0805('0xce')][_0x0805('0x4f')]),'to':_0x34f830['forwardOfflineAddress'],'subject':_0x34f830[_0x0805('0xd5')],'html':_0x1ed87a[_0x0805('0x4c')],'attachments':_0x80ef78}},client9003)['then'](function(){return _0x1ed87a;})[_0x0805('0x1a')](function(_0x109063){logger['error'](_0x109063);});}})['then'](function(){if(_0x34f830&&_0x34f830[_0x0805('0xd6')]&&_0x34f830['MailAccountId']){var _0x3e9ab4=[];if(_0x7f2651[_0x0805('0x36')]){_0x3e9ab4=_0x7f2651[_0x0805('0x2e')](function(_0x2f0ec1){return{'name':_0x2f0ec1[_0x0805('0xd7')],'basename':_0x2f0ec1[_0x0805('0x63')],'type':_0x2f0ec1[_0x0805('0xc6')],'ChatOfflineMessageId':_0x5a670c['id']};});}var _0xd0050b;if(!_['isNil'](_0x34f830['subjectOffline'])){var _0x404efa=_[_0x0805('0x2e')](_0x329ecc['body'],function(_0x25b37b){return _0x25b37b;});var _0x424d85=_[_0x0805('0xd8')](_0x404efa)[0x0];var _0x1f1781=_['mapValues'](_0x424d85,function(_0x52d567){return _0x52d567;});_0xd0050b=_0x1f1781[0x1][_0x34f830['subjectOffline']];}var _0x383591={'from':_0x283490[_0x0805('0xd4')],'firstName':_0x283490['firstName'],'lastName':_0x283490['lastName'],'mapKey':'email','message':{'from':_0x283490[_0x0805('0xd4')],'to':_0x34f830[_0x0805('0xbc')]['email'],'cc':'','subject':_[_0x0805('0x6f')](_0xd0050b)?_0x34f830[_0x0805('0xd5')]:_0xd0050b,'messageId':'','sentAt':new Date(),'attach':_0x3e9ab4[_0x0805('0x36')],'attachments':_0x3e9ab4,'originChannel':'Chat','ChatWebsiteId':_0x34f830['id'],'ChatOfflineMessageId':_0x1ed87a['id'],'originTo':_0x34f830[_0x0805('0xbc')][_0x0805('0xd4')]},'body':_0x1ed87a[_0x0805('0x4c')]};var _0x32f40a={'account':{'id':_0x34f830[_0x0805('0xd9')]},'body':_0x383591,'log':_0x0805('0xda')};return respondWithRpcPromise(_0x0805('0xda'),'notifyMail',_0x32f40a,client9001)[_0x0805('0x25')](function(){return _0x1ed87a;})[_0x0805('0x1a')](function(_0x2d1f26){logger[_0x0805('0x16')](_0x2d1f26);});}return;})[_0x0805('0x25')](function(){if(_0x1ed87a){return _0x1ed87a;}})[_0x0805('0x25')](respondWithResult(_0xd60f85,null))[_0x0805('0x1a')](function(_0xb07324){logger['error'](_0x0805('0x1a'),_0xb07324);for(var _0x471c8f of _0x7f2651){var _0x5ca234=path[_0x0805('0x6b')](config['root'],_0x0805('0xc7'),_0x0805('0xc8'),'attachments',_0x0805('0xca'),_0x471c8f[_0x0805('0x63')]);fs_extra[_0x0805('0xdb')](_0x5ca234)[_0x0805('0x1a')](function(_0x51b5dc){logger[_0x0805('0x16')](_0x0805('0xdc'),_0x5ca234,_0x51b5dc);});}});};exports[_0x0805('0xdd')]=function(_0x2a154d,_0x3c51f0){return db[_0x0805('0xa2')][_0x0805('0x4a')]({'where':{'id':_0x2a154d['params']['id']}})['then'](handleEntityNotFound(_0x3c51f0,null))['then'](function(_0x4b1412){if(_0x4b1412){return _0x4b1412[_0x0805('0xdd')](_0x2a154d[_0x0805('0x4c')][_0x0805('0x58')],_[_0x0805('0xde')](_0x2a154d[_0x0805('0x4c')],[_0x0805('0x58'),'id'])||{});}})['then'](respondWithResult(_0x3c51f0,null))[_0x0805('0x1a')](handleError(_0x3c51f0,null));};exports[_0x0805('0xdf')]=function(_0x1601fd,_0x53ef11){var _0x332851={'raw':![],'where':{}};var _0x2a8618={};var _0x953ff7={'count':0x0,'rows':[]};return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x1601fd['params']['id']}})['then'](handleEntityNotFound(_0x53ef11,null))['then'](function(_0x4ba840){if(_0x4ba840){_0x2a8618['model']=_[_0x0805('0x48')](db[_0x0805('0xa2')][_0x0805('0x30')]);_0x2a8618[_0x0805('0x33')]=_[_0x0805('0x48')](_0x1601fd[_0x0805('0x33')]);_0x2a8618[_0x0805('0x3c')]=_[_0x0805('0x49')](_0x2a8618['model'],_0x2a8618['query']);_0x332851[_0x0805('0x35')]=_[_0x0805('0x49')](_0x2a8618[_0x0805('0x32')],qs[_0x0805('0x34')](_0x1601fd[_0x0805('0x33')]['fields']));_0x332851[_0x0805('0x35')]=_0x332851[_0x0805('0x35')][_0x0805('0x36')]?_0x332851['attributes']:_0x2a8618[_0x0805('0x32')];if(!_0x1601fd[_0x0805('0x33')][_0x0805('0x37')](_0x0805('0x56'))){_0x332851[_0x0805('0x38')]=qs[_0x0805('0x38')](_0x1601fd[_0x0805('0x33')]['limit']);_0x332851[_0x0805('0x1f')]=qs[_0x0805('0x1f')](_0x1601fd[_0x0805('0x33')][_0x0805('0x1f')]);}_0x332851[_0x0805('0x39')]=qs['sort'](_0x1601fd[_0x0805('0x33')][_0x0805('0x3a')]);_0x332851[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x1601fd[_0x0805('0x33')],_0x2a8618[_0x0805('0x3c')]));_0x332851[_0x0805('0x3b')]['ChatWebsiteId']=_0x4ba840['id'];if(_0x1601fd['query'][_0x0805('0x3e')]){_0x332851[_0x0805('0x3b')]=_['merge'](_0x332851['where'],{'$or':_[_0x0805('0x2e')](_0x332851[_0x0805('0x35')],function(_0xbf4eeb){var _0xd3bbb7={};_0xd3bbb7[_0xbf4eeb]={'$like':'%'+_0x1601fd[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0xd3bbb7;})});}_0x332851=_[_0x0805('0x3f')]({},_0x332851,_0x1601fd[_0x0805('0x42')]);return db[_0x0805('0xa2')][_0x0805('0x21')]({'where':_0x332851[_0x0805('0x3b')]})[_0x0805('0x25')](function(_0x8d7cc8){_0x953ff7[_0x0805('0x21')]=_0x8d7cc8;if(_0x1601fd[_0x0805('0x33')]['includeAll']){_0x332851[_0x0805('0x44')]=[{'model':db['CmContact'],'as':_0x0805('0xe0'),'required':![]},{'model':db[_0x0805('0xe1')],'as':_0x0805('0xe2'),'attributes':[_0x0805('0x29'),'fullname',_0x0805('0xe3')],'required':![]},{'model':db['Tag'],'as':_0x0805('0xe4'),'attributes':['id',_0x0805('0x29'),_0x0805('0xe5')],'where':_0x1601fd[_0x0805('0x33')]['tag']?{'id':_0x1601fd['query']['tag']}:undefined,'required':_0x1601fd[_0x0805('0x33')][_0x0805('0xe6')]?!![]:![]}];}return db['ChatInteraction'][_0x0805('0xe7')](_0x332851);})[_0x0805('0x25')](function(_0x3f2bb3){_0x953ff7[_0x0805('0x45')]=_0x3f2bb3;return _0x953ff7;});}})['then'](respondWithFilteredResult(_0x53ef11,_0x332851))['catch'](handleError(_0x53ef11,null));};function iftimePromise(_0x382d94,_0x8c6135){return respondWithRpcPromise(_0x0805('0xe8'),_0x0805('0xe9'),{'command':_0x8c6135[_0x0805('0xea')]?util['format'](_0x0805('0xeb'),_0x382d94[_0x0805('0xec')],_0x8c6135[_0x0805('0xea')]):util[_0x0805('0x9b')]('iftime\x20%s',_0x382d94['interval'])},client9002)[_0x0805('0x25')](function(_0x73af60){var _0x484a4a=_0x73af60&&_0x73af60[_0x0805('0xed')](_0x0805('0xee'))>=0x0?!![]:![];logger[_0x0805('0xef')](_0x0805('0xf0'),_0x8c6135['id'],_0x382d94['id'],_0x382d94[_0x0805('0xec')],_0x484a4a?_0x0805('0xf1'):_0x0805('0xf2'),_0x8c6135[_0x0805('0xea')]?_0x8c6135[_0x0805('0xea')]:_0x0805('0xf3'));return _0x484a4a;})[_0x0805('0x1a')](function(_0x1c4676){logger[_0x0805('0x16')](_0x0805('0xf0'),_0x8c6135['id'],_0x382d94['id'],_0x382d94[_0x0805('0xec')],util[_0x0805('0xf4')](_0x1c4676,{'showHidden':![],'depth':null}),_0x8c6135[_0x0805('0xea')]?_0x8c6135['timezone']:_0x0805('0xf3'));return![];});}exports[_0x0805('0xe9')]=function(_0x9e0285,_0x3df48b){var _0x2ac708=0x0;var _0x2b16de=0x0;var _0x19a021=![];var _0xdeafa1;var _0x31c4a4;return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x9e0285[_0x0805('0x47')]['id']},'include':[{'model':db[_0x0805('0xf5')],'as':_0x0805('0xf5'),'include':[{'model':db['Interval'],'as':_0x0805('0xf6'),'attributes':['id',_0x0805('0xec')],'raw':!![]}]}]})[_0x0805('0x25')](handleEntityNotFound(_0x3df48b,null))[_0x0805('0x25')](function(_0x464885){if(_0x464885){_0xdeafa1=_0x464885;return _0x464885[_0x0805('0xf7')]({'raw':!![]});}})[_0x0805('0x25')](function(_0x58d758){if(_0xdeafa1){if(_0x58d758){_0x31c4a4=_0x58d758;}}return require('../../config/license/util')[_0x0805('0xf8')]();})['then'](function(_0x58027f){if(_0x58027f){_0x2b16de=_0x58027f['virtual'];_0x19a021=_0x58027f['custom'];}})[_0x0805('0x25')](function(){return db[_0x0805('0xa2')][_0x0805('0x21')]({'where':{'closed':![]}});})[_0x0805('0x25')](function(_0x4fcdb4){_0x2ac708=_0x4fcdb4;if(_0x2b16de&&_0x4fcdb4>_0x2b16de){return db['License'][_0x0805('0x5c')]({'where':{'id':0x1}})[_0x0805('0x25')](function(_0x3497fc){if(_0x3497fc){_0x3497fc[_0x0805('0xf9')](_0x0805('0xfa'));}});}})['then'](function(){if(_0xdeafa1[_0x0805('0xf5')]&&_0xdeafa1[_0x0805('0xf5')][_0x0805('0xf6')]){var _0x129f0f=[];for(var _0x3fe908=0x0;_0x3fe908<_0xdeafa1[_0x0805('0xf5')][_0x0805('0xf6')]['length'];_0x3fe908++){var _0x11115e=_0xdeafa1['Interval'][_0x0805('0xf6')][_0x3fe908][_0x0805('0x26')]({'plain':!![]});_0x129f0f[_0x0805('0xa9')](iftimePromise(_0x11115e,_0xdeafa1));}return BPromise[_0x0805('0xfb')](_0x129f0f)[_0x0805('0x25')](function(_0x1d0b1f){return _[_0x0805('0xfc')](_0x1d0b1f);});}else{return!![];}})['then'](function(_0x686bee){var _0x36a7f8=fs['readFileSync'](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0xfd')),_0x0805('0xc0'));var _0x23e1b3={'remote':_0xdeafa1[_0x0805('0xfe')],'query':querystring[_0x0805('0x15')](_[_0x0805('0x3f')](_0xdeafa1[_0x0805('0x26')]({'plain':!![]}),{'customerIp':_0x9e0285[_0x0805('0x75')]['x-forwarded-for']||_0x9e0285[_0x0805('0x75')][_0x0805('0xff')]||_0x9e0285[_0x0805('0x100')]['remoteAddress']||_0x9e0285['ip'],'referer':_0x9e0285[_0x0805('0x75')]['referer'],'openedInteractions':_0x2ac708,'maxInteractions':_0x2b16de,'virtual':_0x19a021[_0x0805('0x101')],'online':_0x686bee,'custom':_0x19a021}))[_0x0805('0x102')](/'/g,'\x5c\x27')};_0x3df48b['send'](ejs[_0x0805('0xc1')](Mustache['render'](_0x36a7f8,_0x23e1b3),{'proactiveActions':_0x31c4a4,'alignment':_0xdeafa1[_0x0805('0x103')],'verticalAlignment':_0xdeafa1[_0x0805('0x104')],'div_color':_0xdeafa1[_0x0805('0xe5')],'labelText':_0xdeafa1[_0x0805('0x105')],'text_color':_0xdeafa1[_0x0805('0x106')],'text_button_color':_0xdeafa1[_0x0805('0x107')],'button_color':_0xdeafa1[_0x0805('0x108')],'background_color':_0xdeafa1['backgroundColor'],'hideWhenOffline':_0xdeafa1[_0x0805('0x109')],'interval':_0xdeafa1['IntervalId']}));})[_0x0805('0x1a')](handleError(_0x3df48b,null));};exports[_0x0805('0x10a')]=function(_0x10d28c,_0x232d17){var _0x3a280c=_0x10d28c[_0x0805('0x47')]['id'];var _0x488896=_0x10d28c[_0x0805('0x4c')];var _0x41c135=0xc8;var _0x839d9=null;return db[_0x0805('0xcb')][_0x0805('0x10b')]({'isolationLevel':db[_0x0805('0xcb')][_0x0805('0x10c')][_0x0805('0x10d')]['READ_COMMITTED']},function(_0x2bc99b){return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x3a280c},'transaction':_0x2bc99b})['then'](function(_0x430fa9){if(_0x430fa9){return db['ChatApplication'][_0x0805('0x24')]({'where':{'ChatWebsiteId':_0x3a280c},'transaction':_0x2bc99b})[_0x0805('0x25')](function(){var _0x871e12=_[_0x0805('0x2e')](_0x488896,function(_0x3dfce5){_0x3dfce5['ChatWebsiteId']=_0x3a280c;return _0x3dfce5;});return db[_0x0805('0x84')][_0x0805('0xcc')](_0x871e12,{'transaction':_0x2bc99b});});}else{_0x41c135=0x194;_0x839d9=[];}});})[_0x0805('0x25')](function(){if(_0x41c135!==0x194){return db[_0x0805('0x84')][_0x0805('0x10e')]({'where':{'ChatWebsiteId':_0x3a280c},'order':'priority'})[_0x0805('0x25')](function(_0x117823){_0x839d9=_0x117823;});}})[_0x0805('0x1a')](function(_0x2101a8){_0x41c135=0x1f4;logger[_0x0805('0x16')](_0x2101a8[_0x0805('0x10f')]);if(_0x2101a8[_0x0805('0x29')]){delete _0x2101a8[_0x0805('0x29')];}_0x839d9=_0x2101a8;})[_0x0805('0x110')](function(){if(_0x839d9===null){_0x232d17['sendStatus'](_0x41c135);}else{if(_0x41c135===0x1f4){_0x232d17[_0x0805('0x1c')](_0x41c135)[_0x0805('0x2a')](_0x839d9);}else{_0x232d17[_0x0805('0x1c')](_0x41c135)[_0x0805('0x1e')](_0x839d9);}}});};exports[_0x0805('0x111')]=function(_0x16afff,_0x4a39f0){var _0x1f2227={};var _0x404ae3={};var _0x1cdbb3;var _0xf43f55;return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x16afff[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x4a39f0,null))[_0x0805('0x25')](function(_0x151440){if(_0x151440){_0x1cdbb3=_0x151440;_0x404ae3[_0x0805('0x32')]=_[_0x0805('0x48')](db[_0x0805('0x84')][_0x0805('0x30')]);_0x404ae3[_0x0805('0x33')]=_[_0x0805('0x48')](_0x16afff[_0x0805('0x33')]);_0x404ae3['filters']=_[_0x0805('0x49')](_0x404ae3[_0x0805('0x32')],_0x404ae3[_0x0805('0x33')]);_0x1f2227[_0x0805('0x35')]=_['intersection'](_0x404ae3['model'],qs['fields'](_0x16afff['query'][_0x0805('0x34')]));_0x1f2227[_0x0805('0x35')]=_0x1f2227[_0x0805('0x35')][_0x0805('0x36')]?_0x1f2227[_0x0805('0x35')]:_0x404ae3['model'];_0x1f2227[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x16afff[_0x0805('0x33')][_0x0805('0x3a')]);_0x1f2227[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x16afff[_0x0805('0x33')],_0x404ae3[_0x0805('0x3c')]));if(_0x16afff[_0x0805('0x33')][_0x0805('0x3e')]){_0x1f2227[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x1f2227[_0x0805('0x3b')],{'$or':_['map'](_0x1f2227['attributes'],function(_0x142d9c){var _0x1f2379={};_0x1f2379[_0x142d9c]={'$like':'%'+_0x16afff[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0x1f2379;})});}_0x1f2227=_[_0x0805('0x3f')]({},_0x1f2227,_0x16afff[_0x0805('0x42')]);return _0x1cdbb3[_0x0805('0x111')](_0x1f2227);}})['then'](function(_0x1c7b06){if(_0x1c7b06){_0xf43f55=_0x1c7b06[_0x0805('0x36')];if(!_0x16afff[_0x0805('0x33')][_0x0805('0x37')]('nolimit')){_0x1f2227[_0x0805('0x38')]=qs['limit'](_0x16afff[_0x0805('0x33')][_0x0805('0x38')]);_0x1f2227[_0x0805('0x1f')]=qs['offset'](_0x16afff['query'][_0x0805('0x1f')]);}return _0x1cdbb3['getApplications'](_0x1f2227);}})[_0x0805('0x25')](function(_0x2f6876){if(_0x2f6876){return _0x2f6876?{'count':_0xf43f55,'rows':_0x2f6876}:null;}})['then'](respondWithResult(_0x4a39f0,null))['catch'](handleError(_0x4a39f0,null));};exports[_0x0805('0x112')]=function(_0x229243,_0x3c1e72){return db[_0x0805('0x113')][_0x0805('0x4a')]({'where':{'id':_0x229243[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x3c1e72,null))['then'](function(_0x62bd8d){if(_0x62bd8d){return _0x62bd8d[_0x0805('0x112')](_0x229243[_0x0805('0x4c')][_0x0805('0x58')],_[_0x0805('0xde')](_0x229243[_0x0805('0x4c')],[_0x0805('0x58'),'id'])||{});}})[_0x0805('0x25')](respondWithResult(_0x3c1e72,null))[_0x0805('0x1a')](handleError(_0x3c1e72,null));};exports[_0x0805('0xf7')]=function(_0x10f80f,_0x22bd4f){var _0x4e281d={};var _0x5f5c9b={};var _0xdc4f94;var _0x5233de;return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x10f80f[_0x0805('0x47')]['id']}})['then'](handleEntityNotFound(_0x22bd4f,null))[_0x0805('0x25')](function(_0x1208f0){if(_0x1208f0){_0xdc4f94=_0x1208f0;_0x5f5c9b[_0x0805('0x32')]=_[_0x0805('0x48')](db['ChatProactiveAction'][_0x0805('0x30')]);_0x5f5c9b[_0x0805('0x33')]=_[_0x0805('0x48')](_0x10f80f[_0x0805('0x33')]);_0x5f5c9b[_0x0805('0x3c')]=_['intersection'](_0x5f5c9b[_0x0805('0x32')],_0x5f5c9b[_0x0805('0x33')]);_0x4e281d['attributes']=_[_0x0805('0x49')](_0x5f5c9b[_0x0805('0x32')],qs['fields'](_0x10f80f[_0x0805('0x33')]['fields']));_0x4e281d['attributes']=_0x4e281d[_0x0805('0x35')][_0x0805('0x36')]?_0x4e281d[_0x0805('0x35')]:_0x5f5c9b['model'];_0x4e281d[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x10f80f[_0x0805('0x33')][_0x0805('0x3a')]);_0x4e281d[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x10f80f['query'],_0x5f5c9b['filters']));if(_0x10f80f[_0x0805('0x33')]['filter']){_0x4e281d[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x4e281d[_0x0805('0x3b')],{'$or':_['map'](_0x4e281d[_0x0805('0x35')],function(_0x3db38d){var _0xf218df={};_0xf218df[_0x3db38d]={'$like':'%'+_0x10f80f[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0xf218df;})});}_0x4e281d=_[_0x0805('0x3f')]({},_0x4e281d,_0x10f80f[_0x0805('0x42')]);return _0xdc4f94[_0x0805('0xf7')](_0x4e281d);}})[_0x0805('0x25')](function(_0x177fb4){if(_0x177fb4){_0x5233de=_0x177fb4[_0x0805('0x36')];if(!_0x10f80f['query'][_0x0805('0x37')](_0x0805('0x56'))){_0x4e281d[_0x0805('0x38')]=qs['limit'](_0x10f80f[_0x0805('0x33')][_0x0805('0x38')]);_0x4e281d[_0x0805('0x1f')]=qs[_0x0805('0x1f')](_0x10f80f[_0x0805('0x33')][_0x0805('0x1f')]);}return _0xdc4f94['getProactiveActions'](_0x4e281d);}})['then'](function(_0x3f4222){if(_0x3f4222){return _0x3f4222?{'count':_0x5233de,'rows':_0x3f4222}:null;}})[_0x0805('0x25')](respondWithResult(_0x22bd4f,null))[_0x0805('0x1a')](handleError(_0x22bd4f,null));};exports[_0x0805('0x114')]=function(_0x2548bf,_0x4c87a7){var _0x15bf4d=_0x2548bf[_0x0805('0x33')][_0x0805('0x115')]===_0x0805('0x116')?_0x0805('0x117'):'onlineForm';return db[_0x0805('0x2f')][_0x0805('0x4a')]({'attributes':['id',_0x15bf4d],'where':{'id':_0x2548bf[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x4c87a7,null))[_0x0805('0x25')](function(_0x5c378a){if(_0x5c378a){var _0x4edc76=_0x5c378a[_0x15bf4d];var _0x3dbbb0=_0x4edc76&&_0x4edc76[_0x0805('0x118')]?_0x4edc76[_0x0805('0x118')]:[];_0x4c87a7[_0x0805('0x2a')]({'fromKey':_[_0x0805('0x6f')](_0x4edc76[_0x0805('0x119')])?undefined:_0x4edc76[_0x0805('0x119')],'count':_0x3dbbb0[_0x0805('0x36')],'rows':_0x3dbbb0});}})['catch'](handleError(_0x4c87a7,null));};exports[_0x0805('0x11a')]=function(_0x5cde12,_0x22e280){var _0x3b88ef={'raw':![],'where':{}};var _0x2df240={};var _0x5d5d04={'count':0x0,'rows':[]};return db[_0x0805('0x2f')]['findOne']({'where':{'id':_0x5cde12[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x22e280,null))[_0x0805('0x25')](function(_0x5720f7){if(_0x5720f7){_0x2df240['model']=_[_0x0805('0x48')](db[_0x0805('0xc4')][_0x0805('0x30')]);_0x2df240[_0x0805('0x33')]=_[_0x0805('0x48')](_0x5cde12[_0x0805('0x33')]);_0x2df240[_0x0805('0x3c')]=_[_0x0805('0x49')](_0x2df240[_0x0805('0x32')],_0x2df240[_0x0805('0x33')]);_0x3b88ef[_0x0805('0x35')]=_[_0x0805('0x49')](_0x2df240['model'],qs[_0x0805('0x34')](_0x5cde12['query'][_0x0805('0x34')]));_0x3b88ef[_0x0805('0x35')]=_0x3b88ef[_0x0805('0x35')][_0x0805('0x36')]?_0x3b88ef[_0x0805('0x35')]:_0x2df240[_0x0805('0x32')];if(!_0x5cde12[_0x0805('0x33')]['hasOwnProperty'](_0x0805('0x56'))){_0x3b88ef[_0x0805('0x38')]=qs['limit'](_0x5cde12[_0x0805('0x33')][_0x0805('0x38')]);_0x3b88ef[_0x0805('0x1f')]=qs[_0x0805('0x1f')](_0x5cde12['query']['offset']);}_0x3b88ef[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x5cde12[_0x0805('0x33')]['sort']);_0x3b88ef[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x5cde12[_0x0805('0x33')],_0x2df240[_0x0805('0x3c')]));_0x3b88ef[_0x0805('0x3b')][_0x0805('0x53')]=_0x5720f7['id'];if(_0x5cde12[_0x0805('0x33')][_0x0805('0x3e')]){_0x3b88ef[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x3b88ef[_0x0805('0x3b')],{'$or':_['map'](_0x3b88ef[_0x0805('0x35')],function(_0x86b2bc){var _0x993361={};_0x993361[_0x86b2bc]={'$like':'%'+_0x5cde12[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0x993361;})});}_0x3b88ef=_['merge']({},_0x3b88ef,_0x5cde12[_0x0805('0x42')]);return db[_0x0805('0xc4')][_0x0805('0x21')]({'where':_0x3b88ef[_0x0805('0x3b')]})[_0x0805('0x25')](function(_0x1804d3){_0x5d5d04[_0x0805('0x21')]=_0x1804d3;if(_0x5cde12[_0x0805('0x33')][_0x0805('0x43')]){_0x3b88ef[_0x0805('0x44')]=[{'all':!![]}];}else{_0x3b88ef[_0x0805('0x44')]=[{'model':db[_0x0805('0x77')],'as':_0x0805('0xe0'),'required':![]},{'model':db[_0x0805('0x11b')],'as':_0x0805('0x11c'),'required':![]}];}return db['ChatOfflineMessage'][_0x0805('0xe7')](_0x3b88ef);})[_0x0805('0x25')](function(_0x1699f5){_0x5d5d04[_0x0805('0x45')]=_0x1699f5;return _0x5d5d04;});}})['then'](respondWithFilteredResult(_0x22e280,_0x3b88ef))['catch'](handleError(_0x22e280,null));};exports[_0x0805('0x11d')]=function(_0x481f50,_0x2cbf16){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x481f50[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x2cbf16,null))[_0x0805('0x25')](function(_0x3d33dc){if(_0x3d33dc){return _0x3d33dc['addAgents'](_0x481f50['body'][_0x0805('0x58')],_['omit'](_0x481f50['body'],[_0x0805('0x58'),'id'])||{})[_0x0805('0xa6')](function(_0x34a43f){for(var _0x502ad3=0x0;_0x502ad3<_0x481f50[_0x0805('0x4c')]['ids'][_0x0805('0x36')];_0x502ad3+=0x1){socket['emit'](_0x0805('0x11e'),{'UserId':Number(_0x481f50[_0x0805('0x4c')][_0x0805('0x58')][_0x502ad3]),'ChatWebsiteId':Number(_0x481f50[_0x0805('0x47')]['id'])});}return _0x34a43f;});}})[_0x0805('0x25')](respondWithResult(_0x2cbf16,null))[_0x0805('0x1a')](handleError(_0x2cbf16,null));};exports[_0x0805('0x11f')]=function(_0x21c587,_0x14e1cf){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x21c587['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x14e1cf,null))['then'](function(_0x3146d7){if(_0x3146d7){return _0x3146d7[_0x0805('0x11f')](_0x21c587['query'][_0x0805('0x58')])[_0x0805('0x25')](function(){if(_['isArray'](_0x21c587[_0x0805('0x33')][_0x0805('0x58')])){for(var _0xccbbdd=0x0;_0xccbbdd<_0x21c587[_0x0805('0x33')][_0x0805('0x58')][_0x0805('0x36')];_0xccbbdd+=0x1){socket[_0x0805('0x120')](_0x0805('0x121'),{'UserId':Number(_0x21c587['query']['ids'][_0xccbbdd]),'ChatWebsiteId':Number(_0x21c587['params']['id'])});}}else{socket[_0x0805('0x120')](_0x0805('0x121'),{'UserId':Number(_0x21c587['query']['ids']),'ChatWebsiteId':Number(_0x21c587['params']['id'])});}});}})['then'](respondWithStatusCode(_0x14e1cf,null))[_0x0805('0x1a')](handleError(_0x14e1cf,null));};exports[_0x0805('0x122')]=function(_0x40a193,_0x16450c){var _0x4920b2={};var _0x5d28ac={};var _0x5da4c4;var _0x309d5e;return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x40a193[_0x0805('0x47')]['id']}})['then'](handleEntityNotFound(_0x16450c,null))[_0x0805('0x25')](function(_0x4c273b){if(_0x4c273b){_0x5da4c4=_0x4c273b;_0x5d28ac[_0x0805('0x32')]=_[_0x0805('0x48')](db[_0x0805('0xe1')][_0x0805('0x30')]);_0x5d28ac[_0x0805('0x33')]=_[_0x0805('0x48')](_0x40a193[_0x0805('0x33')]);_0x5d28ac['filters']=_['intersection'](_0x5d28ac[_0x0805('0x32')],_0x5d28ac['query']);_0x4920b2[_0x0805('0x35')]=_[_0x0805('0x49')](_0x5d28ac[_0x0805('0x32')],qs[_0x0805('0x34')](_0x40a193[_0x0805('0x33')][_0x0805('0x34')]));_0x4920b2[_0x0805('0x35')]=_0x4920b2[_0x0805('0x35')]['length']?_0x4920b2[_0x0805('0x35')]:_0x5d28ac[_0x0805('0x32')];_0x4920b2[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x40a193['query'][_0x0805('0x3a')]);_0x4920b2[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x40a193['query'],_0x5d28ac['filters']));if(_0x40a193[_0x0805('0x33')][_0x0805('0x3e')]){_0x4920b2['where']=_[_0x0805('0x3f')](_0x4920b2[_0x0805('0x3b')],{'$or':_['map'](_0x4920b2[_0x0805('0x35')],function(_0x17d533){var _0x2362d9={};_0x2362d9[_0x17d533]={'$like':'%'+_0x40a193[_0x0805('0x33')]['filter']+'%'};return _0x2362d9;})});}_0x4920b2=_[_0x0805('0x3f')]({},_0x4920b2,_0x40a193[_0x0805('0x42')]);return _0x5da4c4[_0x0805('0x122')](_0x4920b2);}})[_0x0805('0x25')](function(_0x900042){if(_0x900042){_0x309d5e=_0x900042['length'];if(!_0x40a193[_0x0805('0x33')]['hasOwnProperty']('nolimit')){_0x4920b2['limit']=qs[_0x0805('0x38')](_0x40a193[_0x0805('0x33')][_0x0805('0x38')]);_0x4920b2['offset']=qs[_0x0805('0x1f')](_0x40a193[_0x0805('0x33')][_0x0805('0x1f')]);}return _0x5da4c4[_0x0805('0x122')](_0x4920b2);}})[_0x0805('0x25')](function(_0x213d46){if(_0x213d46){return _0x213d46?{'count':_0x309d5e,'rows':_0x213d46}:null;}})['then'](respondWithResult(_0x16450c,null))[_0x0805('0x1a')](handleError(_0x16450c,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 6d32e50..907c4bb 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 _0x8a28=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x8a28,0xfd));var _0x88a2=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8a28[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0x88a2('0x0'));var ChatWebsite=require(_0x88a2('0x1'))['db'][_0x88a2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x88a2('0x3')](0x0);var events={'afterCreate':_0x88a2('0x4'),'afterUpdate':_0x88a2('0x5'),'afterDestroy':_0x88a2('0x6')};function emitEvent(_0x3fc89d){return function(_0x5d5b92,_0x2f482e,_0x238f2a){ChatWebsiteEvents[_0x88a2('0x7')](_0x3fc89d+':'+_0x5d5b92['id'],_0x5d5b92);ChatWebsiteEvents[_0x88a2('0x7')](_0x3fc89d,_0x5d5b92);_0x238f2a(null);};}for(var e in events){if(events[_0x88a2('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x88a2('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3351=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x647c6c,_0x4cb7f){var _0xa57805=function(_0x692f69){while(--_0x692f69){_0x647c6c['push'](_0x647c6c['shift']());}};_0xa57805(++_0x4cb7f);}(_0x3351,0x1b4));var _0x1335=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x3351[_0x3899d1];return _0xeb4a7d;};'use strict';var EventEmitter=require(_0x1335('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1335('0x1')](0x0);var events={'afterCreate':_0x1335('0x2'),'afterUpdate':_0x1335('0x3'),'afterDestroy':_0x1335('0x4')};function emitEvent(_0x21ea3d){return function(_0x173f26,_0x1f635d,_0x4d503a){ChatWebsiteEvents[_0x1335('0x5')](_0x21ea3d+':'+_0x173f26['id'],_0x173f26);ChatWebsiteEvents[_0x1335('0x5')](_0x21ea3d,_0x173f26);_0x4d503a(null);};}for(var e in events){if(events[_0x1335('0x6')](e)){var event=events[e];ChatWebsite[_0x1335('0x7')](e,emitEvent(event));}}module[_0x1335('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 81c7322..b9eab57 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 _0x5510=['api','request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x5510,0x98));var _0x0551=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x5510[_0x21b359];return _0x57b8e7;};'use strict';var _=require(_0x0551('0x0'));var util=require('util');var logger=require(_0x0551('0x1'))(_0x0551('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0551('0x3'));var fs=require('fs');var path=require(_0x0551('0x4'));var rimraf=require(_0x0551('0x5'));var config=require(_0x0551('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x0551('0x7')]=function(_0x4b606f,_0x4f6924){return _0x4b606f[_0x0551('0x8')](_0x0551('0x9'),attributes,{'tableName':_0x0551('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6600=['chat_websites','lodash','api','bluebird','request-promise','rimraf','./chatWebsite.attributes','define','ChatWebsite'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x6600,0x106));var _0x0660=function(_0x2cbcd2,_0x12fea5){_0x2cbcd2=_0x2cbcd2-0x0;var _0x5d36df=_0x6600[_0x2cbcd2];return _0x5d36df;};'use strict';var _=require(_0x0660('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0660('0x1'));var moment=require('moment');var BPromise=require(_0x0660('0x2'));var rp=require(_0x0660('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0660('0x4'));var config=require('../../config/environment');var attributes=require(_0x0660('0x5'));module['exports']=function(_0x43d4d3,_0x594a5c){return _0x43d4d3[_0x0660('0x6')](_0x0660('0x7'),attributes,{'tableName':_0x0660('0x8'),'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 55d4150..9f7820e 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 _0x7d11=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x7c8195,_0x2dec77){var _0x4ebaf3=function(_0xa3d211){while(--_0xa3d211){_0x7c8195['push'](_0x7c8195['shift']());}};_0x4ebaf3(++_0x2dec77);}(_0x7d11,0x17b));var _0x17d1=function(_0x1ccf70,_0x1f6416){_0x1ccf70=_0x1ccf70-0x0;var _0x4a0de6=_0x7d11[_0x1ccf70];return _0x4a0de6;};'use strict';var _=require(_0x17d1('0x0'));var util=require(_0x17d1('0x1'));var moment=require('moment');var BPromise=require(_0x17d1('0x2'));var rs=require(_0x17d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x17d1('0x5'))('rpc');var config=require(_0x17d1('0x6'));var jayson=require(_0x17d1('0x7'));var client=jayson[_0x17d1('0x8')][_0x17d1('0x9')]({'port':0x232a});config[_0x17d1('0xa')]=_[_0x17d1('0xb')](config[_0x17d1('0xa')],{'host':_0x17d1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x17d1('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2349ab,_0x87ee7b,_0x37329c){return new BPromise(function(_0xf01f19,_0x510457){return client['request'](_0x2349ab,_0x37329c)['then'](function(_0x4a9f9c){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x87ee7b,_0x17d1('0xd'));logger[_0x17d1('0xe')](_0x17d1('0xf'),_0x87ee7b,'request\x20sent',JSON[_0x17d1('0x10')](_0x4a9f9c));if(_0x4a9f9c[_0x17d1('0x11')]){if(_0x4a9f9c[_0x17d1('0x11')][_0x17d1('0x12')]===0x1f4){logger[_0x17d1('0x11')](_0x17d1('0x13'),_0x87ee7b,_0x4a9f9c[_0x17d1('0x11')]['message']);return _0x510457(_0x4a9f9c['error'][_0x17d1('0x14')]);}logger[_0x17d1('0x11')](_0x17d1('0x13'),_0x87ee7b,_0x4a9f9c[_0x17d1('0x11')][_0x17d1('0x14')]);return _0xf01f19(_0x4a9f9c[_0x17d1('0x11')][_0x17d1('0x14')]);}else{logger[_0x17d1('0x15')](_0x17d1('0x13'),_0x87ee7b,'request\x20sent');_0xf01f19(_0x4a9f9c[_0x17d1('0x16')]['message']);}})[_0x17d1('0x17')](function(_0x3f7408){logger['error'](_0x17d1('0x13'),_0x87ee7b,_0x3f7408);_0x510457(_0x3f7408);});});}
\ No newline at end of file
+var _0x3a8d=['./chatWebsite.socket','register','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x4a292c,_0x176acd){var _0xaee381=function(_0x4100b6){while(--_0x4100b6){_0x4a292c['push'](_0x4a292c['shift']());}};_0xaee381(++_0x176acd);}(_0x3a8d,0xa8));var _0xd3a8=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x3a8d[_0x251d9c];return _0x16ae64;};'use strict';var _=require(_0xd3a8('0x0'));var util=require(_0xd3a8('0x1'));var moment=require(_0xd3a8('0x2'));var BPromise=require(_0xd3a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3a8('0x4'));var db=require(_0xd3a8('0x5'))['db'];var utils=require(_0xd3a8('0x6'));var logger=require('../../config/logger')(_0xd3a8('0x7'));var config=require(_0xd3a8('0x8'));var jayson=require(_0xd3a8('0x9'));var client=jayson['client'][_0xd3a8('0xa')]({'port':0x232a});config[_0xd3a8('0xb')]=_[_0xd3a8('0xc')](config[_0xd3a8('0xb')],{'host':_0xd3a8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd3a8('0xb')]));require(_0xd3a8('0xe'))[_0xd3a8('0xf')](socket);function respondWithRpcPromise(_0x5e344c,_0x19e390,_0x7ac38b){return new BPromise(function(_0x2ddf5e,_0x3f2b47){return client['request'](_0x5e344c,_0x7ac38b)['then'](function(_0x9e2701){logger[_0xd3a8('0x10')](_0xd3a8('0x11'),_0x19e390,'request\x20sent');logger[_0xd3a8('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x19e390,_0xd3a8('0x13'),JSON[_0xd3a8('0x14')](_0x9e2701));if(_0x9e2701[_0xd3a8('0x15')]){if(_0x9e2701[_0xd3a8('0x15')][_0xd3a8('0x16')]===0x1f4){logger[_0xd3a8('0x15')](_0xd3a8('0x11'),_0x19e390,_0x9e2701[_0xd3a8('0x15')][_0xd3a8('0x17')]);return _0x3f2b47(_0x9e2701[_0xd3a8('0x15')]['message']);}logger[_0xd3a8('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x19e390,_0x9e2701[_0xd3a8('0x15')][_0xd3a8('0x17')]);return _0x2ddf5e(_0x9e2701[_0xd3a8('0x15')][_0xd3a8('0x17')]);}else{logger[_0xd3a8('0x10')](_0xd3a8('0x11'),_0x19e390,_0xd3a8('0x13'));_0x2ddf5e(_0x9e2701[_0xd3a8('0x18')]['message']);}})[_0xd3a8('0x19')](function(_0x143893){logger[_0xd3a8('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x19e390,_0x143893);_0x3f2b47(_0x143893);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a284aa8..09bb4d8 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 _0xda69=['save','remove','update','emit','register','chatWebsite:','./chatWebsite.events'];(function(_0x17f594,_0x52319f){var _0x28e31c=function(_0x76ef43){while(--_0x76ef43){_0x17f594['push'](_0x17f594['shift']());}};_0x28e31c(++_0x52319f);}(_0xda69,0x148));var _0x9da6=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xda69[_0x12f688];return _0x59c3de;};'use strict';var ChatWebsiteEvents=require(_0x9da6('0x0'));var events=[_0x9da6('0x1'),_0x9da6('0x2'),_0x9da6('0x3')];function createListener(_0x1d7586,_0x4304e9){return function(_0x498e87){_0x4304e9[_0x9da6('0x4')](_0x1d7586,_0x498e87);};}function removeListener(_0x37d973,_0x22a70f){return function(){ChatWebsiteEvents['removeListener'](_0x37d973,_0x22a70f);};}exports[_0x9da6('0x5')]=function(_0x571337){for(var _0x58fb3b=0x0,_0x3d4d03=events['length'];_0x58fb3b<_0x3d4d03;_0x58fb3b++){var _0x1e2cea=events[_0x58fb3b];var _0x4c43b6=createListener(_0x9da6('0x6')+_0x1e2cea,_0x571337);ChatWebsiteEvents['on'](_0x1e2cea,_0x4c43b6);}};
\ No newline at end of file
+var _0xd655=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xd655,0xe4));var _0x5d65=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0xd655[_0x1f3aec];return _0x409f0d;};'use strict';var ChatWebsiteEvents=require(_0x5d65('0x0'));var events=[_0x5d65('0x1'),_0x5d65('0x2'),_0x5d65('0x3')];function createListener(_0x2b463d,_0x3516b7){return function(_0x15bf7e){_0x3516b7[_0x5d65('0x4')](_0x2b463d,_0x15bf7e);};}function removeListener(_0x59ebdb,_0x4c02d3){return function(){ChatWebsiteEvents[_0x5d65('0x5')](_0x59ebdb,_0x4c02d3);};}exports[_0x5d65('0x6')]=function(_0x439121){for(var _0x1c8db9=0x0,_0x500f59=events[_0x5d65('0x7')];_0x1c8db9<_0x500f59;_0x1c8db9++){var _0x1883e1=events[_0x1c8db9];var _0x1a5860=createListener(_0x5d65('0x8')+_0x1883e1,_0x439121);ChatWebsiteEvents['on'](_0x1883e1,_0x1a5860);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 2107ee6..b309406 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 _0x2583=['addAgents','put','delete','removeDispositions','removeAnswers','/:id/users','exports','multer','express','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','join','server/files/images/logos/','format','%s-%s','now','originalname','file','root','addAvatar','diskStorage','server/files/images/avatars/','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x2583,0x1ce));var _0x3258=function(_0x35f9f8,_0x3b66c2){_0x35f9f8=_0x35f9f8-0x0;var _0x4cea3c=_0x2583[_0x35f9f8];return _0x4cea3c;};'use strict';var multer=require(_0x3258('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3258('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3258('0x2'));var config=require(_0x3258('0x3'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x3258('0x4')](),controller['index']);router[_0x3258('0x5')]('/describe',auth[_0x3258('0x4')](),controller['describe']);router[_0x3258('0x5')](_0x3258('0x6'),auth['isAuthenticated'](),controller['show']);router[_0x3258('0x5')]('/:id/dispositions',auth[_0x3258('0x4')](),controller[_0x3258('0x7')]);router[_0x3258('0x5')]('/:id/canned_answers',auth[_0x3258('0x4')](),controller['getAnswers']);router['get'](_0x3258('0x8'),controller[_0x3258('0x9')]);router['get'](_0x3258('0xa'),controller[_0x3258('0xb')]);router[_0x3258('0x5')](_0x3258('0xc'),controller[_0x3258('0xd')]);router[_0x3258('0x5')]('/:id/system_avatar',controller[_0x3258('0xe')]);router[_0x3258('0x5')](_0x3258('0xf'),auth[_0x3258('0x4')](),controller[_0x3258('0x10')]);router[_0x3258('0x5')](_0x3258('0x11'),controller['getSnippet']);router[_0x3258('0x5')](_0x3258('0x12'),auth[_0x3258('0x4')](),controller[_0x3258('0x13')]);router[_0x3258('0x5')]('/:id/proactive_actions',auth[_0x3258('0x4')](),controller[_0x3258('0x14')]);router[_0x3258('0x5')]('/:id/fields',controller[_0x3258('0x15')]);router['get'](_0x3258('0x16'),auth[_0x3258('0x4')](),controller[_0x3258('0x17')]);router[_0x3258('0x5')]('/:id/users',auth[_0x3258('0x4')](),controller[_0x3258('0x18')]);router[_0x3258('0x19')]('/',auth[_0x3258('0x4')](),controller[_0x3258('0x1a')]);router['post'](_0x3258('0x1b'),auth[_0x3258('0x4')](),controller[_0x3258('0x1c')]);router[_0x3258('0x19')](_0x3258('0x1d'),auth[_0x3258('0x4')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe916f3,_0x24cce5,_0xc969f6){_0xc969f6(null,path[_0x3258('0x1e')](config['root'],_0x3258('0x1f')));},'filename':function(_0x112cab,_0x5cd40f,_0x23f824){_0x23f824(null,util[_0x3258('0x20')](_0x3258('0x21'),Date[_0x3258('0x22')](),_0x5cd40f[_0x3258('0x23')]));}})});router[_0x3258('0x19')]('/:id/logo',upload['single'](_0x3258('0x24')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46469e,_0xb28938,_0x3734f4){_0x3734f4(null,path[_0x3258('0x1e')](config[_0x3258('0x25')],'server/files/images/avatars/'));},'filename':function(_0x32349e,_0x1c60a0,_0x134b89){_0x134b89(null,util[_0x3258('0x20')](_0x3258('0x21'),Date['now'](),_0x1c60a0['originalname']));}})});router[_0x3258('0x19')](_0x3258('0xa'),upload['single'](_0x3258('0x24')),controller[_0x3258('0x26')]);var upload=multer({'storage':multer[_0x3258('0x27')]({'destination':function(_0x68dc95,_0x2c082b,_0x3fe701){_0x3fe701(null,path[_0x3258('0x1e')](config[_0x3258('0x25')],_0x3258('0x28')));},'filename':function(_0x15e839,_0x270e77,_0x38708f){_0x38708f(null,util[_0x3258('0x20')](_0x3258('0x21'),Date[_0x3258('0x22')](),_0x270e77[_0x3258('0x23')]));}})});router[_0x3258('0x19')]('/:id/customer_avatar',upload[_0x3258('0x29')](_0x3258('0x24')),controller[_0x3258('0x2a')]);var upload=multer({'storage':multer[_0x3258('0x27')]({'destination':function(_0x3e1cd6,_0x2d802e,_0x303bbe){_0x303bbe(null,path[_0x3258('0x1e')](config[_0x3258('0x25')],_0x3258('0x28')));},'filename':function(_0x440ad2,_0x313da0,_0x15eff6){_0x15eff6(null,util['format']('%s-%s',Date['now'](),_0x313da0['originalname']));}})});router['post'](_0x3258('0x2b'),upload[_0x3258('0x29')](_0x3258('0x24')),controller[_0x3258('0x2c')]);router[_0x3258('0x19')]('/:id/notify',controller[_0x3258('0x2d')]);const offlineUploadMulter=multer({'storage':multer[_0x3258('0x27')]({'destination':function(_0x16a7d6,_0x198eeb,_0x21a96a){const _0x5ab2b8=path[_0x3258('0x1e')](config[_0x3258('0x25')],_0x3258('0x2e'),_0x3258('0x2f'),_0x3258('0x30'));fs_extra[_0x3258('0x31')](_0x5ab2b8,function(){_0x21a96a(null,_0x5ab2b8);});},'filename':function(_0x14540d,_0x2fd2c0,_0x4e0c38){const _0x523ccb=_0x2fd2c0[_0x3258('0x23')][_0x3258('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a3c08=path[_0x3258('0x33')](_0x523ccb);const _0x259286=Date[_0x3258('0x22')]()+'-'+_0x523ccb['replace'](_0x2a3c08,'')+_0x2a3c08;_0x4e0c38(null,_0x259286);}})});router[_0x3258('0x19')](_0x3258('0x34'),offlineUploadMulter['any'](),controller[_0x3258('0x35')]);router[_0x3258('0x19')](_0x3258('0xf'),auth['isAuthenticated'](),controller[_0x3258('0x36')]);router[_0x3258('0x19')](_0x3258('0x12'),auth[_0x3258('0x4')](),controller[_0x3258('0x37')]);router[_0x3258('0x19')](_0x3258('0x38'),auth[_0x3258('0x4')](),controller[_0x3258('0x39')]);router[_0x3258('0x19')]('/:id/users',auth[_0x3258('0x4')](),controller[_0x3258('0x3a')]);router[_0x3258('0x3b')](_0x3258('0x6'),auth[_0x3258('0x4')](),controller['update']);router[_0x3258('0x3c')](_0x3258('0x6'),auth[_0x3258('0x4')](),controller['destroy']);router[_0x3258('0x3c')](_0x3258('0x1b'),auth[_0x3258('0x4')](),controller[_0x3258('0x3d')]);router['delete']('/:id/canned_answers',auth[_0x3258('0x4')](),controller[_0x3258('0x3e')]);router['delete'](_0x3258('0x3f'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x3258('0x40')]=router;
\ No newline at end of file
+var _0x3806=['notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','getDispositions','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getFields','/:id/offline_messages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','diskStorage','addCustomerAvatar','addSystemAvatar','/:id/notify'];(function(_0x17ccc4,_0x2a06fa){var _0x58ba42=function(_0x5d14e3){while(--_0x5d14e3){_0x17ccc4['push'](_0x17ccc4['shift']());}};_0x58ba42(++_0x2a06fa);}(_0x3806,0x187));var _0x6380=function(_0x3e63fd,_0x5a6ca6){_0x3e63fd=_0x3e63fd-0x0;var _0x53e79a=_0x3806[_0x3e63fd];return _0x53e79a;};'use strict';var multer=require(_0x6380('0x0'));var util=require(_0x6380('0x1'));var path=require(_0x6380('0x2'));var timeout=require('connect-timeout');var express=require(_0x6380('0x3'));var router=express[_0x6380('0x4')]();var fs_extra=require(_0x6380('0x5'));var auth=require(_0x6380('0x6'));var interaction=require(_0x6380('0x7'));var config=require(_0x6380('0x8'));var controller=require('./chatWebsite.controller');router[_0x6380('0x9')]('/',auth[_0x6380('0xa')](),controller[_0x6380('0xb')]);router[_0x6380('0x9')](_0x6380('0xc'),auth[_0x6380('0xa')](),controller['describe']);router[_0x6380('0x9')]('/:id',auth[_0x6380('0xa')](),controller[_0x6380('0xd')]);router[_0x6380('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6380('0xe')]);router['get']('/:id/canned_answers',auth[_0x6380('0xa')](),controller['getAnswers']);router[_0x6380('0x9')](_0x6380('0xf'),controller[_0x6380('0x10')]);router[_0x6380('0x9')](_0x6380('0x11'),controller['getAvatar']);router[_0x6380('0x9')](_0x6380('0x12'),controller[_0x6380('0x13')]);router['get'](_0x6380('0x14'),controller[_0x6380('0x15')]);router[_0x6380('0x9')](_0x6380('0x16'),auth[_0x6380('0xa')](),controller[_0x6380('0x17')]);router[_0x6380('0x9')](_0x6380('0x18'),controller[_0x6380('0x19')]);router['get'](_0x6380('0x1a'),auth['isAuthenticated'](),controller[_0x6380('0x1b')]);router[_0x6380('0x9')]('/:id/proactive_actions',auth[_0x6380('0xa')](),controller['getProactiveActions']);router[_0x6380('0x9')]('/:id/fields',controller[_0x6380('0x1c')]);router[_0x6380('0x9')](_0x6380('0x1d'),auth[_0x6380('0xa')](),controller['getOfflineMessages']);router[_0x6380('0x9')](_0x6380('0x1e'),auth[_0x6380('0xa')](),controller[_0x6380('0x1f')]);router[_0x6380('0x20')]('/',auth[_0x6380('0xa')](),controller['create']);router['post'](_0x6380('0x21'),auth[_0x6380('0xa')](),controller[_0x6380('0x22')]);router[_0x6380('0x20')](_0x6380('0x23'),auth[_0x6380('0xa')](),controller[_0x6380('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9c18a1,_0x4a738f,_0x97e0d8){_0x97e0d8(null,path[_0x6380('0x25')](config[_0x6380('0x26')],_0x6380('0x27')));},'filename':function(_0x573f7c,_0x1c578e,_0x284d5b){_0x284d5b(null,util[_0x6380('0x28')]('%s-%s',Date[_0x6380('0x29')](),_0x1c578e[_0x6380('0x2a')]));}})});router[_0x6380('0x20')](_0x6380('0xf'),upload[_0x6380('0x2b')](_0x6380('0x2c')),controller[_0x6380('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c3ed4,_0xcde724,_0x3cca59){_0x3cca59(null,path[_0x6380('0x25')](config[_0x6380('0x26')],_0x6380('0x2e')));},'filename':function(_0x398cca,_0x45a3bf,_0xaa58d9){_0xaa58d9(null,util['format'](_0x6380('0x2f'),Date['now'](),_0x45a3bf['originalname']));}})});router[_0x6380('0x20')](_0x6380('0x11'),upload['single']('file'),controller[_0x6380('0x30')]);var upload=multer({'storage':multer[_0x6380('0x31')]({'destination':function(_0x4b20d2,_0x7ba24f,_0x4d4415){_0x4d4415(null,path[_0x6380('0x25')](config[_0x6380('0x26')],_0x6380('0x2e')));},'filename':function(_0x20284a,_0xffc7dd,_0x44ed7a){_0x44ed7a(null,util[_0x6380('0x28')](_0x6380('0x2f'),Date['now'](),_0xffc7dd[_0x6380('0x2a')]));}})});router[_0x6380('0x20')](_0x6380('0x12'),upload[_0x6380('0x2b')](_0x6380('0x2c')),controller[_0x6380('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x30d456,_0x46dc8b,_0x3f173e){_0x3f173e(null,path[_0x6380('0x25')](config[_0x6380('0x26')],_0x6380('0x2e')));},'filename':function(_0x225467,_0x14ec10,_0x11c701){_0x11c701(null,util[_0x6380('0x28')]('%s-%s',Date[_0x6380('0x29')](),_0x14ec10[_0x6380('0x2a')]));}})});router[_0x6380('0x20')]('/:id/system_avatar',upload[_0x6380('0x2b')](_0x6380('0x2c')),controller[_0x6380('0x33')]);router[_0x6380('0x20')](_0x6380('0x34'),controller[_0x6380('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5c013b,_0x36a134,_0x445ec2){const _0x225b15=path[_0x6380('0x25')](config[_0x6380('0x26')],'server/files',_0x6380('0x36'),_0x6380('0x37'));fs_extra[_0x6380('0x38')](_0x225b15,function(){_0x445ec2(null,_0x225b15);});},'filename':function(_0x603e14,_0x2d2e56,_0x5236af){const _0x2bcc29=_0x2d2e56[_0x6380('0x2a')][_0x6380('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3d09be=path[_0x6380('0x3a')](_0x2bcc29);const _0x1ed709=Date[_0x6380('0x29')]()+'-'+_0x2bcc29[_0x6380('0x39')](_0x3d09be,'')+_0x3d09be;_0x5236af(null,_0x1ed709);}})});router['post'](_0x6380('0x3b'),offlineUploadMulter[_0x6380('0x3c')](),controller[_0x6380('0x3d')]);router[_0x6380('0x20')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x6380('0x3e')]);router[_0x6380('0x20')](_0x6380('0x1a'),auth['isAuthenticated'](),controller['addApplications']);router[_0x6380('0x20')]('/:id/proactive_actions',auth[_0x6380('0xa')](),controller[_0x6380('0x3f')]);router[_0x6380('0x20')](_0x6380('0x1e'),auth[_0x6380('0xa')](),controller[_0x6380('0x40')]);router[_0x6380('0x41')](_0x6380('0x42'),auth[_0x6380('0xa')](),controller[_0x6380('0x43')]);router[_0x6380('0x44')](_0x6380('0x42'),auth[_0x6380('0xa')](),controller[_0x6380('0x45')]);router['delete'](_0x6380('0x21'),auth[_0x6380('0xa')](),controller[_0x6380('0x46')]);router[_0x6380('0x44')](_0x6380('0x23'),auth['isAuthenticated'](),controller[_0x6380('0x47')]);router['delete'](_0x6380('0x1e'),auth[_0x6380('0xa')](),controller[_0x6380('0x48')]);module[_0x6380('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 3e0cf7d..e3ce0ac 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 _0xd568=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd568,0xe4));var _0x8d56=function(_0x22c90a,_0x88f294){_0x22c90a=_0x22c90a-0x0;var _0x25240c=_0xd568[_0x22c90a];return _0x25240c;};var beaverLogger=require(_0x8d56('0x0'));var express=require('express');var auth=require(_0x8d56('0x1'));var config=require(_0x8d56('0x2'));var router=express[_0x8d56('0x3')]();var isProduction=config[_0x8d56('0x4')]===_0x8d56('0x5')||![];function clientSideLogs(_0x394a42,_0x50d06a,_0x2d0e10){var _0x1d4183=_0x394a42['app'][_0x8d56('0x6')](_0x8d56('0x7'));if(!_0x1d4183){throw new Error(_0x8d56('0x8'));}return beaverLogger[_0x8d56('0x9')]({'uri':_0x8d56('0xa'),'logger':_0x1d4183,'enableCors':!isProduction})(_0x394a42,_0x50d06a,_0x2d0e10);}router[_0x8d56('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x8d56('0xc')]=router;
\ No newline at end of file
+var _0xf76f=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','production','app','get'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xf76f,0x70));var _0xff76=function(_0x422bf5,_0x12274c){_0x422bf5=_0x422bf5-0x0;var _0x269d3c=_0xf76f[_0x422bf5];return _0x269d3c;};var beaverLogger=require(_0xff76('0x0'));var express=require(_0xff76('0x1'));var auth=require(_0xff76('0x2'));var config=require(_0xff76('0x3'));var router=express[_0xff76('0x4')]();var isProduction=config['env']===_0xff76('0x5')||![];function clientSideLogs(_0x3e9ba0,_0x12b666,_0x407f2b){var _0x314ae9=_0x3e9ba0[_0xff76('0x6')][_0xff76('0x7')](_0xff76('0x8'));if(!_0x314ae9){throw new Error(_0xff76('0x9'));}return beaverLogger[_0xff76('0xa')]({'uri':_0xff76('0xb'),'logger':_0x314ae9,'enableCors':!isProduction})(_0x3e9ba0,_0x12b666,_0x407f2b);}router[_0xff76('0xc')](auth[_0xff76('0xd')](),clientSideLogs);module[_0xff76('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index b7f01b2..8e62440 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 _0x1e41=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x1e41,0x12d));var _0x11e4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1e41[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x11e4('0x0'));module[_0x11e4('0x1')]={'name':{'type':Sequelize[_0x11e4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x11e4('0x3')](_0x11e4('0x4'),'Google',_0x11e4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x11e4('0x3')](_0x11e4('0x6'),_0x11e4('0x7'))},'data1':{'type':Sequelize[_0x11e4('0x2')],'comment':_0x11e4('0x8')},'data2':{'type':Sequelize[_0x11e4('0x2')],'comment':_0x11e4('0x9')},'data3':{'type':Sequelize[_0x11e4('0x2')],'comment':_0x11e4('0xa')},'data4':{'type':Sequelize[_0x11e4('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x11e4('0xb')],'comment':_0x11e4('0xc')},'data7':{'type':Sequelize[_0x11e4('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0xfc7d=['sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0xfc7d,0xa5));var _0xdfc7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xfc7d[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xdfc7('0x0'));module[_0xdfc7('0x1')]={'name':{'type':Sequelize[_0xdfc7('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdfc7('0x3')](_0xdfc7('0x4'),_0xdfc7('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdfc7('0x3')](_0xdfc7('0x6'),_0xdfc7('0x7'))},'data1':{'type':Sequelize[_0xdfc7('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdfc7('0x2')],'comment':_0xdfc7('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0xdfc7('0x9')},'data4':{'type':Sequelize[_0xdfc7('0x2')],'comment':_0xdfc7('0xa')},'data5':{'type':Sequelize[_0xdfc7('0xb')],'comment':_0xdfc7('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xdfc7('0xd')},'data7':{'type':Sequelize[_0xdfc7('0xb')],'comment':_0xdfc7('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 3330568..e6092da 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 _0x920b=['map','CloudProvider','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','service','MicrosoftAzure','decryptString','params','length','find','data3','catch','create','Service\x20parameter\x20not\x20specified','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','then','destroy','name','send','padEnd','index'];(function(_0x5d7005,_0x41f35a){var _0x31ed20=function(_0x3624f8){while(--_0x3624f8){_0x5d7005['push'](_0x5d7005['shift']());}};_0x31ed20(++_0x41f35a);}(_0x920b,0xa4));var _0xb920=function(_0x2c03ca,_0x2b03b6){_0x2c03ca=_0x2c03ca-0x0;var _0xfaa0a0=_0x920b[_0x2c03ca];return _0xfaa0a0;};'use strict';var _=require(_0xb920('0x0'));var Redis=require('ioredis');var qs=require(_0xb920('0x1'));var encryptor=require(_0xb920('0x2'));var config=require(_0xb920('0x3'));var logger=require(_0xb920('0x4'))(_0xb920('0x5'));var db=require(_0xb920('0x6'))['db'];var oauth=require(_0xb920('0x7'));config['redis']=_[_0xb920('0x8')](config[_0xb920('0x9')],{'host':_0xb920('0xa'),'port':0x18eb});var socket=require(_0xb920('0xb'))(new Redis(config[_0xb920('0x9')]));var redis=new Redis(config[_0xb920('0x9')]);function respondWithStatusCode(_0x44320b,_0x1a45d2){_0x1a45d2=_0x1a45d2||0xcc;return function(_0x24616d){if(_0x24616d){return _0x44320b[_0xb920('0xc')](_0x1a45d2);}return _0x44320b['status'](_0x1a45d2)[_0xb920('0xd')]();};}function respondWithResult(_0x5af32f,_0x118bad){_0x118bad=_0x118bad||0xc8;return function(_0x347ad5){if(_0x347ad5){return _0x5af32f[_0xb920('0xe')](_0x118bad)['json'](_0x347ad5);}};}function respondWithFilteredResult(_0x13cad9,_0x300997){return function(_0x36c69e){if(_0x36c69e){var _0x230f1a=typeof _0x300997[_0xb920('0xf')]===_0xb920('0x10')&&typeof _0x300997['limit']===_0xb920('0x10');var _0x50e0ce=_0x36c69e[_0xb920('0x11')];var _0x4c6d8b=_0x230f1a?0x0:_0x300997[_0xb920('0xf')];var _0x293e20=_0x230f1a?_0x36c69e[_0xb920('0x11')]:_0x300997['offset']+_0x300997[_0xb920('0x12')];var _0x1dbc2b;if(_0x293e20>=_0x50e0ce){_0x293e20=_0x50e0ce;_0x1dbc2b=0xc8;}else{_0x1dbc2b=0xce;}_0x13cad9[_0xb920('0xe')](_0x1dbc2b);return _0x13cad9[_0xb920('0x13')](_0xb920('0x14'),_0x4c6d8b+'-'+_0x293e20+'/'+_0x50e0ce)[_0xb920('0x15')](_0x36c69e);}return null;};}function saveUpdates(_0x5275db){return function(_0x28cf61){if(_0x28cf61){return _0x28cf61['update'](_0x5275db)[_0xb920('0x16')](function(_0x36d307){return _0x36d307;});}return null;};}function removeEntity(_0x12c395){return function(_0x2322cd){if(_0x2322cd){return _0x2322cd[_0xb920('0x17')]()['then'](function(){_0x12c395[_0xb920('0xe')](0xcc)[_0xb920('0xd')]();});}};}function handleEntityNotFound(_0x26b775){return function(_0x59ea9d){if(!_0x59ea9d){_0x26b775[_0xb920('0xc')](0x194);}return _0x59ea9d;};}function handleError(_0x3f4798,_0x539f30){_0x539f30=_0x539f30||0x1f4;return function(_0x318aa9){logger['error'](_0x318aa9['stack']);if(_0x318aa9[_0xb920('0x18')]){delete _0x318aa9[_0xb920('0x18')];}_0x3f4798[_0xb920('0xe')](_0x539f30)[_0xb920('0x19')](_0x318aa9);};}function maskClientSecret(_0xa8549c){return _[_0xb920('0x1a')](_0xa8549c['slice'](0x0,0x3),0x14,'*');}exports[_0xb920('0x1b')]=function(_0x457529,_0x3297d7){var _0x247015={},_0x11d411={},_0xc6cfc9={'count':0x0,'rows':[]};var _0x44d397=_[_0xb920('0x1c')](db[_0xb920('0x1d')][_0xb920('0x1e')],function(_0x1e838b){return{'name':_0x1e838b[_0xb920('0x1f')],'type':_0x1e838b['type'][_0xb920('0x20')]};});_0x11d411[_0xb920('0x21')]=_[_0xb920('0x1c')](_0x44d397,'name');_0x11d411[_0xb920('0x22')]=_[_0xb920('0x23')](_0x457529[_0xb920('0x22')]);_0x11d411[_0xb920('0x24')]=_['intersection'](_0x11d411[_0xb920('0x21')],_0x11d411[_0xb920('0x22')]);_0x247015[_0xb920('0x25')]=_[_0xb920('0x26')](_0x11d411[_0xb920('0x21')],qs[_0xb920('0x27')](_0x457529['query'][_0xb920('0x27')]));_0x247015[_0xb920('0x25')]=_0x247015['attributes']['length']?_0x247015[_0xb920('0x25')]:_0x11d411[_0xb920('0x21')];if(!_0x457529[_0xb920('0x22')][_0xb920('0x28')]('nolimit')){_0x247015['limit']=qs[_0xb920('0x12')](_0x457529['query']['limit']);_0x247015[_0xb920('0xf')]=qs[_0xb920('0xf')](_0x457529[_0xb920('0x22')][_0xb920('0xf')]);}_0x247015[_0xb920('0x29')]=qs[_0xb920('0x2a')](_0x457529['query']['sort']);_0x247015[_0xb920('0x2b')]=qs[_0xb920('0x24')](_[_0xb920('0x2c')](_0x457529[_0xb920('0x22')],_0x11d411['filters']),_0x44d397);if(_0x457529[_0xb920('0x22')]['filter']){_0x247015[_0xb920('0x2b')]=_[_0xb920('0x2d')](_0x247015[_0xb920('0x2b')],{'$or':_[_0xb920('0x1c')](_0x44d397,function(_0xbd3535){if(_0xbd3535[_0xb920('0x2e')]!==_0xb920('0x2f')){var _0x3f3d94={};_0x3f3d94[_0xbd3535[_0xb920('0x18')]]={'$like':'%'+_0x457529[_0xb920('0x22')]['filter']+'%'};return _0x3f3d94;}})});}_0x247015=_[_0xb920('0x2d')]({},_0x247015,_0x457529[_0xb920('0x30')]);var _0x2645cf={'where':_0x247015[_0xb920('0x2b')]};return db['CloudProvider'][_0xb920('0x11')](_0x2645cf)[_0xb920('0x16')](function(_0xf573b){_0xc6cfc9['count']=_0xf573b;if(_0x457529['query']['includeAll']){_0x247015[_0xb920('0x31')]=[{'all':!![]}];}return db[_0xb920('0x1d')][_0xb920('0x32')](_0x247015);})[_0xb920('0x16')](function(_0x39447e){_0xc6cfc9[_0xb920('0x33')]=_[_0xb920('0x1c')](_0x39447e,function(_0x55f0ce){if(_0x55f0ce[_0xb920('0x34')]===_0xb920('0x35')){var _0x36f2a5=encryptor[_0xb920('0x36')](_0x55f0ce['data3']);_0x55f0ce['data3']=maskClientSecret(_0x36f2a5);}return _0x55f0ce;});return _0xc6cfc9;})['then'](respondWithFilteredResult(_0x3297d7,_0x247015))['catch'](handleError(_0x3297d7,null));};exports['show']=function(_0x9d513a,_0x4823d8){var _0x1e2582={'raw':!![],'where':{'id':_0x9d513a[_0xb920('0x37')]['id']}},_0x1e3a04={};_0x1e3a04[_0xb920('0x21')]=_[_0xb920('0x23')](db[_0xb920('0x1d')][_0xb920('0x1e')]);_0x1e3a04[_0xb920('0x22')]=_[_0xb920('0x23')](_0x9d513a[_0xb920('0x22')]);_0x1e3a04[_0xb920('0x24')]=_[_0xb920('0x26')](_0x1e3a04[_0xb920('0x21')],_0x1e3a04['query']);_0x1e2582['attributes']=_['intersection'](_0x1e3a04[_0xb920('0x21')],qs[_0xb920('0x27')](_0x9d513a['query'][_0xb920('0x27')]));_0x1e2582[_0xb920('0x25')]=_0x1e2582[_0xb920('0x25')][_0xb920('0x38')]?_0x1e2582[_0xb920('0x25')]:_0x1e3a04[_0xb920('0x21')];if(_0x9d513a[_0xb920('0x22')]['includeAll']){_0x1e2582[_0xb920('0x31')]=[{'all':!![]}];}_0x1e2582=_[_0xb920('0x2d')]({},_0x1e2582,_0x9d513a[_0xb920('0x30')]);return db[_0xb920('0x1d')][_0xb920('0x39')](_0x1e2582)[_0xb920('0x16')](handleEntityNotFound(_0x4823d8,null))['then'](function(_0x139bb6){if(_0x139bb6['service']===_0xb920('0x35')){var _0x4fc980=encryptor[_0xb920('0x36')](_0x139bb6[_0xb920('0x3a')]);_0x139bb6[_0xb920('0x3a')]=maskClientSecret(_0x4fc980);}return _0x139bb6;})['then'](respondWithResult(_0x4823d8,null))[_0xb920('0x3b')](handleError(_0x4823d8,null));};exports[_0xb920('0x3c')]=function(_0xcf23b3,_0x36e9b9){if(!_0xcf23b3['body'][_0xb920('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0xcf23b3['body'][_0xb920('0x34')])throw new Error(_0xb920('0x3d'));var _0x3807e0=db[_0xb920('0x1d')][_0xb920('0x1e')][_0xb920('0x34')][_0xb920('0x3e')];if(!_0x3807e0[_0xb920('0x3f')](_0xcf23b3[_0xb920('0x40')][_0xb920('0x34')]))throw new Error(_0xb920('0x41')+_0x3807e0[_0xb920('0x42')](',\x20'));if(_0xcf23b3[_0xb920('0x40')][_0xb920('0x34')]===_0xb920('0x35')&&_0xcf23b3[_0xb920('0x40')][_0xb920('0x3a')]){_0xcf23b3[_0xb920('0x40')][_0xb920('0x3a')]=encryptor['encryptString'](_0xcf23b3[_0xb920('0x40')][_0xb920('0x3a')]);}return db[_0xb920('0x1d')]['create'](_0xcf23b3[_0xb920('0x40')],{})[_0xb920('0x16')](respondWithResult(_0x36e9b9,0xc9))['catch'](handleError(_0x36e9b9,null));};exports[_0xb920('0x43')]=function(_0x38c6a9,_0x1a4a01){if(_0x38c6a9['body']['id']){delete _0x38c6a9[_0xb920('0x40')]['id'];}return db[_0xb920('0x1d')]['find']({'where':{'id':_0x38c6a9['params']['id']}})[_0xb920('0x16')](handleEntityNotFound(_0x1a4a01,null))[_0xb920('0x16')](function(_0x2f456c){if(_0x2f456c[_0xb920('0x34')]===_0xb920('0x35')&&_0x38c6a9[_0xb920('0x40')]['data3']){_0x38c6a9[_0xb920('0x40')]['data3']=encryptor[_0xb920('0x44')](_0x38c6a9[_0xb920('0x40')][_0xb920('0x3a')]);}return _0x2f456c;})[_0xb920('0x16')](saveUpdates(_0x38c6a9['body'],null))[_0xb920('0x16')](respondWithResult(_0x1a4a01,null))['catch'](handleError(_0x1a4a01,null));};exports[_0xb920('0x17')]=function(_0x13d359,_0x5ced79){return db[_0xb920('0x1d')][_0xb920('0x39')]({'where':{'id':_0x13d359[_0xb920('0x37')]['id']}})[_0xb920('0x16')](handleEntityNotFound(_0x5ced79,null))[_0xb920('0x16')](removeEntity(_0x5ced79,null))[_0xb920('0x3b')](handleError(_0x5ced79,null));};exports[_0xb920('0x45')]=function(_0xeefd51,_0x2f192c){return db['CloudProvider'][_0xb920('0x46')]({'where':{'id':_0xeefd51[_0xb920('0x37')]['id']},'raw':!![]})[_0xb920('0x16')](function(_0x43d4e5){if(!_0x43d4e5)return _0x2f192c[_0xb920('0xc')](0x194);return{'url':oauth[_0xb920('0x47')](_0x43d4e5,_0xeefd51[_0xb920('0x48')]['id'])};})[_0xb920('0x16')](respondWithResult(_0x2f192c,null))[_0xb920('0x3b')](handleError(_0x2f192c,null));};exports[_0xb920('0x49')]=function(_0x2ed89b,_0x19aea1){var _0x40950d=_0x2ed89b[_0xb920('0x40')];var _0x53a167;var _0x497880;if(_0x40950d[_0xb920('0x4a')])throw _0x40950d;redis[_0xb920('0x4b')](_0x40950d[_0xb920('0x4c')])[_0xb920('0x16')](function(_0x2093dd){if(!_0x2093dd)throw new Error(_0xb920('0x4d'));_0x53a167=JSON[_0xb920('0x4e')](_0x2093dd);var _0x2c000f=Buffer[_0xb920('0x4f')](_0x40950d[_0xb920('0x4c')],_0xb920('0x50'))[_0xb920('0x51')]('ascii');_0x497880=JSON[_0xb920('0x4e')](_0x2c000f);if(!oauth[_0xb920('0x52')](_0x40950d[_0xb920('0x53')],_0x53a167['oauth2Claims']))throw new Error(_0xb920('0x54'));redis[_0xb920('0x55')](_0x40950d[_0xb920('0x4c')]);return oauth[_0xb920('0x56')](_0x40950d[_0xb920('0x57')],_0x53a167);})[_0xb920('0x16')](function(_0xecc869){_0x53a167[_0xb920('0x58')]=_0xecc869['access_token'];_0x53a167['data6']=_0xecc869[_0xb920('0x59')];return db[_0xb920('0x1d')][_0xb920('0x43')]({'data5':_0x53a167['data5'],'data6':_0x53a167['data6']},{'where':{'id':_0x53a167['id']}});})['then'](function(){oauth[_0xb920('0x5a')](_0x53a167);socket[_0xb920('0x5b')]('microsoftAuthorization:success',{'id':_0x497880['id']});return;})['then'](respondWithStatusCode(_0x19aea1,null))[_0xb920('0x3b')](function(_0x2ca0cc){if(_0x497880){socket[_0xb920('0x5b')](_0xb920('0x5c'),{'id':_0x497880['id']});}if(!_0x53a167){logger[_0xb920('0x4a')](_0xb920('0x5d'),_0x2ca0cc);return _0x19aea1['status'](0x1f4)['send'](_0x2ca0cc['message']);}logger[_0xb920('0x4a')](_0xb920('0x5e'),_0x53a167['id'],JSON[_0xb920('0x5f')](_0x2ca0cc));});};
\ No newline at end of file
+var _0xa228=['join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','then','name','send','slice','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','service','MicrosoftAzure','data3','catch','show','params','find','decryptString','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa228,0x192));var _0x8a22=function(_0x35af98,_0x103f33){_0x35af98=_0x35af98-0x0;var _0x5f5a62=_0xa228[_0x35af98];return _0x5f5a62;};'use strict';var _=require(_0x8a22('0x0'));var Redis=require(_0x8a22('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x8a22('0x2'));var config=require(_0x8a22('0x3'));var logger=require('../../config/logger')(_0x8a22('0x4'));var db=require(_0x8a22('0x5'))['db'];var oauth=require(_0x8a22('0x6'));config[_0x8a22('0x7')]=_['defaults'](config['redis'],{'host':_0x8a22('0x8'),'port':0x18eb});var socket=require(_0x8a22('0x9'))(new Redis(config[_0x8a22('0x7')]));var redis=new Redis(config[_0x8a22('0x7')]);function respondWithStatusCode(_0x1423bb,_0x414863){_0x414863=_0x414863||0xcc;return function(_0x82bbed){if(_0x82bbed){return _0x1423bb[_0x8a22('0xa')](_0x414863);}return _0x1423bb['status'](_0x414863)[_0x8a22('0xb')]();};}function respondWithResult(_0x34be90,_0x16d1bf){_0x16d1bf=_0x16d1bf||0xc8;return function(_0x2f6e92){if(_0x2f6e92){return _0x34be90[_0x8a22('0xc')](_0x16d1bf)['json'](_0x2f6e92);}};}function respondWithFilteredResult(_0x1fbadc,_0x57ca70){return function(_0x23f1ad){if(_0x23f1ad){var _0x414a73=typeof _0x57ca70[_0x8a22('0xd')]===_0x8a22('0xe')&&typeof _0x57ca70[_0x8a22('0xf')]===_0x8a22('0xe');var _0x15adcf=_0x23f1ad[_0x8a22('0x10')];var _0x15a483=_0x414a73?0x0:_0x57ca70[_0x8a22('0xd')];var _0x54c011=_0x414a73?_0x23f1ad[_0x8a22('0x10')]:_0x57ca70[_0x8a22('0xd')]+_0x57ca70[_0x8a22('0xf')];var _0x553a85;if(_0x54c011>=_0x15adcf){_0x54c011=_0x15adcf;_0x553a85=0xc8;}else{_0x553a85=0xce;}_0x1fbadc['status'](_0x553a85);return _0x1fbadc[_0x8a22('0x11')](_0x8a22('0x12'),_0x15a483+'-'+_0x54c011+'/'+_0x15adcf)[_0x8a22('0x13')](_0x23f1ad);}return null;};}function saveUpdates(_0x56518f){return function(_0x41d82b){if(_0x41d82b){return _0x41d82b[_0x8a22('0x14')](_0x56518f)[_0x8a22('0x15')](function(_0x5a8374){return _0x5a8374;});}return null;};}function removeEntity(_0x2cd243){return function(_0x46991a){if(_0x46991a){return _0x46991a['destroy']()['then'](function(){_0x2cd243[_0x8a22('0xc')](0xcc)[_0x8a22('0xb')]();});}};}function handleEntityNotFound(_0x930c25){return function(_0x512289){if(!_0x512289){_0x930c25['sendStatus'](0x194);}return _0x512289;};}function handleError(_0x4f80e2,_0x3b4329){_0x3b4329=_0x3b4329||0x1f4;return function(_0x304b14){logger['error'](_0x304b14['stack']);if(_0x304b14[_0x8a22('0x16')]){delete _0x304b14[_0x8a22('0x16')];}_0x4f80e2[_0x8a22('0xc')](_0x3b4329)[_0x8a22('0x17')](_0x304b14);};}function maskClientSecret(_0x2ea91b){return _['padEnd'](_0x2ea91b[_0x8a22('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x34b553,_0x28b2be){var _0x1159a8={},_0x2d21e0={},_0x210b36={'count':0x0,'rows':[]};var _0x3fcb=_[_0x8a22('0x19')](db['CloudProvider'][_0x8a22('0x1a')],function(_0x3665c9){return{'name':_0x3665c9[_0x8a22('0x1b')],'type':_0x3665c9[_0x8a22('0x1c')]['key']};});_0x2d21e0['model']=_['map'](_0x3fcb,_0x8a22('0x16'));_0x2d21e0['query']=_[_0x8a22('0x1d')](_0x34b553[_0x8a22('0x1e')]);_0x2d21e0['filters']=_[_0x8a22('0x1f')](_0x2d21e0[_0x8a22('0x20')],_0x2d21e0[_0x8a22('0x1e')]);_0x1159a8[_0x8a22('0x21')]=_['intersection'](_0x2d21e0[_0x8a22('0x20')],qs[_0x8a22('0x22')](_0x34b553[_0x8a22('0x1e')][_0x8a22('0x22')]));_0x1159a8['attributes']=_0x1159a8[_0x8a22('0x21')][_0x8a22('0x23')]?_0x1159a8['attributes']:_0x2d21e0[_0x8a22('0x20')];if(!_0x34b553[_0x8a22('0x1e')]['hasOwnProperty'](_0x8a22('0x24'))){_0x1159a8[_0x8a22('0xf')]=qs[_0x8a22('0xf')](_0x34b553[_0x8a22('0x1e')][_0x8a22('0xf')]);_0x1159a8['offset']=qs[_0x8a22('0xd')](_0x34b553[_0x8a22('0x1e')][_0x8a22('0xd')]);}_0x1159a8[_0x8a22('0x25')]=qs[_0x8a22('0x26')](_0x34b553[_0x8a22('0x1e')][_0x8a22('0x26')]);_0x1159a8[_0x8a22('0x27')]=qs[_0x8a22('0x28')](_[_0x8a22('0x29')](_0x34b553['query'],_0x2d21e0['filters']),_0x3fcb);if(_0x34b553[_0x8a22('0x1e')][_0x8a22('0x2a')]){_0x1159a8['where']=_[_0x8a22('0x2b')](_0x1159a8['where'],{'$or':_[_0x8a22('0x19')](_0x3fcb,function(_0x28c4c9){if(_0x28c4c9['type']!==_0x8a22('0x2c')){var _0x33a607={};_0x33a607[_0x28c4c9[_0x8a22('0x16')]]={'$like':'%'+_0x34b553[_0x8a22('0x1e')][_0x8a22('0x2a')]+'%'};return _0x33a607;}})});}_0x1159a8=_[_0x8a22('0x2b')]({},_0x1159a8,_0x34b553[_0x8a22('0x2d')]);var _0x114fd5={'where':_0x1159a8['where']};return db[_0x8a22('0x2e')][_0x8a22('0x10')](_0x114fd5)[_0x8a22('0x15')](function(_0x1374fc){_0x210b36['count']=_0x1374fc;if(_0x34b553[_0x8a22('0x1e')][_0x8a22('0x2f')]){_0x1159a8[_0x8a22('0x30')]=[{'all':!![]}];}return db[_0x8a22('0x2e')]['findAll'](_0x1159a8);})[_0x8a22('0x15')](function(_0x31e983){_0x210b36['rows']=_[_0x8a22('0x19')](_0x31e983,function(_0x4ed05c){if(_0x4ed05c[_0x8a22('0x31')]===_0x8a22('0x32')){var _0x536d10=encryptor['decryptString'](_0x4ed05c[_0x8a22('0x33')]);_0x4ed05c[_0x8a22('0x33')]=maskClientSecret(_0x536d10);}return _0x4ed05c;});return _0x210b36;})[_0x8a22('0x15')](respondWithFilteredResult(_0x28b2be,_0x1159a8))[_0x8a22('0x34')](handleError(_0x28b2be,null));};exports[_0x8a22('0x35')]=function(_0x5b8e94,_0x20b376){var _0x1e4c81={'raw':!![],'where':{'id':_0x5b8e94[_0x8a22('0x36')]['id']}},_0x10d22c={};_0x10d22c['model']=_[_0x8a22('0x1d')](db['CloudProvider'][_0x8a22('0x1a')]);_0x10d22c['query']=_['keys'](_0x5b8e94['query']);_0x10d22c[_0x8a22('0x28')]=_[_0x8a22('0x1f')](_0x10d22c[_0x8a22('0x20')],_0x10d22c['query']);_0x1e4c81[_0x8a22('0x21')]=_[_0x8a22('0x1f')](_0x10d22c[_0x8a22('0x20')],qs['fields'](_0x5b8e94[_0x8a22('0x1e')][_0x8a22('0x22')]));_0x1e4c81['attributes']=_0x1e4c81[_0x8a22('0x21')][_0x8a22('0x23')]?_0x1e4c81[_0x8a22('0x21')]:_0x10d22c[_0x8a22('0x20')];if(_0x5b8e94['query'][_0x8a22('0x2f')]){_0x1e4c81[_0x8a22('0x30')]=[{'all':!![]}];}_0x1e4c81=_[_0x8a22('0x2b')]({},_0x1e4c81,_0x5b8e94[_0x8a22('0x2d')]);return db[_0x8a22('0x2e')][_0x8a22('0x37')](_0x1e4c81)[_0x8a22('0x15')](handleEntityNotFound(_0x20b376,null))[_0x8a22('0x15')](function(_0x5087c6){if(_0x5087c6['service']===_0x8a22('0x32')){var _0x1860e4=encryptor[_0x8a22('0x38')](_0x5087c6[_0x8a22('0x33')]);_0x5087c6['data3']=maskClientSecret(_0x1860e4);}return _0x5087c6;})[_0x8a22('0x15')](respondWithResult(_0x20b376,null))[_0x8a22('0x34')](handleError(_0x20b376,null));};exports[_0x8a22('0x39')]=function(_0x4f4784,_0x2f3dd7){if(!_0x4f4784['body']['name'])throw new Error(_0x8a22('0x3a'));if(!_0x4f4784[_0x8a22('0x3b')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0xadbe1f=db[_0x8a22('0x2e')]['rawAttributes'][_0x8a22('0x31')][_0x8a22('0x3c')];if(!_0xadbe1f[_0x8a22('0x3d')](_0x4f4784['body']['service']))throw new Error(_0x8a22('0x3e')+_0xadbe1f[_0x8a22('0x3f')](',\x20'));if(_0x4f4784['body']['service']===_0x8a22('0x32')&&_0x4f4784[_0x8a22('0x3b')][_0x8a22('0x33')]){_0x4f4784[_0x8a22('0x3b')][_0x8a22('0x33')]=encryptor[_0x8a22('0x40')](_0x4f4784[_0x8a22('0x3b')][_0x8a22('0x33')]);}return db[_0x8a22('0x2e')][_0x8a22('0x39')](_0x4f4784['body'],{})[_0x8a22('0x15')](respondWithResult(_0x2f3dd7,0xc9))[_0x8a22('0x34')](handleError(_0x2f3dd7,null));};exports[_0x8a22('0x14')]=function(_0x28db6a,_0xf89e5a){if(_0x28db6a[_0x8a22('0x3b')]['id']){delete _0x28db6a[_0x8a22('0x3b')]['id'];}return db[_0x8a22('0x2e')][_0x8a22('0x37')]({'where':{'id':_0x28db6a['params']['id']}})[_0x8a22('0x15')](handleEntityNotFound(_0xf89e5a,null))[_0x8a22('0x15')](function(_0x1ab8d1){if(_0x1ab8d1['service']===_0x8a22('0x32')&&_0x28db6a[_0x8a22('0x3b')][_0x8a22('0x33')]){_0x28db6a[_0x8a22('0x3b')][_0x8a22('0x33')]=encryptor[_0x8a22('0x40')](_0x28db6a[_0x8a22('0x3b')]['data3']);}return _0x1ab8d1;})[_0x8a22('0x15')](saveUpdates(_0x28db6a[_0x8a22('0x3b')],null))[_0x8a22('0x15')](respondWithResult(_0xf89e5a,null))[_0x8a22('0x34')](handleError(_0xf89e5a,null));};exports[_0x8a22('0x41')]=function(_0x4eb39e,_0x2c77c7){return db[_0x8a22('0x2e')][_0x8a22('0x37')]({'where':{'id':_0x4eb39e[_0x8a22('0x36')]['id']}})[_0x8a22('0x15')](handleEntityNotFound(_0x2c77c7,null))[_0x8a22('0x15')](removeEntity(_0x2c77c7,null))['catch'](handleError(_0x2c77c7,null));};exports[_0x8a22('0x42')]=function(_0x5e5abf,_0x2b0d85){return db[_0x8a22('0x2e')][_0x8a22('0x43')]({'where':{'id':_0x5e5abf['params']['id']},'raw':!![]})['then'](function(_0x41d0a9){if(!_0x41d0a9)return _0x2b0d85['sendStatus'](0x194);return{'url':oauth[_0x8a22('0x44')](_0x41d0a9,_0x5e5abf[_0x8a22('0x45')]['id'])};})['then'](respondWithResult(_0x2b0d85,null))[_0x8a22('0x34')](handleError(_0x2b0d85,null));};exports[_0x8a22('0x46')]=function(_0xa8b65,_0x3794f6){var _0x28bc1b=_0xa8b65[_0x8a22('0x3b')];var _0x56cde0;var _0x5ef9f0;if(_0x28bc1b['error'])throw _0x28bc1b;redis['get'](_0x28bc1b[_0x8a22('0x47')])[_0x8a22('0x15')](function(_0x2cf3ce){if(!_0x2cf3ce)throw new Error(_0x8a22('0x48'));_0x56cde0=JSON[_0x8a22('0x49')](_0x2cf3ce);var _0x37988e=Buffer[_0x8a22('0x4a')](_0x28bc1b[_0x8a22('0x47')],_0x8a22('0x4b'))['toString'](_0x8a22('0x4c'));_0x5ef9f0=JSON[_0x8a22('0x49')](_0x37988e);if(!oauth[_0x8a22('0x4d')](_0x28bc1b[_0x8a22('0x4e')],_0x56cde0['oauth2Claims']))throw new Error(_0x8a22('0x4f'));redis['del'](_0x28bc1b[_0x8a22('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x28bc1b['code'],_0x56cde0);})[_0x8a22('0x15')](function(_0x4c3b99){_0x56cde0[_0x8a22('0x50')]=_0x4c3b99[_0x8a22('0x51')];_0x56cde0[_0x8a22('0x52')]=_0x4c3b99[_0x8a22('0x53')];return db[_0x8a22('0x2e')][_0x8a22('0x14')]({'data5':_0x56cde0['data5'],'data6':_0x56cde0['data6']},{'where':{'id':_0x56cde0['id']}});})[_0x8a22('0x15')](function(){oauth[_0x8a22('0x54')](_0x56cde0);socket[_0x8a22('0x55')](_0x8a22('0x56'),{'id':_0x5ef9f0['id']});return;})[_0x8a22('0x15')](respondWithStatusCode(_0x3794f6,null))[_0x8a22('0x34')](function(_0x4a4c28){if(_0x5ef9f0){socket[_0x8a22('0x55')](_0x8a22('0x57'),{'id':_0x5ef9f0['id']});}if(!_0x56cde0){logger['error'](_0x8a22('0x58'),_0x4a4c28);return _0x3794f6[_0x8a22('0xc')](0x1f4)['send'](_0x4a4c28[_0x8a22('0x59')]);}logger[_0x8a22('0x5a')](_0x8a22('0x5b'),_0x56cde0['id'],JSON[_0x8a22('0x5c')](_0x4a4c28));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 05579cc..ca4ca32 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 _0xcb40=['../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x17daa3,_0x5ea740){var _0x1eb9b2=function(_0x268902){while(--_0x268902){_0x17daa3['push'](_0x17daa3['shift']());}};_0x1eb9b2(++_0x5ea740);}(_0xcb40,0x18b));var _0x0cb4=function(_0xba81f5,_0x340a4b){_0xba81f5=_0xba81f5-0x0;var _0x399dbb=_0xcb40[_0xba81f5];return _0x399dbb;};'use strict';var _=require(_0x0cb4('0x0'));var util=require(_0x0cb4('0x1'));var logger=require(_0x0cb4('0x2'))(_0x0cb4('0x3'));var moment=require('moment');var BPromise=require(_0x0cb4('0x4'));var rp=require(_0x0cb4('0x5'));var fs=require('fs');var path=require(_0x0cb4('0x6'));var rimraf=require(_0x0cb4('0x7'));var config=require(_0x0cb4('0x8'));var attributes=require(_0x0cb4('0x9'));module[_0x0cb4('0xa')]=function(_0x1e0941,_0x1ce71c){return _0x1e0941['define'](_0x0cb4('0xb'),attributes,{'tableName':_0x0cb4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0670=['moment','bluebird','../../config/environment','./cloudProvider.attributes','lodash','util','../../config/logger','api'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x0670,0xf4));var _0x0067=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0x0670[_0x451735];return _0x41d1e2;};'use strict';var _=require(_0x0067('0x0'));var util=require(_0x0067('0x1'));var logger=require(_0x0067('0x2'))(_0x0067('0x3'));var moment=require(_0x0067('0x4'));var BPromise=require(_0x0067('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0067('0x6'));var attributes=require(_0x0067('0x7'));module['exports']=function(_0x5f5561,_0x4252c8){return _0x5f5561['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 43c861c..b5574f2 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 _0xb1e6=['lodash','jsonwebtoken','moment','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','/.default','data2','code','id_token','from','stringify','toString','randomBytes','client_id','data1','redirect_uri','data4','scope','prompt','oauth2Claims','replace','oauth2/','set','decode','payload','aud','audience','nonce','isAfter','unix','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','{TENANT_ID}','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s'];(function(_0x32b071,_0x3f20ec){var _0x5c1e99=function(_0x19015b){while(--_0x19015b){_0x32b071['push'](_0x32b071['shift']());}};_0x5c1e99(++_0x3f20ec);}(_0xb1e6,0x172));var _0x6b1e=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0xb1e6[_0x4f08dd];return _0x3017ee;};'use strict';var _=require(_0x6b1e('0x0'));var crypto=require('crypto');var jwt=require(_0x6b1e('0x1'));var moment=require(_0x6b1e('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x6b1e('0x3'));var encryptor=require(_0x6b1e('0x4'));var config=require(_0x6b1e('0x5'));var logger=require(_0x6b1e('0x6'))(_0x6b1e('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x6b1e('0x8'))['db'];config[_0x6b1e('0x9')]=_[_0x6b1e('0xa')](config[_0x6b1e('0x9')],{'host':_0x6b1e('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x6b1e('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6b1e('0xd'),_0x6b1e('0xe'),'email',_0x6b1e('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x6b1e('0x10')],'Dynamics365':[_0x6b1e('0xd'),_0x6b1e('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x6b1e('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x6b1e('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5d608e){var _0x9194e8=_[_0x6b1e('0x13')](AZURE_AUTH_SCOPES[_0x5d608e[_0x6b1e('0x14')]]);if(_0x5d608e[_0x6b1e('0x14')]==='Dynamics365')_0x9194e8[_0x6b1e('0x15')](_0x5d608e[_0x6b1e('0x16')]+'/.default');return _0x9194e8[_0x6b1e('0x17')]('\x20');}function getAccessTokenScope(_0x20a8cc){if(_0x20a8cc[_0x6b1e('0x14')]===_0x6b1e('0x18'))return _0x6b1e('0x19');if(_0x20a8cc['type']===_0x6b1e('0x1a'))return _0x20a8cc[_0x6b1e('0x16')]+_0x6b1e('0x1b');}function generateMicrosoftAuthorizationUrl(_0x270052,_0x29cfa2){var _0x1297a3=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x270052[_0x6b1e('0x1c')]);var _0x3fae79=[_0x6b1e('0x1d'),_0x6b1e('0x1e')];var _0x29fca7=Buffer[_0x6b1e('0x1f')](JSON[_0x6b1e('0x20')]({'id':_0x29cfa2}))[_0x6b1e('0x21')]('base64');var _0x4250ba=crypto[_0x6b1e('0x22')](0x10)['toString']('hex');var _0xbfd516=getAuthorizationScopes(_0x270052);var _0x1057d9=[{'key':_0x6b1e('0x23'),'value':_0x270052[_0x6b1e('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x3fae79[_0x6b1e('0x17')]('\x20'))},{'key':_0x6b1e('0x25'),'value':_0x270052[_0x6b1e('0x26')]},{'key':'response_mode','value':'form_post'},{'key':_0x6b1e('0x27'),'value':encodeURIComponent(_0xbfd516)},{'key':'state','value':_0x29fca7},{'key':'nonce','value':_0x4250ba},{'key':_0x6b1e('0x28'),'value':'login'}];var _0x1ba9c4=_0x1297a3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6b1e('0x13')](_0x1057d9,function(_0x2e44e6){return _0x2e44e6['key']+'='+_0x2e44e6['value'];})[_0x6b1e('0x17')]('&');_0x270052[_0x6b1e('0x29')]={'issuer':_0x1297a3[_0x6b1e('0x2a')](_0x6b1e('0x2b'),''),'audience':_0x270052[_0x6b1e('0x24')],'state':_0x29fca7,'nonce':_0x4250ba};redis[_0x6b1e('0x2c')](_0x29fca7,JSON[_0x6b1e('0x20')](_0x270052));return _0x1ba9c4;}function isValidIdToken(_0x99a378,_0x50a4a6){try{var _0x67154d=jwt[_0x6b1e('0x2d')](_0x99a378,{'complete':!![]});var _0x5da510=_0x67154d[_0x6b1e('0x2e')];if(_0x5da510['iss']!==_0x50a4a6['issuer'])return![];if(_0x5da510[_0x6b1e('0x2f')]!==_0x50a4a6[_0x6b1e('0x30')])return![];if(_0x5da510[_0x6b1e('0x31')]!==_0x50a4a6[_0x6b1e('0x31')])return![];if(moment()[_0x6b1e('0x32')](moment[_0x6b1e('0x33')](_0x5da510['exp'])))return![];return!![];}catch(_0x4f92df){throw _0x4f92df;}}function refreshOauth2MicrosoftAccessToken(_0x30ab51){return Promise[_0x6b1e('0x34')]()[_0x6b1e('0x35')](function(){if(_0x30ab51['data3'])return _0x30ab51;return db[_0x6b1e('0x36')][_0x6b1e('0x37')]({'where':{'id':_0x30ab51['id']},'raw':!![]});})[_0x6b1e('0x35')](function(_0x472df9){var _0xa81492={'grant_type':_0x6b1e('0x38'),'refresh_token':_0x472df9[_0x6b1e('0x39')],'scope':getAccessTokenScope(_0x472df9),'redirect_uri':_0x472df9['data4'],'client_id':_0x472df9['data1'],'client_secret':encryptor[_0x6b1e('0x3a')](_0x472df9[_0x6b1e('0x3b')])};var _0x120153={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x6b1e('0x2a')](_0x6b1e('0x3c'),_0x472df9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xa81492,'json':!![]};return rp(_0x120153);})[_0x6b1e('0x35')](function(_0x22438e){_0x30ab51[_0x6b1e('0x3d')]=_0x22438e['access_token'];_0x30ab51['data6']=_0x22438e[_0x6b1e('0x38')];return db['CloudProvider'][_0x6b1e('0x3e')]({'data5':_0x30ab51[_0x6b1e('0x3d')],'data6':_0x30ab51[_0x6b1e('0x39')]},{'where':{'id':_0x30ab51['id']}});})[_0x6b1e('0x35')](function(){return _0x30ab51;})[_0x6b1e('0x3f')](function(_0x257176){logger[_0x6b1e('0x40')](_0x6b1e('0x41'),_0x30ab51['id'],_0x257176);});}function getOauth2MicrosoftAccessToken(_0x791989,_0x2a4868){var _0x3736aa={'grant_type':_0x6b1e('0x42'),'code':_0x791989,'scope':getAccessTokenScope(_0x2a4868),'redirect_uri':_0x2a4868[_0x6b1e('0x26')],'client_id':_0x2a4868['data1'],'client_secret':encryptor['decryptString'](_0x2a4868[_0x6b1e('0x3b')])};var _0x372166={'method':_0x6b1e('0x43'),'uri':MICROSOFT_AUTH_URL[_0x6b1e('0x2a')](_0x6b1e('0x3c'),_0x2a4868['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3736aa,'json':!![]};return rp(_0x372166);}function startRefreshInterval(_0x54572d){var _0x3df530=schedule[_0x6b1e('0x44')];if(_0x3df530[_0x54572d['id']])clearInterval(_0x3df530[_0x54572d['id']]);_0x3df530[_0x54572d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6b1e('0x45')](this,{'id':_0x54572d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3df530;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x6b1e('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6b1e('0x35')](function(_0x21f746){var _0x3ad97a=_0x21f746[_0x6b1e('0x13')](function(_0x1ee170){return refreshOauth2MicrosoftAccessToken(_0x1ee170)[_0x6b1e('0x35')](function(_0x1e9cda){startRefreshInterval(_0x1e9cda);});});return Promise[_0x6b1e('0x47')](_0x3ad97a);})[_0x6b1e('0x3f')](function(_0x556c82){var _0xfa078c=_0x556c82?util[_0x6b1e('0x48')](_0x556c82,{'showHidden':![],'depth':null}):'';logger['error'](_0x6b1e('0x49'),_0xfa078c);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x77e9=['data3','data6','decryptString','POST','data5','access_token','refresh_token','CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data1','intervals','bind','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','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','push','data7','join','Outlook365','Dynamics365','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','state','prompt','value','oauth2Claims','iss','issuer','aud','audience','nonce','isAfter','unix','exp','then'];(function(_0x3f0d61,_0x5ad324){var _0xfde3f6=function(_0x525073){while(--_0x525073){_0x3f0d61['push'](_0x3f0d61['shift']());}};_0xfde3f6(++_0x5ad324);}(_0x77e9,0x1e1));var _0x977e=function(_0x614b66,_0x580c83){_0x614b66=_0x614b66-0x0;var _0x2c7a20=_0x77e9[_0x614b66];return _0x2c7a20;};'use strict';var _=require(_0x977e('0x0'));var crypto=require(_0x977e('0x1'));var jwt=require(_0x977e('0x2'));var moment=require(_0x977e('0x3'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x977e('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x977e('0x5'));var schedule=require(_0x977e('0x6'));var db=require(_0x977e('0x7'))['db'];config[_0x977e('0x8')]=_[_0x977e('0x9')](config['redis'],{'host':_0x977e('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x977e('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x977e('0xc'),_0x977e('0xd'),_0x977e('0xe'),_0x977e('0xf'),_0x977e('0x10'),_0x977e('0x11'),_0x977e('0x12')],'Dynamics365':['openid',_0x977e('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x977e('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x977e('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x28ae5c){var _0x1cd9dd=_[_0x977e('0x15')](AZURE_AUTH_SCOPES[_0x28ae5c[_0x977e('0x16')]]);if(_0x28ae5c['type']==='Dynamics365')_0x1cd9dd[_0x977e('0x17')](_0x28ae5c[_0x977e('0x18')]+'/.default');return _0x1cd9dd[_0x977e('0x19')]('\x20');}function getAccessTokenScope(_0x3f8e72){if(_0x3f8e72[_0x977e('0x16')]===_0x977e('0x1a'))return _0x977e('0x10');if(_0x3f8e72['type']===_0x977e('0x1b'))return _0x3f8e72[_0x977e('0x18')]+_0x977e('0x1c');}function generateMicrosoftAuthorizationUrl(_0x28c469,_0x5c0349){var _0x3cf7ff=MICROSOFT_AUTH_URL[_0x977e('0x1d')](_0x977e('0x1e'),_0x28c469[_0x977e('0x1f')]);var _0x2f5d45=[_0x977e('0x20'),_0x977e('0x21')];var _0x142f50=Buffer[_0x977e('0x22')](JSON[_0x977e('0x23')]({'id':_0x5c0349}))[_0x977e('0x24')](_0x977e('0x25'));var _0xdc37c8=crypto['randomBytes'](0x10)[_0x977e('0x24')]('hex');var _0x1c22e4=getAuthorizationScopes(_0x28c469);var _0x2df98b=[{'key':_0x977e('0x26'),'value':_0x28c469['data1']},{'key':_0x977e('0x27'),'value':encodeURIComponent(_0x2f5d45[_0x977e('0x19')]('\x20'))},{'key':_0x977e('0x28'),'value':_0x28c469[_0x977e('0x29')]},{'key':_0x977e('0x2a'),'value':_0x977e('0x2b')},{'key':_0x977e('0x2c'),'value':encodeURIComponent(_0x1c22e4)},{'key':_0x977e('0x2d'),'value':_0x142f50},{'key':'nonce','value':_0xdc37c8},{'key':_0x977e('0x2e'),'value':'login'}];var _0x39e10e=_0x3cf7ff+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x977e('0x15')](_0x2df98b,function(_0x2c3f74){return _0x2c3f74['key']+'='+_0x2c3f74[_0x977e('0x2f')];})[_0x977e('0x19')]('&');_0x28c469[_0x977e('0x30')]={'issuer':_0x3cf7ff[_0x977e('0x1d')]('oauth2/',''),'audience':_0x28c469['data1'],'state':_0x142f50,'nonce':_0xdc37c8};redis['set'](_0x142f50,JSON[_0x977e('0x23')](_0x28c469));return _0x39e10e;}function isValidIdToken(_0x3cd383,_0x365d32){try{var _0x520332=jwt['decode'](_0x3cd383,{'complete':!![]});var _0x452e2a=_0x520332['payload'];if(_0x452e2a[_0x977e('0x31')]!==_0x365d32[_0x977e('0x32')])return![];if(_0x452e2a[_0x977e('0x33')]!==_0x365d32[_0x977e('0x34')])return![];if(_0x452e2a['nonce']!==_0x365d32[_0x977e('0x35')])return![];if(moment()[_0x977e('0x36')](moment[_0x977e('0x37')](_0x452e2a[_0x977e('0x38')])))return![];return!![];}catch(_0x2e5cb0){throw _0x2e5cb0;}}function refreshOauth2MicrosoftAccessToken(_0x130daa){return Promise['resolve']()[_0x977e('0x39')](function(){if(_0x130daa[_0x977e('0x3a')])return _0x130daa;return db['CloudProvider']['findOne']({'where':{'id':_0x130daa['id']},'raw':!![]});})[_0x977e('0x39')](function(_0x173386){var _0x5b65a2={'grant_type':'refresh_token','refresh_token':_0x173386[_0x977e('0x3b')],'scope':getAccessTokenScope(_0x173386),'redirect_uri':_0x173386[_0x977e('0x29')],'client_id':_0x173386['data1'],'client_secret':encryptor[_0x977e('0x3c')](_0x173386[_0x977e('0x3a')])};var _0x5554be={'method':_0x977e('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x977e('0x1d')](_0x977e('0x1e'),_0x173386['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5b65a2,'json':!![]};return rp(_0x5554be);})['then'](function(_0x20ca9b){_0x130daa[_0x977e('0x3e')]=_0x20ca9b[_0x977e('0x3f')];_0x130daa[_0x977e('0x3b')]=_0x20ca9b[_0x977e('0x40')];return db[_0x977e('0x41')]['update']({'data5':_0x130daa[_0x977e('0x3e')],'data6':_0x130daa[_0x977e('0x3b')]},{'where':{'id':_0x130daa['id']}});})['then'](function(){return _0x130daa;})[_0x977e('0x42')](function(_0x17170a){logger[_0x977e('0x43')](_0x977e('0x44'),_0x130daa['id'],_0x17170a);});}function getOauth2MicrosoftAccessToken(_0x3194dc,_0x47f85d){var _0x47ee70={'grant_type':_0x977e('0x45'),'code':_0x3194dc,'scope':getAccessTokenScope(_0x47f85d),'redirect_uri':_0x47f85d['data4'],'client_id':_0x47f85d[_0x977e('0x46')],'client_secret':encryptor['decryptString'](_0x47f85d[_0x977e('0x3a')])};var _0x25295f={'method':_0x977e('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x977e('0x1d')]('{TENANT_ID}',_0x47f85d[_0x977e('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x47ee70,'json':!![]};return rp(_0x25295f);}function startRefreshInterval(_0x4515fa){var _0x26df43=schedule[_0x977e('0x47')];if(_0x26df43[_0x4515fa['id']])clearInterval(_0x26df43[_0x4515fa['id']]);_0x26df43[_0x4515fa['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x977e('0x48')](this,{'id':_0x4515fa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x26df43;}function startAllRefreshIntervals(){return db[_0x977e('0x41')][_0x977e('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x977e('0x39')](function(_0x3577ad){var _0x35fbeb=_0x3577ad[_0x977e('0x15')](function(_0x31f5f8){return refreshOauth2MicrosoftAccessToken(_0x31f5f8)[_0x977e('0x39')](function(_0x100726){startRefreshInterval(_0x100726);});});return Promise['all'](_0x35fbeb);})['catch'](function(_0x5dd2d2){var _0x584f75=_0x5dd2d2?util[_0x977e('0x4a')](_0x5dd2d2,{'showHidden':![],'depth':null}):'';logger[_0x977e('0x43')](_0x977e('0x4b'),_0x584f75);});}module[_0x977e('0x4c')]={'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 1c83e47..5716369 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 _0xeba2=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xeba2,0x70));var _0x2eba=function(_0x22aa61,_0x45e107){_0x22aa61=_0x22aa61-0x0;var _0x51500a=_0xeba2[_0x22aa61];return _0x51500a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2eba('0x0'));var BPromise=require(_0x2eba('0x1'));var rs=require(_0x2eba('0x2'));var fs=require('fs');var Redis=require(_0x2eba('0x3'));var db=require(_0x2eba('0x4'))['db'];var utils=require(_0x2eba('0x5'));var logger=require(_0x2eba('0x6'))(_0x2eba('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2eba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b4d9a,_0x14c40a,_0x4e7a50){return new BPromise(function(_0x279806,_0x1fed79){return client[_0x2eba('0x9')](_0x1b4d9a,_0x4e7a50)[_0x2eba('0xa')](function(_0x1cc4e){logger[_0x2eba('0xb')](_0x2eba('0xc'),_0x14c40a,_0x2eba('0xd'));logger[_0x2eba('0xe')](_0x2eba('0xf'),_0x14c40a,'request\x20sent',JSON[_0x2eba('0x10')](_0x1cc4e));if(_0x1cc4e[_0x2eba('0x11')]){if(_0x1cc4e['error'][_0x2eba('0x12')]===0x1f4){logger[_0x2eba('0x11')](_0x2eba('0xc'),_0x14c40a,_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);return _0x1fed79(_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x14c40a,_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);return _0x279806(_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);}else{logger[_0x2eba('0xb')]('CloudProvider,\x20%s,\x20%s',_0x14c40a,_0x2eba('0xd'));_0x279806(_0x1cc4e[_0x2eba('0x14')][_0x2eba('0x13')]);}})[_0x2eba('0x15')](function(_0x2de66e){logger['error'](_0x2eba('0xc'),_0x14c40a,_0x2de66e);_0x1fed79(_0x2de66e);});});}
\ No newline at end of file
+var _0xa9e1=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','CloudProvider,\x20%s,\x20%s','message','error','request\x20sent','result','lodash','util','bluebird','randomstring'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xa9e1[_0x56daff];return _0x132c82;};'use strict';var _=require(_0x1a9e('0x0'));var util=require(_0x1a9e('0x1'));var moment=require('moment');var BPromise=require(_0x1a9e('0x2'));var rs=require(_0x1a9e('0x3'));var fs=require('fs');var Redis=require(_0x1a9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a9e('0x5'));var logger=require('../../config/logger')(_0x1a9e('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a9e('0x7'));var client=jayson[_0x1a9e('0x8')][_0x1a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc9409c,_0x2b8600,_0x91b2c3){return new BPromise(function(_0x9bf04c,_0x32c466){return client[_0x1a9e('0xa')](_0xc9409c,_0x91b2c3)[_0x1a9e('0xb')](function(_0x4f9f78){logger[_0x1a9e('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2b8600,'request\x20sent');logger['debug'](_0x1a9e('0xd'),_0x2b8600,'request\x20sent',JSON[_0x1a9e('0xe')](_0x4f9f78));if(_0x4f9f78['error']){if(_0x4f9f78['error'][_0x1a9e('0xf')]===0x1f4){logger['error'](_0x1a9e('0x10'),_0x2b8600,_0x4f9f78['error'][_0x1a9e('0x11')]);return _0x32c466(_0x4f9f78[_0x1a9e('0x12')][_0x1a9e('0x11')]);}logger[_0x1a9e('0x12')](_0x1a9e('0x10'),_0x2b8600,_0x4f9f78[_0x1a9e('0x12')][_0x1a9e('0x11')]);return _0x9bf04c(_0x4f9f78[_0x1a9e('0x12')]['message']);}else{logger[_0x1a9e('0xc')](_0x1a9e('0x10'),_0x2b8600,_0x1a9e('0x13'));_0x9bf04c(_0x4f9f78[_0x1a9e('0x14')][_0x1a9e('0x11')]);}})['catch'](function(_0x303979){logger[_0x1a9e('0x12')](_0x1a9e('0x10'),_0x2b8600,_0x303979);_0x32c466(_0x303979);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 9cb6259..e56b546 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37ab7b,_0x509b5b){_0x37ab7b=_0x37ab7b-0x0;var _0x3b871f=_0x5f2f[_0x37ab7b];return _0x3b871f;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x37a858,_0x42a793){var _0x1807a7=function(_0x37fd2c){while(--_0x37fd2c){_0x37a858['push'](_0x37a858['shift']());}};_0x1807a7(++_0x42a793);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 59402e4..885ea36 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 _0xc7c6=['sequelize','exports','STRING'];(function(_0x58225c,_0x10d79f){var _0x268260=function(_0x31f50d){while(--_0x31f50d){_0x58225c['push'](_0x58225c['shift']());}};_0x268260(++_0x10d79f);}(_0xc7c6,0x14a));var _0x6c7c=function(_0x3f8529,_0xd67c1a){_0x3f8529=_0x3f8529-0x0;var _0x34091f=_0xc7c6[_0x3f8529];return _0x34091f;};'use strict';var Sequelize=require(_0x6c7c('0x0'));module[_0x6c7c('0x1')]={'name':{'type':Sequelize[_0x6c7c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6c7c('0x2')]},'companyId':{'type':Sequelize[_0x6c7c('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x6c7c('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x6c7c('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x6c7c('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6c7c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x6c7c('0x2')]},'sStreet':{'type':Sequelize[_0x6c7c('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x6c7c('0x2')]},'sCountry':{'type':Sequelize[_0x6c7c('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4b84=['STRING','sequelize','exports'];(function(_0x1b8b95,_0x3ea343){var _0x3657ae=function(_0x3703e1){while(--_0x3703e1){_0x1b8b95['push'](_0x1b8b95['shift']());}};_0x3657ae(++_0x3ea343);}(_0x4b84,0x1cc));var _0x44b8=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0x4b84[_0x12e073];return _0x267748;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x44b8('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x44b8('0x2')]},'fax':{'type':Sequelize[_0x44b8('0x2')]},'type':{'type':Sequelize[_0x44b8('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x44b8('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x44b8('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x44b8('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44b8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 4dd30b7..06f0a13 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 _0xebf2=['end','json','offset','undefined','count','limit','reject','save','update','destroy','then','get','Companies','stack','name','send','index','CmCompany','model','keys','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','map','merge','options','include','findAll','catch','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','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'];(function(_0x57cdfe,_0xb7d00e){var _0x1a8c81=function(_0x17e1e1){while(--_0x17e1e1){_0x57cdfe['push'](_0x57cdfe['shift']());}};_0x1a8c81(++_0xb7d00e);}(_0xebf2,0x91));var _0x2ebf=function(_0x4c54c0,_0x112d91){_0x4c54c0=_0x4c54c0-0x0;var _0x147adb=_0xebf2[_0x4c54c0];return _0x147adb;};'use strict';var emlformat=require(_0x2ebf('0x0'));var rimraf=require(_0x2ebf('0x1'));var zipdir=require(_0x2ebf('0x2'));var jsonpatch=require(_0x2ebf('0x3'));var rp=require(_0x2ebf('0x4'));var moment=require(_0x2ebf('0x5'));var BPromise=require(_0x2ebf('0x6'));var Mustache=require('mustache');var util=require(_0x2ebf('0x7'));var path=require('path');var sox=require(_0x2ebf('0x8'));var csv=require(_0x2ebf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ebf('0xa'));var _=require(_0x2ebf('0xb'));var squel=require(_0x2ebf('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2ebf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2ebf('0xe'));var Papa=require(_0x2ebf('0xf'));var Redis=require(_0x2ebf('0x10'));var authService=require(_0x2ebf('0x11'));var qs=require(_0x2ebf('0x12'));var as=require(_0x2ebf('0x13'));var hardwareService=require(_0x2ebf('0x14'));var logger=require(_0x2ebf('0x15'))(_0x2ebf('0x16'));var utils=require(_0x2ebf('0x17'));var config=require(_0x2ebf('0x18'));var licenseUtil=require(_0x2ebf('0x19'));var db=require(_0x2ebf('0x1a'))['db'];function respondWithStatusCode(_0x17150e,_0x13011a){_0x13011a=_0x13011a||0xcc;return function(_0x2b8108){if(_0x2b8108){return _0x17150e[_0x2ebf('0x1b')](_0x13011a);}return _0x17150e[_0x2ebf('0x1c')](_0x13011a)[_0x2ebf('0x1d')]();};}function respondWithResult(_0x1a299d,_0x34085d){_0x34085d=_0x34085d||0xc8;return function(_0x397d76){if(_0x397d76){return _0x1a299d[_0x2ebf('0x1c')](_0x34085d)[_0x2ebf('0x1e')](_0x397d76);}};}function respondWithFilteredResult(_0x251eb7,_0x235eca){return function(_0x4a26d0){if(_0x4a26d0){var _0xa9c300=typeof _0x235eca[_0x2ebf('0x1f')]===_0x2ebf('0x20')&&typeof _0x235eca['limit']===_0x2ebf('0x20');var _0x4f2585=_0x4a26d0[_0x2ebf('0x21')];var _0x291181=_0xa9c300?0x0:_0x235eca[_0x2ebf('0x1f')];var _0x322c63=_0xa9c300?_0x4a26d0[_0x2ebf('0x21')]:_0x235eca[_0x2ebf('0x1f')]+_0x235eca[_0x2ebf('0x22')];var _0x4802ad;if(_0x322c63>=_0x4f2585){_0x322c63=_0x4f2585;_0x4802ad=0xc8;}else{_0x4802ad=0xce;}_0x251eb7[_0x2ebf('0x1c')](_0x4802ad);return _0x251eb7['set']('Content-Range',_0x291181+'-'+_0x322c63+'/'+_0x4f2585)[_0x2ebf('0x1e')](_0x4a26d0);}return null;};}function patchUpdates(_0x44c3bc){return function(_0x20ab2b){try{jsonpatch['apply'](_0x20ab2b,_0x44c3bc,!![]);}catch(_0x2b54d6){return BPromise[_0x2ebf('0x23')](_0x2b54d6);}return _0x20ab2b[_0x2ebf('0x24')]();};}function saveUpdates(_0x3ed9d6,_0xc6399){return function(_0x412d40){if(_0x412d40){return _0x412d40[_0x2ebf('0x25')](_0x3ed9d6)['then'](function(_0x3148cf){return _0x3148cf;});}return null;};}function removeEntity(_0x34af32,_0x4af01d){return function(_0x4ab6bc){if(_0x4ab6bc){return _0x4ab6bc[_0x2ebf('0x26')]()[_0x2ebf('0x27')](function(){var _0x2c855f=_0x4ab6bc[_0x2ebf('0x28')]({'plain':!![]});var _0x280f93=_0x2ebf('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x280f93,'resourceId':_0x2c855f['id']}})[_0x2ebf('0x27')](function(){return _0x4ab6bc;});})[_0x2ebf('0x27')](function(){_0x34af32[_0x2ebf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4529d9,_0x596229){return function(_0x2c4087){if(!_0x2c4087){_0x4529d9['sendStatus'](0x194);}return _0x2c4087;};}function handleError(_0x5c4184,_0x1383d2){_0x1383d2=_0x1383d2||0x1f4;return function(_0x55f678){logger['error'](_0x55f678[_0x2ebf('0x2a')]);if(_0x55f678[_0x2ebf('0x2b')]){delete _0x55f678[_0x2ebf('0x2b')];}_0x5c4184[_0x2ebf('0x1c')](_0x1383d2)[_0x2ebf('0x2c')](_0x55f678);};}exports[_0x2ebf('0x2d')]=function(_0x5b56f6,_0x435220){var _0x13a232={},_0x19dd72={},_0x3cd709={'count':0x0,'rows':[]};return db[_0x2ebf('0x2e')]['describe']()[_0x2ebf('0x27')](function(_0x8f381a){_0x19dd72[_0x2ebf('0x2f')]=_[_0x2ebf('0x30')](_0x8f381a);_0x19dd72[_0x2ebf('0x31')]=_[_0x2ebf('0x30')](_0x5b56f6[_0x2ebf('0x31')]);_0x19dd72[_0x2ebf('0x32')]=_['intersection'](_0x19dd72[_0x2ebf('0x2f')],_0x19dd72[_0x2ebf('0x31')]);_0x13a232[_0x2ebf('0x33')]=_['intersection'](_0x19dd72[_0x2ebf('0x2f')],qs[_0x2ebf('0x34')](_0x5b56f6[_0x2ebf('0x31')]['fields']));_0x13a232[_0x2ebf('0x33')]=_0x13a232[_0x2ebf('0x33')][_0x2ebf('0x35')]?_0x13a232[_0x2ebf('0x33')]:_0x19dd72[_0x2ebf('0x2f')];if(!_0x5b56f6[_0x2ebf('0x31')]['hasOwnProperty'](_0x2ebf('0x36'))){_0x13a232[_0x2ebf('0x22')]=qs[_0x2ebf('0x22')](_0x5b56f6[_0x2ebf('0x31')][_0x2ebf('0x22')]);_0x13a232[_0x2ebf('0x1f')]=qs[_0x2ebf('0x1f')](_0x5b56f6[_0x2ebf('0x31')]['offset']);}_0x13a232['order']=qs['sort'](_0x5b56f6[_0x2ebf('0x31')][_0x2ebf('0x37')]);_0x13a232[_0x2ebf('0x38')]=qs[_0x2ebf('0x32')](_[_0x2ebf('0x39')](_0x5b56f6[_0x2ebf('0x31')],_0x19dd72[_0x2ebf('0x32')]),_0x8f381a);if(_0x5b56f6[_0x2ebf('0x31')][_0x2ebf('0x3a')]){_0x13a232[_0x2ebf('0x38')]=_['merge'](_0x13a232[_0x2ebf('0x38')],{'$or':_[_0x2ebf('0x3b')](_0x13a232[_0x2ebf('0x33')],function(_0x31c6d0){var _0x451475={};_0x451475[_0x31c6d0]={'$like':'%'+_0x5b56f6[_0x2ebf('0x31')]['filter']+'%'};return _0x451475;})});}_0x13a232=_[_0x2ebf('0x3c')]({},_0x13a232,_0x5b56f6[_0x2ebf('0x3d')]);var _0x189d37={'where':_0x13a232[_0x2ebf('0x38')]};return db[_0x2ebf('0x2e')][_0x2ebf('0x21')](_0x189d37)['then'](function(_0x58d93d){_0x3cd709[_0x2ebf('0x21')]=_0x58d93d;if(_0x5b56f6[_0x2ebf('0x31')]['includeAll']){_0x13a232[_0x2ebf('0x3e')]=[{'all':!![]}];}return db[_0x2ebf('0x2e')][_0x2ebf('0x3f')](_0x13a232);})[_0x2ebf('0x27')](function(_0xad3ff4){_0x3cd709['rows']=_0xad3ff4;return _0x3cd709;})[_0x2ebf('0x27')](respondWithFilteredResult(_0x435220,_0x13a232))[_0x2ebf('0x40')](handleError(_0x435220,null));})[_0x2ebf('0x40')](handleError(_0x435220,null));};exports['show']=function(_0xda9404,_0x4a6531){var _0x2785d2={'raw':![],'where':{'id':_0xda9404[_0x2ebf('0x41')]['id']}},_0x2b5124={};_0x2b5124[_0x2ebf('0x2f')]=_['keys'](db[_0x2ebf('0x2e')]['rawAttributes']);_0x2b5124[_0x2ebf('0x31')]=_[_0x2ebf('0x30')](_0xda9404[_0x2ebf('0x31')]);_0x2b5124[_0x2ebf('0x32')]=_[_0x2ebf('0x42')](_0x2b5124[_0x2ebf('0x2f')],_0x2b5124['query']);_0x2785d2[_0x2ebf('0x33')]=_[_0x2ebf('0x42')](_0x2b5124[_0x2ebf('0x2f')],qs[_0x2ebf('0x34')](_0xda9404[_0x2ebf('0x31')][_0x2ebf('0x34')]));_0x2785d2[_0x2ebf('0x33')]=_0x2785d2[_0x2ebf('0x33')][_0x2ebf('0x35')]?_0x2785d2[_0x2ebf('0x33')]:_0x2b5124[_0x2ebf('0x2f')];if(_0xda9404['query'][_0x2ebf('0x43')]){_0x2785d2[_0x2ebf('0x3e')]=[{'all':!![]}];}_0x2785d2=_[_0x2ebf('0x3c')]({},_0x2785d2,_0xda9404[_0x2ebf('0x3d')]);return db[_0x2ebf('0x2e')][_0x2ebf('0x44')](_0x2785d2)[_0x2ebf('0x27')](handleEntityNotFound(_0x4a6531,null))['then'](respondWithResult(_0x4a6531,null))['catch'](handleError(_0x4a6531,null));};exports['create']=function(_0x142f54,_0x479c4b){return db['CmCompany'][_0x2ebf('0x45')](_0x142f54[_0x2ebf('0x46')],{})[_0x2ebf('0x27')](function(_0x7163d1){var _0x38adda=_0x142f54[_0x2ebf('0x47')][_0x2ebf('0x28')]({'plain':!![]});if(!_0x38adda)throw new Error(_0x2ebf('0x48'));if(_0x38adda[_0x2ebf('0x49')]===_0x2ebf('0x47')){var _0x13b67d=_0x7163d1[_0x2ebf('0x28')]({'plain':!![]});var _0x445063=_0x2ebf('0x29');return db[_0x2ebf('0x4a')]['find']({'where':{'name':_0x445063,'userProfileId':_0x38adda[_0x2ebf('0x4b')]},'raw':!![]})['then'](function(_0x344dbc){if(_0x344dbc&&_0x344dbc[_0x2ebf('0x4c')]===0x0){return db['UserProfileResource'][_0x2ebf('0x45')]({'name':_0x13b67d[_0x2ebf('0x2b')],'resourceId':_0x13b67d['id'],'type':_0x344dbc[_0x2ebf('0x2b')],'sectionId':_0x344dbc['id']},{})[_0x2ebf('0x27')](function(){return _0x7163d1;});}else{return _0x7163d1;}})[_0x2ebf('0x40')](function(_0x44eea6){logger[_0x2ebf('0x4d')](_0x2ebf('0x4e'),_0x44eea6);throw _0x44eea6;});}return _0x7163d1;})[_0x2ebf('0x27')](respondWithResult(_0x479c4b,0xc9))[_0x2ebf('0x40')](handleError(_0x479c4b,null));};exports[_0x2ebf('0x25')]=function(_0x4fbf79,_0x2d3109){if(_0x4fbf79['body']['id']){delete _0x4fbf79['body']['id'];}return db['CmCompany'][_0x2ebf('0x44')]({'where':{'id':_0x4fbf79['params']['id']}})['then'](handleEntityNotFound(_0x2d3109,null))['then'](saveUpdates(_0x4fbf79[_0x2ebf('0x46')],null))[_0x2ebf('0x27')](respondWithResult(_0x2d3109,null))[_0x2ebf('0x40')](handleError(_0x2d3109,null));};exports[_0x2ebf('0x26')]=function(_0x3936ed,_0x5865f8){return db['CmCompany'][_0x2ebf('0x44')]({'where':{'id':_0x3936ed[_0x2ebf('0x41')]['id']}})[_0x2ebf('0x27')](handleEntityNotFound(_0x5865f8,null))['then'](removeEntity(_0x5865f8,null))['catch'](handleError(_0x5865f8,null));};exports[_0x2ebf('0x4f')]=function(_0x56d5f3,_0x2b8d28){return db[_0x2ebf('0x2e')][_0x2ebf('0x4f')]()['then'](respondWithResult(_0x2b8d28,null))[_0x2ebf('0x40')](handleError(_0x2b8d28,null));};exports[_0x2ebf('0x50')]=function(_0x1f5c9c,_0x5821e2,_0x5b7189){return db[_0x2ebf('0x51')][_0x2ebf('0x44')]({'where':{'id':_0x1f5c9c['params']['id']}})[_0x2ebf('0x27')](handleEntityNotFound(_0x5821e2,null))[_0x2ebf('0x27')](function(_0x5ea750){if(_0x5ea750){return _0x5ea750[_0x2ebf('0x50')](_0x1f5c9c['body'][_0x2ebf('0x52')],_['omit'](_0x1f5c9c[_0x2ebf('0x46')],[_0x2ebf('0x52'),'id'])||{});}})[_0x2ebf('0x27')](respondWithResult(_0x5821e2,null))['catch'](handleError(_0x5821e2,null));};exports[_0x2ebf('0x53')]=function(_0x319985,_0x787f32,_0x1bd646){var _0x10d9aa={};var _0x422e8f={};var _0x1eadea;var _0x57753a;return db[_0x2ebf('0x2e')][_0x2ebf('0x54')]({'where':{'id':_0x319985[_0x2ebf('0x41')]['id']}})[_0x2ebf('0x27')](handleEntityNotFound(_0x787f32,null))[_0x2ebf('0x27')](function(_0x147c26){if(_0x147c26){_0x1eadea=_0x147c26;_0x422e8f[_0x2ebf('0x2f')]=_[_0x2ebf('0x30')](db[_0x2ebf('0x51')][_0x2ebf('0x55')]);_0x422e8f[_0x2ebf('0x31')]=_[_0x2ebf('0x30')](_0x319985[_0x2ebf('0x31')]);_0x422e8f[_0x2ebf('0x32')]=_[_0x2ebf('0x42')](_0x422e8f[_0x2ebf('0x2f')],_0x422e8f[_0x2ebf('0x31')]);_0x10d9aa[_0x2ebf('0x33')]=_[_0x2ebf('0x42')](_0x422e8f['model'],qs[_0x2ebf('0x34')](_0x319985[_0x2ebf('0x31')][_0x2ebf('0x34')]));_0x10d9aa[_0x2ebf('0x33')]=_0x10d9aa[_0x2ebf('0x33')][_0x2ebf('0x35')]?_0x10d9aa[_0x2ebf('0x33')]:_0x422e8f[_0x2ebf('0x2f')];_0x10d9aa[_0x2ebf('0x56')]=qs[_0x2ebf('0x37')](_0x319985[_0x2ebf('0x31')][_0x2ebf('0x37')]);_0x10d9aa[_0x2ebf('0x38')]=qs[_0x2ebf('0x32')](_[_0x2ebf('0x39')](_0x319985[_0x2ebf('0x31')],_0x422e8f[_0x2ebf('0x32')]));if(_0x319985[_0x2ebf('0x31')][_0x2ebf('0x3a')]){_0x10d9aa[_0x2ebf('0x38')]=_[_0x2ebf('0x3c')](_0x10d9aa[_0x2ebf('0x38')],{'$or':_[_0x2ebf('0x3b')](_0x10d9aa[_0x2ebf('0x33')],function(_0x52233b){var _0x5d6510={};_0x5d6510[_0x52233b]={'$like':'%'+_0x319985[_0x2ebf('0x31')][_0x2ebf('0x3a')]+'%'};return _0x5d6510;})});}_0x10d9aa=_[_0x2ebf('0x3c')]({},_0x10d9aa,_0x319985[_0x2ebf('0x3d')]);return _0x1eadea[_0x2ebf('0x53')](_0x10d9aa);}})['then'](function(_0x132d5b){if(_0x132d5b){_0x57753a=_0x132d5b[_0x2ebf('0x35')];if(!_0x319985[_0x2ebf('0x31')]['hasOwnProperty'](_0x2ebf('0x36'))){_0x10d9aa[_0x2ebf('0x22')]=qs['limit'](_0x319985[_0x2ebf('0x31')][_0x2ebf('0x22')]);_0x10d9aa[_0x2ebf('0x1f')]=qs[_0x2ebf('0x1f')](_0x319985[_0x2ebf('0x31')][_0x2ebf('0x1f')]);}return _0x1eadea[_0x2ebf('0x53')](_0x10d9aa);}})[_0x2ebf('0x27')](function(_0x4b5628){if(_0x4b5628){return _0x4b5628?{'count':_0x57753a,'rows':_0x4b5628}:null;}})[_0x2ebf('0x27')](respondWithResult(_0x787f32,null))[_0x2ebf('0x40')](handleError(_0x787f32,null));};
\ No newline at end of file
+var _0x68f6=['count','Content-Range','apply','reject','save','destroy','get','Companies','UserProfileResource','then','error','stack','name','send','index','model','keys','query','filters','attributes','fields','length','nolimit','sort','pick','filter','where','merge','map','options','includeAll','include','CmCompany','findAll','catch','params','rawAttributes','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','ids','omit','getContacts','findOne','order','hasOwnProperty','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x68f6,0x90));var _0x668f=function(_0x563fd2,_0x1e1629){_0x563fd2=_0x563fd2-0x0;var _0x3ef9fc=_0x68f6[_0x563fd2];return _0x3ef9fc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x668f('0x0'));var jsonpatch=require(_0x668f('0x1'));var rp=require('request-promise');var moment=require(_0x668f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x668f('0x3'));var util=require(_0x668f('0x4'));var path=require(_0x668f('0x5'));var sox=require(_0x668f('0x6'));var csv=require(_0x668f('0x7'));var ejs=require(_0x668f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x668f('0x9'));var squel=require(_0x668f('0xa'));var crypto=require(_0x668f('0xb'));var jsforce=require(_0x668f('0xc'));var deskjs=require(_0x668f('0xd'));var toCsv=require(_0x668f('0x7'));var querystring=require('querystring');var Papa=require(_0x668f('0xe'));var Redis=require('ioredis');var authService=require(_0x668f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x668f('0x10'));var hardwareService=require(_0x668f('0x11'));var logger=require(_0x668f('0x12'))(_0x668f('0x13'));var utils=require(_0x668f('0x14'));var config=require(_0x668f('0x15'));var licenseUtil=require(_0x668f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd3808a,_0x43063b){_0x43063b=_0x43063b||0xcc;return function(_0x4217cb){if(_0x4217cb){return _0xd3808a[_0x668f('0x17')](_0x43063b);}return _0xd3808a[_0x668f('0x18')](_0x43063b)[_0x668f('0x19')]();};}function respondWithResult(_0x285b40,_0xbb5c8c){_0xbb5c8c=_0xbb5c8c||0xc8;return function(_0x3cb7cd){if(_0x3cb7cd){return _0x285b40[_0x668f('0x18')](_0xbb5c8c)[_0x668f('0x1a')](_0x3cb7cd);}};}function respondWithFilteredResult(_0x565724,_0x322dba){return function(_0x4f8133){if(_0x4f8133){var _0x50ed10=typeof _0x322dba[_0x668f('0x1b')]==='undefined'&&typeof _0x322dba[_0x668f('0x1c')]===_0x668f('0x1d');var _0x8472d4=_0x4f8133[_0x668f('0x1e')];var _0x241fdb=_0x50ed10?0x0:_0x322dba[_0x668f('0x1b')];var _0x26978b=_0x50ed10?_0x4f8133['count']:_0x322dba[_0x668f('0x1b')]+_0x322dba[_0x668f('0x1c')];var _0x2d021d;if(_0x26978b>=_0x8472d4){_0x26978b=_0x8472d4;_0x2d021d=0xc8;}else{_0x2d021d=0xce;}_0x565724[_0x668f('0x18')](_0x2d021d);return _0x565724['set'](_0x668f('0x1f'),_0x241fdb+'-'+_0x26978b+'/'+_0x8472d4)[_0x668f('0x1a')](_0x4f8133);}return null;};}function patchUpdates(_0x32f32c){return function(_0x218253){try{jsonpatch[_0x668f('0x20')](_0x218253,_0x32f32c,!![]);}catch(_0x42ae81){return BPromise[_0x668f('0x21')](_0x42ae81);}return _0x218253[_0x668f('0x22')]();};}function saveUpdates(_0x1fe5b9,_0x38d649){return function(_0x147549){if(_0x147549){return _0x147549['update'](_0x1fe5b9)['then'](function(_0x4f2094){return _0x4f2094;});}return null;};}function removeEntity(_0x5d945b,_0x21a1aa){return function(_0x2fde18){if(_0x2fde18){return _0x2fde18[_0x668f('0x23')]()['then'](function(){var _0x2e1f7f=_0x2fde18[_0x668f('0x24')]({'plain':!![]});var _0x18f4be=_0x668f('0x25');return db[_0x668f('0x26')][_0x668f('0x23')]({'where':{'type':_0x18f4be,'resourceId':_0x2e1f7f['id']}})[_0x668f('0x27')](function(){return _0x2fde18;});})['then'](function(){_0x5d945b[_0x668f('0x18')](0xcc)[_0x668f('0x19')]();});}};}function handleEntityNotFound(_0x204e86,_0x39fb89){return function(_0x412daa){if(!_0x412daa){_0x204e86[_0x668f('0x17')](0x194);}return _0x412daa;};}function handleError(_0xf3822,_0xce66bd){_0xce66bd=_0xce66bd||0x1f4;return function(_0x3ade18){logger[_0x668f('0x28')](_0x3ade18[_0x668f('0x29')]);if(_0x3ade18['name']){delete _0x3ade18[_0x668f('0x2a')];}_0xf3822[_0x668f('0x18')](_0xce66bd)[_0x668f('0x2b')](_0x3ade18);};}exports[_0x668f('0x2c')]=function(_0x286b12,_0xc6d314){var _0x28990d={},_0x4dc384={},_0x318234={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x59c29f){_0x4dc384[_0x668f('0x2d')]=_[_0x668f('0x2e')](_0x59c29f);_0x4dc384[_0x668f('0x2f')]=_[_0x668f('0x2e')](_0x286b12[_0x668f('0x2f')]);_0x4dc384[_0x668f('0x30')]=_['intersection'](_0x4dc384[_0x668f('0x2d')],_0x4dc384[_0x668f('0x2f')]);_0x28990d[_0x668f('0x31')]=_['intersection'](_0x4dc384[_0x668f('0x2d')],qs[_0x668f('0x32')](_0x286b12['query'][_0x668f('0x32')]));_0x28990d['attributes']=_0x28990d[_0x668f('0x31')][_0x668f('0x33')]?_0x28990d['attributes']:_0x4dc384[_0x668f('0x2d')];if(!_0x286b12[_0x668f('0x2f')]['hasOwnProperty'](_0x668f('0x34'))){_0x28990d[_0x668f('0x1c')]=qs[_0x668f('0x1c')](_0x286b12[_0x668f('0x2f')][_0x668f('0x1c')]);_0x28990d[_0x668f('0x1b')]=qs[_0x668f('0x1b')](_0x286b12[_0x668f('0x2f')][_0x668f('0x1b')]);}_0x28990d['order']=qs[_0x668f('0x35')](_0x286b12['query'][_0x668f('0x35')]);_0x28990d['where']=qs[_0x668f('0x30')](_[_0x668f('0x36')](_0x286b12[_0x668f('0x2f')],_0x4dc384['filters']),_0x59c29f);if(_0x286b12['query'][_0x668f('0x37')]){_0x28990d[_0x668f('0x38')]=_[_0x668f('0x39')](_0x28990d['where'],{'$or':_[_0x668f('0x3a')](_0x28990d[_0x668f('0x31')],function(_0x3ba000){var _0xb99da8={};_0xb99da8[_0x3ba000]={'$like':'%'+_0x286b12[_0x668f('0x2f')][_0x668f('0x37')]+'%'};return _0xb99da8;})});}_0x28990d=_['merge']({},_0x28990d,_0x286b12[_0x668f('0x3b')]);var _0x5dae97={'where':_0x28990d[_0x668f('0x38')]};return db['CmCompany'][_0x668f('0x1e')](_0x5dae97)[_0x668f('0x27')](function(_0x4c7960){_0x318234['count']=_0x4c7960;if(_0x286b12[_0x668f('0x2f')][_0x668f('0x3c')]){_0x28990d[_0x668f('0x3d')]=[{'all':!![]}];}return db[_0x668f('0x3e')][_0x668f('0x3f')](_0x28990d);})[_0x668f('0x27')](function(_0x42b184){_0x318234['rows']=_0x42b184;return _0x318234;})[_0x668f('0x27')](respondWithFilteredResult(_0xc6d314,_0x28990d))['catch'](handleError(_0xc6d314,null));})[_0x668f('0x40')](handleError(_0xc6d314,null));};exports['show']=function(_0x42a175,_0x59a8c6){var _0x3b525c={'raw':![],'where':{'id':_0x42a175[_0x668f('0x41')]['id']}},_0x5392c7={};_0x5392c7['model']=_[_0x668f('0x2e')](db[_0x668f('0x3e')][_0x668f('0x42')]);_0x5392c7[_0x668f('0x2f')]=_[_0x668f('0x2e')](_0x42a175['query']);_0x5392c7['filters']=_[_0x668f('0x43')](_0x5392c7[_0x668f('0x2d')],_0x5392c7['query']);_0x3b525c[_0x668f('0x31')]=_['intersection'](_0x5392c7[_0x668f('0x2d')],qs[_0x668f('0x32')](_0x42a175[_0x668f('0x2f')][_0x668f('0x32')]));_0x3b525c[_0x668f('0x31')]=_0x3b525c[_0x668f('0x31')][_0x668f('0x33')]?_0x3b525c['attributes']:_0x5392c7[_0x668f('0x2d')];if(_0x42a175[_0x668f('0x2f')][_0x668f('0x3c')]){_0x3b525c[_0x668f('0x3d')]=[{'all':!![]}];}_0x3b525c=_[_0x668f('0x39')]({},_0x3b525c,_0x42a175[_0x668f('0x3b')]);return db['CmCompany'][_0x668f('0x44')](_0x3b525c)[_0x668f('0x27')](handleEntityNotFound(_0x59a8c6,null))[_0x668f('0x27')](respondWithResult(_0x59a8c6,null))['catch'](handleError(_0x59a8c6,null));};exports[_0x668f('0x45')]=function(_0x459680,_0x26a422){return db[_0x668f('0x3e')]['create'](_0x459680['body'],{})[_0x668f('0x27')](function(_0x12e0ab){var _0x2acb3b=_0x459680[_0x668f('0x46')]['get']({'plain':!![]});if(!_0x2acb3b)throw new Error(_0x668f('0x47'));if(_0x2acb3b[_0x668f('0x48')]==='user'){var _0x40288f=_0x12e0ab[_0x668f('0x24')]({'plain':!![]});var _0x52674f=_0x668f('0x25');return db[_0x668f('0x49')][_0x668f('0x44')]({'where':{'name':_0x52674f,'userProfileId':_0x2acb3b[_0x668f('0x4a')]},'raw':!![]})[_0x668f('0x27')](function(_0xd49656){if(_0xd49656&&_0xd49656[_0x668f('0x4b')]===0x0){return db[_0x668f('0x26')][_0x668f('0x45')]({'name':_0x40288f[_0x668f('0x2a')],'resourceId':_0x40288f['id'],'type':_0xd49656[_0x668f('0x2a')],'sectionId':_0xd49656['id']},{})['then'](function(){return _0x12e0ab;});}else{return _0x12e0ab;}})['catch'](function(_0x42053a){logger[_0x668f('0x28')](_0x668f('0x4c'),_0x42053a);throw _0x42053a;});}return _0x12e0ab;})[_0x668f('0x27')](respondWithResult(_0x26a422,0xc9))['catch'](handleError(_0x26a422,null));};exports[_0x668f('0x4d')]=function(_0xc38e31,_0x19903b){if(_0xc38e31['body']['id']){delete _0xc38e31[_0x668f('0x4e')]['id'];}return db[_0x668f('0x3e')][_0x668f('0x44')]({'where':{'id':_0xc38e31[_0x668f('0x41')]['id']}})['then'](handleEntityNotFound(_0x19903b,null))[_0x668f('0x27')](saveUpdates(_0xc38e31[_0x668f('0x4e')],null))['then'](respondWithResult(_0x19903b,null))[_0x668f('0x40')](handleError(_0x19903b,null));};exports[_0x668f('0x23')]=function(_0x185021,_0x4eda1f){return db[_0x668f('0x3e')][_0x668f('0x44')]({'where':{'id':_0x185021[_0x668f('0x41')]['id']}})[_0x668f('0x27')](handleEntityNotFound(_0x4eda1f,null))[_0x668f('0x27')](removeEntity(_0x4eda1f,null))[_0x668f('0x40')](handleError(_0x4eda1f,null));};exports['describe']=function(_0xd455b7,_0xc1ff9){return db[_0x668f('0x3e')]['describe']()['then'](respondWithResult(_0xc1ff9,null))[_0x668f('0x40')](handleError(_0xc1ff9,null));};exports[_0x668f('0x4f')]=function(_0x411d43,_0x3be79e,_0x4cb7eb){return db[_0x668f('0x50')]['find']({'where':{'id':_0x411d43[_0x668f('0x41')]['id']}})[_0x668f('0x27')](handleEntityNotFound(_0x3be79e,null))[_0x668f('0x27')](function(_0x1427f5){if(_0x1427f5){return _0x1427f5[_0x668f('0x4f')](_0x411d43[_0x668f('0x4e')][_0x668f('0x51')],_[_0x668f('0x52')](_0x411d43[_0x668f('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x3be79e,null))[_0x668f('0x40')](handleError(_0x3be79e,null));};exports[_0x668f('0x53')]=function(_0xd85b37,_0x340818,_0x260d93){var _0xaeb810={};var _0x83eba8={};var _0x58f49f;var _0x5e848f;return db['CmCompany'][_0x668f('0x54')]({'where':{'id':_0xd85b37[_0x668f('0x41')]['id']}})[_0x668f('0x27')](handleEntityNotFound(_0x340818,null))[_0x668f('0x27')](function(_0x2b1f3d){if(_0x2b1f3d){_0x58f49f=_0x2b1f3d;_0x83eba8[_0x668f('0x2d')]=_[_0x668f('0x2e')](db[_0x668f('0x50')][_0x668f('0x42')]);_0x83eba8[_0x668f('0x2f')]=_[_0x668f('0x2e')](_0xd85b37[_0x668f('0x2f')]);_0x83eba8[_0x668f('0x30')]=_['intersection'](_0x83eba8[_0x668f('0x2d')],_0x83eba8[_0x668f('0x2f')]);_0xaeb810[_0x668f('0x31')]=_['intersection'](_0x83eba8['model'],qs['fields'](_0xd85b37[_0x668f('0x2f')][_0x668f('0x32')]));_0xaeb810['attributes']=_0xaeb810[_0x668f('0x31')][_0x668f('0x33')]?_0xaeb810[_0x668f('0x31')]:_0x83eba8[_0x668f('0x2d')];_0xaeb810[_0x668f('0x55')]=qs['sort'](_0xd85b37['query'][_0x668f('0x35')]);_0xaeb810[_0x668f('0x38')]=qs['filters'](_[_0x668f('0x36')](_0xd85b37[_0x668f('0x2f')],_0x83eba8[_0x668f('0x30')]));if(_0xd85b37[_0x668f('0x2f')][_0x668f('0x37')]){_0xaeb810[_0x668f('0x38')]=_[_0x668f('0x39')](_0xaeb810[_0x668f('0x38')],{'$or':_['map'](_0xaeb810[_0x668f('0x31')],function(_0x2b9613){var _0x3939f4={};_0x3939f4[_0x2b9613]={'$like':'%'+_0xd85b37[_0x668f('0x2f')][_0x668f('0x37')]+'%'};return _0x3939f4;})});}_0xaeb810=_['merge']({},_0xaeb810,_0xd85b37[_0x668f('0x3b')]);return _0x58f49f[_0x668f('0x53')](_0xaeb810);}})[_0x668f('0x27')](function(_0x1b4e89){if(_0x1b4e89){_0x5e848f=_0x1b4e89[_0x668f('0x33')];if(!_0xd85b37['query'][_0x668f('0x56')](_0x668f('0x34'))){_0xaeb810['limit']=qs[_0x668f('0x1c')](_0xd85b37[_0x668f('0x2f')][_0x668f('0x1c')]);_0xaeb810[_0x668f('0x1b')]=qs[_0x668f('0x1b')](_0xd85b37['query'][_0x668f('0x1b')]);}return _0x58f49f[_0x668f('0x53')](_0xaeb810);}})[_0x668f('0x27')](function(_0x254356){if(_0x254356){return _0x254356?{'count':_0x5e848f,'rows':_0x254356}:null;}})[_0x668f('0x27')](respondWithResult(_0x340818,null))[_0x668f('0x40')](handleError(_0x340818,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index b6944c9..2e72014 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 _0x46f1=['CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x438ff1,_0x1d84fa){var _0x1302fd=function(_0x229c92){while(--_0x229c92){_0x438ff1['push'](_0x438ff1['shift']());}};_0x1302fd(++_0x1d84fa);}(_0x46f1,0x195));var _0x146f=function(_0xf3b01b,_0x1d72e0){_0xf3b01b=_0xf3b01b-0x0;var _0x50d699=_0x46f1[_0xf3b01b];return _0x50d699;};'use strict';var _=require(_0x146f('0x0'));var util=require(_0x146f('0x1'));var logger=require(_0x146f('0x2'))(_0x146f('0x3'));var moment=require('moment');var BPromise=require(_0x146f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x146f('0x5'));var rimraf=require(_0x146f('0x6'));var config=require(_0x146f('0x7'));var attributes=require(_0x146f('0x8'));module[_0x146f('0x9')]=function(_0x47ec9f,_0x415507){return _0x47ec9f[_0x146f('0xa')](_0x146f('0xb'),attributes,{'tableName':_0x146f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe66d=['rimraf','./cmCompany.attributes','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x48fef8,_0x325b32){var _0x2e169f=function(_0x24a9a8){while(--_0x24a9a8){_0x48fef8['push'](_0x48fef8['shift']());}};_0x2e169f(++_0x325b32);}(_0xe66d,0x68));var _0xde66=function(_0x1522db,_0x7efece){_0x1522db=_0x1522db-0x0;var _0x165585=_0xe66d[_0x1522db];return _0x165585;};'use strict';var _=require(_0xde66('0x0'));var util=require(_0xde66('0x1'));var logger=require(_0xde66('0x2'))('api');var moment=require(_0xde66('0x3'));var BPromise=require(_0xde66('0x4'));var rp=require(_0xde66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde66('0x6'));var config=require('../../config/environment');var attributes=require(_0xde66('0x7'));module['exports']=function(_0x23f943,_0x62b009){return _0x23f943['define'](_0xde66('0x8'),attributes,{'tableName':_0xde66('0x9'),'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 ee310e0..f9e6573 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 _0x949d=['info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x949d,0xe9));var _0xd949=function(_0x4c165b,_0x39b5fb){_0x4c165b=_0x4c165b-0x0;var _0x42c49a=_0x949d[_0x4c165b];return _0x42c49a;};'use strict';var _=require(_0xd949('0x0'));var util=require(_0xd949('0x1'));var moment=require(_0xd949('0x2'));var BPromise=require('bluebird');var rs=require(_0xd949('0x3'));var fs=require('fs');var Redis=require(_0xd949('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd949('0x5'));var logger=require(_0xd949('0x6'))(_0xd949('0x7'));var config=require(_0xd949('0x8'));var jayson=require(_0xd949('0x9'));var client=jayson[_0xd949('0xa')][_0xd949('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42c2dc,_0x35c603,_0x57e023){return new BPromise(function(_0x1af661,_0x369e9c){return client[_0xd949('0xc')](_0x42c2dc,_0x57e023)['then'](function(_0x105d93){logger['info'](_0xd949('0xd'),_0x35c603,_0xd949('0xe'));logger['debug'](_0xd949('0xf'),_0x35c603,_0xd949('0xe'),JSON[_0xd949('0x10')](_0x105d93));if(_0x105d93[_0xd949('0x11')]){if(_0x105d93[_0xd949('0x11')]['code']===0x1f4){logger[_0xd949('0x11')](_0xd949('0xd'),_0x35c603,_0x105d93[_0xd949('0x11')][_0xd949('0x12')]);return _0x369e9c(_0x105d93['error'][_0xd949('0x12')]);}logger['error'](_0xd949('0xd'),_0x35c603,_0x105d93[_0xd949('0x11')][_0xd949('0x12')]);return _0x1af661(_0x105d93[_0xd949('0x11')][_0xd949('0x12')]);}else{logger[_0xd949('0x13')](_0xd949('0xd'),_0x35c603,'request\x20sent');_0x1af661(_0x105d93[_0xd949('0x14')][_0xd949('0x12')]);}})['catch'](function(_0x215eba){logger['error'](_0xd949('0xd'),_0x35c603,_0x215eba);_0x369e9c(_0x215eba);});});}
\ No newline at end of file
+var _0x454b=['jayson/promise','client','http','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1d17a5,_0x133cc9){var _0x25f3d1=function(_0x20118c){while(--_0x20118c){_0x1d17a5['push'](_0x1d17a5['shift']());}};_0x25f3d1(++_0x133cc9);}(_0x454b,0xc6));var _0xb454=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0x454b[_0x4b8156];return _0x4a819c;};'use strict';var _=require(_0xb454('0x0'));var util=require('util');var moment=require(_0xb454('0x1'));var BPromise=require(_0xb454('0x2'));var rs=require(_0xb454('0x3'));var fs=require('fs');var Redis=require(_0xb454('0x4'));var db=require(_0xb454('0x5'))['db'];var utils=require(_0xb454('0x6'));var logger=require(_0xb454('0x7'))(_0xb454('0x8'));var config=require('../../config/environment');var jayson=require(_0xb454('0x9'));var client=jayson[_0xb454('0xa')][_0xb454('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38d925,_0x33d2eb,_0x2ab69b){return new BPromise(function(_0x2065b1,_0x144e6d){return client['request'](_0x38d925,_0x2ab69b)[_0xb454('0xc')](function(_0x5909e0){logger[_0xb454('0xd')]('CmCompany,\x20%s,\x20%s',_0x33d2eb,_0xb454('0xe'));logger['debug'](_0xb454('0xf'),_0x33d2eb,_0xb454('0xe'),JSON[_0xb454('0x10')](_0x5909e0));if(_0x5909e0['error']){if(_0x5909e0[_0xb454('0x11')][_0xb454('0x12')]===0x1f4){logger[_0xb454('0x11')](_0xb454('0x13'),_0x33d2eb,_0x5909e0[_0xb454('0x11')]['message']);return _0x144e6d(_0x5909e0[_0xb454('0x11')][_0xb454('0x14')]);}logger[_0xb454('0x11')]('CmCompany,\x20%s,\x20%s',_0x33d2eb,_0x5909e0['error'][_0xb454('0x14')]);return _0x2065b1(_0x5909e0[_0xb454('0x11')][_0xb454('0x14')]);}else{logger[_0xb454('0xd')](_0xb454('0x13'),_0x33d2eb,_0xb454('0xe'));_0x2065b1(_0x5909e0[_0xb454('0x15')][_0xb454('0x14')]);}})[_0xb454('0x16')](function(_0x1c8417){logger[_0xb454('0x11')]('CmCompany,\x20%s,\x20%s',_0x33d2eb,_0x1c8417);_0x144e6d(_0x1c8417);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 207f502..1f8ee7c 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 _0xa2f2=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create','/:id','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xa2f2,0x67));var _0x2a2f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xa2f2[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x2a2f('0x0'));var path=require(_0x2a2f('0x1'));var timeout=require(_0x2a2f('0x2'));var express=require(_0x2a2f('0x3'));var router=express[_0x2a2f('0x4')]();var fs_extra=require(_0x2a2f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a2f('0x6'));var config=require(_0x2a2f('0x7'));var controller=require(_0x2a2f('0x8'));router[_0x2a2f('0x9')]('/',auth[_0x2a2f('0xa')](),controller[_0x2a2f('0xb')]);router[_0x2a2f('0x9')](_0x2a2f('0xc'),auth['isAuthenticated'](),controller[_0x2a2f('0xd')]);router['get']('/:id',auth[_0x2a2f('0xa')](),controller[_0x2a2f('0xe')]);router[_0x2a2f('0x9')](_0x2a2f('0xf'),auth['isAuthenticated'](),controller[_0x2a2f('0x10')]);router[_0x2a2f('0x11')]('/',auth[_0x2a2f('0xa')](),controller[_0x2a2f('0x12')]);router[_0x2a2f('0x11')]('/:id/contacts',auth[_0x2a2f('0xa')](),controller['addContacts']);router['put'](_0x2a2f('0x13'),auth[_0x2a2f('0xa')](),controller[_0x2a2f('0x14')]);router['delete'](_0x2a2f('0x13'),auth[_0x2a2f('0xa')](),controller[_0x2a2f('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xa192=['/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','get'];(function(_0x1ce723,_0x3995d1){var _0x22b4ca=function(_0x2734a0){while(--_0x2734a0){_0x1ce723['push'](_0x1ce723['shift']());}};_0x22b4ca(++_0x3995d1);}(_0xa192,0x150));var _0x2a19=function(_0x42e30d,_0x3bfb1a){_0x42e30d=_0x42e30d-0x0;var _0x52f82c=_0xa192[_0x42e30d];return _0x52f82c;};'use strict';var multer=require('multer');var util=require(_0x2a19('0x0'));var path=require(_0x2a19('0x1'));var timeout=require(_0x2a19('0x2'));var express=require(_0x2a19('0x3'));var router=express[_0x2a19('0x4')]();var fs_extra=require(_0x2a19('0x5'));var auth=require(_0x2a19('0x6'));var interaction=require(_0x2a19('0x7'));var config=require(_0x2a19('0x8'));var controller=require(_0x2a19('0x9'));router['get']('/',auth[_0x2a19('0xa')](),controller[_0x2a19('0xb')]);router['get'](_0x2a19('0xc'),auth[_0x2a19('0xa')](),controller['describe']);router[_0x2a19('0xd')](_0x2a19('0xe'),auth[_0x2a19('0xa')](),controller[_0x2a19('0xf')]);router[_0x2a19('0xd')](_0x2a19('0x10'),auth[_0x2a19('0xa')](),controller[_0x2a19('0x11')]);router[_0x2a19('0x12')]('/',auth[_0x2a19('0xa')](),controller[_0x2a19('0x13')]);router['post'](_0x2a19('0x10'),auth[_0x2a19('0xa')](),controller[_0x2a19('0x14')]);router[_0x2a19('0x15')]('/:id',auth[_0x2a19('0xa')](),controller[_0x2a19('0x16')]);router[_0x2a19('0x17')](_0x2a19('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a19('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index a1fb45b..1c79870 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 _0xbaa8=['exports','STRING','TEXT','INTEGER','DATE','NOW','sequelize'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0xbaa8,0x6f));var _0x8baa=function(_0xbc2e6,_0x763a5e){_0xbc2e6=_0xbc2e6-0x0;var _0xc05648=_0xbaa8[_0xbc2e6];return _0xc05648;};'use strict';var _=require('lodash');var Sequelize=require(_0x8baa('0x0'));module[_0x8baa('0x1')]={'firstName':{'type':Sequelize[_0x8baa('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8baa('0x2')]},'postalCode':{'type':Sequelize[_0x8baa('0x2')]},'city':{'type':Sequelize[_0x8baa('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x8baa('0x2')]},'description':{'type':Sequelize[_0x8baa('0x3')]},'phone':{'type':Sequelize[_0x8baa('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8baa('0x2')]},'email':{'type':Sequelize[_0x8baa('0x2')]},'url':{'type':Sequelize[_0x8baa('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x8baa('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8baa('0x2')]},'teams':{'type':Sequelize[_0x8baa('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x8baa('0x2')]},'telegram':{'type':Sequelize[_0x8baa('0x2')]},'UserId':{'type':Sequelize[_0x8baa('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8baa('0x2')]},'priority':{'type':Sequelize[_0x8baa('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8baa('0x5')],'defaultValue':Sequelize[_0x8baa('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x8baa('0x4')]}};
\ No newline at end of file
+var _0xebe7=['NOW','lodash','sequelize','STRING','TEXT','INTEGER','DATE'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0xebe7,0x13c));var _0x7ebe=function(_0x900f0a,_0x3f2907){_0x900f0a=_0x900f0a-0x0;var _0x2c6bc3=_0xebe7[_0x900f0a];return _0x2c6bc3;};'use strict';var _=require(_0x7ebe('0x0'));var Sequelize=require(_0x7ebe('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x7ebe('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7ebe('0x2')]},'street':{'type':Sequelize[_0x7ebe('0x2')]},'postalCode':{'type':Sequelize[_0x7ebe('0x2')]},'city':{'type':Sequelize[_0x7ebe('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7ebe('0x2')]},'description':{'type':Sequelize[_0x7ebe('0x3')]},'phone':{'type':Sequelize[_0x7ebe('0x2')]},'mobile':{'type':Sequelize[_0x7ebe('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7ebe('0x2')]},'url':{'type':Sequelize[_0x7ebe('0x2')]},'facebook':{'type':Sequelize[_0x7ebe('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7ebe('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x7ebe('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7ebe('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x7ebe('0x2')]},'priority':{'type':Sequelize[_0x7ebe('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7ebe('0x5')],'defaultValue':Sequelize[_0x7ebe('0x6')]},'dialTimezone':{'type':Sequelize[_0x7ebe('0x2')]},'utcOffset':{'type':Sequelize[_0x7ebe('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 21de8ef..d070c62 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 _0x46e6=['Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','type','start','end','filter','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','some','user','getLists','c.ListId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','Tags','TagIds','rows','catch','find','params','tags','columnName','analytics','findAll','displayName','alias','custom','values','body','get','mergeWith','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','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','each','duplicates','$or','spread','additionalPhones','contact','show','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','omit','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','pick','ContactId','include','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','fork','../../components/import/cm/csv','binding_keys','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','child_process','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','stringify','exit','mail','chat','openchannel','fax','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','closed','note','disposition','secondDisposition','thirdDisposition','Account','key','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','referer','subject','externalUrl','threadId','startCase','Interaction','Owner','flatten','sortBy','reverse','slice','moment','bluebird','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment/shared','defaults','redis','./cmContact.socket','json','offset','limit','count','status','set','update','destroy','then','error','stack','name','send','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','trimStart','all','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions'];(function(_0x3a991b,_0x3277ee){var _0x16d074=function(_0x1e3c4a){while(--_0x1e3c4a){_0x3a991b['push'](_0x3a991b['shift']());}};_0x16d074(++_0x3277ee);}(_0x46e6,0xfa));var _0x646e=function(_0x58fbc1,_0x40f7f4){_0x58fbc1=_0x58fbc1-0x0;var _0x455e0c=_0x46e6[_0x58fbc1];return _0x455e0c;};'use strict';var moment=require(_0x646e('0x0'));var BPromise=require(_0x646e('0x1'));var util=require('util');var path=require(_0x646e('0x2'));var fs=require('fs');var _=require(_0x646e('0x3'));var squel=require(_0x646e('0x4'));var Papa=require(_0x646e('0x5'));var Redis=require(_0x646e('0x6'));var qs=require(_0x646e('0x7'));var as=require(_0x646e('0x8'));var logger=require(_0x646e('0x9'))(_0x646e('0xa'));var config=require('../../config/environment');var shared=require(_0x646e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x646e('0xc')](config[_0x646e('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x646e('0xe'))['register'](socket);function respondWithResult(_0x168138,_0x20af02){_0x20af02=_0x20af02||0xc8;return function(_0x13c7e7){if(_0x13c7e7){return _0x168138['status'](_0x20af02)[_0x646e('0xf')](_0x13c7e7);}};}function respondWithFilteredResult(_0x4b522f,_0x49f347){return function(_0x41de1f){if(_0x41de1f){var _0x3d9081=typeof _0x49f347[_0x646e('0x10')]==='undefined'&&typeof _0x49f347[_0x646e('0x11')]==='undefined';var _0x417530=_0x41de1f['count'];var _0x5a6e26=_0x3d9081?0x0:_0x49f347[_0x646e('0x10')];var _0xaf4739=_0x3d9081?_0x41de1f[_0x646e('0x12')]:_0x49f347[_0x646e('0x10')]+_0x49f347['limit'];var _0x414209;if(_0xaf4739>=_0x417530){_0xaf4739=_0x417530;_0x414209=0xc8;}else{_0x414209=0xce;}_0x4b522f[_0x646e('0x13')](_0x414209);return _0x4b522f[_0x646e('0x14')]('Content-Range',_0x5a6e26+'-'+_0xaf4739+'/'+_0x417530)['json'](_0x41de1f);}return null;};}function saveUpdates(_0x337bd1){return function(_0x2e4651){if(_0x2e4651){return _0x2e4651[_0x646e('0x15')](_0x337bd1)['then'](function(_0x5a2910){return _0x5a2910;});}return null;};}function removeEntity(_0x337c84){return function(_0x1a837f){if(_0x1a837f){return _0x1a837f[_0x646e('0x16')]()[_0x646e('0x17')](function(){_0x337c84[_0x646e('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250ca5){return function(_0x1d886e){if(!_0x1d886e){_0x250ca5['sendStatus'](0x194);}return _0x1d886e;};}function handleError(_0xa7e7d1,_0x1760bd){_0x1760bd=_0x1760bd||0x1f4;return function(_0x522d3a){logger[_0x646e('0x18')](_0x522d3a[_0x646e('0x19')]);if(_0x522d3a[_0x646e('0x1a')]){delete _0x522d3a[_0x646e('0x1a')];}_0xa7e7d1[_0x646e('0x13')](_0x1760bd)[_0x646e('0x1b')](_0x522d3a);};}exports['index']=function(_0x57cfd7,_0xc6c341){var _0x16a99b={},_0x54b5e9={},_0x49c043={'count':0x0,'rows':[]};return db[_0x646e('0x1c')][_0x646e('0x1d')]()[_0x646e('0x17')](function(_0x3c0f0f){var _0x12c702=[];for(var _0x48d1a6=0x0;_0x48d1a6
','Attachments','push','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64'];(function(_0x349915,_0x124261){var _0x8be4f3=function(_0x3a82a9){while(--_0x3a82a9){_0x349915['push'](_0x349915['shift']());}};_0x8be4f3(++_0x124261);}(_0x7992,0xf6));var _0x2799=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x7992[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x2799('0x0'));var moment=require(_0x2799('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2799('0x2'));var util=require(_0x2799('0x3'));var tnef=require(_0x2799('0x4'));var logger=require(_0x2799('0x5'))(_0x2799('0x6'));var config=require(_0x2799('0x7'));function getAddress(_0x14e7dd){var _0x5ed879=_['head'](_0x14e7dd['value']);return _0x5ed879&&_0x5ed879[_0x2799('0x8')]?_0x5ed879[_0x2799('0x8')]:_0x2799('0x9')+random[_0x2799('0xa')](0x6)+_0x2799('0xb');}function getFirstName(_0x5b00c2){var _0x3a9121=_['head'](_0x5b00c2[_0x2799('0xc')]);if(_0x3a9121&&_0x3a9121[_0x2799('0xd')]){if(_0x3a9121[_0x2799('0xd')]==_0x3a9121[_0x2799('0x8')]){return _0x3a9121[_0x2799('0xd')][_0x2799('0xe')](0x0,_0x3a9121[_0x2799('0xd')][_0x2799('0xf')]('@'));}var _0x570c43=_0x3a9121['name'][_0x2799('0x10')](/\s+/);return _0x570c43[_0x2799('0x11')]>0x1?_0x570c43[_0x2799('0x12')](0x0,-0x1)[_0x2799('0x13')]('\x20'):_0x3a9121[_0x2799('0xd')];}return _0x2799('0x14');}function getLastName(_0x43f707){var _0xa2266=_[_0x2799('0x15')](_0x43f707['value']);if(_0xa2266&&_0xa2266[_0x2799('0xd')]){var _0x1fde41=_0xa2266['name'][_0x2799('0x10')](/\s+/);return _0x1fde41[_0x2799('0x11')]>0x1?_0x1fde41[_0x2799('0x16')]():'';}return'';}function getMails(_0x335dab,_0x5d4f15){var _0x303088='';for(var _0x66424f=0x0;_0x66424f<_0x5d4f15[_0x2799('0xc')][_0x2799('0x11')];_0x66424f+=0x1){if(_0x5d4f15[_0x2799('0xc')][_0x66424f][_0x2799('0x8')]!==_0x335dab){if(!_[_0x2799('0x17')](_0x303088)){_0x303088+=',';}_0x303088+=_0x5d4f15[_0x2799('0xc')][_0x66424f][_0x2799('0xd')]||_0x5d4f15[_0x2799('0xc')][_0x66424f][_0x2799('0x8')]||'';_0x303088+='\x20<';_0x303088+=_0x5d4f15[_0x2799('0xc')][_0x66424f][_0x2799('0x8')]?_0x5d4f15['value'][_0x66424f][_0x2799('0x8')]:_0x2799('0x9')+random[_0x2799('0xa')](0x6)+_0x2799('0xb');_0x303088+='>';}}return _0x303088;}function parseEmail(_0x2f66f0,_0x239799,_0x2318c2){if(_0x239799['html']){var _0x8eee99=/